Brake Mode on Motor?


I’m using the Odrive 3.5 for a robotics project to drive some traction wheels.

I’d like to implement a “brake” mode on for the motors and I was wondering if there was some way to command the Odrive to short all the phases together so that the motor self-brakes?

Why do you need to brake the motors by zero-voltage specifically? Why not simply set the velocity setpoint to 0?

Setting the velocity of the motor to zero seems to place the unit in some sort of position hold mode where the motor tries to return to center when pushed.

The sort of behaviour I’m looking for is for the motor to resist movement, but not try to correct for it in any way.

<odrv>.<axis>.controller.set_velocity_setpoint(0.0, 0.0) does exactly that.


What do you mean with 'to resist movement, but to not try to correct for it in any way? Do you mean the behavior of idle mode?

You could first set the velocity setpoint to zero, and after a few milliseconds set the requested state to 1

I’m wondering, why is it that the motor is drifting back to it’s original position in velocity control mode? Shouldn’t it stay where you let go of the motor, ignoring it’s position?

I’m asking since I’m also working on a project where a back and forth movement should be resisted by an adjustable amount. I got it working by changing the vel_gain, but every time I let go, the motor drifts back to it’s original position.

1 Like

The reason is because of the integrator gain correcting for steady-state velocity error. You can simply set the controller.config.vel_integrator_gain to 0 to disable this.

1 Like

That was exactly what I was looking for, thanks!

OK, now the position is kept, but how would I increase the force? I can only increase the vel_gain to about 0.0015 before the motor start shaking badly. But with this setting the current_control.Iq_measured only goes to about 20A peak while the motor should be able to handle at least triple that (Odrive 150Kv motor).

I was having the same issues with the motor oscillating badly at 0 velocity. I found that reducing the axisX.motor.config.current_control_bandwidth parameter down from 100 (the value recommended in the hoverboard tutorial that I was following) down to the 20-50 range, then re-running the motor calibration routine (AXIS_STATE_MOTOR_CALIBRATION). I noticed that this also had the effect of increasing the holding torque.