P controller - Cooling

B32_P_CONTROLLER

PROGRAM B32_TEST
VAR 
   XIN,WIN,COOLING:REAL;   
    FB: LIB.CORE.V1_0.B32_P_CONTROLLER;
END_VAR
  FB(X:=XIN, W:=WIN, OUT=>COOLING);
END_PROGRAM

LIB\CORE

V1.0

The block is an implementation of a P controller (with parameters: P-band, Offset, Min and Max values, and output value of an inactive controller).

Input Type Description Default value
W REAL Setpoint (usually temperature). 0
X REAL Measured value (usually temperature). 0
CONTROLLERTYPECONTROLLERTYPEController type (cooling/heating). cooling
ENABLED BOOL Controller enable (FALSE = controller is deactivated). True
XP REAL Proportional band 30
OFF REAL Offset, added to the setpoint W. 0
MIN REAL Minimum output value OUT (usually 0). 0
MAX REAL Maximum output value OUT (usually 100). 100
DISVAL REAL Value of the OUT output when the controller is deactivated (ENABLED=FALSE).0
OutputTypeDescription
OUT REALOutput signal (mostly valve or damper, 0 to 100%).

There is a control deviation at the controller input, E=(W+OFF)-X. The controller output OUT is given by the relation OUT=-Xp/100×E+MIN, where XP is the proportional band. The resulting value is finally limited by MIN and MAX, see figure below. The ENABLED parameter switches the controller off (ENABLED=FALSE, controller disabled, and OUT=DISVAL). If Xp<0 then Xp=0, see below. If MAX<MIN then OUT=MAX (or minimum from (MIN, MAX)).

Simple P controller using time scheduler TPG to block the controller outside of office hours.

  • © Energocentrum Plus, s.r.o. 2017 - 2024