View Single Post
  #5   Spotlight this post!  
Unread 25-01-2011, 13:35
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: PIDController Parameter values for QuadEncoder

Quote:
Originally Posted by Gary Bonner View Post
Is there any typical range of values of the coefficients? 0 to 1, 0 to 100, 0 to 1000? Does the range differ for P, I, & D? Were not sure what value to start with other than just randomly pick one and be ready on the stop button. If it makes a difference, we're looking at doing position control using a CAN Jaguar.

Thanks.
You can usually eye-ball the initial P setting to get it in the ballpark.

Here's how I do it:

1) determine how much error (i.e. setpoint - processVar) should result in full motor command. Call this MaxError.

2) set P to MaxCommand/MaxError.

For example, let's say you're building an arm that is to hold an angle using a PID controller. If something pulls on the arm, the controller should increase the motor command. A ballpark guess is that you would want to be at full power when the arm is deflected by 10 degrees (MaxError). The maximum PWM command is 1.0 (MaxCommand). Therefore, try using 0.1 as your initial P (MaxCommand/MaxError = 1 / 10).

Note that the above example assumes your setpoint and process variable are measure in degrees in your software.
__________________
-
An ounce of perception is worth a pound of obscure.
Reply With Quote