Damiao CLI Sub-Commands
This page is a practical reference for all commonly adjustable control/configuration parameters currently available inmotorbridge for Damiao motors via the motor_cli binary.
Chinese version: damiao.zh-CN.mdRelated: CLI Reference | shared/channel-compat.md
Channel Compatibility
Channel compatibility: See shared/channel-compat.md.
Supported Modes
| Mode | Description |
|---|---|
scan | Probe motors in an ID range |
enable | Enable motor (exit damping) |
disable | Disable motor (enter damping) |
mit | MIT impedance control (pos/vel/kp/kd/tau) |
pos-vel | Position-velocity control (pos/vlim) |
vel | Velocity control (vel) |
force-pos | Force-position control (pos/vlim/ratio) |
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) Scan
Scan a range of CAN IDs to discover Damiao motors.Arguments
| Argument | Type | Default | Notes |
|---|---|---|---|
--start-id | u16 | 1 | Scan start, must be 1..255 |
--end-id | u16 | 255 | Scan end, must be 1..255 |
Scan Behavior Details
- The scanner is model-agnostic in practice: it internally tries a built-in model-hint list.
- For each candidate ID, it also tries multiple feedback-ID hints: inferred (
id+0x10), user--feedback-id,0x11,0x17. - Detection first attempts register reads (RID 21/22/23), then feedback fallback.
Example
3) Enable / Disable
Enable or disable (damping) a motor.enable/disable.
4) MIT Mode
Command fields:pos: target positionvel: target velocitykp: position stiffness gainkd: velocity damping gaintau: feedforward torque
Arguments
| Argument | Type | Default |
|---|---|---|
--pos | f32 | 0 |
--vel | f32 | 0 |
--kp | f32 | 2 |
--kd | f32 | 1 |
--tau | f32 | 0 |
Examples
5) POS_VEL Mode
Command fields:pos: target positionvlim: velocity limit
Arguments
| Argument | Type | Default |
|---|---|---|
--pos | f32 | 0 |
--vlim | f32 | 1.0 |
Example
6) VEL Mode
Command field:vel: target velocity
Arguments
| Argument | Type | Default |
|---|---|---|
--vel | f32 | 0 |
Example
7) FORCE_POS Mode
Command fields:pos: target positionvlim: velocity limitratio: torque limit ratio
Arguments
| Argument | Type | Default |
|---|---|---|
--pos | f32 | 0 |
--vlim | f32 | 1.0 |
--ratio | f32 | 0.1 |
Example
8) Mode Selection Register (CTRL_MODE)
Register:
rid=10(CTRL_MODE), values:1=MIT2=POS_VEL3=VEL4=FORCE_POS
9) Damiao Extra Arguments
| Argument | Type | Default | Used In | Notes |
|---|---|---|---|---|
--verify-model | 0/1 | 1 | non-scan | Verify PMAX/VMAX/TMAX matches --model |
--verify-timeout-ms | u64 | 500 | non-scan | Register read timeout for model handshake |
--verify-tol | f32 | 0.2 | non-scan | Model limit tolerance |
--set-motor-id | u16 opt | none | id-set flow | Write ESC_ID (RID 8) |
--set-feedback-id | u16 opt | none | id-set flow | Write MST_ID (RID 7) |
--store | 0/1 | 1 | id-set flow | Persist parameters |
--verify-id | 0/1 | 1 | id-set flow | Re-read RID7/RID8 and verify |
10) 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 |
11) 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 |
12) How to Read/Write Parameters
Recommended write workflow:get_registerread old valuewrite_registerwrite new valueget_registerread backstore_parameterspersist
Python SDK API Example
WS Gateway Command Examples
13) ID and Calibration Parameters
rid=8(ESC_ID): command IDrid=7(MST_ID): feedback ID
Update ID Example
Tools
- 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 - WS:
scan,set_id,verify
14) 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.
15) 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).