Documentation Index
Fetch the complete documentation index at: https://motorbridge.seeedstudio.com/llms.txt
Use this file to discover all available pages before exploring further.
Source:
motor_cli/DAMIAO_API.mdDamiao API and Tuning Reference (Complete)
Channel Compatibility (PCAN + slcan + Damiao Serial Bridge)
- Linux SocketCAN uses interface names directly:
can0,can1,slcan0. - For USB-serial CAN adapters, bring up
slcan0first:sudo slcand -o -c -s8 /dev/ttyUSB0 slcan0 && sudo ip link set slcan0 up. - Damiao-only serial bridge transport is also available in CLI (
--transport dm-serial --serial-port /dev/ttyACM0 --serial-baud 921600). - On Linux SocketCAN, do not append bitrate in
--channel(for examplecan0@1000000is invalid). - On Windows (PCAN backend),
can0/can1map toPCAN_USBBUS1/2; optional@bitratesuffix is supported.
motorbridge for Damiao motors.
Chinese version: DAMIAO_API.zh-CN.md
1) Common Device Parameters
| Parameter | Meaning | Typical value |
|---|---|---|
channel | CAN interface name | can0 |
model | Motor model string (4310, 4340P, etc.) | matches real device |
motor-id | Command ID (ESC_ID) | e.g. 0x01 |
feedback-id | Feedback ID (MST_ID) | e.g. 0x11 |
loop | Number of send cycles | 100 |
dt-ms | Send interval per cycle (ms) | 20 |
2) Real-time Control Mode Parameters
2.1 MIT Mode
Command fields:pos: target positionvel: target velocitykp: position stiffness gainkd: velocity damping gaintau: feedforward torque
motor_cli):
2.2 POS_VEL Mode
Command fields:pos: target positionvlim: velocity limit
2.3 VEL Mode
Command field:vel: target velocity
2.4 FORCE_POS Mode
Command fields:pos: target positionvlim: velocity limitratio: torque limit ratio
2.5 Mode Selection (CTRL_MODE)
Register:
rid=10(CTRL_MODE), values:1=MIT2=POS_VEL3=VEL4=FORCE_POS
3) High-impact Registers (Priority)
These have major control impact and should be tuned carefully.| RID | Name | Type | Meaning |
|---|---|---|---|
21 | PMAX | f32 | Position mapping range |
22 | VMAX | f32 | Velocity mapping range |
23 | TMAX | f32 | Torque mapping range |
25 | KP_ASR | f32 | Speed loop Kp |
26 | KI_ASR | f32 | Speed loop Ki |
27 | KP_APR | f32 | Position loop Kp |
28 | KI_APR | f32 | Position loop Ki |
4 | ACC | f32 | Acceleration |
5 | DEC | f32 | Deceleration |
6 | MAX_SPD | f32 | Maximum speed |
9 | TIMEOUT | u32 | Communication timeout register |
4) Protection Registers
| RID | Name | Type | Meaning |
|---|---|---|---|
0 | UV_Value | f32 | Under-voltage threshold |
2 | OT_Value | f32 | Over-temperature threshold |
3 | OC_Value | f32 | Over-current threshold |
29 | OV_Value | f32 | Over-voltage threshold |
5) How to Read/Write Parameters
Recommended write workflow:get_registerread old valuewrite_registerwrite new valueget_registerread backstore_parameterspersist
6) ID and Calibration Parameters
rid=8(ESC_ID): command IDrid=7(MST_ID): feedback ID
- Rust CLI:
motor_cli --vendor damiao --mode scan ...and--set-motor-id/--set-feedback-id --store --verify-id - Python:
motorbridge-cli scan/id-set/id-dump,damiao-read-param,damiao-write-param, and Rust-stylerun --set-motor-id/--set-feedback-id - WS:
scan,set_id,verify
7) Safety Notes
- Tune one parameter group at a time.
- Use small steps, verify each change.
- Keep safe mechanical load and emergency stop ready.
- For protection thresholds (
0/2/3/29), avoid aggressive changes without hardware margin analysis.
8) Gripper Motor Calibration
Damiao motors use a single-turn encoder (position range approx. ±PMAX rad). Zero position is NOT retained across power cycles. When a motor is used as a gripper, calibrate the zero position after each power-on:- Use MIT mode with low
kpandtau=0to move toward the mechanical limit — the motor stops softly on contact. - Wait until feedback shows
vel ≈ 0andposis stable, then run--mode set-zero. - After calibration, use MIT mode for closing (force-limited, safe) and pos-vel mode for opening (fast, precise).