11/29/2023 10:59 AM | |
Joined: 9/23/2005 Last visit: 7/2/2024 Posts: 4347 Rating:
|
Hi Here there some tips about PID_Compact Version (V3), configured as from STEP 7 V19 (for PID_Compact V1, see tips athttps://support.industry.siemens.com/forum/br/pt/posts/tips-for-pid-fb-pid-compact/33957/?page=0&pageSize=10 for PID_Compact V2, see tips athttps://support.industry.siemens.com/forum/br/en/posts/tip-pid-fb-pid-compact-v2-x-configured-with-step7-v12/88237/?page=0&pageSize=10) At the time of this edition (V19) the PID_Compact was only available to S71-500 controllers. 1 – Documentation The main documentation about PID stay on: SIMATIC S7-1200, S7-1500 PID control TIA Portal InformationSystem (online help), in Information System > Programming a PLC > Instructions (S7-1200, S7-1500) > Technology (S7-1200, S7-1500) > PID Control (S7-1200, S7-1500) > PID_Compact (S7-1200, S7-1500) > PID_Compact V2 (S7-1200, S7-1500) (!) > Description of PID_Compact V3 2 - What’s news in version 3, compared with version 2: The main difference is the Dead Zone (equivalently to the dead band, for CONT_C) for PID Compact. DeadZone is a range of PID controller input values where there is no control action. In other words, the controller ignores small variations in the input value when it is within the DeadZone. Normally it is used for the PID to disregard the noise that enters together with the analog variable that represents the process value. 3 – Quick start: Call the PID from a Cyclic Interrupt OB. The Cyclic time OB property should be faster than the controlled process and makes sense with the application: for a temperature control that has field variations in the order of seconds, make no sense times lower than 10ms or gather as seconds… The default value for a Cyclic Interrupt OB is 100ms and it is enough for the general (non time critical) applications. Click on the toolbox button and set the PID parameters (details, see topic 4, Parameters). Notes: E.g. It is desired that the PID starts in automatic operation mode, however for safety reasons, the PID is set as default to starts in Manual mode (see PID behavior after CPU restart, on topic 4). Another important and safety related parameter is the Reaction to error (Output value parameters, on topic 3): this sets how the PID should react as an undesired situation. 4– Parameters Basic settings Controller Type / Physical Unity: it sets units used in the representation of the others configuration parameters. There is no direct influence on the PID algorithm by itself. Reverse operation: It could be obtained with a check box (Invert the control logic – recommended procedure), or, like S7-200/300/400, with the use of a negative value of Proportional Gain. PID behavior after CPU restart: as default value for the PID configuration is set the PID to manual mode after restart. If it is desired that the PID follows a different operation mode (for example runs in automatic mode after CPU restart) it is necessary to change the properties “activate Mode after CPU restart” / “Set Mode to” (e.g. automatic mode). Input / output parameters: Set point and process values (Setpoint and Input inputs) should be filled with the same units (for example, it is not possible to have set point in Celsius and process value in Fahrenheit). However, e.g. there is no relationship between inputs units and outputs unit. Note, that the variable ManualValue should have the same unit as output. Process value settings Process value limits: High and low limits for the process values. If the process value violates these limits then the PID shows an error indication and reacts like configured in “output value settings”. Process value scaling: shows the unit conversion rules for analogical signals (only relevant if Basic settings/Input was configured to use Input_PER (analog)). Advanced settings Process value monitoring: it is used to set alarms bits. They should stay inside of the Process value limits range to be effective. If the process value violates Process value monitoring limits but says inside of the Process value limits, then the PID sets alarm bits but still works. PWM limits: Has just significance if the PID is configured to have a PWM output. These parameters avoid that the PWM “flicks” the output. Output value Output value limits: used as limit for float points output and as scale conversion rules for analogical outputs. Reaction to error: here you specify how the PID reacts to an unexpected situation (e.g. input outside to configured limits, non regular time interval call or non valid float point input): goes to inactive mode, “freeze” the output while the error occurs (default value) or set to a substitute value while the error occurs. PID parameters: if it is intended to tune the PID automatically, these parameters are disabled (default situation), else the Tuning Rule (that defines if the PID will run with or without derivative control). For manual tuning, it should be enabled. The parameters should be set directly in the configuration tool or by instance DB variables (details in the topic 4, TIPs, at How to set PID parameters manually). Special case: If it is necessary to call the PID from a OB much faster as necessary, and it is intended to minimize unnecessary processing, it could be possible to set the property “sampling time of PID algorithm” as a multiple time of the OB call. 5 - TIPs: How to set PID parameters manually To tune the PID manually, it is necessary to set the “Enable manual entry” property at the PID block toolbox button -> Advanced settings -> PID Parameters. The PID tuning parameter could be found at this windows, or be accessed directly in the Instance DB (for example in a Watch Table or from a HMI) in this variables: Proportional Gain: “Instance DB name”.Retain.CtrlParams.Gain Integral action Time: “Instance DB name”.Retain.CtrlParams.Ti Derivative action Time: “Instance DB name”.Retain.CtrlParams.Td Derivative delay coefficient: “Instance DB name”.Retain.CtrlParams.TdFiltRatio Proportional action weighting: “Instance DB name”.Retain.CtrlParams.PWeighting Derivative action weighting: “Instance DB name”.Retain.CtrlParams.DWeinghting Sampling time of the PID algorithm: “Instance DB name”.Retain.CtrlParams.Cycle DeadZone: “Instance DB name”.Retain.CtrlParams.DeadZone enables manual entry: “Instance DB name”.Retain.CtrlParams.SetByUser All PID parameters are retentive. If you enter the PID parameters manually, you must completely download PID_Compact (see online documentation topic “Downloading technology objects to device”). Alternative is set the parameter by watch table or to create another instance DB to the PID How to reset an inactive mode / how to set a mode The PID has many operation modes. The State output parameter shows the actual operation mode. The operation modes/status are: 0 = Inactive 1 = Pretune 2 = Fine tuning 3 = Automatic mode 4 = Manual mode 5 = Substitute output value with error monitoring To set the PID in a Mode (e.g. Automatic or Manual) , set the desired mode number at input “Mode” and give a positive edge (0->1) at the input “ModeActivate”. Note: falling edge at Reset / ManualEnable or could restart the CPU + RunModeByStartup = True can change the operation mode too. 6 - Sample program I attached a very simple sample program that has a PID and a simple field simulation. It could be used to understand the call/ tuning procedure. The special highlight here is the possibility of activating or deactivating the addition of noise to the field signal and of changing the dead zone value (new in this version). Sample project (archived from TIA Portal as .zap19 and after that compacted in .zip format to be uploaded here) AttachmentPID.zip (292 Downloads) |
Last edited by: Denilson Pegaia at: 11/29/2023 11:02:54Last edited by: The Helping Hand at: 11/29/2023 14:13:09Text formatting optimized Denilson Pegaia |
|
This contribution was helpful to
3 thankful Users |
12/1/2023 4:25 AM | |
Joined: 10/10/2010 Last visit: 4/28/2024 Posts: 307 Rating:
|
What about these options -cascaded PID loops (like modular PID in s7-300/400) - integral wind up -bumpless transfer |
Follow us on