The function block FB_HeatingControl2 is designed to monitor and control heating systems. This means that the output q_rAnalogOutput can only have values greater than or equal to zero.
The auto-tuning algorithm is based on the reverse tangent method. With this method, the process is initiated by switching on the heating until a certain (system-dependent) temperature is reached. Based on the maximum temperature reached and the cooling curve, the auto-tuning calculates a set of PID parameters.
Also refer to Auto-Tuning (Heating) - FB_HeatingControl2.
It is important to ensure that the parameters are rational. There is no plausibility verification done by the function block.
WARNING | |
---|---|
Set the input i_xEnable to FALSE if an invalid process value is detected (for example if a temperature sensor is no longer connected).
Process temperatures must also be validated.
WARNING | |
---|---|
The process temperature is not taken into account in open loop operation. This is the case with i_xHold = TRUE or i_xManualMode = TRUE. If both inputs are TRUE, manual mode is enabled.
Set the input i_xEnable to FALSE if an over-temperature is detected (for example, by setting an excessive value for i_lrManualValue when the manual mode is active).
Input |
Data type |
Description |
---|---|---|
i_xEnable |
BOOL |
TRUE: Enables function block and parameters are validated. FALSE: Disables function block and all outputs are set to 0 or FALSE. |
i_rSetPoint |
REAL |
Temperature (in °C) to be maintained by the system. Active in auto and auto-tuning mode. Range: i_stTemperatureControl.rSetPointLowLimit ≤ i_rSetPoint ≤ i_stTemperatureControl.rSetPointHighLimit Default value: 0.0 °C |
i_rProcessValue |
REAL |
Process temperature value [°C] The process temperature value needs to be converted to the permissible value range in degrees Celsius outside the function block. If values outside the permissible value range are detected, the function block indicates that an error is detected, a diagnostic message is generated and the heating is switched off. Active in auto and auto-tuning mode. Range: -200…850 |
i_xManualMode |
BOOL |
TRUE: Enables manual mode FALSE: Disables manual mode Only takes effect if q_etStatusAutoTune = ET_StatusAutoTune.Inactive. |
i_rManualValue |
REAL |
Manual mode PID output [%] Active in manual mode. Range: i_stTemperatureControlr.PidLowLimit ≤ i_rManualValue ≤ i_stTemperatureControl.rPidHighLimit Default value: 0.0 % |
i_xAutoTune |
BOOL |
Enables auto-tuning with a rising edge from FALSE to TRUE. A falling edge does not stop auto-tuning. Default value: FALSE |
i_xHold |
BOOL |
TRUE: Stops the internal PID calculation and holds the output q_rAnalogOutput at the present value. FALSE: Resumes the internal PID calculation. Default value: FALSE Only takes effect if q_etStatusAutoTune = ET_StatusAutoTune.Inactive AND i_xManualMode = FALSE. |
i_xReset |
BOOL |
Certain diagnostic messages can be reset using the input i_xReset. If a diagnostic message cannot be reset by a rising edge of i_xReset, verify and modify the parameter which causes the issue. Active in all modes. |
i_stTemperatureControl |
Includes various parameters needed for temperature control. |
In-/Output |
Data type |
Description |
---|---|---|
iq_etSelectParameterSetPID |
It is possible to select one of the 5 PID parameter sets to influence the PID controller behavior. Each set includes different values for the PID parameters (rKp, rTn, rTv). |
|
iq_stParameterSetsPID |
Structure providing 5 different PID parameter sets. |
|
iq_HeatingSystemMonitoring |
Structure providing various parameters for monitoring and controlling the heating system. |
Output |
Data type |
Description |
---|---|---|
q_xActive |
BOOL |
Indicates with TRUE that the program code is executing and that it must be executed in each cycle. |
q_xReady |
BOOL |
Indicates with TRUE that the POU is ready and can be controlled via its inputs according to its functionality. After the function block has been activated via a rising edge of i_xEnable, the output q_xReady is only set to TRUE if the function block can process instructions from the inputs. |
q_xError |
BOOL |
Indicates with TRUE that an error has been detected. For details, refer to q_etResult and q_etResultMsg. |
q_etResult |
Provides diagnostic and status information as an enumeration value. |
|
q_sResultMsg |
STRING [80] |
Provides additional diagnostic and status information as a text message. |
q_rAnalogOutput |
REAL |
Analog form (signal) of the internal PID controller output or manual value (in manual mode). Range: i_stTemperatureControl.rPidLowLimit ≤ q_rAnalogOutput ≤ i_stTemperatureControl.rPidHighLimit |
q_xPwmOutput |
BOOL |
PWM signal according to the output q_rAnalogOutput. TRUE: Heating on FALSE: Heating off |
q_xAutoTuneActive |
BOOL |
TRUE: Auto-tuning active FALSE: Auto-tuning inactive |
q_etStatusAutoTune |
Status of auto-tuning as an enumeration value. Default value: ET_StatusAutoTune.Inactive |
The following elements of ET_Result are used for q_etResult.
Name |
Data type |
Value |
Description |
---|---|---|---|
Ok |
UDINT |
0 |
Operation completed successfully. |
SetPointOutOfRange |
UDINT |
300 |
i_rSetPoint < rSetPointLowLimit or i_rSetPoint > rSetPointHighLimit |
SetPointLowLimitOutOfRange |
UDINT |
301 |
For FB_HeatingControl: rSetPointLowLimit < -100000 user temperature unit or For rSetPointLowLimit > rSetPointHighLimit FB_HeatingControl2: rSetPointLowLimit < -100 °C or rSetPointLowLimit > rSetPointHighLimit |
SetPointHighLimitOutOfRange |
UDINT |
302 |
For FB_HeatingControl: rSetPointHighLimit > 100000 user temperature unit or For rSetPointHighLimit < rSetPointLowLimit FB_HeatingControl2: rSetPointHighLimit > 800 °C or rSetPointHighLimit < rSetPointLowLimit |
ControlModeOutOfRange |
UDINT |
303 |
Accepted control mode range: refer to ET_ParameterSetPID. |
ManualValueInvalid |
UDINT |
304 |
i_rManualValue < rPidLowLimit or i_rManualValue > rPidHighLimit |
CycleTimeInvalid |
UDINT |
305 |
Calculated task cycle time must be greater than 0 and less than or equal to 10000 [ms]. |
PidParametersOutOfRange |
UDINT |
307 |
One or more PID parameters are out of range |
PidControllerIssue |
UDINT |
308 |
General issue from the internal PID controller |
PwmTimePeriodOutOfRange |
UDINT |
309 |
rPwmTimePeriod out of range
NOTE: The lower value of this time period depends on the determined cycle time multiplied by the factor uiPwmCycleTimeToTaskRatio. With uiPwmCycleTimeToTaskRatio = 1 the value of rPwmTimePeriod must be at least equal to the determined cycle time.
|
PidLowLimitOutOfRange |
UDINT |
310 |
rPidLowLimit < 0 or rPidLowLimit ≥rPidHighLimit |
PidHighLimitOutOfRange |
UDINT |
311 |
rPidHighLimit > 100 or rPidHighLimit ≤rPidLowLimit |
FilterTimeInvalid |
UDINT |
312 |
Invalid value for rDigitalFilterTime |
PwmCycleTimeToTaskRatioInvalid |
UDINT |
314 |
The value for uiPwmCycleTimeToTaskRatio is out of range. |
MonitoringTimeOutOfRange |
UDINT |
315 |
For FB_HeatingControl2: The value for timShortCircuitMonitoring or the value for timNoHeatingPowerMonitoring is out of range. |
ShortCircutThresholdOutOfRange |
UDINT |
316 |
For FB_HeatingControl2: The value for rShortCircuitThreshold is out of range. |
ShortCircuitSlopeLimitOutOfRange |
UDINT |
317 |
For FB_HeatingControl2: The value for rShortCircuitSlopeLimit is out of range. |
NoHeatingPowerSlopeLimitOutOfRange |
UDINT |
318 |
For FB_HeatingControl2: The value for rNoHeatingPowerSlopeLimit is out of range. |
ProcessValueOutOfRange |
UDINT |
319 |
For FB_HeatingControl2: The process value is outside the valid range -200 °C… 850 °C. Verify whether there is a cable break in the sensor or a short circuit. |
HeatingShortCircuit |
UDINT |
320 |
For FB_HeatingControl2: Heating of the system without active control. Verify the heating control. For example, are the relay contacts opening? |
NoHeatingPower |
UDINT |
321 |
For FB_HeatingControl2: No temperature increases (slope) at maximum (rPidHighLimit) heating power. Verify the function of the heating element or the heating control and its wiring. |