Application of the genetic algorithm for cascade control of a HVAC system

In this article the application of genetic algorithm for tuning of HVAC cascade system is proposed. The tuning procedure for a cascade system is very time-consuming and practice shows that additional controller tuning is needed when classical method is used. The main problem in classical method is the interconnection between the parameters of the two controllers. The proposed optimal tuning procedure overcomes the disadvantages. It is based on the following criteria: minimum integral square error, minimum settling time and minimum overshoot. The best process quality is achieved with PI controller in the inner loop and a PID controller in the outer loop of the cascade HVAC system. The proposed method for simultaneous tuning of controller parameters in a cascade control system can be applied in different control systems.


INTRODUCTION
Heating, ventilation and air-conditioning (HVAC) systems are among the most widely used control systems. Normally an air conditioning system is controlled by a single loop PID controller. The control structure is simple, but sometimes the standard PID controller fails to meet the process requirements because of large inertia, delays, nonlinear characteristics, and uncertain disturbance factors [1]. Therefore, many design solutions propose the cascade control of HVAC systems. In [1], the PIP-cascade control system has shown better performance than the standard PI and PID controllers. It is found that the PIP cascade controller enhances stability, rejects the disturbances and increases the response speed and control precision. In some references, different intelligent methods for cascade control in HVAC systems are applied. In [2,3], instead of a fixed PID controller in the standard cascade control scheme, a neural network controller in the outer loop is used. It is thus possible to avoid the tedious parameters tuning procedure for the inner and outer loop in a classical cascade control system. Fuzzy control is one of the methods which provide a basic powerful rule for decisions made to guarantee optimal use of the cooling and heating system [4]. A controller with combined fuzzy control and cascade control is designed to be applied in a central air-conditioning system in [5]. In [6], fuzzy control is proposed of the heating in a household room in accordance with the energy consumption, response time and accuracy, which is performed within an admissible range specified by the thermal comfort in the home. Robust control is another method applied in a HVAC system [7,8]. In [7], a robust cascade control strategy for temperature control of an airconditioning system is proposed. It is found that the set point response, the robust and the performance of the designed robust control system are better than in a traditional cascade PID control system and a single PID control system. The cascade control system has some advantages of disturbance rejection and stable output, but there are also some disadvantages such as difficult tuning and influence each other between the inner and outer loop [7]. The disadvantages of the cascade control have been overcome in [9,10]. In [10], a novel auto-tuning method for a cascade control system is proposed. By employing a simple relay feedback test, both inner and outer loop model parameters can be simultaneously identified. Consequently, well-established PID tuning rules can be applied to tune both loops. In [9] simultaneous tuning of the inner and outer loop controllers is given. Tuning parameters of the inner and outer loop controllers are determined using a genetic algorithm.
The genetic algorithm (GA) is a stochastic method for the solution of optimization problems with and without limitations, based on natural selection. GA alters at each step the population of individuals and selects those individuals from the current population that will evolve, i.e. they will be used to form the next generation. The selection of the best individuals is based on a functional or functionals (target functions) which evaluate the proximity of the individual to the desired solution. The rules applied for the selection of individuals from the current population are as follows: -Selection rules -the best individuals are selected to breed the next generation or be transferred unaltered into the next generation; -Crossover rules -the selected individuals are recombined with the purpose of obtaining individuals that will inherit the best characteristics of their parents; -Mutation rules -a random alteration of some of the genes ensures that even if the necessary gene is not present in any of the individuals in the current generation, an extremum will still be reached. * Corresponding author: npvalov@uni-ruse.bg The classical optimization methods such as gradient methods and point estimation methods are often used for determination of the PID controller parameters by minimizing the integral square error or the integral of absolute error [11]. For all these optimization tasks, the setting occurs around the operating point where it is reported that the model is linear. Current optimization techniques are designed to provide controller tuning taking into account all nonlinearities in the system. In some publications, the genetic algorithm is used for PID tuning in a single-loop control system [12,13].
The purpose of this article is to utilize the genetic algorithm for determination of the controller parameters in a cascade HVAC control system, and for comparison of these processes with the ones occurring in a single-loop system with PID controller tuned using the genetic algorithm and in cascade systems with PID controllers tuned by the classical methods.

DESCRIPTION OF THE HVAC SYSTEM
The block diagram of a cascade HVAC system is given in fig.1 [1]. The system consists of four main blocks where 1 represents the dynamics of the process along the way "early warning" variable  output variable, 2 represents the dynamics of the process along the way control output variable  "early warning" variable, and 1 and 2 are the transfer functions of the outer loop and inner loop controllers, respectively. The controlled process variable is the room temperature 1, and the set point is = 25℃. The control action 2 is the heating flow. The selected "early warning" variable is the temperature of the incoming air -2, which is the sum of the outdoor air temperature and the temperature of the returned to the room air. The disturbance 1 represents the temperature change in the room because of a number of random factors. The disturbance 2 accounts the influence of an ambient temperature and returned air temperature. The transfer function of the heat exchanger is based on the energy conservation law and has the following equation [1]: where 1 is the gain, (℃. / ); 1 is the time constant, ( ); τ 1 is time delay of the process, ( ). The conditioning space model has the following equation where 2 is gain of the room, (℃. / ); 2 is time constant, ( ); τ 2 is time delay of the process, ( ) .
The following transfer functions of the heat exchanger and conditioning space can be derived from (1) and (2) The values of the parameters are:

