Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

DC - PID Controller

Can be used for


Device From version no.:
EASY800 04
MFD 01

General

The devices provide 32 PID controller function blocks DC01...DC32.


A closed-loop control circuit with a PID controller consists of the following
components:

l Setpoint (reference variable),

l Actual value (controlled variable),

l Control deviation = (setpoint–actual value),

l PID controller,

l Control system (e.g. PTn system),

l Disturbance variables.
Symbol in the function block
General notes on the use of function blocks are provided in the section
diagram
Programming with function blocks!

Note:
A combination of MFD device and EASY800 is ideal for applications requiring lengthy calculations such as closed-loop
control tasks with the PID controller and also visualization functions at the same time.
With large scale visualization applications, the cycle time may be increased when the screen(s) is(are) updated.
These increases may not be suitable for the controller tasks.
With applications of this kind, assign the lengthy calculations to a second EASY800 or MFD device, possibly without
a display, which you can connect via easyNet.

Function
The principle of the PID controller is based on the equation that represents the manipulated variable Y(t) as a result of
a proportional component, an integral component and a differential component.
These three closed-loop control components can be disabled separately via the Boolean inputs EP, EI and ED (disabling
of closed-loop control components).
A deactivation of the I and D component is linked with a reset. The controller is assigned parameters with the standard
variables Kp [%], TN [0.1 s] and TV [0.1 s].
The controller can also be run in UNP and BIP modes, and also controlled in Manual mode.
The proportional gain input KP is used to define a proportional gain factor.
The value 100 corresponds to a KP factor of 1, the value 50 corresponds to a KP of 0.5 etc.
The controller provides the manipulated variable QV as the output value.
Setting "EN=1" will start the function block.
Setting "EN=0" will initiate a reset in which the QV output is set to 0.

Manual mode

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
The controller can be “controlled” in Manual mode via the corresponding inputs SE and MV. If bit input SE = 1, the
controller provides at output QV the value that was assigned at double word input MV. If the status of SE changes to 0,
the controller accepts the manually manipulated variable and uses this manipulated variable to proceed with continuous
control (smooth).

UNP mode
The manipulated variable is output as a unipolar 12-bit value. The value range is 0 ... 4095.

BIP mode
The manipulated variable is output as a bipolar 13-bit value. The value range is -4096 ... 4095.

Tc Scan Time
The TC input defines the time between the function block calls. Values between 0.1s and 6553.5s can be defined.
If the TC scan time is set to 0, the program cycle time defines the time difference between the function block calls. This
may cause irregularities in the control response as the program cycle time is not always constant. The ST (set cycle
time) function block should be used to set a constant program cycle time.

The PID algorithm

The principle of the PID controller is based on the equation that represents the manipulated variable Y(t) as a result of
a proportional component, an integral component and a differential component.

EASY800 and the MFD devices calculate the manipulated variable every time when the control difference is scanned.
These calculations start with the first scan. The equation used is explained in the following table:

Manipulated variable = Proportional component + Integral component + Differential component


Y(n) = YP(n) + YI(n) + YD(n)
Y(n) Calculated manipulated variable with scan time n
YP(n) Value of the proportional component of the manipulated variable at scan time n
YI(n) Value of the integral component of the manipulated variable at scan time n
YD Value of the differential component of the manipulated variable at scan time n
(n)

Table: PID algorithm

The proportional component of the PID controller


The proportional component YP is the product of the gain (Kp) and the control difference (e). The control difference is
the difference between the setpoint (Xs) and the actual value (Xi) at a specified scan time.
The equation for the proportional component used by the EASY800 or MFD device is as follows:

Proportional component
YP(n) = Kp * (Xs(n) - Xi(n) )
Kp Proportional gain
Xs(n) Setpoint at scan time n
Xi(n) Actual value at scan time n

The integral component in the PID controller


The integral component YI is proportional to the sum of the control difference over time.
The equation for the integral component used by the EASY800 or MFD device is as follows:

Integral component
YI(n) = Kp * Tc/Tn * (Xs(n) - Xi(n) ) + YI (n-1)
Kp Proportional gain
Tc Scan Time
Tn Integration time (also called reset time)
Xs(n) Setpoint at scan time n
Xi(n) Actual value at scan time n

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
YI (n- Value of the integral component with scan time n-1
1)

The differential component in the PID controller


The differential component YD is proportional to the change of the control difference. In order to prevent step changes
or jumps in the manipulated variable when the setpoint changes due to the differential response, the change of the
actual value (process variable) and not the control difference are calculated. This is shown by the following equation:

Differential component
YD(n) = Kp * Tv/Tc * (Xi (n-1) - Xi(n) )
Kp Proportional gain
Tv Differential time of the control system (also called rate time)
Tc Scan Time
Xi(n) Actual value at scan time n
Xi (n-1) Actual value at scan time n-1

The Function Block and its Parameters


Description Note
Function block
inputs (DWord)

I1 Setpoint
Value range: -32768...+32767

I2 Actual value
Value range: -32768...+32767

KP Proportional gain Kp [%], The value 100 corresponds to a KP (factor)


of 1
Value range: 0 ...65535

TN Reset time Tn [0.1 s],


Value range: 0...65535

TV Rate time Tv [0.1 s],


Value range: 0...65535

TC Scan time = Time between function block The value TC=0 may cause irregularities in
calls. Value range: 0.1 s...6553.5 s . the control response as the program cycle
time is not always constant.
If the value 0 is specified, the scan time is
You can achieve a constant program cycle
determined by the program cycle time.
time by using the ST (set cycle time)
function block.

MV Manual manipulated variable When UNP mode is selected and negative


values are entered at MV, the function
Value range: -4096...+4095
block returns a zero at output QV.
Function block
output (DWord)

QV Value range of the manipulated variable in


UNP mode:
0...+4095 (12 bit)
Value range of the manipulated variable in
BIP mode:
-4096...+4095 (13 bit)
Contact
(bit output)

LI Status 1 if the value range of the setpoint is


exceeded

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
Coil function
(bit input)

EN Activates the function block on status 1.

EP Activates the P component on status 1

EI Activates the I component on status 1

ED Activates the D component on status 1

SE Acceptance of the manual manipulated


variable on status 1
Operating mode
UNP The manipulated variable is output as a -
unipolar 12-bit value. Value range 0...4095.
BIP The manipulated variable is output as a -
bipolar 13-bit value. Value range -
4096...+4095
Parameter set
Call enabled Function block parameters can be viewed
on the device.
Simulation
Possible

Memory Requirement
The PID controller function block requires 96 bytes of memory plus 4 bytes for each function block input that is
configured with an NU constant.

Tip: Refer to the EASY800 or MFD manual for more information on the function block.

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer

You might also like