Adaptive Model Output Following Control for a Networked Thermostat †

: The model of a networked temperature control system is easily affected by its surrounding environment. Because of that, it is hard to identify an accurate model. This paper proposes an adaptive model output following control based on system identiﬁcation for a networked thermostat system. First, the time-varying system model is built via some thermal laws, whose parameters are identiﬁed based on the least-squares method (LSM). The time delay is transferred to deterministic by setting the data buffer. The system stability is ensured by a feedback controller. Meanwhile, an adaptive model output following controller with a command generator tracker (CGT) is designed to adjust the forward control input based on system identiﬁcation. Finally, the effectiveness of the proposed method is illustrated by simulation and experimental results.


Introduction
During the past few decades, networked control systems (NCSs) have been widely applied to industrial control systems with the development of computer and communication science [1,2].NCSs have some advantages [3,4], such as reduced cost and strong stability.NCSs can be divided into two classes: control of networks [5][6][7] and control through networks [8,9].Control of networks focuses on improving the quality of network services, such as scheduling, network routing, and network data flow.Control through networks is to obtain the desired performance of control systems that use networks as transmission media.In NCSs, data is not directly transmitted from one node to the destination node, and lots of data are sent through the same network.Due to bandwidth limitations, NCSs have some disadvantages, such as network-induced delay, packet dropouts, and packet disorder [10].Without considering them, the effectiveness of control systems can not be guaranteed, and NCSs will be unstable.
According to time delay, the research for NCSs can be divided into two classes: stochastic delay methods and deterministic delay methods.In stochastic control methods [11], the time delay is regarded as a random variable.In [12], the variable time delay is smoothed by Hilbert-Huang transform, and a fuzzy controller combining several proportional-integral controllers is designed to ensure system stability.As for packet dropouts it is modeled by Markov chains whose parameters are partly known, and NCSs are regarded as Markov jump linear systems in [13].What is more, the system stability is guaranteed by a H ∞ controller.For packet disordering, linear quadratic regulation is applied to obtain a suboptimal sampling period sequence in [14].Both packet dropouts and time delay in a networked dc permanent magnet motor system are taken into consideration in [15], and a predictive tracking control algorithm based on the sliding mode is designed to compensate them.In [16], all communication constraints are taken into account together, and a PI controller and a PD controller located at the remote and local sides, respectively.The above controllers are designed according to the statistical properties of communication constraints.Because it is not easy to determine their statistical properties, the designed controllers can not always ensure system stability.Deterministic control is to transfer the time-varying delay from stochastic to deterministic by setting data buffers [17,18].In [19], data buffers are introduced for both the forward and feedback channels.Based on the command generator tracker (CGT), a model output following control is given for the networked thermal process in [20].However, the data buffer makes time delay increase and system performance reduces.
Many adaptive control methods [21][22][23] are also developed to ensure system robustness for NCSs with uncertainty or disturbance.For a class of nonlinear NCSs, adaptive fuzzy control is proposed to ensure the boundness of all signals in the closed-loop system in [24].In [25], measurement uncertainty is considered in NCS models, and the sliding mode control is applied.Meanwhile, some sufficient conditions of the Lyapunov stability are also presented.In [26], NCSs subjected to additive noise are investigated, and a moderate local controller is directly implemented on the plant while a remote controller works through the network.In [27], NCSs with noise are investigated in the delta domain, and optimal control is applied to ensure an upper bound.As to deterministic control, NCSs with uncertainties are taken into consideration in [28,29], and adaptive control based on CGT is proposed.The CGT theory was first proposed for modeling the following problem with known constant parameters [30].In [28], an adaptive extension is given to consider a little uncertainty.
Because the statistical properties of time delay are not easily obtained, the stochastic control methods are based on their assumptions, and the system stability can not always be ensured.As a result, this paper adopts the buffer strategy, and the time delay becomes deterministic.In this paper, the parameters of a networked thermostat system are time-varying.The adaptive approaches discussed above only consider uncertainty in system models and can not always ensure tracking performance.Motivated by system identification-based methods [31,32], an adaptive model output following the control method based on parameter estimation is given to ensure the system stability and tracking ability for a networked temperature system with time-varying parameters.The time delay becomes deterministic by setting a data buffer.The system stability is guaranteed by a feedback controller.Based on online system identification, a forward adaptive model output following controller is proposed to ensure tracking performance.The main contribution of this paper is the proposal of the adaptive model output following controller for NCSs with time-varying parameters, which can ensure tracking performance.
The remainder part of this paper is organized as follows.Section 2 provides the structure of a networked thermostat system whose model is presented in Section 3. In Section 4, the adaptive model output following control is proposed.The simulation and experimental results are shown in Section 5.The conclusions are provided in Section 6.

