SMHCCA – Sliding mode heating/cooling controller with autotuner
Block SymbolLicensing group: AUTOTUNING
Function Description
The functional block SMHCCA (Sliding Mode Heating/Cooling Controller with Autotuner) is a
high-quality control algorithm with a built-in autotuner for automatic tuning of the controller
parameters. The controller is an easily adjustable controller for quality control of
thermal systems with two-state (ON-OFF) heating and two-state (ON-OFF) cooling. A
classic example of such systems is the plastic extruder. However, it can of course also
be deployed on other systems where conventional thermostats are commonly used
so far. To ensure proper function, the SMHCCA block must be supplemented by the
PWM block (Pulse Width Modulation), as is evident from the following
figure.
Operating Principles
It’s important to realize that the SMHCCA block operates with several time periods. The first
period
is the sampling period of the measured temperature and is also equal to the
period with which the SMHCCA controller block is executed. The second period
is the
control period with which the SMHCCA block generates the manipulated variable. This period
is identical to
the cycle period of the PWM block. At every instant when the manipulated variable mv
of the SMHCCA block changes, the PWM block algorithm recalculates the pulse width and
starts a new PWM cycle. The third period that needs to be set is the triggering period
of the PWM
block. Generally, may
be different from .
To achieve the best control quality, it is recommended to set the period
to the minimum possible
value ( to the maximum
possible value), the ratio
maximum, but
should be sufficiently small with respect to the process dynamics. For applications in the
plastics industry, the following values are recommended:
Note, however, that for a faster controlled system, the sampling periods , , and must be shortened! More precisely, the three minimum time constants of the process are important for selecting these time periods (all real thermal processes have at least three time constants). For example, the sampling period is sufficiently short for such processes that have at least three time constants, the minimal of them is greater than 10s and the maximal is greater than 100s. For the proper function of the controller, it is necessary that these time parameters are suitably chosen by the user according to the current dynamics of the process! If SMHCCA is implemented on a processor with floating-point arithmetic, then the accurate setting of the sampling periods , , and the parameter beta is critical for the correct function of the controller. Also, some other parameters with the clear meaning described below have to be chosen manually. All the remaining parameters (xi, om, taup, taum, tauf) can be set automatically by the built-in autotuner.
Automatic Tuning Mode
The autotuner uses two methods for this purpose:
- The first one is intended for situations where the process asymmetry is not too large (approximately, this means that the gain ratio of heating/cooling or cooling/heating is less than 5).
- The second method provides tuning support for strongly asymmetric processes and is not yet implemented (So far, this method has been developed and tested in Simulink only).
Despite the fact that the first method of tuning is based only on the heating mode, the resulting parameters are usually satisfactory for both heating and cooling modes due to the strong robustness of sliding mode control. The tuning procedure is very quick and can be completed during the normal rise time of the process temperature from a cold state to the setpoint usually without any delay or degradation of control performance. Thus, the tuning procedure can be included in every start-up from a cold state to a working point specified by a sufficiently high temperature.
Now, the implemented procedure will be described in detail:
- The tuning procedure begins in tuning mode or in manual mode. If the tuning mode () is selected, the manipulated variable mv is automatically set to zero, and the output TBSY is set to on to indicate the tuning phase of the controller. The cold state of the process is preserved until a rising edge offon is indicated at the TUNE input.
- After some time (dependent on beta), when the noise amplitude is estimated, heating is turned on with the amplitude given by the ut_p parameter. The process temperature pv and its two derivatives (outputs t_pv, t_dpv, t_d2pv) are observed to obtain the optimal controller parameters.
- If the tuning procedure ends without errors, then TBSY is set to off, and the controller begins to operate in manual or automatic mode according to the MAN input. If and the confirmation input TAFF is set to on, then the controller begins to operate in automatic mode with the new set of parameters provided by tuning (if , then the new parameters are only displayed on the outputs p1..p6).
- If an error occurs during tuning, then the tuning procedure stops immediately or stops after the condition pv>sp is met, the output TE is set to on, and ite indicates the type of error. Also in this case, the controller begins to operate in the mode determined by the MAN input. If , then it operates in automatic mode with the original parameters before tuning!
- Tuning errors are usually caused by either inappropriate setting of the beta parameter or too low a value of sp. The suitable value of beta ranges in the interval (0.001,0.1). If drift and noise in pv are large, a small beta value must be chosen, especially for the tuning phase. The default value (beta=0.01) should work well for extruder applications. The correct value gives properly filtered signal of the second derivative of the process temperature t_d2pv. This well-filtered signal (corresponding to the low value of beta) is mainly necessary for proper tuning. For control, the parameter beta can sometimes be slightly increased.
- The tuning procedure can also be started from manual mode () with any constant value of the hv input. However, a steady state must be ensured in this case. Again, tuning is initiated by an upward edge at the TUNE input, and after tuning stops, the controller continues in manual mode. In both cases, the resulting parameters appear on the outputs p1,...,p6.
For individual ips values, the parameters p1,...,p6 have the following meanings:
- 0: Controller parameters
- p1… recommended control period
- p2 … xi
- p3 … om
- p4 … taup
- p5 … taum
- p6 … tauf
- 1: Auxiliary parameters
- p1 … htp2 – time of the peak in the second derivative of pv
- p2 … hpeak2 – peak value in the second derivative of pv
- p3 … d2 – peak to peak amplitude of t_d2pv
- p4 … tgain
Automatic mode
The control law of the SMHCCA block in automatic mode (MAN=off) is based on the discrete
dynamic sliding mode control technique and employs a special third-order filter for estimating
the first and second derivatives of the control error.
After a setpoint change or upset, the controller enters the first phase, the reaching phase, where the discrete sliding variable
is forced to zero. In this definition, , , denote the filtered deviation error , its first and second derivatives at time , respectively. The parameters and are described below. In the second phase, the quasi sliding mode, the variable is kept near zero value through appropriate control actions, alternating between heating and cooling modes. The amplitudes for heating and cooling are adapted to approximately achieve . Consequently, the hypothetical continuous sliding variable
remains approximately zero at all times. In other words, the control deviation is described by a second-order differential equation
This implies that the evolution of can be influenced by choosing the parameters and . Note that for stable behavior, it is required that and . The typical optimal value of lies in the range . The optimal value of is strongly dependent on the controlled process; slower processes have a lower optimal , and faster ones have a higher. The recommended value of for the start of tuning parameters is .
The manipulated variable mv typically ranges from . A positive value corresponds to heating, a negative to cooling, e.g., means full heating. The limits on mv can be set by the parameters hilim_p and hilim_m. This limitation may be necessary when there is a significant asymmetry between heating and cooling. For example, if cooling is much more aggressive than heating in the working zone, it is appropriate to set and . If such limitation is only to be applied in some time interval after a change of setpoint (during the transient response), the initial values of the heating (cooling) action amplitude u0_p and u0_m should be set such that and .
The amplitudes of heating and cooling variables t_ukp and t_ukm, respectively, are automatically adapted by a special algorithm to achieve a quasi-sliding mode, where the signs of alternate at each step. In this case, the controller output isv switches between and . The rate of adaptation of heating and cooling amplitudes is given by the time constants taup and taum. Both of these time constants must be sufficiently large to ensure the proper functioning of adaptation, but fine-tuning is not essential for the final quality of regulation. For completeness, mv is determined based on the amplitudes t_ukp and t_ukm according to the following expression:
It is also worth mentioning that achieving quasi-sliding mode occurs very rarely because controlled processes contain transport delays and are subject to disturbances. A suitable indicator of the quality of sliding is again the output isv. For fine-tuning, it may be possible in exceptional cases to use the beta parameter defining the bandwidth of the derivative filter. In most cases, however, the preset value suffices. In manual mode (), the controller input hv is copied (after possible limitation by saturation limits ) to the output mv.
Manual mode
In the manual mode ()
the controller input hv is (after limitation to the range
)
copied to the manipulated variable mv. The controller output mve provides the equivalent
amplitude-modulated value of the manipulated variable mv for informative purposes. The
output mve is obtained by the first order filter with the time constant tauf applied to
mv.
This block propagates the signal quality. More information can be found in the 1.4 section.
Input
sp | Setpoint variable | Double (F64) |
pv | Process variable | Double (F64) |
hv | Manual value | Double (F64) |
MAN | Manual or automatic mode | Bool |
|
|
|
TMODE | Tuning mode | Bool |
TUNE | Start the tuning experiment | Bool |
TBRK | Stop the tuning experiment | Bool |
TAFF | Tuning affirmation | Bool |
|
|
|
ips | Meaning of the output signals | Long (I32) |
|
|
|
Parameter
ipwmc | PWM cycle (in sampling periods of the block) 100 | Long (I32) |
xi | Relative damping of sliding zero dynamics 0.5 8.0 1.0 | Double (F64) |
om | Natural frequency of sliding zero dynamics 0.0 0.01 | Double (F64) |
taup | Time constant for adaptation - heating [s] 700.0 | Double (F64) |
taum | Time constant for adaptation - cooling [s] 400.0 | Double (F64) |
beta | Bandwidth parameter of the derivative filter 0.01 | Double (F64) |
hilim_p | Upper limit of the heating action amplitude 0.0 1.0 1.0 | Double (F64) |
hilim_m | Upper limit of the cooling action amplitude 0.0 1.0 1.0 | Double (F64) |
u0_p | Initial amplitude - heating action 1.0 | Double (F64) |
u0_m | Initial amplitude - cooling action 1.0 | Double (F64) |
sp_dif | Setpoint difference threshold 10.0 | Double (F64) |
tauf | Equivalent manipulated variable filter time constant 400.0 | Double (F64) |
itm | Tuning method 1 | Long (I32) |
|
|
|
ut_p | Amplitude of heating for tuning experiment 0.0 1.0 1.0 | Double (F64) |
ut_m | Amplitude of cooling for tuning experiment 0.0 1.0 1.0 | Double (F64) |
Output
mv | Manipulated variable (controller output) | Double (F64) |
mve | Equivalent manipulated variable | Double (F64) |
de | Deviation error | Double (F64) |
SAT | Saturation flag | Bool |
|
|
|
isv | Number of sliding variable steps | Long (I32) |
t_ukp | Current amplitude of heating | Double (F64) |
t_ukm | Current amplitude of cooling | Double (F64) |
t_sk | Discrete dynamic sliding variable | Double (F64) |
t_pv | Filtered process variable | Double (F64) |
t_dpv | Filtered first derivative of process variable | Double (F64) |
t_d2pv | Filtered second derivative of process variable | Double (F64) |
TBSY | Tuner busy flag | Bool |
TE | Tuning error | Bool |
|
|
|
ite | Error code | Long (I32) |
|
|
|
p1..p6 | Results of identification and design phase | Double (F64) |
[Previous] [Back to top] [Up] [Next]
2024 © REX Controls s.r.o., www.rexygen.com