Programming the PID function. Schneider Electric Software PLC Application-Specific Functions, Micro/Junior/Pro, 4.5
Reklama
Reklama
Description of the regulation functions
Programming the PID function
At a Glance PID functions are standard PL7 functions. They are therefore available from the function library.
This means that it is possible, by working with the language editors, to use assisted entry for a PID function in order to facilitate programming.
Note: A PID function can be entered in any periodic task (MAST or FAST). The function must not be subject to any conditions.
Illustration The illustration below shows the Functions screen in the library which can be used to implement the PID function.
EF
Function Information: Parameters
Family
Orphee function
Timer functions
GRAFCET
Single precision reals
Process control
Integer tables
Call format
V.Bib V.App
2.10
2.00
1.00
2.22
2.01 2.01
2.10
-
-
-
-
-
PID
Name
PID_MMI
PWM
SERVO
Mixed PID controller
Management of dedicated HMI on CCX17 for PIDs
Pulse Width Modulation of a numerical value
PID output stage for discrete valve control
FUNCTION parameters:
Name Type Nature
TAG STRING IN
UNIT STRING
PV WORD
IN
IN
OUT WORD OUT
Comment
Label of PID (8 char.), used by the HMI on CCX17
Unit of measurement (6 char.), used by the HMI>>
Process variable, format [0; +10000]
Output, format [0; +10000]
“TEMP”
Comment
“DEGRES”
%MW10
%MW11
Entry field
Display the call
PID ( “TEMP”,”DEGRES”,%MW10,%MW11,TRIG_PROD_A,%MW20:43 )
Syntax The call syntax for the PID function is:
PID(TAG,UNIT,PV,OUT,AUTO,PARA)
TLX DS 37 PL7 xxE
361
Description of the regulation functions
Parameters of the PID function
The table below shows the different parameters of the PID function.
Parameter Type Nature
IN = Input
OUT =
Output
TAG IN 8 characters (maximum) or
%MBi:L where L is less than or equal to 8
UNIT
PV
6 characters (maximum) or
%MBi:L where L is less than or equal to 6
%MWi or %IWxy.i.j
IN
IN
Default value
Description
-
-
-
Name used for the PID used by the CCX 17.
Unit of measure for the PID used by the CCX
17.
OUT
AUTO
PARA
%MWi or %QWxy.i.j
%Mi , %Ixy.i or %Qxy.i
%MWi:43
OUT
IN / OUT
IN / OUT -
0
0
Input representing the process variable for the function.
Analog output of the PID.
If TI = 0, an offset of 5000 is added to the OUT output in Auto mode.
Operating mode of the PID and the CCX 17.
0: manual, 1 = Auto.
(See table below for details of PARA table).
The table below shows the different parameters of the PARA table:
Parameter
SP
OUT_MAN
KP
TI
TD
TS
Position
%MWi
%MW(i+1)
%MW(i+2)
%MW(i+3)
%MW(i+4)
%MW(i+5)
Function
Internal setpoint in 0/10000 format
Value of the manual output of the PID (between
0 and 10000)
Proportional gain of the PID (x100), with sign and without units (-10000<KP<+10000). The sign of
Kp determines the direction in which the PID acts
(negative: direct, positive: reverse)
Integral time of the PID (between 0 and 20000) expressed in 10
-1
seconds
Derivative time of the PID (between 0 and 10000) expressed in 10
-1
seconds
Sampling period of the PID (between 1 and
32000) expressed in 10
-2
seconds The actual sampling period will be a multiple of the task period in which the PID closest to TS is located
362
TLX DS 37 PL7 xxE
TLX DS 37 PL7 xxE
Parameter
OUT_MAX
OUT_MIN
PV_DEV
NO_BUMP
DEVAL_MMI
PV_SUP (CCX 17)
PV_INF (CCX 17)
PV_MMI (CCX17)
SP_MMI (CCX 17)
Position
%MW(i+6)
%MW(i+7)
%MW(i+8):X0
%MW(i+8):X4
%MW(i+8):X8
%MW(i+9)
%MD(i+11)
%MD(i+13)
%MD(i+15)
Description of the regulation functions
Function
Upper limit of the PID output in auto mode.
(between 0 and 10000)
Lower limit of the PID output in auto mode.
(between 0 and 10000)
Derivative action chosen 0 = on process variable,
1 = on deviation
Bump or bumpless mode.
0 = bumps, 1 = no bumps
= 1 : inhibits acknowledgment of the PID by the
Human Machine Interface.
= 0 : the PID is used by the Human Machine
Interface.
This bit makes it possible to avoid having to carry out scale conversions on PIDs not being used by the CCX_17, and to select the PIDs being used, particularly when there are more than 9 PIDs in the PL7 application.
Upper limit of the process variable scale, in physical units (x100) (between -9 999 999 and +
9 999 999).
Lower limit of the process variable scale, in physical units (x100) (between -999 999 and + 9
999 999).
Image of the process variable in physical units
(x100)
Operator setpoint and image of the setpoint, in physical units (x100)
Note: l The other parameters used for internal management of the PID must never be modified by the application.
l The values used by the CCX 17 are multiplied by 100 so that they can be shown with 2 figures after the decimal point on the CCX 17 (the CCX 17 does not use floating point format but supports a fixed decimal point format).
363
Description of the regulation functions
Rules There is no alignment of the internal setpoint to the process variable in manual mode.
Scaling is only performed when one of the setpoints is modified (SP or DOP_SP).
The algorithm without integral action (TI = 0) performs the following operation:
The output is ...
For
ε t = SP – PV
Where ...
Dt= action dérivée
The algorithm with integral action (TI <0) performs the following operation:
For
ε t = SP – PV
The output is ...
∆
OUT = KP [
∆ε ε ∆
Dt]/100 OUT
= OUT +
∆
OUT
Where ...
Dt= action dérivée
On cold start, the PID resumes in manual, with the output at 0. To impose automatic mode or a manual input not at zero after a cold start, you must program the initialization sequence after the PID call.
364
TLX DS 37 PL7 xxE
Examples
Description of the regulation functions
The examples provided below are in Ladder language.
Where the process control Human Machine Interface is used (DEVAL_MMI = 0)
(* PID correction on temperature process control loop *)
OPERATE
PID(‘TEMP’,’DEGRES’,%MW10,%MW1>> with PID(‘TEMP’,’DEGRES’,%MW10,%MW11,%M10,%MW20:43)
Where no Human Machine Interface is used DEVAL_MMI = 1.
(* PID correction on process control loop without built-in HMI
OPERATE
PID(‘ ’,’ ’,%MW10,%MW1>> with PID(‘ ’,’ ’,%IW3.1,%QW4.0,%M10,%MW20:43)
Note: In this example, the TAG and UNIT parameters are not applicable, so you can simply enter the values.
TLX DS 37 PL7 xxE
365
Stáhnout
Reklama