Escolar Documentos
Profissional Documentos
Cultura Documentos
PID Controller
By FLS Automation
FLS Automation A/S Hffdingsvej 77 DK-2500 Valby Copenhagen Denmark +45 36 18 27 00 Fax: +45 36 18 27 99 Printing History:
Version Last modified Author Last modified by Name of Word File Index Range AceV6.5.4 $Revision:: 1 $Modtime:: 26. October 2001 Poul Nielsen $Author:: Finn Kousgaard Poulsen $Workfile:: PID_Controller.doc 0-1000 $ $ $ $
Disclaimer:
Information in this document is subject to change without notice and does not represent a commitment on the part of FLS Automation A/S. The present documentation from FLS Automation A/S is subject to the content of the ordered, confirmed and supplied system configuration. Options specified and described in the FLS Automation A/S documentation as part of the general description but initially neither ordered by the customer nor confirmed by the seller - will not commit the supplier to any further and future supply and/or installation. FLS Automation A/S assumes no responsibility for any errors that may appear in this document. Copyright FLS Automation A/S. All rights reserved.
Contents
PID Controller........................................................................................1
Introduction..........................................................................................................................1 Operating modes...................................................................................................................3 1. Automatic mode........................................................................................................3 2. Manual mode.............................................................................................................3 3. Cascade mode............................................................................................................3 4. Balanced Mode..........................................................................................................3 List of Abbreviations............................................................................................................4 PID Controller Input parameters/Flags................................................................................5 1. NO PID Controller Number.....................................................................................5 2. PVNO Number of the Analog block used as PV ...................................................5 3. PV_TRACK Enable/Disable PV Tracking..............................................................5 4. AUTO_EN Enable/Disable Auto mode...................................................................5 5. EXT1_EN Enable/Disable External 1 mode (Cascade)...........................................5 6. EXT1SP External 1 Setpoint (Cascade)...................................................................5 7. FR1 Enable/Disable Force 1 (Up) Value.................................................................5 8. FR1SP Force 1 (Up) Value......................................................................................5 9. FR2 Enable/Disable Force 2 (Down) Value............................................................5 10. FR2SP Force 2 Value.............................................................................................5 11. EXT2 Enable/Disable External 2 (Balanced) Mode..............................................6 12. EXT2SP External 2 Setpoint (Balanced Mode).....................................................6 13. EXTPV_EN Enable/Disable External PV..............................................................6 14. EXTPV External PV (Value).................................................................................6 15. EXT_FAULT External Fault.................................................................................6 PID Controller Output parameters/Flags..............................................................................7 1. CV - Controlled Value..............................................................................................7 2. CO - Physical Analog Output...................................................................................7 3. AUTO - Controller in Auto.......................................................................................7 4. AINORM - Process Variable Normalised.................................................................7 5. SPNORM - Set point Normalised.............................................................................7 PID Controller Interface Flags.............................................................................................8 1. PID_PARA_CTLx P, I, Dparameter 1 .. 4...............................................................8 2. FR_AUTO Force Auto.............................................................................................8 3. FR_MAN Force Manual..........................................................................................8 4. FR_EXT1 Force External 1 (Cascade).....................................................................8 5. INV Inverse Operation.............................................................................................8 Additional Parameter Settings..............................................................................................9 1. Deviation Fault..........................................................................................................9 2. Ramp Time................................................................................................................9 3. Output Min/Max........................................................................................................9 4. Upper/Lower Deadband ...........................................................................................9 Program structure ................................................................................................................9 ECS-Faceplate Controller...................................................................................................11 ECS-Faceplate, PID Parameters 1......................................................................................12 ECS-Faceplate, PID Parameters 2......................................................................................13 ECS-Faceplate, Trend Curve diagram................................................................................14 Controller status to ECS.....................................................................................................15 Siemens S7-program structure...........................................................................................16 Reserved Function-blocks in STEP7 ..........................................................................16
PID Controller i
Reserved data blocks...................................................................................................16 PID Controller Step7 program structure 1..................................................................18 PID Controller Step7 program structure 2..................................................................19 PID Controller Step7 program structure 3..................................................................20 Control Logix program structure .......................................................................................21 Calling Subroutines for PID Controllers.....................................................................25 Defining Module type.................................................................................................26 Point address Configuration........................................................................................27 Concept program structure.................................................................................................29 Special output pins for PID-ACESYS........................................................................29 Concept program structure..........................................................................................30 A and B point address configuration...........................................................................31
ii PID Controller
PID Controller
Introduction
The PID function block is pre-programmed to handle all commonly used control loops, such as standard loops, cascade control and Balanced Mode etc., and a step controller in combination with the positioner. All Controllers have the functions of Manual/Auto changeover. In Manual operating mode the output can be controlled directly with +/- or a decimal value can be set directly. Four set of controller parameters P-I-D are available. If a controlled system has different dynamics based on the operating point, then a different set of PID-controller parameters can be adapted through the ECS system. Tracking of setpoint and output for bumble transfer is also a part of the controller. A PID controller, often called a three-point controller, has three important parameters to be set. The P-value (proportional part), the I-value (integral time) and the D-value (derivative time). All pre-programmed ACESYS controllers have their D part equal to zero. The standard PID faceplate allows, depending on the mode the user, to adjust the set point or output value of the associated PID controller. The value may be adjusted by manual entry, by moving the slider bar or by a percentage adjustment. Through the external modes provision is made for support of cascaded control loops. In this case the Aux. signal could reflect an external set point. PID loops are implemented at the PLC level so the values displayed in the faceplate describe the immediate values in the PLC. The PID parameter window allows for examination and modification of the Proportional, Integral and Derivative controller parameters as well as setting values for maximal and minimal allowed output. Any parameter change is logged in the ECS event system and therefore traceable. Change of parameters in the PID controller is only allowed for users being granted the proper access privileges. Being a general faceplate the faceplate model can be modified to make an exact match of the PID parameters available in the PLC. The PID trend window provides a short-term trend display for the measurements involved in the PID control. The curves are updated every second and the window length of the display is 10 minutes. In addition to providing a quick overview of the control performance due to fast updating, the PID trend window is suitable for tuning of fast control loops. Long term
PID Controller 1
history information on the PID values must be found using the general trend utility.
2 PID Controller
Operating modes
The following four operating modes are possible: 1. Automatic mode This operating mode is released from the faceplate, and if the interface Controller in Automatic mode Enable = 1 and there are no faults controller will go into AUTO mode. In Auto mode the controller is using the internal setpoint send out from the ECS system. The Automatic setpoint can be set in three different ways. Via 1% or 5% keys Entering a decimal figure Using the sliding bar
2. Manual mode This operating mode is released from the faceplate, and is a flip-flop function with the Auto mode. In operating mode MANUAL the output can be controlled directly with more / less or a value can be set directly as a decimal value. 3. Cascade mode This operating mode is released from the faceplate, and if the interface Controller in Cascade mode Enable = 1, then the controller will accept the External 1 setpoint. 4. Balanced Mode With Interface Controller Balanced mode = "1", done in the PLC program, will the controller go into Balanced mode, and then the Balanced setpoint value is transferred to the output of the controller. For example, when two controllers are connected to form a cascade, the output of the primary controller can be connected as the Balanced mode set point of the secondary controller. This interface is normally written into in manual mode by the ECS system if the program does not provide it. (E.g.: If the controller is the leading one in a cascade, the set point of the subordinate controller is connected to this interface.) An example of Balanced mode is also the ratio calculation of a mill total feed is transferred via the controller to the external controller when the total feed controller is in AUTO.
PID Controller 3
List of Abbreviations
FLSA
NO PV_NO PV_TRACK AUTO_EN EXT1_EN EXT1SP FR1 FR1SP FR2 FR2SP EXT2 EXT2SP EXTPV_EN EXTPV EXT_FAULT CV CO AUTO AINORM SPNORM PID_PARA_CTL1 PID_PARA_CTL2 PID_PARA_CTL3 PID_PARA_CTL4 FR_AUTO FR_MAN FR_EXT1 INV
HTC
NR RX1NR RSNF RFGS RWEE1 RWEX1 RWEE2 RWEX2 RWEE3 RWEX3 RWEE4 RWEX4 RX2NR RX2PV RSA RYCO RYA RAUT RX1NORM RWENORM RTA1 RTA2 RTA3 RTA4 FR_RFGS FR_RHND FR_RWEE1 RINV
Interface
Input integer Input integer Input Flag Input Flag Input Flag Input Floating point Input Flag Input Floating point Input Flag Input Floating point Input Flag Input Floating point Input Flag Input Floating point Input Flag Output Floating point Output integer Output Flag Output Floating point Output Floating point Interface Flag Interface Flag Interface Flag Interface Flag Interface Flag Interface Flag Interface Flag Interface Flag
4 PID Controller
PID Controller 5
11. EXT2 Enable/Disable External 2 (Balanced) Mode A logic 1 on this parameter will bring the controller in Balanced mode. Balanced Mode, where the leading controller in a cascade sets its CV, so bumbles auto <-> man transition is ensured. 12. EXT2SP External 2 Setpoint (Balanced Mode) The controller will use the Setpoint Balanced Mode when there is a Logic 1 on the Balanced Mode parameter. The setpoint can come from e.g. a calculation or a master controller. 13. EXTPV_EN Enable/Disable External PV A logic 1 on this parameter will enable the controller to use an external PV, which could come from e.g. a calculation 14. EXTPV External PV (Value) This value is this Variable, normalised in a range from 0-100, could come from e.g. from a calculation e.g. PV mill total feed 15. EXT_FAULT External Fault An external fault signal switches the controller to mode Manual. The controller displays a fault. This signal is in addition to the analog fault and the fault from the corresponding positioner module.
6 PID Controller
PID Controller 7
8 PID Controller
2. Ramp Time The output of the controller can by means of the Ramp Time, when it's enabled, be set to follow a certain time-driven curve. The smaller the time is set the smaller are changes over the time period.
3. Output Min/Max The output of the controller can be limited by given in the values for minimum and maximum of the controller. The range is 0 to 100%.
4. Upper/Lower Deadband If the process variable or the setpoint is affected by higher frequency noise and the controller is optimally set, the noise will also affect the controller output. This can lead to faster wear and tear on the final control element. The Deadband function can suppress this noise and thereby reduce oscillation of the controller output.
Program structure
PID Controller 9
Tag Name for PID Controller Module No. - NO Process Variable No. - PVNO PV Tracking - PV_TRACK Auto Enable - AUTO_EN Cascade Enable - EXT1_EN Setpoint Cascade Mode - EXT1SP Force Up - FR1 Setpoint Force Up - FR1SP Force Down - FR2 Setpoint Force Down - FR2SP Balanced Mode - EXT2 Setpoint Balanced Mode - EXT2SP Ext. PV Enable - EXTPV_EN External PV (0-100) - EXTPV External Fault - EXT_FAULT CV - Controlled Value 0-100 CO - Analog Output AUTO - Controller in Auto AINORM -Process Variable 0-100 SPNORM - Set Point 0-100
PID-Controller
10 PID Controller
ECS-Faceplate Controller
The operator can bring up the following faceplate by right hand clicking on a motor symbol or a motor status field.
PID Controller 11
12 PID Controller
PID Controller 13
14 PID Controller
The PID Controller uses the B-point algorithm no. 40 for the controller mode.
PID Controller 15
Reserved data blocks For the purpose to store and organise data for ECS communication and internal status of a function block, Data Blocks are used. In the following table the overview of used DBs is shown: In ACESYS controller the setpoint are stored in DB20. The first word is the Auto setpoint and the next is the Manual setpoint the consecutive order is: data word; Controller No * 8, e.g.. Controller No. 2 (2 x 8 = DW16).
16 PID Controller
Data block DB20 controller setpoints DW8 DW12 DW16 DW20 DW24 DW28 DW32 DW36 .. DW320 DW322 Setpoint controller #40 Man Setpoint controller #40 Setpoint controller #1 Man setpoint controller #1 Setpoint controller #2 Man setpoint controller #2 Setpoint controller #3 Man setpoint controller #3 Setpoint controller #4 Man setpoint controller #4
Data block No.: 21 contain the Controller modes. The first word is the controller mode and the next is the timestamp. The consecutive order is: data word; Controller No * 4, e.g. Controller No. 2 (2 x 4 = DW8).
Data block DB21 controller Mode DW4 DW6 DW8 DW10 DW12 DW14 DW16 DW18 .. DW160 DW162 Mode controller #40 Time Stamp controller #40 Mode controller #1 Time Stamp controller #1 Mode controller #2 Time Stamp controller #2 Mode controller #3 Time Stamp controller #3 Mode controller #4 Time Stamp controller #4
PID Controller 17
18 PID Controller
PID Controller 19
20 PID Controller
It is possible to select between 4 sets of PID parameters. In the above rungs parameter set 1 is selected. Inverted Operating mode:
To invert the operation mode of the PID controller, set the INV flag high. The default value is low. Auto Mode:
The AUTO_EN is used to control if it should be possible to select Auto Mode from the faceplate. If the flag is low, it is not possible to select Auto mode from faceplate.
PID Controller 21
The FR_AUTO is used to force the PID into Auto Mode controlled by the PLC-program. Manual Mode:
The FR_MAN is used to force the PID into Manual Mode controlled by the PLC-program. Force Up:
The variable FR1SP is the setpoint for Force Up mode. The value has to be in the interval 0-100. To force the PID into Force Up mode the pin FR1 has to be set. Force Up will bring the PID into manual mode. Force Down:
The variable FR2SP is the setpoint for Force Down mode. The value has to be in the interval 0-100. To force the PID into Force Down mode the pin FR2 has to be set. Force Down will bring the PID into manual mode.
22 PID Controller
Cascade Mode:
The variable EXT1SP is the setpoint for Cascade Mode. The value has to be in the interval 0-100. To bring the PID into Cascade mode the pin EXT1 has to be set. The PID must be in Auto Mode to activate Cascade Mode. The EXT1_EN is used to control if it should be possible to select Cascade Mode from the faceplate. If the flag is low, it is not possible to select Cascade Mode from faceplate. The Auto Setpoint will be tracked in Cascade Mode. Balanced Mode:
The variable EXT2SP is the setpoint for Balanced Mode. The value has to be in the interval 0-100. To bring the PID into Balanced mode the pin EXT2 has to be set. Balanced Mode will bring the PID into manual mode. The Manual Setpoint will be tracked in Balanced Mode. Extern PV:
The variable EXTPV is used to decide the wanted external PV. The value has to be in the interval 0-100. To activate the External Process Value the pin EXTPV_EN has to be set.
PID Controller 23
PV Track:
If the PID is in Manual Mode and the flag PV_TRACK is high, the Auto Setpoint will track on the Process value. The purpose is to obtain a bumbles transfer when the controller is swapped from Manual to Auto Mode. Process Value:
The Process Value for the PID is moved to the variable AINORM. The value has to be in the range 0-100. To ensure that the PID is not acting on a invalid process value the flag ANA_OK is used to bring the status from the analog signal to the PID. The flag must be high to bring the PID into Auto Mode. Calling the Subroutine:
Assign the unit number Code for the signal type (e.g. 1 = 4-20mA) Code for the analog output type (e.g. 0 = 1756 series) Calling the subroutine with the following parameters: Routine Name Input par. Input par. Return par. : : : : Z12_FLSA_Controller Unit tag Group/Route command tag Unit tag
24 PID Controller
Outputs:
Two outputs are available from the PID Controller. The CO output is for direct connection of a analog output, in the range decided by the input signals CODE and MOD_TYPE. CV is a output in the range 0-100. If the PID Controller is controlling a positioner nothing has to be connected to the output pins. Connection has to be done on the positioner.
Calling Subroutines for PID Controllers The subroutines for PID Controllers are call from the program F00_DISPATCHER. This dispatcher is executed every 100mS. In the dispatcher program is implemented a counter counting to 10. Depending of the value of this counter various subroutines are called. The purpose of this program is to reduce the PLC load. Each PID Controller subroutine is executed every seconds.
PID Controller 25
Defining Module type Since the raw value range from Control Logix I/O module return differ it has been necessary to assign a new input to the analog block, when using Control Logix PLCs. The following table shows the supported combinations of output modules and signals:
Signal Data MOD_TYPE 0=1756-xxxx (Output) 0=1756-xxxx (Output) 0=1756-xxxx (Output) CODE 0= 0-20mA 1= 4-20mA * 6= 0-10V Low Signal 0 (0mA) -25 (0mA) 0 (0V) High Signal 100 (20mA) 100 (20mA) 100 (10V)
Raw range and limits RAW_MIN 0 (0mA) 0 (4mA) 0 (0V) RAW_MAX 100 (20mA) 100 (20mA) 100 (10V)
10=1794-OE4/B (Output) 0= 0-20mA ** 0 (0mA) 10=1794-OE4/B (Output) 1= 4-20mA ** 0 (0mA) 10=1794-OE4/B (Output) 6= 0-10V ** 0 (0V)
0 0 0
0 0 0
For the 1756-serie modules it is expected that the modules are configured to use the output range 0-100 equal to the signal range indicated by the code. Example 1: Module = 0 (1756-series) Code = 1 (4-20mA) Module has to be configured for input range 0-20mA High signal = 20.0mA / High Engineering = 100.0 Low signal = 0.0mA / Low Engineering = -25.0 Example 2: Module = 0 (1756-series) Code = 0 (0-20mA) Module has to be configured for input range 0-20mA High signal = 20mA / High Engineering = 100.0 Low signal = 0.0mA / Low Engineering = 0.0
26 PID Controller
For each PID controller one B-point and two A-points are necessary. The Bpoint is used to monitor the PID mode, and the A-points are used to set and monitor the SPA (Setpoint Auto) and SPM (Setpoint Manual). The following picture illustrates the configuration of the B-point for PID mode:
The index for PID_MODE corresponds to the variable NO assigned before calling the subroutine for the PID Controller. B-point algorithm no. 40 is used for PID-mode.
PID Controller 27
The following picture illustrates the configuration of A-points for PID setpoint Auto and Manual:
The configuration of the address for SPA and SPM is the same, except for the index for the PID_SETPOINT. The index is calculated as follow: Index for SPA Index for SPA : (NO * 2 ) 1 : NO * 2
The variable NO is assigned before calling the subroutine for the PID Controller. A-point algorithm no. 3 is used for Setpoint Auto. A-point algorithm no. 4 is used for Setpoint Manual.
28 PID Controller
Special output pins for PID-ACESYS. STAT1: Direct 4xx-register address (Data type: RealArr2 of 2 real values (4words)) holding the Automatic Setpoint (SPA) and the Manuel Setpoint (SPM) from ECS. STAT2: Direct 4xx-register address (Data type: Word-array of 2 words.) holding status information and timestamp for the controller. These 2 words are read by the ECS. 1.Word: contain status information about the analog signal. 2.Word: contain Timestamp for events in the PID-ACESYS block. (Se Data-layout for the Concept program Chapter 15 page 19)
PID Controller 29
30 PID Controller
A and B point address configuration The PID-ACESYS block needs 3 points in the ECS. Next you will see the 1. Point: an A-point (Automatic Setpoint) address configuration in the ECS.
The point Code: UF01M013F1_SPA. PLC: 1 (PLC no. (In which PLC this point is reading)). Input type: Float (Reading 2 words: The value of the Automatic Setpoint) Input Register: 5107 (equal to the data register address %4:05107 connected to the output pin STAT1 on the PID-ACESYS block) Input Bit: Always zero. Output type: Holding Register (Reading 1 word). Output Register: 5107 (the same as input register). Output Bit: Always zero. Parameter type: Holding Register (Pointer for start reading data register area of 80 words). Parameter Register: 49081 (equal to the data type UINT connected to the input pin PARAno on the PID-ACESYS block).
PID Controller 31
Next you will see the 2. Point: an A-point (Manual Setpoint) address configuration in the ECS.
The point Code: UF01M013F1_SPM. PLC: 1 (PLC no. (In which PLC this point is reading)). Input type: Float (Reading 2 words: The value of the Manual Setpoint) Input Register: 5109 (equal to the data register address %4:05109 which must be data register address connected to the output pin STAT1 + 2 (5107 + 2 = 5109). Input Bit: Always zero. Output type: Holding Register (Reading 1 word). Output Register: 5109 (the same as input register). Output Bit: Always zero. Parameter type: Holding Register (Pointer for start reading data register area of 80 words). Parameter Register: 49081 (equal to the data type UINT connected to the input pin PARAno on the PID-ACESYS block).
32 PID Controller
Next you will see the 3. Point: a B-point (The MODE of the PID) address configuration in the ECS.
The point Code: UF01M013F1_MODE. PLC: 1 (PLC no. (In which PLC this point is reading)). Input type: HR-16bit/Timestamp (Reading 2 words: 1.word=Status for the PID. 2.word=Timestamp for when an event happened.) Input Register: 5111 (equal to the data register address %4:05111 connected to the output pin STAT2 on the PID-ACESYS block) Input Bit: Always zero. Output type: Holding Register (Reading 1 word). Output Register: 49107 (equal to the data register address %4:49107, which must be parameter address + 26 (49081+26=49107). Output Bit: Always zero. Parameter type: Holding Register (Pointer for start reading data register area of 80 words). Parameter Register: 49081 (equal to the data type UINT connected to the input pin PARAno on the PID-ACESYS block)
PID Controller 33
PID Controller 35