Odrive + Hoverboard Motors AXIS0 errors

#1

Hi

My setup is Odrive + two hoverboard motors + 12/36 V battery.

Motors are calibrated according to hoverboard motors guide and everything looks fine. So I setup PWM control with velosity range ±200 and connect my autopilot. It works fine just 30 seconds )))
I constantly had hall encoder error so I solder 22nF capacitors and set ignore hall erros in config.
Next try - and after 1 min I get axis errors ERROR_CURRENT_MEASUREMENT_TIMEOUT. If i reset this error - next eror in 30sec - 4 mins.
What does mean this error? I checked thru code but doesnt get cleary what does it means.
Looks like control loop not worked fine - missing intterupts but why ? Worst thing - its happens only on Axis 0 and only then both motors are running.
I’ve got two ODRIVE - 3.5 and 3.6 version and both have same issues so its not HW fault i suppose.

Cheers

Strange behaviour when both axis start
#2

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)

#3

Please try dump_errors(odrv0) and paste the result here

#4

Well dump shows same axis error - 0x32, motor error 0x48 or 0x58.
But I think I found the problem. I’ve read ODRIVE code again very carefully and I think issue was because calibration was at too low current. After this conclusion I read config guide again and found same info - " You can change odrv0.axis0.motor.config.calibration_current [A] to the largest value you feel comfortable leaving running through the motor continuously when the motor is stationary."
Unfortunately this info was riiight AFTER guide line - “There is a separate guide specifically for hoverboard motors.” so I missed this info. My wheels are 10 inches and in video they are 6.5 inches. So I thought - hmmm may be my hover wheels just bigger and need more power to rotate.
So i set calibration current to 5 and recalibrate motor & encoders.
I still get errors after this procedure but much more rarely. So I increase calibration current slowly till errors gone.
P.S. Also I desolder capacitors use ferrite ring and disable hall errors. Not quite sure is this helps or not

1 Like