Control loops and loop objects

For the mapping of control loops the BACnet standard provides the Loop object. The control parameters, such as P, I, D, limits of the control range or the operating direction are passed on to the controller function block as properties of the loop object type. The type of the controller itself is not specified in the BACnet standard.

The library Tc3_BA2_Common contains the implementation of the PID controller (FB_BA_PIDCtrl), which is mapped via the function blocks FB_BACnet_Loop and FB_BACnet_LoopRef respectively.

FB_BACnet_Loop implements a controller whose setpoint, output value and actual value are mapped via function block-internal variables.

FB_BACnet_LoopRef uses a reference to an Analog Value object as the setpoint, a reference to an Analog Output object as the output value, and a reference to an Analog Input object for the actual value.

While the function block type FB_BACnet_Loop is sufficient for most applications, the function block type FB_BACnet_LoopRef allows the operator of the management and operating level to access the controller values (setpoint, output value and actual value) via BACnet. However, this increases the number of BACnet objects per control loop to 4.

The following examples show the realization of a PI controller.

Variables

// control loop using internal variables
fbLoopInternal : FB_BACnet_Loop := (
                        bEn := TRUE,
                        sDescription := 'Loop using internal control parameters',
                        eOutputUnit := E_BA_Unit.eOther_Percent,
                        eAction := E_BA_Action.eReverse,
                        fProportionalConstant := 5.0,
                        fIntegralConstant := 180,
                        fSetpoint := 20
        );
fCtrlVal : REAL := 18;


// control loop using external BACnet objects
fbLoopRef_Setpt : FB_BACnet_AV_Setp := (
                        fValue := 20 );
fbLoopRef_CtrlVar : FB_BACnet_AI := (
                        fVal := 18 );
fbLoopRef_Y : FB_BACnet_AO := ();
fbLoopRef : FB_BACnet_Loop_Ref := (
                        bEn := TRUE,
                        sDescription := 'Loop using reference objects',
                        stControlledVariableReference :=
                            F_BACnet_Reference( fbLoopRef_CtrlVar, PropPresentValue),
                        stSetpointReference :=
                            F_BACnet_Reference( fbLoopRef_Setpt, PropPresentValue),
                        stManipulatedVariableReference :=
                            F_BACnet_Reference( fbLoopRef_Y, PropPresentValue),
                        eOutputUnit := E_BA_Unit.eOther_Percent,
                        eAction := E_BA_Action.eReverse,
                        fProportionalConstant := 5.0,
                        fIntegralConstant := 180
        );


Code

// internal control loop
fbLoopInternal.fCtrlVar := fCtrlVal;
fbLoopInternal();

// control loop using external object references
fbLoopRef_Setpt();
fbLoopRef_CtrlVar();
fbLoopRef_Y();
fbLoopRef();