INT J COMPUT COMMUN, ISSN 1841-9836 8(5):654-661, October, 2013. Development an Adaptive Incremental Fuzzy PI Controller for a HVAC System J. Bai Jianbo Bai College of Mechanical and Electrical Engineering, Hohai University, Changzhou 213022, China, bai_jianbo@hotmail.com Abstract: This paper presents an adaptive incremental fuzzy PI controller (AIFPI) for a heating, ventilating, and air conditioning (HVAC) system capable of maintaining comfortable conditions under varying thermal loads. The HVAC system has two subsystems and is used to control indoor temperature and humidity in a thermal zone. As the system has strong-coupling and non-linear characteristics, fixed PI controllers have poor control performance and more energy consumption. Aiming to solve the problem, fuzzy control and PI control are combined together organically. In the proposed control scheme, the error of the system output and its derivative are taken as two parameters necessary to adapt the proportional (P) and integral (I) gains of the PI controller based on fuzzy reasoning according to practical control experiences. To evaluate the effectiveness of the proposed control methods in the HVAC system, it is compared with a fixed well-tuned PI controller. The results demonstrate that the AIFPI controller has more superior performance than the latter. Keywords: HVAC system, adaptive control, fuzzy logic control, PI control. 1 Introduction Commercial and industrial HVAC applications use electric and mechanical control system to maintain the desired temperature humidity level, and static pressure within a given area or zone. Good HVAC control schemes help reduce energy used and maintain occupant comfort. In spite of many advance in control theory, simply controllers of PI/PID type are still widely used in the majority of HVAC control loops [1]. There are three common methods for determine "good" values for the gain, integral time constant and derivative time constant of a PI/PID controller: manual tuning, auto tuning and adaptive control method [2]. For thermal load disturbances, variation of fluid flowrate, heat exchangers fouling or wear on valves, most HVAC systems have nonlinear, strong-coupling and time-varying dynamics [3]. A problem using conventional PI controllers in HVAC control systems is that control performance varies as conditions change and loops may become sluggish or oscillatory at certain times [2]. According to Åström, a fixed gain controller should be used for systems with constant dynam- ics, and adaptive control methods should be used for processes with time varying dynamics [4]. Consequently, we should use adaptive control methods in the HVAC industry. Some work has already been done in this area. For example, the development of control strategies for im- proving the performance of PID controllers using self tuning and adaptive control PI control techniques for HVAC systems has been studied in recently years [5]. The controllers normally have two parts: online identification and controller tuning. And the Recursive Least Square (RLS) method is commonly used by the identification part. However, it has been reported that unmodeled process disturbances and actuator hysteresis limit the effectiveness of the RLS [6]. Then, the traditional adaptive control methods based on the identification have limitations in HVAC control applications, such as absence of robustness. Copyright c⃝ 2006-2013 by CCC Publications Development an Adaptive Incremental Fuzzy PI Controller for a HVAC System 655 Intelligent adaptive control using AI (Artificial Intelligence) techniques don’t need the identi- fication procedure and can also adapt to the various situations in real time [7]. It has both adapt- ability and robustness characteristics. Therefore, the adaptive control based on AI techniques has acquired more attention in application to HAVC systems since the end of last century [8]. Zaheer-Uddin [9] has utilized a Neuro-PID algorithm for tracking control of a discharge air tem- perature (DAT). The ANN (Artificial Neural Network) is used to calculate the gain coefficient of PID controller. Results show that the controller is able to track set point trajectories efficiently in the presence of disturbances. Seem [10] has described a method for automatically adjusting the gain and integral time of PI controllers based upon patterns that characterize the closed-loop response for HVAC systems. This new pattern recognition adaptive controller (PRAC) is easy to use and can provides near-optimal performance for a range of systems and noise levels. Fuzzy logic control, also a method of AI techniques, is proposed by Zadeh in 1973 and has been widely applied to industry areas [11]. It presents a good tool to deal with complicated, non-linear and time-variant systems. To utilize the advantages of fuzzy control and the existing PI controllers in HVAC control systems, we design an adaptive incremental fuzzy PI (AIFPI) controller, within which the parameters of the PI controllers can be updated online as a function of operational conditions to adapt to various load disturbances in HVAC systems. 2 HVAC System and System Models A single thermal zone HVAC system for control analysis is considered [12]. The schematic diagram of the HAVC system and its control system is shown in Fig.1. The HVAC system consists of the following main components: a cooling coil, a supply air fan, a thermal zone, connecting ductwork, water pipe, and filter. The control system includes temperature sensors, humidity sensors, a Variable Frequency Drive (VFD), a water valve and a centralized controller, etc. The basic operation mode of the HVAC system is considered as follows: initially, 25% fresh air enters the system and is mixed with 75% of the recirculated air, the remained air is exhausted. Then, the mixed air passed through the cooling coil where it is conditioned according to the thermal zone designed temperature. Next, the conditioned air is delivered by a supply fan and the flow rate of the air is adjusted to maintain the thermal zone humidity. Furthermore, the supply air enters thermal space to offset sensible and latent loads acting on the system. Finally, the air in the room space is recirculated and the remained air is exhausted to the outside environment. During the operation, the flow rate of the water and the air is modulated to maintain the setting points of the temperature and the humidity in the thermal space. Figure 1: Schematic diagram of the HVAC system and its control system According to the energy and mass balance of the HVAC system, the differential equations of the system mathematical model can be described as follows [12]: 656 J. Bai   dW 3 dt = (W2−W3)fa Vz + Mz ρaVz dT3 dt = (T3−T2)fa Vhe + 0.25(T0−T3)fa Vhe − hw(0.25W0+0.75W3−W2)fa CpaVhe dT3 dt = (T2−T3)fa Vz − hfg(W2−W3)fa CpaVz + 1 ρaVzCpa (Qz − hfgMz) (1) where Cpa is the specific heat of air (1.004kJ/kg.K);Cpw is the specific heat of water (4.183kJ/kg.K); fa is the flow rate of air(m3/s);fw is the flow rate of water(m3/s);hw is the enthalpy of liquid of water(790.84kJ/kg);hfg is the enthalpy of water vapor(2500.45kJ/kg);Mz is the moisture load (0.021kg/s);Qz is the sensible heat load (84.93kJ/s);T0 is the temperature of outside air (K);T2 is the temperature of supply air (K);T3 is the controlled temperature of thermal space(K);Vhe is the volume of cooling coil (1.72m3);Vz is the volume of room space (1655.11m3);W0 is the humidity of outside air (0.018kg/kg);W2 is the humidity of supply air(0.007kg/kg);W3 is the controlled humidity of thermal space (kg/kg); ρa is the density of air (1.185kg/m3); ρw is the density of Water(1000kg/m3). 3 Design of an Adaptive Increment Fuzzy PI Controller Fig.2 shows the schematic diagram of the proposed controller and its application to the HVAC system. The control system is composed of two control loops. One is to control the indoor humidity (W3) by regulating the frequency of the supply fan. The other is to control the indoor temperature (T3) by regulating the opening of the bypass valve. Due to the complex characteristics of the HVAC system, it is difficult for fixed PI controllers to maintain the indoor environment and keep comfort situations Fig.3 shows the infrastructure of the AIFPI controller. The control scheme is mainly com- posed of two parts: Fuzzy controller and PI controller, the increment of proportional and integral gains of the PI controller can be adjusted by the Fuzzy controller in real-time according to the error of the system output and the change of the error. Figure 2: Schematic diagram of the AIFPI controller for the HVAC system Figure 3: Infrastructure of the AIFPI controller Development an Adaptive Incremental Fuzzy PI Controller for a HVAC System 657 In Fig.3, r(t) is the desired setpoint for process output and y(t) is real process output; u(t) is the fuzzy PI controller output;e is the error at sampling time t defined as e= r(t); ec is the change of the error; Ke and Kec are input scaling factors of the fuzzy controller; Multiplied by Ke and Kec separately, e′ and ec′ are the input variables of the fuzzy controller, which can be regarded as equivalent to e and ec. CP and CI are output scaling factors of the fuzzy controller;kp0 and ki0 represent initial proportional and integral gains of the PI controller;E and EC are Fuzzy sets of e′ and ec′separately; ∆KP and ∆KI are fuzzy sets of δkp and δki. They are the increment of proportional and integral gains of the PI controller. And KP and KI are proportional and integral gains of the PI controller. As the kernel of the fuzzy controller, the fuzzy rules are composed of the generalized forms "if –then" to describe the control policy and can be represented as follows. R(n): If z Then{ δkp is ∆KP (n) i and δki is ∆KI (n) i } i=1, . . . ,m; where E(n)i ,E (n) j ,∆KP (n) i and ∆KI (n) i are linguistic terms of E ,EC, ∆KP and ∆KI . According to the Mamdani inference rule, the fuzzy vector-matrix composition relation of ∆KP and ∆KI can be described as in follows:  RP = R1 ∪ R2 · · · ∪ Rn = n∪ m=1 Ri (m = 1, · · · ,49) RI = R1 ∪ R2 · · · ∪ Rn = n∪ m=1 Ri (m = 1, · · · ,49) (2) Then, the fuzzy rule bases for determination of ∆KP and ∆KI can be presented as{ ∆KP = (E × EC) · Rp, ∆KI = (E × EC) · Ri, (3) As shown in Fig.3, the proposed fuzzy PI controller can be formulated as{ KP = kp0 + δkp · Cp KI = ki0 + δki · Ci (4) where the output crisp values, δkp and δki can be calculated by the center of gravity methods. Thus, the output of the fuzzy PI controller can be given by u(t) = KP e(t) + KI ∫ τ 0 e(t)dt (5) Figure 4: Infrastructure of the AIFPI controller Fig.4 shows the diagram of controlled output regions at a step response and these regions’ positions in a rectangular coordinate. The controlled output can be divided into ten regions. In the control scheme, the variation of incremental parameters of the PI controllers is relevant with the e and ec.And each of input and output variables are fuzzified using seven fuzzy sets. The 658 J. Bai linguistic terms of the fuzzy sets are negative big (NB ), negative medium (NM ), negative small (NS ), zero (ZO), positive small (PS ), positive medium (PM ), positive big (PB ). The shape of the fuzzy sets, i.e. member functions, is chosen to be either triangle or Z-shape curve ones. The relation between ∆KP, ∆KI and E, EC can be summarized as the fuzzy rules in Table1, where the content in the first and second brackets represents the ∆KP and ∆KI separately. Table 1 Fuzzy rule base for determination of ∆KP ,∆KI based on E and EC E EC PB PM PS ZE NS NM NB PB (NB)(PB) (NB)(PB) (NM)(PM) (NM)(PM) (NM)(PS) (Z)(Z) (Z)(Z) PM (NB)(PB) (NM)(PB) (NM)(PM) (NM)(PS) (NS)(PS) (Z)(Z) (PS)(Z) PS (NM)(PB) (NM)(PM) (NS)(PS) (NS)(PS) (Z)(Z) (PS)(NM) (PS)(NS) Z (NM)(PM) (NM)(PM) (NS)(PS) (Z)(Z) (PS)(NS) (PM)(NM) (PM)(NM) NS (NS)(PS) (NS)(PS) (Z)(Z) (PS)(NS) (PM)(NS) (PM)(NM) (PM)(NB) NM (NS)(Z) (Z)(Z) (PS)(NS) (PS)(NS) (PM)(NM) (PB)(NB) (PB)(NB) NB (Z)(Z) (Z)(Z) (PS)(NS) (PM)(NM) (PM)(NM) (PB)(NB) (PB)(NB) 4 Application of the AIFPI Controller to the HVAC System The AIFPI controller is applied to the HVAC system described in section 2. In the control system, there are two control loops to maintain the indoor temperature and humidity separately. There are hence two controllers in the control scheme (Fig.2).They have the same member functions of E, EC , ∆KP and ∆KI depicted in Fig.5. However, other parameters of the two AIFPI controllers, such as Ke, Kec, Cp and Ci have different values to achieve good performance. From Fig.5, it can be found that the input variables of the fuzzy controller in the proposed control Figure 5: Member functions of the proposed AIFPI controller scheme,e′ and ec′,which are equivalent to the error e and the change of error ec are all quantized inside [-3, 3]. The output of the fuzzy controller, δk p and δki, which are incremental proportional Development an Adaptive Incremental Fuzzy PI Controller for a HVAC System 659 and integral gains of the PI controller are quantized inside [-0.06, 0.06] and [-0.3, 0.3] separately. A proper choice of input and output scaling factors Ke, Kec, Cp and Ci is important for the AIFPI controller to achieve good performance of the two control loops. After plenty of trials, the values of Ke, Kec,Cp and Ci for controlling the indoor temperature are set as 6.5, 3, 1.6 and 10. And that for controlling the indoor humidity are 2.2, 4, 1.5 and 10. To evaluate the effectiveness of the proposed AIFPI controller, its control performance is compared with a fixed well-tuned PI controller, which adopts the PI/PID tuning rules proposed by Wang [13]. It has been proved that the auto-tuning controller using the PI/PID tuning rules has good performance for HVAC systems [14]. Their behavior is all evaluated with MATLAB/Simulink simulation using the HVAC system model described by Eq.(1) and predefined load disturbances, which are used to simulate non-linear, strong coupling and time-variable characteristics of the HVAC system. (1)Comparison with different moisture load in the HVAC system Fig.6 shows the controlled temperature and humidity subjected to different moisture load during the simulation. In the beginning, the moisture load is 0.021kg/s, the setting points of the humidity and the temperature are 0.009kg/kg and 298.15K. At the 400th sampling time, the moisture load is improved to 0.031kg/s to evaluate the control performance of the proposed controller.As shown in Fig.6, it can be found that the variation of the load disturbances is one of the important factors which will influence the stability of the controlled loops in the HVAC system. Good controllers can recover the stability and accuracy of the controlled variable quickly. It can be seen that the proposed controller achieves more superior performance than the well-tuned PI controller considering the transition time and the overshoot subjected to different moisture load disturbances. Fig.7 and Fig.8 also present the variation of the proportional and integral gains of the proposed controller during the simulation. It can be also found that the proportional and integral gains can adapt to the different load disturbances and attain new stable status when offsetting them. Figure 6: Controlled humidity and temperature with moisture load disturbances Figure 7: Variation ofKp and Ki of the AIFPI controller for controlling the humidity (2)Comparison with different cooling load in the HVAC system In HVAC systems, cooling load is changing all the time during a day. The variation of the cooling 660 J. Bai Figure 8: Variation of Kp and Ki of the AIFPI controller for controlling the temperature load will lead to oscillation and drift of the controller variable, the indoor comfort then will be reduced. In order to evaluate the control performance subjected to cooling load disturbances for the proposed controller followed situations were simulated. In the beginning, the cooling load in the thermal zone is set as 84.93kJ/s, and the setting point of the humidity and the temperature is 0.009 kg/kg and 298.15K. At the 400th sampling step, the cooling load is increased by 40kJ/s. Fig.9 shows the temperature and the humidity response of the two control loops. It can be seen that the proposed controller has less overshoot and quicker response speed than the well- tuned PI controller. It can be also found that the humidity will not be influenced subjected to the cooling load in the HVAC system. The variation of the proportional and integral gains of the controller controlling the temperature is shown in Fig.10. It can be concluded that the proposed controller has good adapt ability and control performance subjected to the cooling load disturbances. Figure 9: Controlled humidity and temperature with different cooling load disturbances Figure 10: Variation of Kp and Ki of the AIFPI controller for controlling the indoor temperature Development an Adaptive Incremental Fuzzy PI Controller for a HVAC System 661 5 Conclusion In this paper, an AIFPI controller is developed and applied to a HVAC system, which has two subsystems and is used to maintain temperature and humidity in a thermal zone. Taking full advantage of fuzzy logic control and PI control together, the proposed AIFPI controller uses Fuzzy logic to supervise PI controller parameters. In the control scheme, the incremental parameters of a PI controller are updated online as a fuzzy function of the operating conditions to improve the behavior of classical fixed PI controllers. The results demonstrate the AIPFI controller has good adaptability to the non-linear, strong coupling characteristics of the HVAC system. It performs significantly better control performance than the well-tuned PI controller considering response time and overshoot subjected to different moisture load disturbances or cooling load disturbances during the simulation. The AIFPI controller can be widely used in the HVAC industry. Bibliography [1] Underwood, C.P., HVAC control systems: modeling, analysis and design, London and New York, E & FN Spon, 1999. [2] Salsbury, T., A survey of control technologies in the building automation industry, Proc. of the 16th IFAC World Congress, 331–341, 2005. [3] Levine, W.S., Control System Applications, Boca Raton, CRC Press, 121-123, 2000. [4] Astrom, K.J., Wittenmark, B., Adaptive control, Reading, Addison-Wesley, 1995. [5] Bai, J., Zhang. X., A new adaptive PI controller and its application in HVAC systems, Energy Conversion and Management, 48(2): 1043-1054, 2007. [6] Nesler, C.G., Automated Controller Tuning for HVAC Applications, ASHRAE Trans., 92(2B): 189-201, 1986. [7] White, D.A., Sofge, D.A., Handbook of Intelligent Control: Neural, Fuzzy, and Adaptive Approaches, Van Nostrand, Reinhold Comp., 1992. [8] Ferreira, P.M., Ruano, A.E., Silva S., Neural networks based predictive control for thermal comfort and energy savings in public buildings, Energy and Buildings, 55(0): 238-251, 2012. [9] Zaheer-uddin, M., Tudoroiu, N., Neuro-PID tracking control of a discharge airtemperature system, Energy Conversion and Management, 45(15-16): 2405-2415, 2004. [10] Seem, J.E., Haugstad, H.J., Field and Laboratory Results for a New Pattern Recognition Adaptive Controller, Proc. of Clima 2000 Conference, 96-100, 2000. [11] Chang, S.S.L., Zadeh, L.A., On fuzzy mapping and control. Systems, Man and Cybernetics, IEEE Trans. on, (1): 30-34, 1972. [12] Arguello-Serrano, B., Velez-Reyes, M., Nonlinear control of a heating, ventilating, and air conditioning system with thermal load estimation, IEEE Transactions on Control Systems Technology, 7(1): 56-63, 1999. [13] Wang, Q.G., Lee T.H., Fung, H.W. et al., PID tuning for improved performance, IEEE Trans. on Control Syst. Tech., 7(2): 457-465, 1999. [14] Bi, Q., Cai W.J., Wang, Q.G. et al., Advanced controller auto-tuning and its application in HVAC systems, Control Eng. Practice, 8(6): 633-644, 2000.