Skip to main content

Channel Compatibility (PCAN + slcan + Damiao Serial Bridge)

  • Linux SocketCAN uses interface names directly: can0, can1, slcan0.
  • For USB-serial CAN adapters, bring up slcan0 first: 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 example can0@1000000 is invalid).
  • On Windows (PCAN backend), can0/can1 map to PCAN_USBBUS1/2; optional @bitrate suffix is supported.
Practical and complete reference for RobStride control, parameter access, and current capability boundaries in motorbridge.
Chinese version: ROBSTRIDE_API.zh-CN.md

1) Common Device Parameters

Supported RobStride model strings are rs-00, rs-01, rs-02, rs-03, rs-04, rs-05, and rs-06. High-level control commands keep the same shape across these models. Runtime read-param and write-param use the common protocol section 4 table (0x7005..0x702E); keep --model set to the physical RS model for limits and logging. The runtime parameter table is aligned with the RobStride manual section 4 “read/write single parameter” list.

2) motor_cli RobStride Modes

Supported now:
  • ping
  • scan
  • enable
  • disable
  • mit
  • pos-vel
  • vel
  • read-param
  • write-param
  • save
Unified “big-four” mapping status:

2.1 Ping

2.2 MIT

MIT mapping details (unified -> native):
  • Effective inputs: --pos, --vel, --kp, --kd, --tau (all are used).
  • Units:
    • --pos: rad
    • --vel: rad/s
    • --tau: Nm
    • --kp, --kd: MIT loop gains

2.3 Position (unified pos-vel mapping)

Notes:
  • Unified pos-vel maps to native RobStride Position path:
    • run_mode=1 (Position)
    • write 0x7017 (limit_spd) from --vlim
    • optional write 0x701E (loc_kp) from --loc-kp or --kp
    • write 0x7016 (loc_ref) from --pos
  • --vel, --kd, and --tau do not belong to native Position mode and are ignored in --mode pos-vel.

2.4 Velocity

2.5 Two Usage Paths (Unified Wrapper / Native Params)

  • Unified wrapper path (recommended for app-layer control):
    • --mode mit
    • --mode pos-vel (already mapped to native Position)
    • --mode vel
  • Native path (debug/protocol-level verification):
    • --mode read-param --param-id ...
    • --mode write-param --param-id ... --param-value ... --store 1
    • --mode save for a direct save-parameters operation
    • Typical sequence: write run_mode(0x7005) first, then write target params (loc_ref/spd_ref, etc.)

3) Scan and ID Update

3.1 Scan

Notes:
  • Fast pass: ping + query-parameter probe.
  • probe / device_id is the motor ID.
  • feedback_id / host_id (for example 0xFD) is the host-side ID, not the motor ID.
  • --feedback-ids is a comma-separated list of host IDs to try during scan.
  • RobStride motor_id / device_id must be 1..255; feedback_id / host_id must be 0..255.
  • During scan, each listed --feedback-ids entry is probed exactly; invalid host IDs are rejected instead of silently falling back.
  • If no ping replies in full range, CLI auto-falls back to blind pulse probing:
    • --manual-vel (default 0.2)
    • --manual-ms (default 200)
    • --manual-gap-ms (default 200)

3.2 Update Device ID

Python CLI equivalent:
Raw protocol alignment (with official upper software):
  • Set-ID frame uses comm_type=7.
  • This changes the RobStride device_id only; it does not change feedback_id / host_id.
  • --set-motor-id / --new-motor-id is validated as 1..255; out-of-range values are rejected instead of being truncated.
  • Extended ID format in this command path is:
    • 0x07 [new_id] [host_id] [old_id]
    • example (old_id=1, new_id=11, host_id=0xFD): 0x070BFD01
  • Data payload uses the latest ping UUID token when available (fallback to zeros if ping token is unavailable).

4) Frequently Used Parameter IDs

5) Parameter Read/Write

Parameter access is section-4-runtime. For common runtime control parameters in the 0x7000 range, the unified control paths share the same IDs. For manual function-code parameters from the RobStride manuals, especially the 0x2000 and 0x3000 ranges, each RS model may define different names, data types, or valid ranges at the same ID. Read parameter:
Write parameter:
Python binding sample:

6) Protocol Communication Coverage

motorbridge currently exposes or uses these RobStride protocol communication types:
  • In use directly: 0(GET_DEVICE_ID), 1(OPERATION_CONTROL), 3(ENABLE), 4(DISABLE), 6(SET_ZERO_POSITION), 7(SET_DEVICE_ID), 17(READ_PARAMETER), 18(WRITE_PARAMETER), 22(SAVE_PARAMETERS)
  • Receive/parse path: 2(OPERATION_STATUS), 21(FAULT_REPORT)
  • Present in protocol constants but not yet first-class high-level APIs: 23(SET_BAUDRATE), 24(ACTIVE_REPORT), 25(SET_PROTOCOL)

7) Gap Summary and Next Improvements

Current status: core control is production-usable (scan/ping/mit/pos-vel/vel/read/write/set-id/set-zero/store). Known issues (observed in field tests):
  1. pos-vel parameter effectiveness can be inconsistent on some firmware:
    • --vlim (0x7017) and --kp/loc_kp (0x701E) may read back as written but show weak/no visible effect.
    • MIT path is currently more reliable.
  2. RobStride zeroing now keeps the unified user-facing command and writes zero_sta(0x7029)=1 internally:
    • use the normal zero / set_zero_position() path;
    • use store_parameters / --store 1 when the -pi..pi startup range must survive power cycles.
Main improvement opportunities:
  1. Add semantic CLI mode for current/torque control (today still done via write-param, less ergonomic).
  2. Add multi feedback-host candidate support in scan CLI.
  3. Expose high-level APIs for SET_BAUDRATE / ACTIVE_REPORT / SET_PROTOCOL.
  4. Decode and present FAULT_REPORT in dedicated structured output.

8) WS Gateway JSON Examples

9) Safety Notes

  • Start with small velocity and short loop count.
  • Confirm CAN wiring/termination and interface state before stress tests.
  • Prefer ping/read-param verification before long periodic control.
  • Keep emergency stop path available.