Through studying the temperature characteristics of the micro-integrated heaters in this section, the data from the open-loop step response experiment were imported into the MATLAB system identification toolbox to identify the control system’s transfer function. The PID control and two fuzzy controllers were used to adjust the PID control parameters in real-time.
3.1. Transfer Function of Controlled Object
To simulate the controlled object, using Simulink, it is necessary to determine the transfer function of the object. This article analyzes the entire process of temperature control for an integrated heater, primarily composed of the following variables: thermistor surface area A, thermistor mass m, external air temperature Tambient, heat generated by the thermistor Qin, heat dissipated Qout, heat transfer coefficient h, the specific heat capacity of the thermistor cp, and real-time thermistor temperature T(t).
The heat balance equation is:
where
Substituting
Qout into the heat balance equation, we get:
To obtain the transfer function, we need to convert this differential equation into the Laplace domain. Let
s be the Laplace variable,
T(
s) be the Laplace transform of
T(
t), and
Qin(
s) be the Laplace transform of
Qin. By the properties of the Laplace transform, we have:
Rearranging this equation, we can obtain the transfer function:
This transfer function represents the transient response of the thermistor system. Note that this is a first-order transfer function with a single real pole, meaning that the system’s transient response will decay exponentially to a steady-state value.
To account for the effect of the thermistor temperature changes causing resistance changes, it is necessary to introduce Equation (1).
The power on the resistor is proportional to the square of the voltage, i.e.,
where
P is the power on the thermistor, and
V is the step voltage. Substituting
R(
T) with
P, we get:
Now, we need to modify the heat balance equation to:
Substituting the expression for
P, we get:
To obtain the transfer function, we need to convert this nonlinear differential equation into the Laplace domain. Let vs. be the Laplace transform of the step voltage, and T(s) be the Laplace transform of T(t). Solving in the Laplace domain becomes complex due to the nonlinearity of the equation. In this case, alternative methods, such as nonlinear system identification techniques, might be required to obtain the transfer function.
The Hammerstein model is a nonlinear system identification method, where a nonlinear static system (usually represented by a nonlinear function) is cascaded with a linear dynamic system (represented by a linear transfer function). This model simplifies the representation of a nonlinear system, making it easier to analyze and control. The mathematical representation of the Hammerstein model is as follows:
where
y(
t) is the system’s output,
u(
t) is the system’s input,
f is the nonlinear function (usually represented by a polynomial or neural network),
h(
τ) is the linear system’s impulse response,
G is the linear transfer function, and * denotes convolution.
To implement the Hammerstein model in Simulink, we use two subsystems, one representing the nonlinear static system and the other representing the linear dynamic system. First, we connect the input signal to the nonlinear static system, and then connect the output of the nonlinear static system to the input of the linear dynamic system. The output of the linear dynamic system will be the system’s output.
In this paper, the integrated heater is both a temperature control resistor and a temperature measurement resistor, and the transfer function of the controlled object is complex. It is difficult to determine the form of the transfer function through theoretical deduction, so we use the System Identification Toolbox in MATLAB to automatically identify the transfer function of the controlled object through open-loop step response experiments. The input voltage measured in the standby state of the temperature control system is 748.8 mV, with a resistance of 483.8 Ω and a sampling time of 0.1 s. By replacing the input voltage with 4697.8 mV, the system reaches a steady state after about 160 s, and the response curve is shown in
Figure 3. The identified transfer function of the controlled object is shown in the following equation:
The transfer function obtained is a second-order model with a fitting accuracy of 93.13%. The goodness of fit is commonly represented by the R-squared value
R2 or the coefficient of determination, which ranges from zero to one. The
R2 value indicates the degree to which the model fits the data, i.e., the difference between the fitted curve and the actual data. The closer the
R2 value is to one, the higher the degree of correspondence between the fitted results and the actual data, and the stronger the model’s explanatory power for the data. Conversely, when the
R2 value is close to zero, it indicates that the model has a weaker explanatory power for the data. The appropriateness of the transfer function’s goodness of fit depends on the specific application and research purpose. In practice, a high goodness of fit (e.g.,
R2 value greater than 0.9 or 0.95) is generally considered to be a good fitting result. Based on actual experimental results, this level of goodness of fit is sufficient to simulate the controlled object. The calculation method for the R-squared value is as follows:
where
SSR represents the sum of squared residuals (the sum of squared differences between the fitted curve and the actual data), and
SST represents the total sum of the squares (the sum of squared differences between the actual data and the mean).
3.2. Select a Temperature Control Scheme
The PID control structure is simple and easy to implement, widely used in industrial process controls. The algorithm combines the current output value and the deviation from the target value by combining proportional, integral, and differential components to produce an output applied to the controlled object. The error calculation formula is as follows:
where
E(
t) represents the deviation between the target value and the output value at time
t,
R(
t) represents the target value at time
t, and
Y(
t) represents the output value of the controlled object at time
t.
The continuous time signals are sampled and quantized, converting the integral into a summation form and the differential into a different form, resulting in the discrete form of the PID control algorithm as follows:
The position-based PID control algorithm used here employs
U(
t), which represents the output value of the PID controller at time
t,
E(
t) to represent the deviation at time
t,
Kp as the proportional gain,
Ki as the integral gain,
Kd as the derivative gain,
Ti as the integral time constant,
Tp as the derivative time constant,
Ts as the sampling time, and
EC(
t) as the change in error between the current and previous sampling instances. While a PID controller is a linear controller, it may not effectively address nonlinear system issues. The fuzzy control, a nonlinear controller, can solve nonlinear problems and speed up temperature control while reducing overshoots by adaptively adjusting the PID controller parameters. The temperature control scheme framework is depicted in
Figure 4, where two fuzzy controllers, respectively, conduct a nonlinear system adjustment and adaptive modulation. The output
Y(
t) at time
t and target value
R(
t) serves as the input for the fuzzy controller, which outputs the PID controller adjustment parameter Δ
Kp after undergoing fuzzification, fuzzy inference, and defuzzification. The other fuzzy controller inputs the error
E(
t) and its change
EC(
t) at time
t, and outputs Δ
Ki and Δ
Kd after undergoing fuzzification, fuzzy inference, and defuzzification. After fuzzy logic control, the PID control parameters are expressed as:
where
qp,
qi, and
qd are the scale factors, and
R(
t) is the target value.
3.3. Nonlinear Adjustment
This text utilizes a Mamdani-type fuzzy controller. The fuzzy controller transforms the input into computationally processed mathematical expressions through fuzzy theory by utilizing rich human experience. Firstly, the input and output values are mapped to fuzzy subsets through the use of a membership function, such as a triangular, Gaussian, or trapezoidal shape. In this paper, a triangular membership function is used. “Fuzzy subset” is a term used to describe the process of converting clear values of inputs or outputs into fuzzy linguistic values through the use of human language, for example, the letters “B”, “M” and “S” which represent “big”, “medium” and “small”, respectively. The second step is fuzzy logic inference. In this step, fuzzy control rules are established and fuzzy logic inference is performed. For example, “if R(t) is ‘B’ and Y(t) is ‘M’, then ∆Kp is ‘S’” where ‘B’, ‘M’, and ‘S’ are used as fuzzy linguistic values. The rules used in this article are more complex. Finally, defuzzification takes place. The output fuzzy quantity is converted into a clear value using a defuzzification method. Methods such as the center of area method, the bisection of area method, and the maximum membership method can be used for defuzzification. This paper uses the center of area method.
Due to the wide temperature range of the controlled object, there is a significant nonlinearity in the system. By conducting experiments, we obtained the input required for the system to reach a steady state at different temperatures, as shown in
Figure 5. The analysis shows that the input required for the system to achieve the same temperature change in the low-temperature range is significantly greater than in the high-temperature range, indicating the system’s nonlinearity. During the temperature rise process, both the output value
Y(
t) and the target value
R(
t) are changing at different time points. By using
Y(
t) and
R(
t) as inputs to the fuzzy controller and summarizing the fuzzy rules from the experiments, we adjust the proportional coefficient
Kp output by the PID controller to accelerate the response speed of the controller in the low-temperature range.
The experiment found that the linearity of the system in the high-temperature range remains basically unchanged. Therefore, in this paper,
Y(
t) and
R(
T) were taken as input linguistic variables and transformed into ten linguistic values,
T0,
T100,
T150,
T200,
T250,
T300,
T350,
T400,
T600, and
T800, with a variable range of (0, 800). The triangular membership functions were used and the membership functions are shown in
Figure 6a. Fifty-five output linguistic variables of ∆
Kp were set and the fuzzy control rule table is shown in
Table 2. Based on the set fuzzy control rules, the output surface of ∆
Kp was obtained as shown in
Figure 7a. In the practical control, ∆
Kp is multiplied by a scaling factor to prevent output overshooting and oscillation caused by excessively large proportional coefficients.
3.4. Improve Overshoot
The solution to the nonlinear problem of the system has greatly improved the response speed but also brought greater overshoot to the system output. In this paper, The fuzzy control system utilizes
E(
t) and
EC(
t) as its input variables, and ∆
Ki and ∆
Kd are used as the outputs of fuzzy control. Linguistic variables are assigned to the inputs, with NB representing negative large, NM representing negative middle, NS representing negative small, ZO representing zero, PS representing positive small, PM representing positive middle, and PB representing positive large (seven linguistic values). The range of these variables was (−6, 6). The triangular affiliation function is used, as shown in
Figure 6b. After multiple rounds of experimentation and adjustments, a fuzzy rule table was created and is depicted in
Table 3 and
Table 4.
E(
t) is the difference between the target value and the input value, and
EC(
t) is the change in the last adjustment value. For programmed temperature rises, when
E(
t) is at zero, it means that the target value and the output value are consistent. If
E(
t) is greater than zero, it means that the output value does not reach the target value. If it is less than zero, it means that the output value is greater than the target value and the system has overshoot. If
EC(
t) is zero, the temperature remains unchanged. If
EC(
t) is greater than zero, the temperature decreases, and if
EC(
t) is less than zero, the temperature increases. The fuzzy rule design method is summarized as follows: When the temperature overshoots, but the temperature continues to rise,
Ki decreases and
Kd increases to suppress the overshoot. When the output value closely matches the target value and the temperature remains relatively stable,
Ki and
Kd increase, and the time to reach the steady state is accelerated. When the output value is less than the target value, appropriately increase
Ki and
Kd to speed up the response speed. According to the set fuzzy control rules, the output surfaces of ∆
Ki and ∆
Kd are obtained as shown in
Figure 7b,c.
Figure 6.
Membership function: (a) Membership function of Kp.; (b) Membership function of Ki and Kd.
Figure 6.
Membership function: (a) Membership function of Kp.; (b) Membership function of Ki and Kd.
Figure 7.
Output surfaces. (a) Proportion coefficient; (b) Integral coefficient; (c) Differential coefficient.
Figure 7.
Output surfaces. (a) Proportion coefficient; (b) Integral coefficient; (c) Differential coefficient.
Table 2.
Fuzzy control rule table of ∆Kp.
Table 2.
Fuzzy control rule table of ∆Kp.
Y(t) | R(t) |
---|
T0 | T100 | T150 | T200 | T250 | T300 | T350 | T400 | T600 | T800 |
---|
T0 | J1 | A1 | B1 | C1 | D1 | E1 | F1 | G1 | H1 | I1 |
T100 | A1 | J2 | A2 | B2 | C2 | D2 | E2 | F2 | G2 | H1 |
T150 | B1 | A2 | J3 | A3 | B3 | C3 | D3 | E3 | F3 | G3 |
T200 | C1 | B2 | A3 | J4 | A4 | B4 | C4 | D4 | E4 | F4 |
T250 | D1 | C2 | B3 | A4 | J5 | A5 | B5 | C5 | D5 | E5 |
T300 | E1 | D2 | C3 | B4 | A5 | J6 | A6 | B6 | C6 | D6 |
T350 | F1 | E2 | D3 | C4 | B5 | A6 | J7 | A7 | B7 | C7 |
T400 | G1 | F2 | E3 | D4 | C5 | B6 | A7 | J8 | A8 | B8 |
T600 | H1 | G2 | F3 | E4 | D5 | C6 | B7 | A8 | J9 | A9 |
T800 | I1 | H2 | G3 | F4 | E5 | D6 | C7 | B8 | A9 | J10 |
Table 3.
Fuzzy control rule table of ∆Ki.
Table 3.
Fuzzy control rule table of ∆Ki.
E(t) | EC(t) |
---|
NB | NM | NS | ZO | PS | PM | PB |
---|
NB | ZO | ZO | NM | NM | NS | NM | ZO |
NM | ZO | ZO | NM | NS | NS | NM | ZO |
NS | ZO | NM | NS | NM | NS | NS | ZO |
ZO | NS | ZO | NS | NB | NS | NS | ZO |
PS | ZO | ZO | NS | NM | NM | NS | ZO |
PM | ZO | NM | NS | NM | NM | ZO | ZO |
PB | ZO | NM | NM | NM | NM | ZO | ZO |
Table 4.
Fuzzy control rule table of ∆Kd.
Table 4.
Fuzzy control rule table of ∆Kd.
E(t) | EC(t) |
---|
NB | NM | NS | ZO | PS | PM | PB |
---|
NB | NB | NM | NB | NB | NS | ZO | ZO |
NM | NM | NM | NM | NM | NM | NM | NM |
NS | NM | NM | NM | NM | NM | NM | NM |
ZO | NM | NM | NS | ZO | NM | NM | NM |
PS | NM | NM | NS | NS | NM | NM | NM |
PM | NM | NM | ZO | ZO | NS | NM | NM |
PB | NM | NS | NM | ZO | NS | NS | PM |
3.5. Hardware System Design
Revised for logic and translated to English: In this article, the MCU used is the STM32F105RC. The STM32F105RC is a part of STMicroelectronics’ STM32F1 series of microcontrollers, which are based on the ARM Cortex-M3 processor core. Experimental measurements found that in the high-temperature region (above approximately 800 °C), the temperature changes by 1 °C for every 5 mA change in the current, so a sufficiently precise DAC and ADC are needed for temperature control. For the temperature control section, the 12-bit DAC is utilized to generate analog signals from digital data. The voltage acquisition uses the programmable ADC chip ADS1115 and, during programming, a range of ±4.096 V and an LSB SIZE of 125 μV is used to ensure that the steady-state temperature error in the high-temperature region is controlled within 1 °C, preventing frequent temperature oscillations.
The hardware circuit system includes temperature measurement and temperature control circuits. Due to the dual functions of the temperature measurement and the heating required by the single molybdenum resistor in the design, this article controls the temperature by adjusting the current at both ends of the molybdenum resistor and then measures the voltage across the platinum resistor to calculate the resistance value. The circuit block diagram is shown in
Figure 8 below.
The schematic of the constant current source control circuit is shown in
Figure 9. The transistor operates in the amplification region, with the MCU controlling the base current, which in turn controls the current through the molybdenum resistor. The current across the molybdenum resistor can be calculated using the potentials on the base and collector, as well as the resistances of
R3 and
R4. Revised for logic and translated to English: The voltage acquisition circuit employs a design with two voltage followers, followed by a subtractor, which results in more accurate voltage measurements. The schematic is shown in
Figure 10.