2.3 KiB
Learning how to use the Moteus BLDC controller
The EIL5 of communication with the Moteus
There are two protocol's at play with the Moteus you need to be aware of:
- Diagnostic: This is used by the
tview
andmoteus_tool
applications and is of the text formd pos
- Calibration of the motor used with the Moteus as of 05/04/2023 still requires the
moteus_tool
you cannot calibrate the motor from within your application. conf write
will persist the configuration you have set in tview to the motor controller. It's the easiest way to change the gains you or whatever.- Getting Started with the DevKit Has a great explaination of a lot of the tools.
- Calibration of the motor used with the Moteus as of 05/04/2023 still requires the
- Register: This is the protocol used under the hood with the Python library. It read/writes to registers on the Micro over CANBus FD.
- BE AWARE: There is a watchdog timer set per servo that defaults to
servo.default_timeout_s=0.1
. This means that you you need to send a valid command at least every 100ms or you will trip the fault state. TODO add how to get out of fault state. END TODO. YOu can change this value in tview and persist withconf write
or you can can usewatchdog_timeout
kwarg in theset_postion
command. ALSO! You can use diagnotic protocol from python programs to programtically set it #TODO add an example python file showing how to do this END TODO#.
- BE AWARE: There is a watchdog timer set per servo that defaults to
Firmware updates
Firmware updates will unlock newer features of the boards. Follow these instructions https://github.com/mjbots/moteus/blob/main/docs/reference.md#flashing-over-can when you need to upgrade the controllers.
Quickstart
Launching t-view
python -m moteus_gui.tview
Calibrating a new motor. Note the calibration process will require free movement.
python3 -m moteus.moteus_tool --target 1 --calibrate
The first movement. This will be a position control movemen from an arbitrary start point.
This command is of the form d pos <pos> <vel> <max_torque> [options...]
In tview terminal
d pos nan 0.2 0.3 s0.8
d: diagnostic command pos: position control nan: Uses not a number (nan) to state from any position 0.2: positive movement at 0.2 revolutions per second 0.3: a max torque of 0.3 Nm s0.8: Position stop at 0.8