Networked Thermostat System
As shown in Figures 1 and 2, the networked thermostat system consists of two computers connected to the network, a PCL-812PG board, a PCI-1760U board, a thermostat, a Peltier device, a temperature sensor, and a signal conditioning board.The thermostat temperature is collected and sent to PC1 by PC2.Based on the proposed method, PC1 returns the control outputs over the network.PC2 commands PCI-1760U to produce PWM according to the control output.The Peltier device will cool the thermostat as desired.The signal conditioning board is to amplify the voltage output of the temperature sensor and provides enough power for the Peltier device.Details are shown as follows:  To improve the cooling ability, the fans and copper pipe is used to decrease the temperature on the radiation side.In this paper, the Peltier is controlled by pulse width modulation (PWM) produced by the PCI-1760U board.Further, it commands the PCL-812PG board to sample the voltage amplified by the signal conditioning board and send it over the network to the remote computer, PC1.(6) Signal conditioning board: In order to improve the precision of temperature, the voltage output of the temperature sensor is amplified from 0-1 to 0-5 V.Because the power provided by the PCI-1760U board is not enough for the Peltier, the PWM amplitude is converted from 5 to 12 V by the signal conditioning board.( 7) PCL-812PG board: It is inserted in PC2 and used to collect the temperature information from the signal conditioning board by a 12-bit analog-to-digital converter.Its voltage input range is 0-5 V. ( 8) PCI-1760U board: It can produce PWM used to control the thermostat temperature.
Its voltage is 5 V and the period is set to 10 ms.(9) Network system: It is designed based on a network platform HORB based on the Java programming language.On this platform, a server is designed to manage tasks from local and remote terminals.This platform packets all the communication protocols, primary data processing, and remote function call.The only thing for the two PCs is to provide their IP addresses and tasks to the server at the beginning of the experiments.

Peltier Model
In this experiment platform, the Peltier is controlled by PWM.Assuming the PWM duty cycle is denoted by u p , and the current is I c , the electro-thermal amount by the Peltier effect is given by where S p is the Seebeck coefficient, and T e is the temperature at the endothermic side of the Peltier device.The thermal conduction by the temperature difference between the radiation and endothermic sides is where K is the Peltier's thermal conductivity.The temperature difference (T r − T e ) can be approximated by [33] T where k 1 − k 5 are constant.The Joule heat by the current is written as where R p is Peltier's resistance.The endothermic heat Q p consists of the above three parts [34]: ). (5)

Thermostat Model
The configuration of the thermostat process is shown in Figure 4 and Table 1.Liquid flows from one side to the other side.Assume heat is conducted from top to bottom, the heat conduction Q c , based on Fourier's law of heat conduction, is computed as where T 0 and T(t) are the initial temperature and current temperature, respectively.The constant λ is the thermal conductivity of the thermostat.As the temperature of the thermostat drops, the released heat is given by where m a is the quality of the thermostat and c a is its specific heat coefficient.Based on Newton's law of cooling, the convective heat from the thermostat to the air is The released heat of the temperature drop from the liquid is given by where m l is the quality of liquid and c l is its specific heat coefficient.The heat released by the temperature drop from the air temperature in the thermostat is where V a is the volume of the air in the thermostat and c v is the specific heat coefficient of air.According to the conservation of energy, the thermostat can be modeled as Define y(t) = T 0 − T(x), and Equation ( 11) can be rewritten as where Because the mass of liquid m a and the volume of air in the thermostat are not constant, a 0 varies with time.Define one time-varying variable β, which satisfies Then the model becomes where b 1 is also time-varying and given by According to Laplace transform, the transfer function of the equation above can be represented by  The outer width of thermostat d 3 The outer height of thermostat d 4 The length of peltier d 5 The width of peltier d 6 The thickness of thermostat

Networked System Model
The total time delay in both the forward and feedback network channels of the closeloop networked system is shown in Figure 5.It is shown that the delays are about 19 s in this network system.In our program, the time delay T d is set to 19 by setting a data buffer.As a result, the networked system model with deterministic delay can be modeled by

