Y_YA_PID_Control
This function block can be used as a generic control loop feedback mechanism. A PID controller calculates an "error" value as the difference between a measured process variable and a desired set point, or reference. PIDParameters must be adjusted to allow the process to provide the proper ControlOutput for a given error situation.
Parameters:
| * | Parameter | Data Type | Description | Default |
|---|---|---|---|---|
|
VAR_INPUT
|
||||
| B | Enable | BOOL | The function will continue to execute every scan while Enable is held high and there are no errors. | FALSE |
| V | PIDParameters | Yt_YA_PIDStruct | Structure containing all the information for PID control block to operate | N/A |
| V | Reference | LREAL | Setpoint for the PID control loop. | LREAL#0.0 |
| V | ProcessValue | LREAL | Real world value to be compared with the Reference in the control loop | LREAL#0.0 |
| VAR_OUTPUT | ||||
| B | Valid | BOOL | Indicates that the function is operating normally and the outputs of the function are valid. | |
| V | ControlOutput | LREAL | Output value from the PID control block. The range of values will be governed by the PID parameters, especially the upper and lower limit. | |
| B | Error | BOOL | Set high if an error has occurred during the execution of the function block. This output is cleared when 'Execute' or 'Enable' goes low. | |
| E | ErrorID | UINT | If Error is true, this output provides the Error ID. This output is reset when 'Execute' or 'Enable' goes low. | |
- All time parameters in the PIDStruct (Ts, Td1, and Td2) must be in the same units, i.e seconds or ms.
| Symbol | Specification |
|---|---|
| Ts | Scan time set value |
| Kp | Proportional gain |
| Ki | Integral gain |
| Kd | Derivative gain |
| Td1 | Divergence differentiation time |
| Td2 | Convergence differentiation time |
| Ti | Integration time |
| IUL | Upper integration limit |
| ILL | Lower integration limit |
| LowerLimit | Lower PID Limit |
| UpperLimit | Upper PID limit |
| Deadband | Width of the deadband for the P+I+D correction value |
Here, the PID operation is expressed as follows:
X: deviation input value; Y: output value
The following operation is performed within the PID instruction:
X’: previous input value; Yi’: previous I output value; Ts: scan time set value