PID Controller
From SysCAD Documentation
Navigation: Main Page -> Models -> Process Control Models
Contents |
General Description
The PID unit is used to simulate simple PID plant control functions. If the user requires more complicated controls that involve loops, then the Controller - General should be used.
- A single PID controller unit can be used to simulate any number of independent PID controllers on the plant.
- The control logic used to manipulate the variables is implemented once at the end of every SysCAD iteration.
- The PID controller may be used in ProBal or in Dynamic mode. In Dynamic mode it closely simulates an actual plant PID loop, while in ProBal mode the time dependent factors have no relevance.
- The Controlled Tags, the Output from the PID, and the Measured Tags, the Input to the PID, will have coloured triangles shown in the access window of those units. When the user right clicks on one of these referenced tags it will indicate which PID is referencing the tag. See Controlled and Referenced Variables.
Diagram
The diagram shows the default drawing of a PID controller.
This screen dump shows variables used and calculated in the PID Controller.
Inputs and Outputs
There are no connections to this unit.
Model Theory
The classical PID algorithm as shown below is used in the model:
Where:
- u(t) = the control action or output variable at time t;
- e(t) = the error (or deviation) w(t) - y(t): the difference between the set point w(t) and the measured variable y(t);
- K = the Gain;
- Ti = the Integral time;
- Td = the Derivative time.
For a full description of the theory, please see the reference below.
References
Clarke D.W, PID Algorithms and their computer implementation, Dept of Engineering Science, University of Oxford Trans Inst M C Vol 6 No 6 Oct-Dec 1984
Data Sections
The default PID Controller access window consists of 2 sections. The number of sections in the access window will depend on the number of independent PID controllers required by the user.
- The first tab contains general information relating to the unit.
- The Info section contains general settings for the unit and allows the user to include documentation about the unit and create Hyperlinks to external documents.
Class: PID_Cont-1 - The first tab page in the access window will have this name.
First Section - Overall Data Fields
|
Tag / Symbol |
Input / Calc |
Description |
| On | Tick Box | The Overall PID unit will be enabled or disabled using this box. This means that all of the independent PID controllers in the unit will be disabled. |
| ShowCnv | Tick Box | With this option selected, SysCAD will display engineering units for tags such as Spt, Meas, Output, InMin/Max and OutMin/Max. Note that these will only be displayed after SysCAD has completed at least one iteration. |
| No_of_PIDs | Input | The number of independent PID controllers required. This may be any number from 0 upwards. The user may also change this number at any time. However, the unit will always add new PID controllers after existing ones, and it will delete them starting from the last controller. e.g. if you have 5 PIDs set up and you change this to 4, PID number 5 will be deleted. So if you do not want PID number 1, the best is to turn this off individually or use the priority field to change its display order. |
| Check Tags | Button | SysCAD will perform a check on the validity of the tags and functions used in the PID controllers. |
| State | Display | The state of the PID controller. If everything is correct and operating normally, the user will see 'OK' in this box. Otherwise the unit will flag an error message, which helps the user to locate the problem with the controller. |
|
Error: | ||
| MSG_1 to MSG_2 | Display | Any errors will be reported here. These messages are also displayed in the message window. |
Individual PID Data Fields
Each independent PID has the following layout. The first PID will be displayed on the first page. Each page thereafter displays two PIDs.
|
Tag / Symbol |
Input / Calc |
Description |
|
Tag.Cfg.[PID number] | ||
| On | Tick Box | This can be used to enable or disable the independent PID. |
| Name | Input | The user may give the PID a name that describes the control, e.g. Autoclave steam control. |
| Type | Original | Method which is based on the PID controller block in the Foxboro IA system (this method is not available in SysCAD 9.2 and later) |
| Clark | This method is recommended for most applications. | |
| Clark FF | This method refers to controller Direct/Reverse acting in the form of Process Gain, as well as having extra fields such as Bias for Proportional control and Feed Forward cross reference. | |
|
UseSetPointTag |
Tickbox |
If this is enabled, then the user can use a SysCAD tag/function as the setpoint. If this is not ticked, then a constant value is expected for the setpoint. (Only applicable for SysCAD 9.2) |
|
Current values | ||
|
SptUsed |
Output |
The Set Point value used. The value is either a fixed user defined Set point value or it changes according to the user defined Set Point Tag. |
|
Meas / Measured_Value |
Output |
The measured variable, or more commonly called the Process Variable or PV. The PV is measured and acts as an input to the Controller which takes action based on the value of the PV. Alternatively the PV can be measured and displayed so that the operator can perform manual control. |
|
Out / Output_Value |
Output |
The current value of the Controller Output Signal (OP). |
|
SetPoint | ||
|
Spt / SetPoint |
Input |
The Target Value of the Process Variable (Meas), it should be between the minimum and maximum input values.
|
|
SetPoint_Tag |
Input |
This can either be a SysCAD tag or a function:
The value of the calculated set point will be displayed in the SetPoint box.
|
|
Measured tag (input) and expected range | ||
|
Meas_Tag |
Input |
The Measured variable (sometimes called the Process Variable or PV). The Measured variable acts as an input to the Controller which takes action based on the difference between the Measured variable and the Set Point. The Measured variable can either be a valid SysCAD tag or a function. If it is a function, the first character must be an '=' followed by a valid expression. See the PGM documentation for the required syntax. |
|
InMin / Minimum_Input |
Input |
The expected minimum value of the Measured variable. If the relative difference between this Minimum value and the Set Point is too small, SysCAD will flag a warning and adjust the range that is used to carry out the control. |
|
InMax / Maximum_Output |
Input |
The expected maximum value of the Measured variable. If the relative difference between this Maximum value and the Set Point is too small, SysCAD will flag a warning and adjust the range that is used to carry out the control. Note: If the actual value of the Measured variable moves outside of these expected values, the controller will not operate efficiently. |
|
Controlled tag (output) and range limits | ||
|
Output_Tag |
Input |
The tag that the PID Controller will set, or the Output Signal (OP). This must be a valid SysCAD tag that can be adjusted by the user, i.e. it MUST be a white field. |
|
OutMin / Minimum_Output |
Input |
The minimum value that the PID controller may send to the Output tag, or Output Controller Signal (OP). |
|
OutMax / Maximum_Output |
Input |
The maximum value that the PID controller may send to the Output tag, or Output Controller Signal (OP). |
|
Settings | ||
|
Auto |
Tick Box |
This emulates the auto/manual function of a controller. If this option is switched off, then the controller is in manual and will no longer control automatically. Instead, the user may set the output of the controller to a fixed value. |
|
SptTrk |
Tick Box |
This field only appears in a dynamic project. If the controller is in manual (Auto check box is unchecked), then if this option is switched on, the setpoint of the controller will set to the measured value. |
|
TrackMinMaxMeas |
Tick Box |
This field only appears in a dynamic project. If this option is disabled then the user will stop receiving warnings when the measured value is outside the specified range of InMin to InMax. |
|
TrackMinMaxOut |
Tick Box |
This field only appears in a dynamic project. If this option is disabled then the user will stop receiving warnings when the output value is at either of the specified limits (OutMin or OutMax). |
|
Reverse |
Tick Box |
The direction in which the PID controller will operate. For Methods 2 - Original and 3 - Clark: This refers to the process response, which is opposite of what the control engineers' definition of process gain. For example, for this model to work properly, the line of thinking should be as such: 1) Steam is added ↑ to raise ↑ the temperature in the tank. So the process response in the same direction, thus this should be left un-ticked. 2) Cooling water is added ↑ to reduce ↓ the temperature in the tank. So the process response is in the opposite direction, thus this should be ticked. For Method 4 - Clark FF: Direct/Reverse Acting is implemented in the traditional way, thus opposite of what the Original and Clark method does. 3) Reverse Acting (SP - PV) Used when the process gain is +ve. A process measurement increase causes a control output decrease. For example Inlet Flow to Tank Level - if the Tank Level is above Setpoint then we need to reduce the inlet flow. 4) Direct Acting (PV - SP) Used when the process gain is -ve. A process measurement increase causes a control output increase. For example Outlet Flow to Tank Level, if the Tank Level is above setpoint we need to increase the outlet flow. |
|
Gain |
Input |
This uses the Proportional Control which is the main and principal method of control. It calculates a control action proportional to the error. Where Error is the difference between PV and SP. The Gain is applied to scale the size of the control action based on error. Using Proportional Control alone cannot eliminate the error completely. Gain represents the power of the control action. The larger the Gain, the stronger the control (or more difficult to control). Therefore, user must not use a Gain larger than really necessary as it affects the stability of the process. |
|
PropBand |
Input |
The proportional band (PB) of the Proportional control. It is calculated as PB(%) = 100 / Gain. User only need to enter values for either Gain or PB, the other is calculated using the above formula. |
|
Integral |
Input |
The integral time constant of the Integral control. Integral control is used to control towards no error, thus to assist the Proportional control. When a value is input in this field, we are using the PI Control. For Methods Original and Clark: The integral term can not be turned off. Its value is set to max(Ic,m_Period/2) where Ic is the selected integral reset time and m_Period is the period of execution of the PID controller. Integral cannot be turned off in the PID3 implementation as there is not a Bias. For Method Clark FF: Integral action is turned off when Ic=0.0 If Ic is non zero the Integral reset time used by the PID is set to max(Ic,m_Period/2) where Ic is the selected integral reset time and m_Period is the period of execution of the PID controller. When you do not use integral action you usually need to specify a Bias signal for the P Only or PD controller output to operate around. |
|
Derivative |
Input |
The derivative time constant of the Derivative control. Derivative control is used to add stability. Note: This is generally only used in Dynamic mode. This would normally be 0 in ProBal mode. |
|
Bias |
Input |
Only appears for Method Clark FF: For proportional controllers only. The controller output will equal bias when the error is zero, thus bias is adjusted so that the controller output are at their nominal steady state value. It has the same units as the control output. |
|
Options | ||
|
TrackSptRange |
Tick Box |
If this option is disabled then the user will stop receiving warnings when the setpoint value is close to the limits of the specified range of InMin to InMax. |
| Tune Rule | Input | The user may select a tuning rule to use when automatic tuning is used. The user may select between Proportional only (P), Proportional and Integral (PI) or Proportional, Integral and Derivative (PID). |
|
Priority |
Input |
If more than one controller is used, the user may set the priority of the controllers. This changes the order the controllers are displayed. If the user wants to delete an unwanted controller, assign it with the lowest priority (thus the largest number) to move it to the last position. |
|
FeedForward _Tag |
Input |
Only appears for Method Clark FF: Cross reference tag that specifies the amount of feedforward in units of the control output. Typically this value would be calculated in another controller. |
|
FeedFwd |
Output |
Only appears for Method Clark FF: The value corresponding to that specified in the FeedForward_Tag. |
|
Control Tolerances | ||
|
AbsTol / Tolerance_Abs |
Input |
Absolute Tolerance, allows user to loosen or tighten the control. Use '*' to use project tolerance (see Project Commands for more information). Refer to Tolerance Testing for an explanation of how this is used. |
|
RelTol / Tolerance_Rel |
Input |
Relative Tolerance, allows user to loosen or tighten the control. Use '*' to use project tolerance (see Project Commands for more information). Refer to Tolerance Testing for an explanation of how this is used. |
Adding this Model to a Project
Insert into Configuration file
Sort either by DLL or Group.
|
|
DLL: |
Control1.dll |
→ |
Units/Links |
→ |
Control: PID |
|
or |
Group: |
General |
→ |
Units/Links |
→ |
Control: PID |
See Project Configuration for more information on adding models to the configuration file.
Insert into Project
|
|
Insert Unit |
→ |
Control |
→ |
PID |
See Insert Unit for general information on inserting units.
Hints and Comments
- If one of the PID controllers contains a tag that is invalid, SysCAD will not begin execution, but will flag that user that there is an error in the PID controller. Check the Messages window for a list of the invalid tags.
- If a PID controller ceases controlling, it may be that the measured variable is outside of the user defined minimum and maximum values. If this is the case, adjust the minimum or maximum so that the measured variable falls within the limits.
- If the response of a independent PID is too fast, it will bounce around and never converge. In ProBal mode, increase the proportional band until the response settles down. In dynamic mode, the integration factor should be increased, either alone, or in conjunction with an increase in the proportional band.
- Users can take advantage of the controller auto-tuning functionality to help tune controllers in the project. This often result in projects converging much faster with well tuned controls and is especially useful if many controllers have been used. To find out how, please refer to Trend Window (with PID Controllers).
- All control engineers using SysCAD will complain that the PID controller Direct / Reverse action is opposite to what they are used to, this is due to the fact that SysCAD uses the process response to determine the direction, not the process gain. For example, for this model to work properly, the line of thinking should be as such:
- a) Steam is added ↑ to raise ↑ the temperature in the tank. So the process response in the same direction, thus this should be left un-ticked.
- b) Cooling water is added ↑ to reduce ↓ the temperature in the tank. So the process response is in the opposite direction, thus this should be ticked.
- The problem above can be rectified by selecting the newly implemented method 4-Clark FF under Type. Reverse Acting (SP - PV) Used when the process gain is positive. Direct Acting (PV - SP) Used when the process gain is negative.
- Each PID implementation scales the measured variable and control output between 0-100%. The PID algorithm thus works in this scaled range. This scaling needs to be taken into account when computing the effective open loop gain of the process as seen by the PID controller.
- Process Measurement Scaling : Kin = 100/(Inmax-Inmin)
- Control Output Scaling : Kout = (Outmax-Outmin)/100
- Process Gain with Eng Units : Ku
- Unitless Process Gain as Seen by PID : K = Kout*Ku*Kin = (Outmax-Outmin)/(InMax-InMin)*Ku

