Difference between revisions of "PID Control"
Jump to navigation
Jump to search
Dsteinmark (talk | contribs) m (→Intro) |
Dsteinmark (talk | contribs) |
||
| Line 6: | Line 6: | ||
'''See page: [[Intro to Control Theory and PID Loops]]''' | '''See page: [[Intro to Control Theory and PID Loops]]''' | ||
| + | |||
| + | == Tips and Guides == | ||
| + | |||
| + | * PID control works best if the underlying control mechanism does a decent job first | ||
| + | :* That way, the correction constants can be tuned to correct disturbances, and not to control the system for its default behavior. | ||
| + | :* This implies that your feed-forward/open loop/bias component should be calculated appropriately, and not rely on the PID portion to perform basic operation. Proper bias is an important element of the controller, and will allow you to focus efforts on tuning for step changes or variability, and not for basic performance. It is ''unnatural'' to combine them into the ''P'', ''I'', and ''D'', and it will complicate the tuning process considerably if you do not account for a proper bias. | ||
| + | * Get your ''bias'' right before tuning ''P'', ''I'', or ''D''. If the bias is incorrect, you will have a hard time tuning with only ''P''. | ||
| + | * Tune ''P'' before ''I'' or ''D''. ''P'' should generally be the largest input to correct the error, and should be tuned first. If you have to retune ''P'', you will likely need to retune ''I'' and then ''D''. | ||
| + | * Tune ''I'' before ''D''. ''I'' should be used to help with variation and unexpected inputs, that can be corrected over time. If you have to retune ''I'', you will likely need to retune ''D''. | ||
| + | * ''D'' often does not need to be used | ||
| + | :* The Derivative component ''D'' is often subject to noise and can be difficult to control | ||
| + | :* You can perform noise filtering to get improvements at a cost of slightly delayed response for the D component. Usually the delayed response is insignificant. | ||
| + | * When tuning, know that you cannot correct with MORE than 100% of positive correction or MORE than of 100% negative correction. Note that either positive or negative correction (which causes process variable to lessen) may be nil (zero). For example, when heating, usually the best you want to do when its too hot is to turn off the heating element (not introduce cooling). Similarly, when cooling, you frequently turn off cooling and do not want to introduce heating when it has gotten to cold. | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
== Resources == | == Resources == | ||
| Line 22: | Line 30: | ||
* [https://en.wikipedia.org/wiki/Control_theory Wikipedia Control Theory] | * [https://en.wikipedia.org/wiki/Control_theory Wikipedia Control Theory] | ||
* [https://phoenix-documentation.readthedocs.io/en/latest/ch16_ClosedLoop.html Talon SRX PIDF controller] PID Control built into the Talon SRX controllers | * [https://phoenix-documentation.readthedocs.io/en/latest/ch16_ClosedLoop.html Talon SRX PIDF controller] PID Control built into the Talon SRX controllers | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
'''To Do:''' | '''To Do:''' | ||
| − | * Cover use of the [https://phoenix-documentation.readthedocs.io/en/latest/ch16_ClosedLoop.html PIDF controller] built into the Talon SRX controllers. | + | * Cover use of the [https://phoenix-documentation.readthedocs.io/en/latest/ch16_ClosedLoop.html PIDF controller] built into the Talon SRX controllers by descriptive text here. |
* Maybe include advanced treatment (noise filtering, especially for D, windowing for I, cascading controllers?) and possibly info about the mentor PID Controller code when completed. | * Maybe include advanced treatment (noise filtering, especially for D, windowing for I, cascading controllers?) and possibly info about the mentor PID Controller code when completed. | ||
* Additional topics: tips for tuning, keeping away from D unless necessary, typical places to apply on the robot. | * Additional topics: tips for tuning, keeping away from D unless necessary, typical places to apply on the robot. | ||
| + | * banding the PID control (I.e) multiple DLOs) to create a stronger response | ||
| + | * oscillations | ||
| + | * can’t correct with > 100% effort | ||
[[Category:Programming]] | [[Category:Programming]] | ||
Revision as of 17:45, 8 December 2021
Intro
PID Control is a closed loop control architecture that uses monitoring and feedback to improve control of a process variable - that is something you wish to control. It is more robust than open loop controllers that have a set it and forget it type of mentality, which do not monitor what is happening.
Before learning about PID Control, it is important to know where it fits in with other types of control options. The introduction to PID is on this other page.
See page: Intro to Control Theory and PID Loops
Tips and Guides
- PID control works best if the underlying control mechanism does a decent job first
- That way, the correction constants can be tuned to correct disturbances, and not to control the system for its default behavior.
- This implies that your feed-forward/open loop/bias component should be calculated appropriately, and not rely on the PID portion to perform basic operation. Proper bias is an important element of the controller, and will allow you to focus efforts on tuning for step changes or variability, and not for basic performance. It is unnatural to combine them into the P, I, and D, and it will complicate the tuning process considerably if you do not account for a proper bias.
- Get your bias right before tuning P, I, or D. If the bias is incorrect, you will have a hard time tuning with only P.
- Tune P before I or D. P should generally be the largest input to correct the error, and should be tuned first. If you have to retune P, you will likely need to retune I and then D.
- Tune I before D. I should be used to help with variation and unexpected inputs, that can be corrected over time. If you have to retune I, you will likely need to retune D.
- D often does not need to be used
- The Derivative component D is often subject to noise and can be difficult to control
- You can perform noise filtering to get improvements at a cost of slightly delayed response for the D component. Usually the delayed response is insignificant.
- When tuning, know that you cannot correct with MORE than 100% of positive correction or MORE than of 100% negative correction. Note that either positive or negative correction (which causes process variable to lessen) may be nil (zero). For example, when heating, usually the best you want to do when its too hot is to turn off the heating element (not introduce cooling). Similarly, when cooling, you frequently turn off cooling and do not want to introduce heating when it has gotten to cold.
Resources
Links:
- Control Gurus - The P-Only Control Algorithm A decent intro to Proportional Control, and a solid basis for understanding PID Control. Careful - ControlGuru uses Kc instead of Kp, and Kc/Ti instead of Ki. Essentially works the same.
- Control Gurus - Table of Contents Some of the most comprehensive documentation on PID Control on the net. Includes beginner topics and advanced topics.
- Non-linear Processes and Design Level Of Operation (DLO) To tune a non-linear process that responds differently to changes at different levels of output, you need to determine a representative operating point (DLO). Maybe you need more than one because there is too much variation, in which case - you need more than one controller, each based on its own range of operation.
- Wikipedia PID Controller
- Wikipedia Control Theory
- Talon SRX PIDF controller PID Control built into the Talon SRX controllers
To Do:
- Cover use of the PIDF controller built into the Talon SRX controllers by descriptive text here.
- Maybe include advanced treatment (noise filtering, especially for D, windowing for I, cascading controllers?) and possibly info about the mentor PID Controller code when completed.
- Additional topics: tips for tuning, keeping away from D unless necessary, typical places to apply on the robot.
- banding the PID control (I.e) multiple DLOs) to create a stronger response
- oscillations
- can’t correct with > 100% effort