Application of Numerical GPC for Temperature Control

We design a controller based on generalized predictive control (GPC), which is mainly used to intelligently regulate the temperature in a constant temperature warehouse with uncertain parameters. We model it in a generalized control system and use the properties of GPC to make this controller adaptive to different parameters and resistant to random disturbances. Since the warehouse has high requirements for temperature control, we extend the GPC method appropriately numerically and use its numerical equivalent proposition to construct a fast solution algorithm, which is applied in specific simulation experiments. The simulation results prove that the controller we constructed is effective with high adaptability to different parameters and random disturbances and can resist destructive disturbances to a certain extent.


Introduction
The Temperature Control (TC) Systems are used in a wide range of applications, such as constant temperature warehouses and other storage facilities that require real-time monitoring of temperature. Because TC is directly related to the quality of the goods stored in the warehouse, energy loss, environmental pollution and other important indicators, so how to maintain the stability of the temperature in the warehouse has become a key issue in the design of TC Systems in the warehouse [1,2]. Generally speaking, such warehouses will be stored in the temperature sensor. After the warehouse closed, TC System can only be transmitted through the sensor to determine the temperature change inside the warehouse, so the TC Systems are often lagging relative to the environment in it [3].
According to the basic method, the control strategy that people tend to adopt is PID [4,5] based on sensor information, but due to the lag of sensing data, the control results obtained by PID have a certain degree of empirical and instability [6,7]. The traditional PID control relies on the accurate estimation of the mathematical model and the appropriate combination of calculus parameters, but we cannot describe them well with uncertain lag time, large parameter and complex structural.
In addition, there is a class of research methods based on the establishment of mathematical models of physical systems [8,9,10], which used to solve the energy control problems of small thermostatic systems [11,12] and some mechanics system [13,14] better. However, they do not perform well in larger complex systems [15]. The reason is that, unlike many simple systems, the control process of a warehouse involves nonlinear, strongly coupled dynamic processes such as Heat and Mass Transfer Flow, which makes it difficult to establish a mathematical model of the real-time temperature field in the warehouse in most cases.
Predictive Control has become an important research topic in the field of automatic control, because of its unique advantage of evading the dilemma that complex systems are difficult to give accurate models. In recent years, with the development of new technologies such as Fuzzy Control and Deep Learning, Predictive Control has gradually started to show its rich vitality when adopting intelligent  [16] (GPC) is one of the most widely used theory in the field of Predictive Control, which is well adapted to large complex systems and has a wide application space with the advancement of machine learning methods such as intelligent optimization and time series prediction.
In this paper, we design a temperature control algorithm applied to the warehouse, which is mainly developed based on the GPC in order to eliminate as much as possible the uncertainties and instabilities that usually occur in the control. GPC has a low requirement for parameter settings, therefore having a certain degree of universality. Moreover, GPC will automatically estimate the true time lag parameters for the system, which will avoid overshooting and oscillations in the control process.

Model and Algorithm Design
For the general constant temperature warehouse, we consider it as a first-order inertia link with pure hysteresis [17] and give a way to use the Z-Transform Discrete System in order to achieve computer intelligent control by discrete information.
We design the temperature control system as shown in figure 1, where denotes the control variables, and denote the input and output variables of the system, respectively. denotes a class of systematic disturbances of stochastic process nature. We mainly focus on the system variables and output variables, so we ignore the discussion of the other variables for the time being and just let they satisfy the basic control equations.

Model Building and Discretization
After the temperature control system is started, if the warehouse is at a high temperature, it takes some time for the temperature in the warehouse to drop until the temperature sensor provides valid information to the system. We simplify it in our simulation as a first-order inertia link with pure hysteresis, and its transfer function is , where is the static gain, is the time constant, and is the pure lag time. For computer control and digital simulation, we need to discretize this continuous system to obtain discrete signals [18]. Using the Z-Transform, we can derive the impulse transfer function of the discrete system, and then derive the dynamic difference equation of the discrete system. Therefore, we first add a sampler and a keeper to the system. We might as well set the addition of a zero-order keeper, then its transfer function is , where is the sampling period. Since the generalized object transfer function is , by performing the Z-Transform on it, a discrete model equivalent to equation (1) can be obtained as follows: Rewriting the form of equation (3), we get 1 Performing the Z-Inverse Transform on both sides of equation (4), we obtain and it is the discrete equation that describes the control and output quantities of the system.

Numerical Prediction Algorithm of GPC
Equation (5) holds Taylor's formula, as Therefore, we can use the Controlled Auto-Regressive Integrated Moving Average (CARIMA) to describe the temperature control equation that holds in the warehouse as where is the back-shift operator, denoting the corresponding quantity with a lag of 1 sampling period; ∆ 1 is the difference operator; and is a sequence of stochastic processes independent of both the control and the system, representing the random noise that the system is subjected to over time. In particular, the control states , and satisfy As can be seen from the equation (8), the control states are all polynomials of , and the parameters not stated in the equation are all taken in the complex domain, indicating the generalized system pure lag step. Meanwhile, in order to reduce unnecessary disturbances in the control, it may be assumed that 1. At this time, equation (7) can be used to describe the transfer relationship between the control and the output by the Z Transfer Function, as .
To derive the value of after T-step prediction with equation (7)- (9), consider using the Diophantine Equation where and are also polynomials of , exactly as defined in equation (8), except that ∈ ℙ , ∈ ℙ . From equation (7)(10), we can get so the optimal predicted volume is ∆ 1 .
Equation (12) is the GPC predictive control equation for the equation (1). Since the value of , must be calculated first when calculating the value of , which is equivalent to solving a set of Diophantine equations in parallel, the computational complexity is too high to meet the control requirements of the system. Therefore, we use the Recursive Algorithm [19] for the computation, i.e. , , where ∆ 1 1 . . . . Using equation (13), we can recursively and quickly calculate equation (12) to achieve accurate prediction.