APPLICATION OF THE GENETIC ALGORITHM FOR CASCADE CONTROLLER TUNING
The linear continuous PID controller implements the equation: where , and are parameters of the proportional, integral and differential components; = -integral time constant; Most frequently, the optimal tuning of the PID controller is determined by minimizing the functionals: The use of single criteria based only on the error signal would hardly meet the contradictory requirements between accuracy in reference mode and dynamic criteria -settling time and overshoot. Therefore, for solving optimization problems several criteria that account the specific requirements of the problem are used. In this paper, the following criteria are used: where is the settling time, ; -overshoot, %; -simulation time, . The optimization problem for cascade controllers tuning is solved in MATLAB and SIMULINK. In SIMULINK, a model of the closed-loop control system is created; in the block of the inner loop PID controller 2 variables , and are set to the corresponding parameters, while in the block of the outer loop PID controller 1, variables , and are set, fig. 2. The error and the process variable are exported to the MATLAB workspace. The genetic algorithm is executed with the command GAMULTIOBJ entered in the command window or through m-file. Parameters of the function GAMULTIOBJ are set as: PopulationSize=60; ParetoFraction=0.7; PlotFcn=@gaplotpareto; Generation=30. The rest of the parameters are set by default.
The optimization parameters , , , , and are set within limits which include the values of the tuning parameters obtained by some of the classical methods. The optimization criteria calculation function is recorded in an m-file. It contains the global variables , , , , and , and using the "sim" function the SIMULINK model is accessed and the respective criteria are calculated (4). The optimization procedure is terminated when the "FunctionTolerance" is reached.

SIMULATION RESULTS
The genetic algorithm is applied for the tuning of a PID controller in a single-loop HVAC control system with transfer function (3). The PID controller parameters are: = 0.1167, = 0.0005 and = 9.8271. The system's transient response to the set point is given in fig. 3 and fig. 4 -curve 1. The process quality indicators are settling time = 540 and overshoot σ = 1%. For the settling time ±2% tolerance band were allowed.
The procedure for setting the controllers parameters in the cascade control system is applied by using the following methods: Ziegler-Nikols first method (ZN-1), Chain-Chrones-Reswik (CHR) and Internal Model Control (IMC). The inner loop controller parameters are determined regardless of the outer loop and they can be for P or PI. Then, the already tuned inner loop controller is used for calculation of the outer loop PI or PID controller parameters. The described tuning procedure is time-consuming and requires additional tuning of the controllers because of the coupling of the two cascade system loops. The best process quality indicators for the transient response to the set point are obtained by tuning the controllers with Ziegler-Nikols method. Fig. 3 shows the transient response in the cascade system with a P inner loop controller and a PI outer loop controller -curve 2. Fig. 4 shows the transient response in the cascade system with a PI inner loop controller and a PID outer loop controller -curve 2. Table 1 displays the controller parameters in the cascade control system and the process quality indicators of the transient responses. It is evident that the transient response in the system with a PI inner loop controller and a PID outer loop controller exhibits better performance characteristics compared to the system with a P inner loop controller and a PI outer loop controller. The transient response in the single-loop system with a PID controller tuned through the genetic algorithm under optimization criteria (4) -curve 1, has better process quality indicators compared to that in the cascade system tuned by the Ziegler-Nikols methodcurves 2 in fig. 3 and fig. 4.

Fig. 4. Set point input response comparison
The genetic algorithm is used to tune the PID controllers in the cascade control system. The controller parameters in the cascade system are shown in Table 1 controller. Fig. 4 shows the transient response in the system having a PI inner loop controller and a PID outer loop controller. The best process quality indicators of the transient response to the set point input are obtained in the system having a PI inner loop controller and a PID outer loop controller, both tuned using the genetic algorithm according to the criteria of minimum integral square error, minimum settling time and minimum overshooting. Fig.  5 shows the Pareto optimal line in the system with a PI inner loop controller and a PID outer loop controller. Fig. 6 shows the transient response to disturbance in the cascade HVAC system. It is evident that the transient response to disturbance -curve 3, in the cascade system with a PI inner loop controller and a PID outer loop controller, tuned using the genetic algorithm, has the best performance characteristics. Therefore, the best process quality indicators are obtained in the system having a PI inner loop controller and a PID outer loop controller tuned using the genetic algorithm according to the criteria of minimum integral square error, minimum settling time and minimum overshooting.

CONCLUSIONS
The proposed article presents the application of the genetic algorithm for simultaneous tuning of the outer and inner loop controller parameters of a cascade HVAC system. The objective of the multi-criteria optimization, applied for the determination of the controller parameters in the cascade HVAC system, is to achieve minimum integral square error, minimum duration and minimum overshoot. The best performance of the transient response to the set point input and disturbance action for the selected criteria is achieved with a PI inner loop controller and a PID outer loop controller, both tuned using the genetic algorithm.
The proposed method for simultaneous tuning of the parameters in the inner and outer loops of a cascade control system may be utilized in different control objects.
The study was supported by contract of University of Ruse "Angel Kanchev", № BG05M2OP001-2.009-0011-С01, "Support for the development of human resources for research and innovation at the University of Ruse "Angel Kanchev". The project is funded with support from the Operational Program "Science and Education for Smart Growth 2014 -2020" financed by the European Social Fund of the European Union.