Giter VIP home page Giter VIP logo

bldc-controller's Introduction

Getting Started

cd ~
git clone https://github.com/berkeleyopenarms/bldc-controller.git
cd bldc-controller
git submodule update --recursive --remote --init
sudo apt-get install gcc-arm-none-eabi

Compiling

cd ~/bldc_controller/firmware
make

Uploading firmware via ST-LINK

cd ~/bldc_controller/firmware
make upload

Upload firmware via RS485

cd ~/bldc_controller/tools
python upload_firmware.py <serial_port> <board_id> ~/bldc_controller/firmware/build/motor_controller.bin

Upload bootloader via RS485

Use this with caution. If this fails and a power cycle or reboot occurs, the board will have to be programmed directly. In the case of a failed upload, try again immediately. To be safe, first upload and test on an easy-to-remove link such as the gripper or base which are not as difficult to access in case of a failure.

upload_bootloader.py <serial_port> <board_id> <path_to_file>

Serial Transmission Speed Limits

Serial device drivers only permit at most one transmission per millisecond. By default, this is set to 16 milliseconds on our usb to RS485 converters. To change this execute the following terminal commands:

cat /sys/bus/usb-serial/devices/ttyUSB<id_num>/latency_timer
setserial /dev/ttyUSB<id_num> low_latency
cat /sys/bus/usb-serial/devices/ttyUSB<id_num>/latency_timer

(when running the arm, this is done automatically by the ROS control stack)

Python Scripts

These scripts are made to remotely interface with the boards. They can debug, program, and run the boards. They interface using our custom communications protocol.

Motor Calibration

To calibrate the motor board, a motor must first be attached. The results of calibration are based on the properties of the given motor.

  • calibrate_encoder.py <serial_port> <board_id> <duty_cycle>
  • upload_calibration.py <serial_port> <board_id> <calibration_file.json>
  1. Run calibrate_encoder.py: for 24V Power Supplies the duty cycle used in testing is 0.3 and for 48V or 50V supplies use half (0.15).
  2. Update calibrations.json found in the bldc-controller-calibration repo.
  3. Run upload_calibration.py with the updated calibrations.json as the final argument.

After completing these steps, the motor should be controllable.

Current Command

Use this script to spin a motor with a given current command. A substantial starting point is 0.5 and increase above this with proper supervision! A negative command will reverse the direction.

current_command.py <serial_port> <board_id> <command>

bldc-controller's People

Contributors

allanzhao avatar brentyi avatar gbalke avatar lxd20 avatar menglongguo avatar wuphilipp avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.