Quote:
Originally Posted by Gary Bonner
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.