FB_CTRL_2POINT_PWM_ADAPTIVE
The function block provides an adaptive two-position controller. It is particularly suitable for single-area controllers in which high inlet temperatures are present and which make use of a thermal actuator.
Behavior of the output
Description of the function
Internally, the controller uses a PWM function block that is used to control the thermal actuator. The mark-to-space ratio of the PWM function block is adaptively adjusted to the behavior of the controlled system. The PWM output is switched on when the control deviation "fE = setpoint – actual value" is greater than "0" and switched off when the control deviation is less than "0". The mark-to-space ratio is not changed as long as the control deviation remains within the range "[-fOkRange ... fOkRange]". If "fE > fOkRange", the mark-to-space ratio is increased by "fStepSize". After such an increase, time tWaitTime
must elapse before the mark-to-space ratio can be changed again. If fE falls below "-fOkRange", the mark-to-space ratio is reduced by "fStepSize". The mark-to-space ratio is only modified over the range "[fMinLimit ... fMaxLimit]". The period of the PWM signal is specified by the parameter tPWMPeriod
.
Inputs
VAR_INPUT
fSetpointValue : FLOAT;
fActualValue : FLOAT;
fManSyncValue : FLOAT;
bSync : BOOL;
eMode : E_CTRL_MODE;
END_VAR
Name | Type | Description |
---|---|---|
fSetpointValue | FLOAT | Setpoint of the controlled variable |
fActualValue | FLOAT | Actual value of the controlled variable |
fManSync | FLOAT | Input to which the controller's mark-to-space ratio can be set, or with which the output can be set in Manual Mode. The output is set in Manual Mode if "fManSyncValue > 0.0". |
bSync | BOOL | A rising edge at this input will set the mark-to-space ratio of the internal PWM function block to the value "fManSyncValue". |
eMode | E_CTRL_MODE | Input that specifies the operation mode of the function block. |
Outputs
VAR_OUTPUT
bOut : BOOL;
fPWMDutyCycle : FLOAT;
eState : E_CTRL_STATE;
eErrorId : E_CTRL_ERRORCODES;
bError : BOOL;
END_VAR
Name | Type | Description |
---|---|---|
bOut | BOOL | Controller output |
fPWMDutyCycle | FLOAT | Current mark-to-space ratio of the internal PWM function block |
eState | E_CTRL_STATE | State of the function block |
eErrorId | E_CTRL_ERROR | Supplies the error number when the output |
bError | BOOL | Becomes TRUE, as soon as an error occurs. |
Inputs/ outputs
VAR_IN_OUT
stParams : ST_CTRL_2POINT_PWM_ADAPTIVE_PARAMS;
END_VAR
Name | Type | Description |
---|---|---|
stParams | ST_CTRL_2POINT_PWM_ | Parameter structure of the 2-point element |
stParams
consists of the following elements:
TYPE
ST_CTRL_2POINT_PWM_ADAPTIVE_PARAMS:
STRUCT
tCtrlCycleTime : TIME := T#0ms;
tTaskCycleTime : TIME := T#0ms;
tPWMPeriod : TIME;
fOkRange : FLOAT;
fForceRange : FLOAT;
fStepSize : FLOAT;
fMinLimit : FLOAT;
fMaxLimit : FLOAT;
tWaitTime : TIME;
END_STRUCT
END_TYPE
Name | Type | Description |
---|---|---|
tCtrlCycleTime | TIME | Cycle time with which the control loop is processed. This must be greater than or equal to the TaskCycleTime. The function block uses this input value to calculate internally whether the state and the output values have to be updated in the current cycle. |
tTaskCycleTime | TIME | Cycle time with which the function block is called. If the function block is called in every cycle this corresponds to the task cycle time of the calling task. |
tPWMPeriod | TIME | Period of the PWM signal |
fOkRange | FLOAT | The range of "fE" over which the mark-to-space ratio will not be modified. |
fForceRange | FLOAT | If "fE" exceeds this range, the output is permanently set to TRUE. |
fStepSize | FLOAT | Value by which the mark-to-space ratio is varied each time it is adapted. [0% ... 100%] |
fMinLimit | FLOAT | Maximum mark-to-space ratio in percent [0% ... 100%] |
fMaxLimit | FLOAT | Minimum mark-to-space ratio in percent [0% ... 100%] |
tWaitTime | TIME | Waiting time between individual modifications of the mark-to-space ratio |