PID

PLCopen motion icon

 Function Block - PID loop.

See Regulation.

Inputs

Input

Data Type

Range

Unit

Default

Description

AUTO

BOOL

FALSE, TRUE

N/A

N/A

  • TRUE = normal mode
  • FALSE = manual mode

DEADB_ERR

REAL

No range

Process Value Units

N/A

Hysteresis on PV.

  • PV is considered as unchanged if it is both:
    • Greater than (PVprev - DEADBAND_W).
    • Less than (PRprev + DEADBAND_W).

FFD

REAL

No range

Process Value Units

N/A

Disturbance value on output.

I_ITL_ON

BOOL

FALSE, TRUE

N/A

N/A

If TRUE, the integrated value is reset to I_ITLVAL.

I_ITLVAL

REAL

No range

Process Value Units

N/A

Reset value for integration when I_ITL_ON is TRUE.

I_SEL

BOOL

FALSE, TRUE

N/A

N/A

If FALSE, the integrated value is ignored.

INT_HOLD

BOOL

FALSE, TRUE

N/A

N/A

If TRUE, the integrated value is frozen.

KP

REAL

No range

No Units

N/A

Gain.

PV

REAL

No range

Process Value Units

N/A

Process value.

SP

REAL

No range

Process Value Units

N/A

Set point.

TD

REAL

No range

1/sec

N/A

Derivation factor.

TI

REAL

No range

Sec

N/A

Integration factor.

TS

TIME

No range

Time Units

N/A

Sampling period.

XMAX

REAL

No range

Process Value Units

N/A

Maximum output value.

XMIN

REAL

No range

Process Value Units

N/A

Minimum allowed output value.

Xout_Manu

REAL

No range

Process Value Units

N/A

Output value in manual mode.

Outputs

Output

Data Type

Range

Unit

Description

ER

REAL

No range

Process Value Units

Last calculated error.

Xout

REAL

No range

Process Value Units

Output command value.

Xout_D

REAL

No range

Process Value Units

Last calculated derivated value.

Xout_HLM

BOOL

FALSE, TRUE

N/A

TRUE if the output value is saturated to XMAX.

Xout_I

REAL

No range

Process Value Units

Last calculated integrated value.

Xout_LLM

BOOL

FALSE, TRUE

N/A

TRUE if the output value is saturated to XMIN.

Xout_P

REAL

No range

Process Value Units

Last calculated proportional value.

Remarks

  • It is important for the stability of the control that the TS sampling period is much bigger than the cycle time.
  • Output of the PID block always starts with zero.
    • The value varies per the inputs provided upon further cycle executions.

Diagram

FBD Language Example

FFLD Language Example

  • In the FFLD Language, the output rung has the same value as the AUTO input, corresponding to the input rung.
  • ENO has the same state as the input rung.

IL Language Example

Not available.

ST Language Example

(* 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;