Talon SRX closed loop tolerance band?

Is there a way to set a tolerance band for closed loop mode on the SRX?

+/- 10 encoder tics is plenty close enough for what we’re doing and I’d rather not have the SRX trying to drive the motors when we’re that close to the setpoint.

I assume you have read the TALON SRX Software Reference Manual.

You can clear the Integral Accumulator when your code determines that the feedback value is “close enough” to the set point. Or you can just not use an Integral term at all, and rely on a well-chosen Proportional gain to get the motor near where you want without overshooting.

Bingo.

I’ll just add a bit more. Traditionally it’s the integral component of the PID response that causes continual movement even though you are close enough. So Alan is right suggesting clearing IAccum will likely meet your expection.

But if for some reason you wanted zero drive completely, you are always free to check GetCloseLoopErr() and if it’s within tolerance, you can change the mode to kNoDrive in order to neutral the motors. (See section 5.1 for example accessor).

Also for things like drive servo in auton, normally you want to servo to PosX, then when you are close enough, move on to do the next servo/arm/whatever. Calling GetClosedLoopErr() is the best way to know if you are closed enough to your target.