Motor Error Current Limit Violation and Axis Error Failed

I’m facing lots of problems while dealing with ODrive. If I want to increase speed or switching the direction of BLDC Motor connected to the Odrive it shows an error of >MOTOR_ERROR_CURRENT_LIMIT_VIOLATION and

AXIS_ERROR_MOTOR_FAILDED. I attached an image of the error.

I have set the following parameter to the Odrive:

odrv0.axis0.motor.config.requested_current_range = 42
odrv0.axis1.motor.config.requested_current_range = 42
odrv0.axis0.controller.config.vel_limit = 4000
odrv0.axis1.controller.config.vel_limit = 4000
odrv0.axis0.motor.config.calibration_current = 7
odrv0.axis1.motor.config.calibration_current = 7
odrv0.config.brake_resistance = 0
odrv0.axis0.motor.config.pole_pairs = 14
odrv0.axis1.motor.config.pole_pairs = 14
odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT
odrv0.axis1.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT
odrv0.axis0.motor.config.resistance_calib_max_voltage = 4
odrv0.axis0.motor.config.current_control_bandwidth = 100
odrv0.axis1.motor.config.resistance_calib_max_voltage = 4
odrv0.axis1.motor.config.current_control_bandwidth = 100
odrv0.axis0.encoder.config.mode = ENCODER_MODE_HALL
odrv0.axis0.encoder.config.cpr = 84
odrv0.axis1.encoder.config.mode = ENCODER_MODE_HALL
odrv0.axis1.encoder.config.cpr = 84
odrv0.axis0.encoder.config.bandwidth = 100
odrv0.axis0.controller.config.pos_gain = 1
odrv0.axis0.controller.config.vel_gain = 0.05136
odrv0.axis0.controller.config.vel_integrator_gain = 0.05
odrv0.axis1.encoder.config.bandwidth = 100
odrv0.axis1.controller.config.pos_gain = 1
odrv0.axis1.controller.config.vel_gain = 0.05136
odrv0.axis1.controller.config.vel_integrator_gain = 0.05
odrv0.axis0.controller.config.control_mode = CONTROL_MODE_POSITION_CONTROL
odrv0.axis1.controller.config.control_mode = CONTROL_MODE_POSITION_CONTROL

And one more problem, I have to calibrate ODrive every time when I want to use it. Is there any solution for that? If yes please share with us.

Please! help us to solve these problems. Thank you.

You should reset your bandwidth settings to default. (1000)
If you still get current_limit_violation you can increase motor.config.current_lim_tolerance
If you are using Hall sensors then you can set encoder.config.pre_calibrated=True after you have done the first calibration, then save config. Next time you should not need to calibrate again.

What motor and power supply are you using, and for what application?

Thanks for the quick reply! I’m using Racestar BRH 5065 200KV BLDC Motor, And 8000mAh 6S 30C Lithium polymer battery Pack (LiPo).

Surely I will try this. Thank you.

I have increased the value >motor.config.current_lim_tolerance but Still I’m getting the same error >MOTOR_ERROR_CURRENT_LIMIT_VIOLATION

I’m not sure what you expected to happen lol. You’re going 25 revolutions / sec one direction, then you request a change of 50 revolutions / sec instantly. The velocity controller does this calculation:

0.05136 * 50 = 2.568 Nm
I don’t see where you’ve set your torque constant, so by default that’s 0.04 Nm / A

2.568 Nm / (0.04 Nm / A) = 64.2 A.

The controller will attempt to clamp to your 37A limit, but with the low current control bandwidth and high acceleration it’s probably exceeding the threshold. To improve this, you probably want INPUT_MODE_VEL_RAMP. I assume that since you’re doing input_vel you’re actually in CONTROL_MODE_VELOCITY_CONTROL also, not position?

1 Like

I’m also new with the ODrive and I’m getting the same issue
There is any solution that you know about ?
I’ve been trying to restart all the settings by the earse command but still getting both errors (Current limit violation and axis Error) on both axis
Please help :slight_smile: