A strange thing is happening to my motor in velocity control mode. It rotates for 45 revolutions (around 370k encoder counts) and then stops spinning. Setting the velocity in the reverse directions causes it to spin -90 revolutions until it reaches -370k and then stops spinning again!
Hardware version: the new batch of v3.5
Software: ODrive control utility v0.4.1
Motor: GARTT ML5210 (24N22P)
Encoder: CUI AMT102
Commands:
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.controller.config.control_mode = CTRL_MODE_VELOCITY_CONTROL
odrv0.axis0.controller.vel_setpoint = 200000
# motor spins up a few seconds (drawing 0.1A),
# then stops after ~45 revolutions (draws 1.5A when stopped)
print(odrv0.axis0.encoder.pos_estimate) # returns around 370000
odrv0.axis0.controller.vel_setpoint = -200000
# motor spins the other way, then stops again
print(odrv0.axis0.encoder.pos_estimate) # returns around -370000
In [27]: odrv0.config.brake_resistance
Out[27]: 2.0
In [28]: odrv0.axis0.motor.config.pole_pairs
Out[28]: 11
In [29]: odrv0.axis0.motor.config.motor_type
Out[29]: 0
# did you mean this?
In [31]: odrv0.axis0.config.counts_per_step
Out[31]: 2.0