Difference between revisions of "Component: PID Control (DSP)"
(One intermediate revision by the same user not shown) | |||
Line 14: | Line 14: | ||
==PID Control component== | ==PID Control component== | ||
Control algorythm based on Proportional, Integral and Differential error. P/PI/PID - Mathematical control process to get to the setpoint as fast as possible, similar to the process in the human brain when steering a car. Used to accurately control things like motors, temperatures etc. | Control algorythm based on Proportional, Integral and Differential error. P/PI/PID - Mathematical control process to get to the setpoint as fast as possible, similar to the process in the human brain when steering a car. Used to accurately control things like motors, temperatures etc. | ||
+ | |||
+ | ==Component Pack== | ||
+ | |||
+ | DSP | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
+ | |||
+ | |||
Line 26: | Line 34: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
+ | |||
+ | |||
Line 160: | Line 172: | ||
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] |
| width="90%" | Setpoint Connect To | | width="90%" | Setpoint Connect To | ||
|- | |- | ||
− | | colspan="2" | DSP component with output buffer to collect our | + | | colspan="2" | DSP component with output buffer to collect our data from. |
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] |
| width="90%" | Feedback Connect To | | width="90%" | Feedback Connect To | ||
|- | |- | ||
− | | colspan="2" | DSP component with output buffer to collect our | + | | colspan="2" | DSP component with output buffer to collect our data from. |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
Line 179: | Line 191: | ||
|- | |- | ||
| colspan="2" | Sets the buffer data type. | | colspan="2" | Sets the buffer data type. | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Control | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
Line 209: | Line 225: | ||
|- | |- | ||
| colspan="2" | Time in seconds between each sample | | colspan="2" | Time in seconds between each sample | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Integral Properties | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
Line 224: | Line 244: | ||
|- | |- | ||
| colspan="2" | Minimum value that the integral value can go to. | | colspan="2" | Minimum value that the integral value can go to. | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Derivative Properties | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
Line 239: | Line 263: | ||
|- | |- | ||
| colspan="2" | Coefficient used to calculate the response of the filter, the higher the value the more filtering is performed | | colspan="2" | Coefficient used to calculate the response of the filter, the higher the value the more filtering is performed | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} |
Latest revision as of 17:19, 9 November 2022
Author | Matrix Ltd |
Version | 1.2 |
Category | DSP |
Contents
PID Control component
Control algorythm based on Proportional, Integral and Differential error. P/PI/PID - Mathematical control process to get to the setpoint as fast as possible, similar to the process in the human brain when steering a car. Used to accurately control things like motors, temperatures etc.
Component Pack
DSP
Detailed description
No detailed description exists yet for this component
Examples
Setpoint = Value that the user wishes the system to be running at. e.g. the temperature control knob for an oven.
Feedback = Measurement to monitor the value we are controlling. e.g. the temperature reading inside the oven.
Control Signal = The value we want to output to the device. e.g. the signal sent to the heat element inside the oven.
Proportional (P) - Provides an instantaneous kick to try and get the control variable to the setpoint as quickly as possible. P control alone will generally always end up with some form of steady state error. If this is acceptable then P control alone is very easy to perform and stable as long as the P gain is not excessive.
Integral (I) - Provides an accumulation of error over time to try and minimise any steady state error. PI control alone can be a very suitable option for controlling a lot of systems. A potential problem with I control is if the control variable goes into saturation and cannot for whatever reason reach the setpoint. This can cause the I accumulator to get larger and larger and then if the saturation is removed the system can become very unstable. Integral clamping allows the integral accumulator to be held within a certain range and avoid excessive windup.
Derivative (D) - Provides a delaying effect when the error is changing fast. This can have the effect of dampening oscillations and allowing the P and I gains to be increased further to provide faster and more stable responses. The D term can be tricky to get right and too much especially when used with a noisy feedback signal can lead to instabilities. The D filter allows for some high frequency noise to be removed from the feedback.
Here is a project file showing an PID control system for a system such as an high accuracy temperature controller e.g. a 3D printer hotend.
The setpoint is set via an analogue input which controls the desired temperature of the system.
In this first example the feedback is provided using the simulated load DSP component which simply takes a percentage of the last output and combines with a percentage of the new output.
This allows easy moddeling of systems such as devices that heat up and cool down over time which allows you to see the system in action.
You assign a setpoint and then the system will get to temperature and then maintain the temperature by automatically adjusting the output duty.
PID Control Simulated Output Example
In this second example the feedback is provided via a temperature sensor component. This shows how you would do it with a real system using a sensor to complete the feedback loop.
As with other DSP components the raw signals and values can be seen in the data recorder and console windows.
Downloadable macro reference
![]() |
Process |
Processes the current value from a buffer. | |
![]() |
Return |
![]() |
GetPIDPortions |
Collects a single contribution from the PID output. | |
![]() |
Index |
0=P, 1=I, 2=D | |
![]() |
Return |
![]() |
ProcessArray |
Processes an entire buffer, either by performing the control operation to every value in the buffer or just the last value. | |
![]() |
Return |
![]() |
ChangePID |
Allows the P, I and D control parameters to be changed on the fly during a program. | |
![]() |
P |
![]() |
I |
![]() |
D |
![]() |
Return |