Numerical Optimization Solution of GPC
In GPC, the optimization performance metric at time has the following form: where is the Expectation, is the Expectation Value of the system output, and is the control weighting factor, which can generally be a constant.
, is the optimization time domain, and is the control time domain. The control quantity u no longer changes after steps of the system. The Performance Metric defined in equation (14) uses the long time period prediction. It extends the prediction variance from one point in time to a period of time domain, and uses the optimization of multi-step prediction to reduce the effects caused by improper estimation of time lag. It allows the whole system to be reasonably controlled through the optimization process. In fact, this is an important reason for the robustness of GPC.
Without loss of generality, let 1 and . From equation (9) It follows that is precisely the sampled value of the first terms of the device step response. In addition, equation (15) Using Recursive Least Square (RLS), the solution that makes the above performance index optimal is ∆ . . .
where the matrix with the Expectation Value of the system output are , Ultimately, the optimal control quantity obtained from equation (18) is where denotes the first row of , which must exist. Now, we only need to use equation (19)(20)(21), jointly with equation (12)(13), to obtain the best prediction of GPC for the discrete system defined by equation (5) in a recursive form. The time complexity of the algorithm does not exceed max , , so the algorithm is executed efficiently.

Control Algorithm Simulation
In this part, we test the performance of the GPC-based Control Algorithm and combine the simulation results to show that our control system can regulate the warehouse temperature in a timely and accurate manner. This algorithm also has the function of detecting system faults, which improves the reliability and safety of the control system. It is worth noting that the control system designed in this paper does not target any specific warehouse parameters, so this system can be applied to general time-lag systems.

Algorithm Validity
The setting of the model parameters is uncertain and parameter identification is unnecessary because we do not require specific parameters and environment of the warehouse. To show the control effect and robustness of the algorithm on the system, we control the first-order lag model generated from 2 sets of data separately.
Discretizing this system, we get Then we set the specified temperature is 178°C (±2°C), while the starting temperature is 230°C in the system.
Set the specified temperature is 175°C (±2°C), while the starting temperature is 230°C in the system. Simulate the above 2 systems, and the results are shown in figure 2.

Figure 2. Simulation Control Curve of System I&II
The simulation results show that, the control algorithm designed based on GPC has a strong adaptive capability to the changes of parameters. Moreover, the controller also has a strong anti-interference capability to the class of random noise added in the simulation, which satisfies the requirement that temperature control in the general warehouse must be intelligently adapted to different situations. At the same time, although the specified temperatures and parameters of above 2 systems are different, the temperature can be cooled down quickly within one sampling period given a starting temperature of 230°C. Finally, the temperature of systems is maintained within the specified temperature range, which shows that the controller we designed is effective.

Algorithm Stability
To further test the stability of the controller, we change the random variables of systems I and II, so that they have a stronger randomness relative to the original. It means that the systems will be subject to stronger disturbances. In particular, we enlarge the variance of the random variables in the stochastic process at time cross-section to 1.5 times of the original, with the remaining parameters unchanged.
Then we simulate the systems again for control, and the result is shown in figure 3. It shows that the enhanced consistent disturbance to the system within a certain range cannot destroy the control system, and both system I and II can reach stability within the specified temperature range. The only difference from the original control process is that the time to reach stability is slightly extended.

Algorithm Resilience
Finally, we test the resilience of the system, i.e., whether the system temperature can recover to the original level under control after a destructive forced disturbance is applied to the system from time to time. We require that the time for the recovery should not be too long.
In particular, we specified that system I and II were applied high temperature of 230°C at 50 and low temperature of 150°C at 150. The simulation results are shown in figure 4. Figure 4. Simulation Control Curve of System I&II (with Forced Disturbance) It shows that, both 2 systems can recover to the original level in about 10-12 time steps under control, so our control algorithm has some resistance to destructive temperature disturbance and can make the system temperature recover quickly.

Conclusion
We have designed a GPC-based temperature control system for effective and stable temperature control of the general warehouse. It realizes the basic requirements of an intelligent temperature controller. Simulation results show that, the system under control can reach the specification temperature quickly and smoothly with different model parameters. Moreover, it can effectively resist random disturbances or sudden forced disturbances, thus solving the problem that it is difficult to design a general temperature controller for different warehouses due to different specific parameters, time variability and time lag.
It is worth noting that when we apply GPC, the algorithm may produce less error in practice because our treatment is basically all numerical analysis methods. Unlike the traditional way, we not only use recursive acceleration algorithms in equation (13)(15)(18), but also use Taylor expansions to approximate the algebraic result generated by equation (7) as much as possible in concrete practice, in order to achieve higher accuracy. In fact, general arithmetic cases are usually truncated at the 6th to 8th order of the polynomial, while the calculations performed in this paper are all truncated at the 16th order. This can significantly reduce the analysis cost in the control process because it allows us to handle the computational errors without excessive care.
Further, we can continue to study GPC-based robust controllers based on this paper, not limited to temperature control. For example, fault diagnosis for time lag systems [20], decoupling control for chemical extraction [21,22], etc. can be designed with effective and stable control algorithms based on numerical GPC. We hope that more results can be achieved in these directions for GPC-based controllers.