2.1. Theory of Thermocouple Time Constant Testing
When the measuring end of the thermocouple is in thermal equilibrium, the thermal equilibrium equations of the measuring end are as shown in Equations (1)–(5).
In these equations, qs is the heat storage at the measuring end, qc is the heat transfer at the measuring end, qr is the radiative heat transfer at the measuring end, qh is the heat transfer conducted from the thermocouple wire to the measuring end, ρ is the density at the measuring end, Cp is the specific heat at the measuring end, V is the volume at the measuring end, a is the convective heat transfer coefficient, A is the effective contact area between the measuring end of the thermocouple and the fluid, Tj is the temperature at the measuring end, Tg is the medium temperature, and ε is the emissivity at the measuring end. C0 is the absolute blackbody radiation coefficient, km is the thermal conductivity of the couple wire, Tb is the temperature of the couple wire at a distance l from the measurement end, and l is the length of the couple wire.
In a general sense, a thermocouple whose transfer function is treated as first-order refers to a thermocouple that ignores two terms on the right side of Equation (1), namely the heat conduction and radiation at the temperature measurement end of the thermocouple, as shown in Equation (6). By substituting Equations (2) and (3) into Equation (6) and converting them, Equations (7) and (8) can be obtained.
Let
. According to Equation (8), Equation (9) can be obtained.
Equation (9) is a first-order linear differential equation, and its general solution is shown in Equation (10).
In this equation, C is the integral constant, which is determined by the initial conditions. Suppose at t = 0,
, and then Equations (11)–(13) can be obtained.
According to Equation (13), when t equals , the indicated temperature of the thermocouple reaches 63.2% of the step temperature, which is the definition of the thermocouple time constant.
Basic methods for testing the time constant of thermocouples involve forming a quantitative temperature step change at the temperature measurement end of the thermocouple and then collecting and plotting the output data graph at the output end of the thermocouple. The ideal temperature–time curve of the thermocouple after being excited by the step temperature is shown in
Figure 1, where T
s is the stable step temperature, and T
0 is the initial temperature.
Furthermore, the selection of the response termination point of the measured thermocouple to the step temperature determines the total step temperature quantity and directly affects the value. Many studies have shown that when , it can be regarded as ; that is, the step temperature tends to equilibrium after 5. Therefore, the stable duration for the thermocouple to reach the expected step temperature needs to be greater than 5 in order to obtain an accurate time constant value.
If the heat conduction and radiative heat transfer at the temperature measurement end of the thermocouple are not ignored, Equation (1) is an extremely complex thermal equilibrium equation, and it is very difficult to obtain its general solution. In addition, for armored thermocouples with unexposed nodes and thermocouples with protective sleeves, when considering the thermal equilibrium of the thermocouple, it is also necessary to take into account that the equations for the thermal equilibrium caused by different shell materials are not the same, and the process is more complex. This makes it difficult to theoretically calculate the time constant of the thermocouple. From the above content, it can be concluded that the time constant value of a thermocouple, that is, the dynamic response speed of the thermocouple, is closely related to its own material properties, three-dimensional structure, and convective heat transfer coefficient. However, these characteristic parameters of the thermocouple are not constant. Under different experimental environments, these values may change with air pressure, temperature, humidity, and the inherent properties of the object being measured. Therefore, the acquisition of the time constant of a thermocouple is specific to the environment. The time constant of a thermocouple measured in a low-temperature and low-speed environment is highly likely not applicable to a transient high-temperature environment. To address this issue, it is particularly necessary to establish a comprehensive thermocouple time constant testing system to ensure that the selection of thermocouples can be completed in different testing environments.
2.2. Thermocouple Time Constant Testing System
In the laser excitation method, when a laser is used to heat a thermocouple, if the power output of the laser is fixed, since the heating power of the laser is greater than the heat dissipation power of the thermocouple, the energy output by the laser accumulates on the surface of the thermocouple. As the heating time increases, the temperature on the surface of the sensor will also continuously rise, as shown in
Table 1, where P
h represents the heating power of the thermocouple being measured. P
d represents the heat dissipation power of the thermocouple under test. In order to achieve the precise control of the surface temperature of the thermocouple, it is essentially necessary to establish a dynamic thermal balance mechanism. When the thermocouple’s temperature reaches the preset target value, the test system initiates a power regulation protocol: the laser control module dynamically adjusts the laser output power to maintain equilibrium between the Joule heating power generated through laser excitation and the heat dissipation power from the material surface via conduction, convection, and radiation. In this way, the thermocouple will remain in a thermal equilibrium state and maintain a fixed temperature. Therefore, this thesis proposes to adjust the laser power by using the negative feedback method to form an instantaneously balanced temperature on the surface of the thermocouple.
The thermocouple time constant testing system used in this thesis mainly consists of a semiconductor laser module (Wuhan Ruike Laser Technology Co., LTD., Wuhan, China), a laser power feedback control module (Self-made), a data acquisition module (Shanghai Jianyi Technology Co., LTD., Shanghai, China), an ellipsoidal mirror module (Self-made), a colorimetric temperature measurement module (Changzhou Sijie Optoelectronic Technology Co., LTD., Changzhou, China), etc. A schematic diagram of the testing system is shown in
Figure 2, and a physical diagram of the testing system is shown in
Figure 3.
During the experiment, the semiconductor laser was used as the step excitation source of the thermocouple under test. Through the Settings of its driving software, the output power of the laser could be changed, and the temperature step at the temperature measurement end of the thermocouple could be achieved in a very short time. To prevent harm from laser reflections and eliminate interference from ambient light on the measurement of the colorimetric temperature measurement module, the colorimetric temperature measurement module, the measured thermocouple, and the ellipsoidal mirror need to be placed in a shielded box. According to the indicator red light of the laser, the laser emitted by the laser is placed in a straight line with the opening of the shield box and the thermocouple to be measured. The thermocouple to be measured and the colorimetric temperature measurement module are placed at the two conjugate foci of the ellipsoidal mirror. After the thermocouple is excited by the laser, the ellipsoidal mirror can converge the radiation energy it generates to the colorimetric temperature measurement module. Because the colorimetric temperature measurement module responds much faster than the thermocouple, its reading can be considered the true surface temperature of the thermocouple. This value is then input to the control module via an Analog-to-digital converter. The control module subsequently adjusts the laser’s output power through feedback control to achieve the set temperature on the thermocouple’s surface. The data acquisition module collects the time–voltage (t−V) response curve of the thermocouple during operation, calculates the collected voltage value according to the corresponding scale table of the thermocouple used, converts it into the temperature value of the thermocouple, and finally obtains the time constant of the thermocouple under different control strategies by analyzing the time–temperature (t−T) curve of the thermocouple.
In this testing system, the most important component is the ellipsoidal mirror module. When heating a thermocouple using the laser method, the thermocouple junction exhibits a unique heat dissipation behavior during the laser energy injection process: its microscale structure significantly limits the heat capacity. When the surface temperature rise in the thermocouple is in a relatively low range, the heat exchange between the junction and the surrounding environment presents a quasi-point source radiation mode, and the thermal energy is uniformly dispersed into three-dimensional space in an approximately spherical wave form. If a colorimetric thermometer is used to directly measure the surface temperature of the thermocouple under test, it is prone to interference from other surrounding heat sources, resulting in inaccurate output. Therefore, it is necessary to converge the thermal radiation on the surface of the thermocouple under test. The ellipsoidal focusing mirror is an inwardly concave mirror, which has relatively ideal conjugate imaging properties and can provide valuable optical characteristics: that is, when an object is at any one of the focal points, after reflection, it can be imaged without aberration at the other focal point. In order to give full play to its conjugate imaging characteristics, it is obtained through theoretical calculation that when the radius of the major axis is 177 mm, the radius of the major axis is 170 mm, and the distance between the conjugate foci is 49.28 mm, the sphericity of the ellipsoidal mirror is not less than 3sr, and the PV value of the ellipsoidal focusing mirror is 8 μm. This is simulated by using ZEMAX software2009. A simulation shadow diagram is shown in
Figure 4. It is found that at this time, there is a better reflection and convergence effect, which can meet the test requirements of the system designed in this thesis.
When choosing the appropriate temperature measurement module, the first thing to consider is that the response speed of the temperature measurement module must be faster than that of the thermocouple so that it can be used as the calibration source of the thermocouple. Secondly, the output of the temperature measurement module should have at least two channels, simultaneously fulfilling the functions of data acquisition and serving as the input signal for the feedback controller. Finally, due to the testing requirements, the temperature measurement module needs to have the characteristic of high-temperature resistance. Therefore, the temperature measurement module used in the system designed in this paper is a high-performance and intelligent colorimetric optical fiber infrared thermometer. It is composed of a lens, optical fiber, and processing components. The optical fiber and lens assembly can withstand a high temperature of 250 °C without additional cooling. It adopts a stainless steel lens, an aluminum diecast housing, and a protection grade of IP65. A physical diagram of the colorimetric thermometer is shown in
Figure 5, and its main parameters are presented in
Table 2.
In the system designed in this paper, the colorimetric thermometer is the calibration source of the thermocouple to be measured. Therefore, the upper limit of the thermocouple time constant that this system can test is consistent with the response speed of the colorimetric thermometer, which is 1 ms.
2.3. PID Controller Based on Quantum Neural Network
In the control system designed in this thesis, the application of the feedback control algorithm can lead to the better formation of a step temperature rise on the surface of the thermocouple. PID control is the most fundamental method in feedback control algorithms. It takes the deviation between the system set value and the output value as the system input and outputs the control quantity through proportional, integral, and differential calculations to complete the control of the controlled object. The PID control algorithm is widely used in engineering practice due to its advantages such as mature technology, good reliability, and simple structure. However, for nonlinear time-varying uncertain systems, the control effect of the PID control algorithm is not ideal. Moreover, in practical engineering applications, the adjustment of PID parameters is mostly based on experience for trial matching, which undoubtedly increases the difficulty and workload of the experiment. Therefore, in this article, quantum neural networks are used to conduct the real-time dynamic adjustment of PID control parameters, with the expectation of achieving good control effects for nonlinear systems.
The structure of the PID control system based on the quantum neural network is shown in
Figure 6. The controller consists of two parts: One is the conventional PID controller, which is used to directly perform closed-loop control on the object, and the three parameters are tuned online. The second is the quantum neural network. According to the operating state of the system, through the information calculation method of the neurons in the quantum neural network and the adjustment of the weight coefficient matrix based on the gradient descent method, the output variables of the quantum neural network correspond to the parameters of the PID controller under the optimal control rate, and thus the PID parameters are adjusted to achieve the optimization of certain performance indicators.
The algorithm process of the PID controller based on the quantum neural network can be summarized as follows:
➀ The structure of the quantum neural network is determined; that is, the number of nodes in the input layer and the hidden layer is determined, and the initial values of each variable are determined, setting k = 1.
➁ The system obtains r(k) and y(k) through sampling and calculates the error e(k) at this moment = r(k) − y(k).
➂ The input and output of neurons in each layer are calculated. In this calculation, the output of the output layer of the quantum neural network consists of the three adjustable parameters kp, ki, and kd of the PID controller.
➃ The output u(k) of the PID controller based on the PID control algorithm is calculated.
➄ The learning of quantum neural networks is conducted, the parameters of the quantum neural networks are adjusted online, and the adaptive adjustment of PID control parameters is achieved.
➅ Let k = k + 1, and ➀ is returned.
Since the system output variables k
p, k
i, and k
d are all non-negative real values, the selection of the output layer activation function must strictly follow the physical feasible domain criterion of the control parameters. In order to have both constraint completeness and convergence smoothness, the activation function from the hidden layer neurons to the output layer neurons adopts a non-negative Sigmoid function, and its mathematical expression is shown in Equation (14).
The quantum neural network designed in this thesis is composed of an input layer, a hidden layer, and an output layer. Among these layers, the hidden layer is set as a single-layer network. This is because in application practice, when the number of hidden layers is set to one or two, the convergence characteristics of the network will be better. Poor convergence occurs when the number of layers in the network’s hidden layer is two or more or when there are none. Since the designed quantum neural network is used to tune the PID control parameters, the input variables of the network are the error of the control system, the integral of the error, and the differential of the error. Therefore, the number of neurons in the input layer is 3. The output of the network consists of the coefficients of the proportion, integral, and differential. Therefore, the number of neurons in the output layer is also 3. The number of neurons in the hidden layer is selected by the trial-and-error method. When the number of neurons in the hidden layer is 5, the systematic error is the smallest. Therefore, the number of neurons in the hidden layer is determined to be 5. The structure of the designed quantum neural network is shown in
Figure 7.
In practical applications, the input variables of neural networks are often real values and need to be transformed into quantum state inputs
. The variable transformation formula is as shown in Equation (15).
Quantum rotation gates, represented by
, are one of the main ways to transform quantum states and are defined as in Equation (16).
For the input quantum state
,
acting on
can yield Equation (17).
After the quantum states of the input variables are rotated, the aggregation operation can be expressed as Equation (18).
After this aggregation operation, the output result of the hidden layer can complete the flipping operation after the controlled not gate action. The representation of the controlled not gate is shown in Equation (19).
For the input quantum state
, the action of
on
yields Equation (20).
When t = 1,
, causing the phase of
to flip, and the quantum state output of the hidden layer neuron is shown in Equation (21).
Here, f (·) is the activation function, and the actual output of the hidden layer neurons is the probability amplitude of the quantum ground state
. Therefore, the output of the hidden layer is shown in Equation (22).
The output of the output layer is shown as Equation (23).
In this formula, g (·) is the activation function of the output layer; i = 1, 2, …, n; j = 1, 2, …, p; and k = 1, 2, …, m, where n is the number of neurons in the input layer, which is equal to 3; p is the number of neurons in the hidden layer, which is equal to 5; and m is the number of neurons in the output layer, which is equal to 3.
In the general training process of PID parameters in neural networks, the loss function is selected as the integral square error of the system response, with the goal of minimizing the integral of the square of the error over the entire time domain. However, in this thermocouple time constant test system, in order to prevent excessive control quantity parameters and excessive system output overshoot, the loss function needs to be improved. The original loss function and the improved loss function are shown in Equations (24)–(27).
In these equations, , which is used to track the error between the system output and the set value. represents the penalty coefficient, and represents the overshoot penalty weight.
The original loss function is L1, which can minimize the steady-state error, enable the system to quickly convergence to the set value, and shorten the regulation time of the system. The improved loss function adds the error differential penalty term L2 and the overcall penalty term L3. The error differential penalty term can suppress the rapid change in the error, reduce the high-frequency oscillation of the system, and significantly lower the time constant of the control system. The overshoot penalty term imposes a penalty when the system output exceeds the set value, suppressing the system output overshoot and enhancing the stability of the system.