cubemarsPyCAN¶
Correct, tested CAN control for CubeMars AK-series actuators, in MIT and servo modes.
Every constant is traceable to the AK Series Module Driver Manual v1.0.18, a CubeMars
datasheet, or a bench measurement. See Sourced.
from cubemarspycan import SPECS, CanTransport, MitMotor, MotorBus
with CanTransport.open("socketcan:can0") as tp, MotorBus(tp) as bus:
m = MitMotor(bus, motor_id=1, spec=SPECS["AK40-10"], supply_voltage=24.0)
with m.control():
m.zero_here()
m.settle(1.5)
state = m.update(position=0.5, velocity=0.0, kp=20.0, kd=0.5, torque=0.0)
Guides
- CAN setup
- Command line
- Unit contract
- AK 2.0 and manual v1.0.18
- Adding a motor
- Migrating from TMotorCANControl
- Troubleshooting
- Nothing arrives on the bus
- Feedback stops after a while, or never starts
- Position lags the setpoint by a constant-looking amount
state.seqjumps by more than one- The motor lurches right after
zero_here() StaleFeedbackErrorright afterzero_here()StaleFeedbackErrorMotorFaultServoModeNotConfirmedSpecIncompleteErrorCapabilityErroronset_originUnresolvedFrameErroronstatus.output_rad- The motor twitches at “zero” torque
- Commands near full scale behave strangely
- First bench session
API reference