Adaptive Model Output Following Control
Figure 6 shows the proposed adaptive model output following control for the networked thermostat system, where u(t) and u * (t) are the feedback and forward inputs, respectively.The compensator F(s) is designed to transform an augmented plant into an almost strictly positive real (ASPR).The feedback controller C(s) is to ensure system stability.The adaption part is based on CGT and adjusted u(t) based on system identification.

Compensator
Because of time delay, the networked system model G p (s) is non-ASPR, and a compensator can be designed to augment G p (s) such that the augmented plant can satisfy ASPR [35].When the time delay is described by the first, second, or higher-order lag term, the NCS model G p (s) can be approximated by: It can also be written as The compensator F(s) can be designed as following [35]: where δ is a small positive constant, d j (s) is a monic stable polynomial of any order n dj (≥ m 2 − m 1 − j), and n j (s) is a monic stable polynomial of any order m nj (= n dj − (m 2 − m 1 − j)).The parameter β is chosen such that the following polynomial is the Hurwitz polynomial

Robust Feedback Controller
Given the compensator, the plant is augmented as The feedback controller C(s) is designed as a constant −k e .Define the following functions: Ĝ and a sufficient condition for the stability of closed-loop control is given by (30)

System Identification
Normally, system parameters are identified in discrete space.Assume the discrete model of G(s) is described by where the time interval is T d .Because of the deterministic time delay, the discrete model of G p (s) is given by and y(k − 1) = y p (k).Even though the temperature data are received with a time delay, the above two equations show that the parameters of G(s) in discrete space can be estimated directly.There are various identification methods for linear or nonlinear systems.Because of the simplicity of the above system model, LMS is applied to estimate the parameters a 0 and b 1 online in this paper.Based on the Runge-Kutta method, the parameters in continuous state space can be obtained by

Adaptation
The adaptive controller is based on CGT theory.Assume that the reference model is denoted by G m (s) and expressed as: and the state-space representation of G m (s) is described as follows: where x m (t) can be represented by Assuming the state space of G p (s) is represented by the tracking controller is given by [30] where Theorem 1.When the NCS model and the first-order reference model are represented by Equations ( 21) and (36), respectively, the tracking performance can be ensured by the following forward controller: where S 1 and S 2 are computed by The first term, S 1 x m (t) in Equation ( 44), guarantees the steady steady-state error, and the other two ensure the tracking performance.
Proof of Theorem 1.Based on Equation ( 21), the state-space function of the NCS model G p (s) can be given by where T is the solution of the following matrix equation . .
Based on the equation above, the following equation can be obtained: Then A B C T D can be written as Its value can be computed by The algebraic complement M (n+1)(n+1) of the element at n + 1 row and n + 1 column in A B C T D is shown as following The variable Ω 22 can be given by Combining Equations ( 42), (43), and (45), Equation (44) can be obtained.

Simulation Results
As stated in Section 2, the system parameters are time-varying.In order to illustrate how the designed controller works when system parameters change, the model G(s) is assumed to change as follows: The above two functions are two possible models for G(S), which will be illustrated in the experimental parameter estimation.The parameters a 0 , a 1 , and b 1 of model G(s) are identified by LSM, as described in Section 4.3.The time-varying delay becomes deterministic by setting a data buffer in the experimental platform, while T d is set to 19 directly in the simulation for convenience.Let n = 3, the NCS model can be approximated by where The compensator terms F 2i (s) can be constructed as follows: where β 2 = 1, β 1 = 0.6, and β 0 = 0.09.The compensator is given by where G(s) are time-varying with identified parameters rather than Equation ( 54).The reference model is given by The forward control input u * is computed by The reference input u m (t) is set to 2.5 and K e = 1.
The simulation result of the CGT-based method [20] is shown in Figure 7.The settling time is about 1000 s.Before system parameters change, the system output follows the reference output, and the steady-state error is 0. After the system model changes, the control output also changes.However, the steady-state error does not decrease.The results of the proposed method are shown in Figures 8 and 9.The settling time is about 500 s, and the steady-state error is 0. The parameter estimation converges after several time intervals.After system parameters change, the maximum error is 0.3 • C, and the system parameters are estimated correctly by the LMS method in 400 s.Meanwhile, the steady-state error becomes 0.

