motor_cli binary.
- Crate:
motor_cli - Recommended (release package):
./bin/motor_cli [ARGS...] - Optional (source build):
./target/release/motor_cli [ARGS...]
Release-first Usage
Download and extract the release package (GitHub Releases asset likemotor-cli-vX.Y.Z-linux-x86_64.tar.gz), then run directly:
motor_cli as a plain command:
Additional Damiao Command/Register Reference
- Detailed Damiao command + register tuning doc (English):
DAMIAO_API.md - Chinese version (command/register reference):
DAMIAO_API.zh-CN.md
Additional RobStride Command/Parameter Reference
- Detailed RobStride command + parameter guide (English):
ROBSTRIDE_API.md - Chinese version (parameter/capability reference):
ROBSTRIDE_API.zh-CN.md
Additional MyActuator Command/Mode Reference
- Detailed MyActuator command + mode guide (English):
MYACTUATOR_API.md - Chinese version (command/mode reference):
MYACTUATOR_API.zh-CN.md
HighTorque Notes
- Protocol analysis (Chinese):
../docs/zh/hightorque_protocol_analysis.md - Current
vendor=hightorqueis a native ht_can v1.5.5 direct-CAN mode, not the official serial-CANboard transport.
CAN Debugging Entry
- Professional Linux
slcan+ Windowspcantroubleshooting:../docs/en/can_debugging.md - Chinese troubleshooting guide:
../docs/zh/can_debugging.md
Transport Legend
[STD-CAN]=>--transport auto|socketcan[CAN-FD]=>--transport socketcanfd(Linux-only; required by Hexfellow)[DM-SERIAL]=>--transport dm-serial(Damiao-only)
- Hexfellow: validated on
socketcanfdwith unifiedmit/pos-vel. - HighTorque: validated on standard CAN with unified
mit/vel(kp/kdignored by protocol). - Damiao: baseline implementation for unified
mit/pos-vel/vel/force-pos.
Validated Capability Matrix (Damiao + RobStride, 2026-04)
| Capability | Damiao | RobStride |
|---|---|---|
| Scan | Yes | Yes |
| Ping / online probe | Yes (scan/register path) | Yes (ping) |
| Enable / Disable | Yes | Yes |
MIT (pos/vel/kp/kd/tau) | Yes | Yes |
| POS_VEL unified mode | Yes | Yes (mapped to native Position path) |
| VEL unified mode | Yes | Yes |
| Parameter read/write | Yes | Yes |
| Set zero | Yes (disable first) | Yes (experimental sequence; firmware-dependent ack behavior) |
| Set motor ID | Yes (--set-motor-id) | Yes (--set-motor-id) |
| Set feedback ID | Yes (--set-feedback-id) | No (host id is configured by --feedback-id) |
- RobStride default
--feedback-idis0xFD; scan defaults to--feedback-ids 0xFD,0xFF,0xFE,0x00,0xAA. - RobStride
feedback_id/host_idis not the motordevice_id; scan reports the motor ID asprobe/device_id. - RobStride
--modelis still passed for limits and logging, while current parameter read/write uses the common section 4 runtime table. - RobStride
pos-velignores--vel/--kd/--tauby design (warning only, no hard error).
1. Argument Parsing Rules
- Only
--key valuestyle options are parsed. - A bare mode word, for example
motor_cli scan --vendor robstride ..., is accepted as shorthand for--mode scan. - A standalone flag (for example
--help) is treated as value1. - Numeric IDs accept decimal (
20) and hex (0x14). - Unknown keys are parsed but ignored unless used by code paths.
2. Top-Level Arguments (All Vendors)
| Argument | Type | Default | Notes |
|---|---|---|---|
--help | flag | off | Prints CLI help and exits |
--version, -v | flag | off | Prints the Rust CLI package version and exits |
--vendor | string | damiao | damiao, robstride, hightorque, myactuator, hexfellow, all |
--transport | string | auto | auto, socketcan, socketcanfd, dm-serial (socketcanfd is Hexfellow-required path; dm-serial is Damiao-only) |
--channel | string | can0 | Linux: SocketCAN interface name (can0/slcan0); Windows (PCAN backend): can0/can1 with optional @bitrate suffix (for example can0@1000000); macOS (PCBUSB backend): can0/can1 |
--serial-port | string | /dev/ttyACM0 | Used when --transport dm-serial |
--serial-baud | u64 | 921600 | Used when --transport dm-serial |
--model | string | vendor dependent | 4340 for Damiao; physical rs-00 through rs-06 for RobStride; hightorque for HighTorque; X8 for MyActuator |
--motor-id | u16 (hex/dec) | 0x01 | Motor CAN ID |
--feedback-id | u16 (hex/dec) | vendor dependent | Damiao 0x11, RobStride 0xFD, HighTorque 0x01, MyActuator 0x241 (for motor-id 1) |
--mode | string | vendor dependent | Damiao mit, RobStride ping, HighTorque read, MyActuator status, all -> scan |
--loop | u64 | 1 | Control loop cycles |
--dt-ms | u64 | 20 | Loop interval in ms |
--ensure-mode | 0/1 | 1 | Auto-switch mode before control |
2.1 Channel Quick Reference (--channel)
- Linux SocketCAN:
- Use interface names directly:
can0,can1,slcan0. - Configure bitrate at interface setup time (
ip link/slcand), not in--channel. can0@1000000is invalid on Linux SocketCAN.
- Use interface names directly:
- Windows PCAN:
can0maps toPCAN_USBBUS1,can1maps toPCAN_USBBUS2.- Optional bitrate suffix is supported:
can0@1000000.
- macOS PCBUSB (PCAN backend):
can0maps toPCAN_USBBUS1,can1maps toPCAN_USBBUS2.- Install
libPCBUSB.dylibfirst (see rootREADME.mdmacOS section).
2.2 Damiao Serial-Bridge Quick Reference (--transport dm-serial)
- This path is adapter-specific and intended for Damiao motors.
- Typical flags:
--transport dm-serial --serial-port /dev/ttyACM1 --serial-baud 921600. - In
dm-serialmode,--channelis ignored by transport creation.
2.3 Damiao Dedicated CAN-FD Quick Reference (--transport socketcanfd)
- This path is Linux-only and independent from classic SocketCAN transport.
- Hexfellow must use this path (
--vendor hexfellow --transport socketcanfd). - Typical flags:
--transport socketcanfd --channel can0. - Ensure the interface is in FD mode first (
scripts/canfd_restart.sh can0). - Current status: Hexfellow validated; Damiao CAN-FD matrix can be validated per model.
3. Vendor = damiao
3.1 Supported Modes
scanenabledisablemitpos-velvelforce-pos
3.2 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 |
--start-id | u16 | 1 | scan | Scan start, must be 1..255 |
--end-id | u16 | 255 | scan | Scan end, must be 1..255 |
--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 |
3.3 Control Arguments by Mode
| Mode | Arguments | Defaults |
|---|---|---|
mit | --pos --vel --kp --kd --tau | 0 0 2 1 0 |
pos-vel | --pos --vlim | 0 1.0 |
vel | --vel | 0 |
force-pos | --pos --vlim --ratio | 0 1.0 0.1 |
enable/disable | no extra required | n/a |
3.4 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.
3.5 Damiao Examples
4. Vendor = robstride
4.1 Supported Modes
pingscanenabledisablemitpos-velvelread-paramwrite-paramsave
4.2 RobStride Extra Arguments
| Argument | Type | Default | Used In | Notes |
|---|---|---|---|---|
--start-id | u16 | 1 | scan | Scan start, 1..255 |
--end-id | u16 | 255 | scan | Scan end, 1..255 |
--feedback-ids | csv u16 | 0xFD,0xFF,0xFE,0x00,0xAA | scan | RobStride host_id candidates, 0..255; not motor IDs |
--timeout-ms | u64 | 80 | scan | Ping timeout |
--param-timeout-ms | u64 | 120 | scan | Parameter fallback timeout |
--manual-vel | f32 | 0.2 | scan fallback | Blind pulse velocity |
--manual-ms | u64 | 200 | scan fallback | Pulse duration per ID |
--manual-gap-ms | u64 | 200 | scan fallback | Gap between IDs |
--set-motor-id | u16 opt | none | id-set flow | Set device ID, 1..255 |
--store | 0/1 | 1 for id-set, 0 for param write | id-set / write-param | Save parameters after ID update or after a successful parameter write |
--param-id | u16 | required for param modes | read/write param | Parameter ID |
--param-value | typed | required for write | write-param | Parsed by selected RobStride model metadata |
4.3 Control Arguments by Mode
| Mode | Arguments | Defaults |
|---|---|---|
mit | --pos --vel --kp --kd --tau | 0 0 8 0.2 0 |
pos-vel | --pos --vlim [--kp] | 0 1.0 [none] |
vel | --vel | 0 |
enable/disable | no extra required | n/a |
- RobStride unified control currently supports
MIT/POS_VEL/VEL. - Supported RobStride models are
rs-00,rs-01,rs-02,rs-03,rs-04,rs-05, andrs-06. - Always pass the real motor model. Basic control command shape is shared, but native function-code parameters differ by model; a parameter ID may have a different name or type on a different RS model.
- The built-in RS00-RS06 parameter tables are aligned with RobStride/Product_Information commit
ba7236bc26417766fda71e75ae128c66dbd21aba. - Torque/current is currently parameter-level only (via
write-param, for exampleiq_refand limit registers), not a first-class high-level mode. - In RobStride
mit, all five unified inputs are effective:--pos,--vel,--kp,--kd,--tau. - RobStride
mitunits follow unified semantics:posinrad,velinrad/s,tauinNm(kp/kdare MIT loop gains). - In RobStride
pos-vel, only--pos,--vlim, and optional--kp/--loc-kpare consumed. - In RobStride
pos-vel,--vel,--kd, and--tauare ignored (CLI prints a warning if provided).
4.4 Scan Behavior Details
- Fast pass: ping + query-parameter probe per ID.
- If no hits in full range: fallback to blind velocity pulses for manual movement observation.
- Fallback hit criteria includes state feedback presence.
4.5 RobStride Examples
5. Vendor = all
vendor=all currently supports only --mode scan.
5.1 Additional Arguments for all-scan
| Argument | Default | Notes |
|---|---|---|
--damiao-model | 4340P | Model hint used when invoking Damiao scan path |
--robstride-model | rs-00 | Model hint used when invoking RobStride scan path |
--hightorque-model | hightorque | Model hint used when invoking HighTorque scan path |
--myactuator-model | X8 | Model hint used when invoking MyActuator scan path |
--start-id | 1 | Passed to all scans |
--end-id | 255 | Passed to Damiao/RobStride; MyActuator path auto-clamps to 32 |
5.2 Example
5.3 Vendor = hightorque (native ht_can v1.5.5)
- This path uses native HighTorque
ht_canv1.5.5 direct-CAN protocol. - It is intended for setups where motors are exposed directly on SocketCAN (
can0etc.). - Official Panthera/HighTorque SDK serial chain (
USB serial -> CANboard -> motors) is separate from this CLI direct-CAN path. - Supported modes:
scan | read | ping | mit | pos | vel | tqe | pos-vel-tqe | volt | cur | stop | brake | rezero | conf-write | timed-read. - Unified unit interface:
--posinrad--velinrad/s--tauinNm--kp,--kdare accepted for MIT signature compatibility but ignored byht_can.- Raw debug parameters:
--raw-pos,--raw-vel,--raw-tqe.
6. Vendor = myactuator
6.1 Supported Modes
scanenabledisablestopset-zerostatuscurrentvelposversionmode-query
6.2 MyActuator Extra Arguments
| Argument | Type | Default | Used In | Notes |
|---|---|---|---|---|
--start-id | u16 | 1 | scan | Scan start, 1..32 |
--end-id | u16 | 32 | scan | Scan end, 1..32 (input >32 will be clamped) |
--current | f32 | 0.0 | current | Current setpoint in A |
--vel | f32 | 0.0 | vel | Velocity setpoint in rad/s (converted to deg/s internally) |
--pos | f32 | 0.0 | pos | Absolute position in rad (converted to deg internally) |
--max-speed | f32 | 8.726646 | pos | Position move max speed in rad/s (converted internally) |
anglecomes from0x9Cstatus-2 near-turn angle.mt_anglecomes from0x92multi-turn angle and should be used for absolute-position judgement.
6.3 MyActuator Examples
7. Vendor = hexfellow
Transport constraint:
- Hexfellow is CAN-FD-only in this repository (
--transport socketcanfd). - Current support scope: scan / status / pos-vel / mit / enable / disable.
- Current status: transport integrated; model validation matrix pending.
7.1 Hexfellow Examples
8. Practical Notes
- For Damiao ID updates, prefer keeping
--store 1 --verify-id 1. - If scan intermittently misses motors, retry after CAN restart.
- RobStride supports CLI
--mode pos-vel(mapped to native Position); in this mode use--pos/--vlim/[--kp|--loc-kp]. - MyActuator low-voltage protection returns error code
0x0004in status-1 (0x9A) and blocks motion.