I have four ODrives (v3.6). On each one, using the same settings and same motor, the M1 completes calibration perfectly while the M0 fails to calibrate with the error:
MotorError.UNKOWN_CURRENT_MEASUREMENT
Again, same wiring, same motor, same settings starting from erase_configuration. Any insight is greatly appreciated.
Hmm, super interesting! Could you post a picture of your wiring, and all of your configuration (from erase_configuration)?
Sure. I’ve disconnected everything except a single motor while I’m troubleshooting.
And here’s the code I use to calibrate, replacing axis0 with axis1 when calibrating each, with the exact same settings otherwise.
odrv0.erase_configuration()
odrv0.config.enable_brake_resistor = True
odrv0.config.brake_resistance = 2
odrv0.axis1.motor.config.current_lim = 25
odrv0.axis1.motor.config.requested_current_range = 25
odrv0.axis1.motor.config.pole_pairs = 15
odrv0.axis1.motor.config.torque_constant = 8.27 / 16
odrv0.axis1.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT
odrv0.axis1.motor.config.resistance_calib_max_voltage = 10
odrv0.axis1.motor.config.current_control_bandwidth = 150
odrv0.axis1.motor.config.calibration_current = 5
odrv0.config.dc_max_positive_current = 25
odrv0.config.dc_max_negative_current = -0.01
#odrv0.config.dc_bus_undervoltage_trip_level = 10
#odrv0.config.dc_bus_overvoltage_trip_level = 40
odrv0.save_configuration()
odrv0.axis1.encoder.config.mode = ENCODER_MODE_HALL
odrv0.axis1.encoder.config.cpr = 90
odrv0.axis1.encoder.config.calib_scan_distance = 150
odrv0.axis1.encoder.config.bandwidth = 100
odrv0.save_configuration()
odrv0.axis1.controller.config.vel_limit = 10
odrv0.axis1.controller.input_pos = 1
odrv0.axis1.controller.config.vel_gain = (0.02
* odrv0.axis1.motor.config.torque_constant
* odrv0.axis1.encoder.config.cpr)
odrv0.axis1.controller.config.vel_integrator_gain = (0.1
* odrv0.axis1.motor.config.torque_constant
* odrv0.axis1.encoder.config.cpr)
odrv0.axis1.controller.config.control_mode = CONTROL_MODE_TORQUE_CONTROL
odrv0.save_configuration()
odrv0.axis1.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
odrv0.axis1.motor.config.pre_calibrated = True
odrv0.axis1.encoder.config.pre_calibrated = True
odrv0.axis1.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.config.startup_closed_loop_control = True
odrv0.axis1.config.startup_closed_loop_control = True
odrv0.save_configuration()
odrv0.reboot()
And with each of the four boards, I get the same result: M1 calibrates successfully and M0 fails with
dump_errors(odrv0)
system: no error
axis0
axis: Error(s):
AxisError.MOTOR_FAILED
motor: Error(s):
MotorError.UNKNOWN_CURRENT_MEASUREMENT
DRV fault: none
sensorless_estimator: no error
encoder: no error
controller: no error
axis1
axis: no error
motor: no error
DRV fault: none
encoder: no error
controller: no error
Thanks for your help.
Hmm, where’d you buy those ODrives? The reason I ask – a few details about the board make me think they’re a clone / not official. Those are all based on ODrive v3.4 (even if they say v3.6 on it), which had some massive massive electrical interference and performance issues. I would definitely point towards that as the culprit here.
I received them from a colleague a few months ago. They were purchased as redundancy for the project we collaborated on and didn’t end up needing them. The box he delivered them to me in had the original packing slip and purchase receipt from ODrive, though its current whereabouts are unknown.
Still, the M0 lanes calibrated other motors prior to now as I was testing various builds and motor placement. This is a new issue.
Any noise causes problems you def need to use 31X19X13mm Isolator Ferrite Core rings. Solved all my problems with my hoverbot. My 2 odrive 3.6 boards are noisy. 4 im guessing is worse