Experimental Results
In experiments, the feedback gain k e is set to 0.1, and the reference model does not change.The reference input varies as follows: Figure 12 shows the parameter estimation results.Let a 1 = 1; the other two parameters are shown in Figure 13.They certify that the NCS model is time-varying.When the reference input does not change, the estimated parameters change slowly.While u m (t) changes as the sine function, the parameter estimation process can not converge.The tracking performance is shown in Figure 14.In the beginning, parameter estimation does not converge, and the maximum abstract error is 1.88 • C. From 300 to 1520 s, the system output becomes steady, and the steady-state error is 0.2 • C. When the reference input changes as the sine function from 1520 to 3800 s, the maximum tracking error is 0.8 • C. In the last period, the steady-state error is 0.16 • C. The experimental results show that the proposed methods can ensure the tracking performance for time-varying NCSs.
When the reference input changes as follows: u m (t) =    5, 0 s < t < 1140 s 4 + 2 sin( πt−1140π 1140 ), 1140 s ≤ t < 3420 s 2, 3420 s ≤ t < 4408 s , (62) the tracking performance is shown in Figure 15.Compared with the previous experiment results, the system performance is similar to that.The maximum abstract error is 3.08 • C in the beginning, while the steady-state error is 0.23 • C from 400 to 1140 s.When the reference input varies from 1140 to 3420 s, the maximum tracking error is 0.83 • C. In the last period, the steady-state error is 0.08 • C.

Conclusions
In this paper, an adaptive model output following the control method is proposed for a networked temperature control system with time-varying parameters.The time delay is set to 19 s by the data buffer.To apply CGT theory, a compensator is designed.The feedback controller is used to ensure system stability.The adaptive model output following control is designed to adjust the control output according to system parameter estimation.The experimental results show that the maximum steady-state error is 0.16 • C. The maximum tracking error for time-varying reference input is 0.8 • C. The effectiveness of the proposed method is confirmed by the simulation and experimental results.

Figure 2 . 4 •
Figure 2. Thermostat system.(1) Thermostat: It is a container that ensures the temperature of the liquid flowing out is always the same as desired.While flowing from one side to another side, the liquid will be cooled by the Peltier device.(2) Temperature Sensor: LM35 Precision Centigrade Temperature Sensor is used to collect the temperature of the thermostat, whose voltage output increases linearly with the temperature.It is equipped at the side where liquid flows out.Its voltage output range 0-1 V corresponds to the temperature range 0-100 • C, and the measurement error is ± 1 4 • C. (3) Peltier device: As shown in Figure 3, the Peltier device consists of a Peltier, a copper pipe, and two fans.The working voltage of the Peltier is 12 V.When current flows through the Peltier, the temperature at the endothermic side will decrease, and the other side radiates energy into the air.Its endothermic side is close to the thermostat.To improve the cooling ability, the fans and copper pipe is used to decrease the temperature on the radiation side.In this paper, the Peltier is controlled by pulse width modulation (PWM) produced by the PCI-1760U board.

Figure 3 .
Figure 3.The configuration of the Peltier device.(4)PC1: It is used to receive the temperature of the thermostat through the network, run the proposed algorithm, and then return the result through the network.(5) PC2: This PC receives data sent by the remote computer PC1 over the network, and outputs the PWM wave to control the PCI-1760U board based on the proposed method.

Figure 4 .
Figure 4.The configuration of the thermostat.

Figure 6 .
Figure 6.Adaptive output following control based on identification model.

Figure 8 .
Figure 8. Simulation result of the proposed method.

Figure 9 .
Figure 9. Parameter estimation of the proposed method.When parameters a 0 and b 1 change as follows a 0 = 162 + 5 cos( πt 1520 ), (59) b 1 = 0.15 + 0.05 sin( πt 1900 ), (60) the simulation results and parameter estimation are shown in Figures 10 and 11.At 500 s, the abstract temperature error is 0.08 • C, and the steady-state error is 0.15 • C.These results show that the proposed method ensures system stability for NCSs with timevarying parameters.

Figure 10 .
Figure 10.Simulation results of the proposed method for time-varying NCSs.

Figure 11 .
Figure 11.Parameter estimation of the proposed method for time-varying NCSs.

Figure 12 .
Figure 12.Experimental parameter estimation of the proposed method.

Figure 14 .
Figure 14.Experimental results of the proposed method.

Figure 15 .
Figure 15.Experimental results with difference reference input.

Table 1 .
Parameters of the thermostat.