I wrote python test script to reproduce issue :
import time
import odrive
import random
motor_error_to_str = {
0: ‘ERROR_NONE’,
1: ‘ERROR_PHASE_RESISTANCE_OUT_OF_RANGE’,
2: ‘ERROR_PHASE_INDUCTANCE_OUT_OF_RANGE’,
4: ‘ERROR_ADC_FAILED’,
8: ‘ERROR_DRV_FAULT’,
16: ‘ERROR_CONTROL_DEADLINE_MISSED’,
32: ‘ERROR_NOT_IMPLEMENTED_MOTOR_TYPE’
}
axis_error_to_str = {
0: ‘ERROR_NONE’,
1: ‘ERROR_INVALID_STATE’,
2: ‘ERROR_DC_BUS_UNDER_VOLTAGE’,
4: ‘ERROR_DC_BUS_OVER_VOLTAGE’,
8: ‘ERROR_CURRENT_MEASUREMENT_TIMEOUT’,
16: ‘ERROR_BRAKE_RESISTOR_DISARMED’,
32: ‘ERROR_MOTOR_DISARMED’
}
odrv0 = odrive.find_any()
odrv0.axis0.motor.error = 0
odrv0.axis0.error = 0
odrv0.axis0.requested_state = 8
odrv0.axis1.motor.error = 0
odrv0.axis1.error = 0
odrv0.axis1.requested_state = 8
while True:
vel_val = random.randint(-200, 200)
vel_delay = 10 * random.random()
print("Axis0 Vel delay %f s, vel_val = %d" % (vel_delay, vel_val))
odrv0.axis0.controller.vel_setpoint = vel_val
motor_error = odrv0.axis0.motor.error
axis_error = odrv0.axis0.error
if motor_error != 0 | axis_error != 0:
axis_error_str = axis_error_to_str[axis_error]
motor_error_str = motor_error_to_str[motor_error]
print("Motor 0 error : %d (%s), Axis 0 error : %d(%s)" % (motor_error, motor_error_str, axis_error, axis_error_str))
# odrv0.axis0.motor.error = 0
# odrv0.axis0.error = 0
# odrv0.axis0.requested_state = 8
time.sleep(vel_delay)
vel_val = random.randint(-200, 200)
vel_delay = 10 * random.random()
print("Axis1 Vel delay %f s, vel_val = %d" % (vel_delay, vel_val))
odrv0.axis1.controller.vel_setpoint = vel_val
time.sleep(vel_delay)
motor_error = odrv0.axis1.motor.error
axis_error = odrv0.axis1.error
if motor_error != 0 | axis_error != 0:
axis_error_str = axis_error_to_str[axis_error]
motor_error_str = motor_error_to_str[motor_error]
print("Motor 1 error : %d (%s), Axis 1 error : %d(%s)" % (motor_error, motor_error_str, axis_error, axis_error_str))
I ve restart script 5 times and get this values before error :
Axis0 Vel delay 4.124869 s, vel_val = -118
Axis1 Vel delay 6.500733 s, vel_val = -136
Axis0 Vel delay 0.349871 s, vel_val = 142
Motor 0 error : 16 (ERROR_CONTROL_DEADLINE_MISSED), Axis 0 error : 32(ERROR_MOTOR_DISARMED)
Axis0 Vel delay 2.659829 s, vel_val = -177
Axis1 Vel delay 4.007129 s, vel_val = -136
Axis0 Vel delay 7.294514 s, vel_val = -99
Motor 0 error : 16 (ERROR_CONTROL_DEADLINE_MISSED), Axis 0 error : 32(ERROR_MOTOR_DISARMED)
Axis0 Vel delay 3.220356 s, vel_val = -74
Axis1 Vel delay 3.745444 s, vel_val = 172
Axis0 Vel delay 2.452145 s, vel_val = 127
Motor 0 error : 16 (ERROR_CONTROL_DEADLINE_MISSED), Axis 0 error : 32(ERROR_MOTOR_DISARMED)
Axis1 Vel delay 3.714755 s, vel_val = -172
Axis0 Vel delay 3.270711 s, vel_val = -110
Motor 0 error : 16 (ERROR_CONTROL_DEADLINE_MISSED), Axis 0 error : 32(ERROR_MOTOR_DISARMED)