Function Block - PID loop.

Inputs

Input

Data type

Description

AUTO

BOOL

TRUE = normal mode - FALSE = manual mode.

PV

REAL

Process value.

SP

REAL

Set point.

Xout_Manu

REAL

Output value in manual mode.

KP

REAL

Gain.

TI

REAL

Integration factor.

TD

REAL

Derivation factor.

TS

TIME

Sampling period.

XMIN

REAL

Minimum allowed output value.

XMAX

REAL

Maximum output value.

I_SEL

BOOL

If FALSE, the integrated value is ignored.

INT_HOLD

BOOL

If TRUE, the integrated value is frozen.

I_ITL_ON

BOOL

If TRUE, the integrated value is reset to I_ITLVAL.

I_ITLVAL

REAL

Reset value for integration when I_ITL_ON is TRUE.

DEADB_ERR

REAL

Hysteresis on PV. PV will be considered as unchanged if greater than (PVprev - DEADBAND_W) and less that (PRprev + DEADBAND_W).

FFD

REAL

Disturbance value on output.

Outputs

Output

Data type

Description

Xout

REAL

Output command value.

ER

REAL

Last calculated error.

Xout_P

REAL

Last calculated proportional value.

Xout_I

REAL

Last calculated integrated value.

Xout_D

REAL

Last calculated derivated value.

Xout_HLM

BOOL

TRUE if the Xout output value is greater or equal to XMAX.

Xout_LLM

BOOL

TRUE if the Xout output value is less or equal to XMIN.

Diagram

Fixed_Image

Remarks

It is important for the stability of the control that the TS sampling period is much bigger than the cycle time.

In LD language, the output rung has the same value as the AUTO input, corresponding to the input rung.

ST Language

MyPID is a declared instance of PID function block.

MyPID (AUTO, PV, SP, XOUT_MANU, KP, TI, TD, TS, XMIN, XMAX,
       I_SEL, I_ITL_ON, I_ITLVAL, DEADB_ERR, FFD);
XOUT := MyPID.XOUT;
ER := MyPID.ER;
XOUT_P := MyPID.XOUT_P;
XOUT_I := MyPID.XOUT_I;
XOUT_D := MyPID.XOUT_D;
XOUT_HLM := MyPID.XOUT_HLM;
XOUT_LLM := MyPID.XOUT_LLM;

FBD Language

Fixed_Image

LD Language

ENO has the same state as the input rung.

Fixed_Image


Created with the Personal Edition of HelpNDoc: Easily Add Encryption and Password Protection to Your PDFs