Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Control System (http://www.chiefdelphi.com/forums/forumdisplay.php?f=177)
-   -   Talon SRX closed loop tolerance band? (http://www.chiefdelphi.com/forums/showthread.php?t=134096)

Ty Tremblay 06-02-2015 20:46

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.

Alan Anderson 07-02-2015 11:17

Re: Talon SRX closed loop tolerance band?
 
Quote:

Originally Posted by Ty Tremblay (Post 1439517)
Is there a way to set a tolerance band for closed loop mode on the SRX?

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.

ozrien 07-02-2015 21:23

Re: Talon SRX closed loop tolerance band?
 
Quote:

Originally Posted by Alan Anderson (Post 1439685)
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.


All times are GMT -5. The time now is 20:08.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi