This document lists Damiao control/configuration interfaces exposed by the motorbridge Python package.
中文版: DAMIAO_API.zh-CN.md
pos: target positionvel: target velocitykp: position stiffness gainkd: velocity damping gaintau: feedforward torque
pos: target positionvlim: velocity limit
vel: target velocity
pos: target positionvlim: velocity limitratio: torque limit ratio
Controller:
Controller(channel)enable_all()/disable_all()poll_feedback_once()shutdown()/close_bus()/close()add_damiao_motor(motor_id, feedback_id, model)
Motor:
- control:
enable(),disable(),clear_error(),set_zero_position()- project rule: call
disable()beforeset_zero_position() - Python API has no
msargument for set-zero; core applies fixed20mssettle internally
- project rule: call
- mode:
ensure_mode(mode, timeout_ms=1000) - command:
send_mit(),send_pos_vel(),send_vel(),send_force_pos() - ops:
request_feedback(),store_parameters(),set_can_timeout_ms(timeout_ms) - register:
write_register_f32/u32(),get_register_f32/u32() - state:
get_state()
You can import built-in register metadata directly:
from motorbridge import (
DAMIAO_RW_REGISTERS,
DAMIAO_HIGH_IMPACT_RIDS,
DAMIAO_PROTECTION_RIDS,
get_damiao_register_spec,
RID_CTRL_MODE,
)
print(DAMIAO_RW_REGISTERS[22]) # VMAX spec
print(DAMIAO_HIGH_IMPACT_RIDS)
print(get_damiao_register_spec(RID_CTRL_MODE))Print all currently exported tunable registers with ranges:
from motorbridge import DAMIAO_RW_REGISTERS
for rid in sorted(DAMIAO_RW_REGISTERS):
spec = DAMIAO_RW_REGISTERS[rid]
print(f"rid={rid:>2} {spec.variable:<10} type={spec.data_type} range={spec.range_str} desc={spec.description}")Exported constants:
- ID/mode related:
RID_MST_ID,RID_ESC_ID,RID_CTRL_MODE,RID_TIMEOUT - mode values:
MODE_MIT,MODE_POS_VEL,MODE_VEL,MODE_FORCE_POS
21 PMAX,22 VMAX,23 TMAX25 KP_ASR,26 KI_ASR,27 KP_APR,28 KI_APR4 ACC,5 DEC,6 MAX_SPD,9 TIMEOUT
0 UV_Value,2 OT_Value,3 OC_Value,29 OV_Value
- Read old value (
get_register_*) - Write new value (
write_register_*) - Read back for verification
- Persist with
store_parameters()
For a full operation/tuning table and command examples, see: