Brake vs Coast Mode? Which is better for PID Loops?

We are tuning our PIDloop and wondering if it’s better to be running in brake mode or in cost mode?

As brake and coast mode only have an effect when the motor controller is commanded to 0, and this is almost never the case when running closed-loop control, it makes very little difference.

Wouldn’t the motor be commanded to 0 when it stops at the set point? Or would that be a poorly tuned closed-loop control?

In a (working) velocity loop, no, the output is not 0 at the setpoint because a nonzero voltage is required to hold a constant speed.

In a position loop, yes - but unless you have a sizeable deadband, you are almost never going to be exactly on the setpoint with no output. Even if you do reach the setpoint, any perturbation will cause the motor to respond, and so you’ll only have a short period of time where brake/coast could possibly make a difference - moreover, the braking is proportional to the speed so there won’t be much in the way of braking regardless.

The only time I can envision brake/coast being anything more than a triviality in closed-loop control is if you were running unidirectional bang-bang control on a flywheel.

On the old Victor 884’s, brake vs coast mode would change the switching mode to switch between on and open instead on and off. This changed the response dramatically and was a pain to deal with.

We run all our Victor SPs in brake mode. Coast mode introduces nonlinearity in the system which makes it harder to do tight controls. I just had 1678 switch their victors back to brake mode, and it fixed a problem with their drivetrain control loops.

The one thing that was nice about the old 884s though was that if you wired them up properly (using an additional PWM cable into the brake/coast port instead of a jumper) you could actually switch between coast and brake dynamically with code, which is something I don’t think is possible with any modern controller. :frowning:

You can tell the Talon SRX to switch modes at runtime.

1 Like

And even when the robot is disabled.