MC_AxCtrlSlowDownOnPressure_BkPlcMc (from V3.0)

MC_AxCtrlSlowDownOnPressure_BkPlcMc (from V3.0) 1:

The function block decelerates an axis such that a certain default value is not exceeded in the actual value selected through ReadingMode. The rules of substitutional pressure control apply.

In most cases the actual pressure can be logged with function blocks of type MC_AxRtReadPressureSingle_BkPlcMc or MC_AxRtReadPressureDiff_BkPlcMc.

MC_AxCtrlSlowDownOnPressure_BkPlcMc (from V3.0) 2: Inputs

VAR_INPUT
    EnableP:          BOOL:=FALSE;
    EnableM:          BOOL:=FALSE;
    Reset:            BOOL:=TRUE;
    FirstAuxParamIdx: INT:=0.0;
    kP:               LREAL:=0.0;
    Tn:               LREAL:=0.0;
    PreSet:           LREAL:=0.0;
    ReadingMode:      E_TcMcPressureReadingMode:=iTcHydPressureReadingDefault;
END_VAR

E_TcMcPressureReadingMode

Name

Type

Description

EnableP

BOOL

TRUE at this input enables the controller to influence the output value during a motion in positive direction.

EnableM

BOOL

TRUE at this input enables the controller to influence the output value during a motion in negative direction.

Reset

BOOL

TRUE at this input resets the controller. The memory of the I part is cleared.

FirstAuxParamIdx

INT

Here a range in the Axis_Ref_BkPlcMc.ST_TcHydAxParam.fCustomerData can be activated as parameter interface.

kP

LREAL

The gain factor of the P part.

Tn

LREAL

The integral action time of the I part.

PreSet

LREAL

Here you can specify a default value for calculating an initial value for the I part of the controller. The I part is preloaded with this value on activation.

ReadingMode

E_TcMcPressureReadingMode

The actual value to be controlled can be specified here. Axis_Ref_BkPlcMc.ST_TcHydAxRtData.fActPressure is selected as default value.

MC_AxCtrlSlowDownOnPressure_BkPlcMc (from V3.0) 3: Inputs/outputs

VAR_INOUT
    Axis:             Axis_Ref_BkPlcMc;
END_VAR

Name

Type

Description

Axis

Axis_Ref_BkPlcMc

Here, the address of a variable of type Axis_Ref_BkPlcMc should be transferred.

MC_AxCtrlSlowDownOnPressure_BkPlcMc (from V3.0) 4: Outputs

VAR_OUTPUT
    Response:         LREAL;
    Active:           BOOL;
    Error:            BOOL;
    ErrorID:          UDINT;
END_VAR

Name

Type

Description

Response

LREAL

The output value of a pressure controller.

Active

BOOL

TRUE at this output indicates that the function block generates a response in order to take over the pressure control.

Error

BOOL

The occurrence of an error is indicated here.

ErrorID

UDINT

An encoded indication of the cause of the error is provided here.

Behaviour of the function block:

TRUE at Reset puts the function block in an idle state, irrespective of the other control signals. Active is then FALSE and Response := 0.0, since both the P component and the I component are deleted.

The input ReadingMode determines which variable is assigned the parameter to be controlled in the stAxRtData structure.

MC_AxCtrlSlowDownOnPressure_BkPlcMc (from V3.0) 5:

The set value has to be specified in fSetPressure in the stAxRtData structure of the axis.

During active operation the behavior of the function block is determined by the inputs EnableP and EnableM. They determine whether the function block should intervene in positive or negative direction during a motion. Note that the function block is tasked to counteract an active travelling motion. EnableP should therefore be set if travelling motion in positive direction should not exceed a specified pressure. In opposite direction of travel EnableM enables a pressure-limiting controller response in positive direction.

First, the function block determines whether it has to assume or quit the active state. To this end the signals EnableP, EnableM, the sign of ST_TcHydAxRtData.fSetSpeed and the difference between SetPressure and the selected actual value are evaluated.

During transition to the active state the I component is initialized with PreSet. It is loaded with a starting value, which in combination with ST_TcHydAxRtData.fSetSpeed results in the value of PreSet. If the output value matching fSetPressure is known, it can be utilized for reaching the compensated state more quickly. In practice, the choice of this parameter should be made dependent on the behavior of the controlled system. This is mainly influenced by the flexibility of the pressed in object, but also by the selected velocity. If the increase is rather slow compared with the Tn used, the current control value from ST_TcHydAxRtData.fSetSpeed should be used as preset value. If the actual pressure responds with a rapid increase, it is advisable to use a value, which takes into account the set pressure and the pressure amplification of the valve.

A P component is then calculated with kP, an I component with Tn. The sum of these controller components is output as Response, and the state of the controller is indicated as TRUE at Active.

The transition to the inactive state results in deletion of the controller components and is indicated with FALSE at Active.

Integration of the function block in the application

A function block of this type must be called after the actual value and actual pressure acquisition, and after the control value generation. If function blocks are called for velocity or position control, these must also be positioned before the pressure regulator function block, or the responses of the controllers should be coordinated with due diligence.

Although the pressure regulator calculates a response, it is not entered in the ST_TcHydAxRtData structure. This is done by the application, depending on Active and taking into account signals of other controllers. Usually, Response is assigned to the variable ST_TcHydAxRtData.fLagCtrlOutput. The MC_AxRtFinish_BkPlcMc function block to be positioned after the controller function block then considers the response automatically.

MC_AxCtrlSlowDownOnPressure_BkPlcMc (from V3.0) 6:

A value greater than 0 in FirstAuxParamIdx can be used to instruct the function block to use three consecutive values in the fCustomerData of the parameter structure as Tn, kP and PreSet. If the address of a suitable ARRAY[..] OF STRING() is entered in Axis.pStAxAuxLabels, the parameters are automatically assigned a name.