Int. J. Reasoning-based Intelligent Systems, Vol. 2, Nos. 3/4, 2010
293
Design of an embedded fuzzy PD controller for thermal comfort applications H. Soy* Vocational College, Karamanoglu Mehmetbey University, Yunus Emre Kampüsü, 70100, Karaman, Turkey E-mail:
[email protected] *Corresponding author
E. Yilmaz Department of Electronic Engineering, Uludag University, Görükle Kampüsü, 16059, Nilüfer, Bursa, Turkey E-mail:
[email protected] N. Allahverdi Department of Electronic and Computer Education, Selcuk University, Alaeddin Keykubad Kampüsü, 42075, Selçuklu, Konya, Turkey E-mail:
[email protected] Abstract: In this paper, a reasoning-based intelligent system makes use of fuzzy control approach, which is designed for thermal comfort applications by using an embedded microcontroller system. In general, it is not possible to implement the mathematical thermal comfort models in actual environment. Thermal comfort usually depends on four environmental parameters and two personal parameters. Normally, only air temperature and humidity could be controlled in conventional heating ventilation and air conditioning (HVAC) systems. Managing and controlling the temperature and humidity parameters are very important for creating healthy living and comfortable working places. As known, fuzzy logic allows complex control system design directly from human experience. Therefore, preferring fuzzy model-based control systems to traditional ones may provide valuable advantage in applications requiring different control strategies for personal choices like thermal comfort control in buildings. So, in this paper, a comfortable fuzzy control system is investigated and performance of this suggested system is tested by Proteus virtual system modelling software. As a result, success of system is founded acceptable from view of the thermal comfort. Keywords: fuzzy control; fuzzy PD controller; embedded system; microcontroller; heating ventilation and air conditioning; HVAC; thermal comfort. Reference to this paper should be made as follows: Soy, H., Yilmaz, E. and Allahverdi, N. (2010) ‘Design of an embedded fuzzy PD controller for thermal comfort applications’, Int. J. Reasoning-based Intelligent Systems, Vol. 2, Nos. 3/4, pp.293–299. Biographical notes: Hakki Soy received his BS in Electronic Engineering from Uludag University, Bursa, Turkey, in 1999, and MS in Electronic and Computer Education Department from Selcuk University, Konya, Turkey, in 2006. He is currently working towards his PhD in the Department of Electrical and Electronic Engineering Department, Selcuk University. He is a Lecturer in K. Mehmetbey University, Karaman. His research focuses on embedded systems, and advanced control techniques. Ersen Yilmaz received his MS and PhD in Electronic Engineering from the University of Uludag, Bursa, Turkey, in 2001 and 2007, respectively. He is presently working as a Lecturer in the Department of Electronic Engineering, Uludag University, Bursa. His research interest includes statistical signal processing, fuzzy systems and artificial neural networks. Novruz Allahverdi received his BS in Computer Engineering from Azerbaijan Technical University, Baku and PhD in Computer Engineering from Moscow Energetic Institute (Moscow Power Engineering University), Russia in 1972 and 1979, respectively. He is presently a Professor in the Department of Electronic and Computer Education, Selcuk University, Konya, Turkey. His research interest includes parallel computing systems, applications of artificial intelligence in different areas.
Copyright © 2010 Inderscience Enterprises Ltd.
294
1
H. Soy et al.
Introduction
Thermal comfort is defined as “that condition of mind which express satisfaction with the thermal environment” by Fanger (1967). According to thermal comfort definition made by American Society of Heating, Refrigerating and Air-Conditioning Engineers (ASHRAE) the factors determining thermal comfort are stated as air temperature, relative humidity, mean radiant temperature, air movement velocity, insulating clothing and activity level (ASHRAE, 1992). Although the thermal comfort parameters are managed by climate systems, indoor conditions are sensed differently by different persons. Activity level and insulating clothing have personal effects on thermal comfort and both of them could be assumed as constant. Air velocity has effect on thermal comfort, and according to ASHRAE Standards, it is no greater than 0.25 m/s. Air temperature and humidity are used generally as basis parameters of thermal comfort and in most applications only temperature and humidity can be controlled. Furthermore, many of these applications, over a wide range of humidity, only temperature is controlled in the designed control system (Mirinejad et al., 2008). In such cases, the control objective is then to maintain the zone temperature within a predefined range. In this paper, fuzzy control technique was applied to adjust the temperature and humidity control signal outputs of the thermal comfort control system. Unlike the conventional systems, which use to regulate the temperature; additionally humidity is controlled by fuzzy controller. As a result, cooling-heating control actions realised by using the temperature control signal and humidifying-dehumidifying control actions is realised by using the humidity control signal on the proposed thermal comfort control system.
2
Fuzzy PD controller design
HVAC systems are generally used in building for heating, cooling and ventilation. It can realise hot air transfer to places where hot air is required by the aid of heating actuator. Heating and cooling actuators are usually equipped with fan or control valve. The purpose of ventilation is to prevent excessive rise of temperature and humidity. This is achieved by replacing the hot and humid air of the building with outdoor ambient cooler and dryer air. At the same time, ventilation can also reduce the concentration of pollutant gases generated by incomplete combustion in a heating system. Human thermal comfort depends on four environmental parameters and two personal parameters. Since the activity level and clothing depend upon personal preference, only air temperature and humidity could be controlled in HVAC systems. It is generally difficult to establish the mathematical thermal comfort models in actual environment which has non-linear characteristics (non-uniformity of air distribution, air flow, etc.), discontinuities (dead times, air flow delay, etc.) and ambiguities (sensor positions in
buildings, thermal volumes of stuffs, etc.). Due to fact that the expected performance of traditional methods are not obtained, it is preferred to use intelligent control methods to traditional ones for such kind of non-linear time variable multivariate systems with disturbances and uncertainties. During the past decade, many works by making use of advantages of fuzzy control have done for thermal comfort (Mirinejad et al., 2008; Kumrnert et al., 1997; Kolokotsa et al., 2009; Tripolitakis et al., 2004; Dounis and Caraiscos, 2009; Shiming et al., 2009; Ari et al., 2008; Singh et al., 2006; Yu and Dexter, 2000; Thompson and Dexter, 2005). Fuzzy control refers to the control of processes through linguistic expressions and mathematical modelling is not required for the design of the controller. Fuzzy controller is a knowledge-based controller which performs the close loop operations autonomously. It allows the representation of uncertainties of the plant, the treatment of non-linearities and the generation of smooth control actions. Fuzzy controllers are often realised with two inputs and one output. If these inputs consist from a variable and its derivation, this controller is thought as fuzzy proportional-derivative (PD) controller. The fuzzy modelling of thermal comfort could be of importance in the design of such a control system that regulates thermal comfort levels rather than temperature levels. The thermal comfort levels-based fuzzy controller establishes the desired set-point values of the environmental variables to be supplied to the HVAC system and distributed in the building to create a comfortable indoor climate (Mirinejad et al., 2008). Therefore, the use of fuzzy modelling enhances system control performance. In this paper, the proposed fuzzy control system for controlling thermal comfort in an air-conditioned building is based on a fuzzy modelling. Fuzzy model-based controllers has a rule base inference mechanism imitating the decision-making process of human brain for performing desired control processes on the systems and they consist of three main components: fuzzification, decision-making, and defuzzification. Fuzzification is the process of transforming a crisp input value into a fuzzy value through computing its membership to a fuzzy set. The fuzzy set is described by a membership function. Decision-making concludes control action from rule-based and the linguistic expressions. Defuzzification is the process of transforming the inferred control action to a crisp value. An HVAC system is basically a multiple-input, multiple-output (MIMO) system. However, sometimes it may be considered as an single-input, single-output (SISO) system in the design of the controller, but if the aim was full control of the system, the interaction between temperature control and humidity control loops is important and must be taken into consideration in thermal comfort control (Mirinejad et al., 2008). In our proposed model, the designed controller includes two different fuzzy control blocks. Each block has two inputs, one output and 21 rules. The described fuzzy controller has been modelled by aid of the MATLAB fuzzy logic toolbox to determine the performance required for each block to meet requirements,
Design of an embedded fuzzy PD controller for thermal comfort applications defining the number and the form of the memberships functions for input and output variables, and the rules that are the basis of the applied control strategy. The basic architecture of the first control block is shown in Figure 1, takes temperature error (errT) and its derivative (derrT) values as inputs and produces an output signal as temperature control signal (ST). The second control block, which is shown in Figure 2, takes humidity error (errH) and its derivative (derrH) values as inputs and produces an output signal as humidity control signal (SH). These values are given in Celsius (°C) for temperature and the humidity amount in the environment percentage (%). Figure 1
295
In this statement, n is sampling time and Δt is sampling period. If sampling period is chosen as unity then derivative of temperature error is simplified as change of temperature error ΔT. ΔT [n] = errT [n] − errT [n − 1] ( DC / s )
(3)
Similarly, humidity error input variable is determined by the difference between reference humidity (refH) value and actual humidity (actH) value measured by sensor at sampling times. errH [n] = refH [n] − actH [n] (%)
(4)
Derivative of humidity error input variable is determined by the ratio of the difference between current and previous humidity error values to the sampling period.
Basic structure of fuzzy temperature controller
derrH [ n] = ( errH [ n] − errH [n − 1]) / Δt
(% / s )
(5)
Again, if sampling period is chosen as unity then derivative of humidity error is simplified as change of humidity error ΔH. Figure 2
ΔH [n] = errH [n] − errH [n − 1] (% / s )
Basic structure of fuzzy humidity controller
(6)
Derivative values in system inputs give information about the amount of changes of temperature and humidity errors between two samples. Because of which the sensitivities of temperature and humidity errors may change depending on the process effectiveness of the controller system can be increased by setting the sampling period.
2.1 Input and output variables
2.2 Membership functions
The inputs to the controller include information about the current state of the system and the current operating environment, and likewise similar information about the future state and operating environment. The inputs of fuzzy thermal comfort control system are measured and acquired signals from temperature and humidity sensors. Temperature error, derivative of temperature error, humidity and derivative of humidity error are chosen as input variables for controller. According to these input variables, the designed controller produces two output signals which are used to control of system actuator properties such as motor speed and valve aperture. Temperature error input variable is determined by the difference between the reference temperature (refT) value and the actual temperature (actT) value measured by sensor at sampling times.
Aim of proposed model is to fulfil the criterions of thermal comfort. Achieving high sensitive control for thermal comfort depends on choosing suitable membership functions. Membership functions for input and output variables are usually determined with the help of expert experience. Triangular and trapezoidal membership functions are preferred since computation simplicity is important for embedded system in this study. Linguistic variables are assigned for fuzzy sets in order to create appropriate structure for determining values of temperature and humidity. The number of fuzzy sets depends on the input resolution required. In general, the smaller the number of fuzzy sets, the lower is the input resolution. In this study, same fuzzy sets are used for input variables of both control blocks. Seven fuzzy sets are defined for error input variables of control blocks. These sets are named as negative large (NL), negative medium (NM), negative small (NS), zero (Z), positive small (PS), positive medium (PM), positive large (PL) and shown in Figure 3. Three fuzzy sets are defined for derivative of error variables of control blocks. These sets are named as negative (N), zero (Z), positive (P) and shown in Figure 4. Suitable ranges are chosen for input and output variables in the membership functions experimentally. As it can be seen from membership functions error values from outside
errT [ n] = refT [ n] − actT [n] ( DC )
(1)
Derivative of temperature error input variable is determined by the ratio of the difference between current and previous temperature error values to the sampling period. derrT [ n] = ( errT [ n] − errT [n − 1]) / ΔT
( DC / s )
(2)
296
H. Soy et al.
of [–6, 6] interval lead the control signal to saturation. Error values smaller than –6°C fully activate cooling actuators, whereas error values larger than +6°C fully activate heating actuators. Derivative of error values from outside of [–1, 1] interval lead the control signals to saturation. Same fuzzy sets are used for output variables of both control blocks. Nine fuzzy sets are defined for output variables and named as Level 1 to Level 9. These sets are shown in Figure 5. Control signal is about 0% for L1 whereas it is about 100% for L9. So actuators connected the output stimulated by control signals can be opened or closed relatively between the values 0%–100%. Weighting mean given in equation (7) is used as defuzzification for obtaining the crisp values of control signals. So* =
∑ μ (S ) S i
i
Si
(7)
where μ(Si) is the membership function of input vector Si, and So* is the crisp value of output vector So. Figure 3
Input membership functions for error variable
controller is determined by a set of fuzzy rules. Fuzzy rules are written based on the empirical knowledge obtained from domain expert’s knowledge and stored in fuzzy rule base. The rules describe the control strategy of fuzzy control system. In general form, all rules are expressed based on the error (E) and its time derivative (dE) and written as: “if E is X i and dE is Y i then S is Z i ”
where Xi and Yi are the fuzzy sets in antecedent and Zi is the fuzzy set in consequent that describe the nature of the inputs and output. In this paper, Mamdani-type fuzzy model is used for decision-making stage in rule base according to values of input variables. Common fuzzy rule base used to control temperature and humidity can be imagined to be a two dimensional matrix as shown in Table 1. Table 1
A fuzzy PD controller rule base for temperature and humidity control signals
dE | E
NL
NM
NS
Z
PS
PM
PL
N
L7
L5
L3
L1
L3
L5
L7
Z
L8
L6
L4
L2
L4
L6
L8
P
L9
L7
L5
L3
L5
L7
L9
Figure 6 shows the resulting control surface obtained from implementation of error values (E) in columns and derivative of error values (dE) in rows to membership functions. Controller output values related to all possible combinations of inputs are obtained from control surface. Figure 4
Input membership functions for derivative of the error variable
Figure 5
Output membership functions for control signals
Figure 6
Control surface of designed fuzzy PD controller (see online version for colours)
2.4 Control loops
2.3 Rule base of the fuzzy controller The control objective of the designed fuzzy system controls the activation of actuators. The control action in the fuzzy
Proposed system consists of two different control loops. Temperature and humidity values are evaluated separately by controller and two different control signals are produced. Subsystems like heating, cooling, ventilation and humidity can be controlled by using these control signals. Initially, the error between the measured values and the actual values, as well as the change in the error values are calculated and fed into the fuzzy controller embedded in the chip. These
Design of an embedded fuzzy PD controller for thermal comfort applications
values determine the control signals at the output of the controller. The fuzzy controller is designed to output pulse-width modulation (PWM) signals corresponding to the error and change in the error values to control of system actuators. Figure 7
Simulation model of designed fuzzy control system
3
297
Simulation model and results
This project is based on a PIC 18F452 microcontroller and was written using CCS C compiler. The system was simulated by Proteus virtual system modelling (VSM) software. Designed simulation model is showed in Figure 7.
298
H. Soy et al.
3.1 Hardware components Designed controller model allows to user to setup reference values of temperature and humidity, respectively. Temperature, humidity and pressure values are measured by the sensors and send to the microcontroller then the actuators are controlled by using control signals obtained from microcontroller. Actuators driven by DC motor are like fan, valve, etc. are easily controlled by with the help of PWM output of microcontroller. By increasing or decreasing pulse width, the microcontroller regulates energy flow to the motor shaft. Program memory capacity, operating speed, cost and special requirements for application were taken into consideration and PIC 18F452 was chosen. This microcontroller is produced by Microchip and has 1,536 bytes RAM memory, 32,768 bytes standard flash type program memory, 256 bytes data EEPROM, ten-bit A/D converters, 34 I/O pins and many other features as two PWM outputs, timers and several communication ports in a 40-pin DIP package (Microchip, 2006). SHT75 is Sensirions family of relative humidity and temperature sensors with pins. The sensor integrates sensor elements plus signals processing in compact format and provides a fully calibrated digital output. A unique capacitive sensor element is used for measuring relative humidity while temperature is measured by a bandgap sensor. SHT75 sensor has the ability to measure temperature between –40°C to 125°C and relative humidity between 0%–100%. It is seamlessly coupled to a 14-bit analogue to digital converter and a serial interface circuit. The small size and low power consumption (85 W) makes SHT75 the ultimate choice for even the most demanding applications (Sensirion, 2009). Optimum values of temperature and relative humidity keeps their currency under constant pressure. Pressure is affected much by temperature. Pressure changes according to changes in temperature. Optimum values of temperature and relative humidity keeps their currency under constant pressure. Pressure is affected much by temperature. Pressure changes according to changes in temperature. Freescale (Motorola) MPX4115 silicon pressure sensor was used to measure atmospheric pressure. The MPX4115 is designed to sense absolute air pressure in altimeter or barometer (BAP) applications. Freescale’s BAP sensor integrates on-chip, bipolar op amp circuitry and thin film resistor networks to provide a high level analogue output signal and temperature compensation. This sensor has the ability to measure pressure between 15–115 kPa (2.2 to 16.7 psi) (Freescale, 2009). Also special control missions can be performed with the help of DS1302 real time clock at certain time intervals. The DS1302 trickle-charge timekeeping chip contains a real-time clock/calendar and 31 bytes of static RAM. It communicates with a microprocessor via a simple serial interface. Only three wires are required to communicate with the clock/RAM: CE, I/O (data line), and SCLK (serial clock). Data can be transferred to and from the clock/RAM 1 byte at a time or in a burst of up to 31 bytes. The DS1302
is designed to operate on very low power and retain data and clock information on less than 1 W (Dallas Semiconductor, 2008). Values measured by sensors and working states of actuators can be stored periodically in 24C02 EEPROM. All information related to working of control systems are presented to user on the graphic display. Figure 8
Change in the value of temperature control signal for the 22°C reference temperature on the 25 samples (see online version for colours)
Figure 9
Change in the value of humidity control signal for the 50% reference relative humidity on the 25 samples (see online version for colours)
3.2 Analysis of the simulation results In order to test temperature control on designed simulation model the temperature control signal was monitored on a test set of temperature values by choosing reference temperature value as 22°C. As it can be seem from Figure 8, the changes in temperature value measured along sampling interval and the changes in control signal were obtained. Similar to temperature control signal, the relative humidity control signal was monitored on a test set of relative humidity values by choosing reference relative humidity value as 50%. As it can be seem from Figure 9,
Design of an embedded fuzzy PD controller for thermal comfort applications
the changes in relative humidity value measured along sampling interval and the changes in control signal were obtained.
4
Conclusions
The development of fuzzy control systems in the framework of computational intelligence has set the basis for improving the efficiency of control systems in buildings. A complete fuzzy logic-based embedded control system for thermal comfort control problem in buildings equipped with HVAC has been described in the paper. The system was designed and analysed, and its performance was studied extensively by simulation experiments to validate the theoretical concepts. The experimental work is also realised on designed special software testing board. There are two different fuzzy controllers in the system. The fuzzy temperature and humidity controllers are designed like a fuzzy PD controller. The experimental simulation results indicate that the implemented fuzzy logic controllers have a high performance for real-time control over a wide range of operating conditions and system effort was found to be acceptable.
Acknowledgements This research work was supported by the Scientific Research Projects Coordinating Office, Selcuk University, Konya, Turkey.
References American Society of Heating, Refrigerating, and Air-Conditioning Engineers, Inc. (ASHRAE) (1992) ‘Thermal environmental conditions for human occupancy’, ANSI/ASHRAE Standard 55-1992. Ari, S., Wilcoxen, P., Khalifa, H.E., Dannenhoffer, J.F. and Isik, C. (2008) ‘A practical approach to individual thermal comfort and energy optimization problem’, Fuzzy Information Processing Society, NAFIPS 2008, 19–22 May, pp.1–6, New York City, NY.
299
Dallas Semiconductor (2008) DS1302 Data Sheet. Dounis, A.I. and Caraiscos, C. (2009) ‘Advanced control systems engineering for energy and comfort management in a building environment – a review’, Renewable and Sustainable Energy Reviews, Vol. 13, Nos. 6–7, pp.1246–1261. Fanger, P.O. (1967) ‘Calculation of thermal comfort: introduction of a basic comfort equation’, ASHRAE Transactions, Vol. 73, No. 2, p.4. Freescale Semiconductor (2009) MPX4115A Data Sheet. Kolokotsa, D., Pouliezos, A., Stavrakakis, G. and Lazos, C. (2009) ‘Predictive control techniques for energy and indoor environmental quality management in buildings’, Building and Environment, Vol. 44, No. 9, pp.1850–1863. Kumrnert, M., Andre, P. and Nicolas, J. (1997) ‘Optimized thermal zone controller for integration within a building energy management system’, Proceeding of Clima 2000 Conference, Paper No. 329, Brussels, Belgique. Microchip Technology Inc. (2006) PIC18FXX2 Data Sheet. Mirinejad, H., Seyed, H.S., Ghasemian, M. and Torab, H. (2008) ‘Control techniques in heating, ventilating and air conditioning systems’, Journal of Computer Science, Vol. 4, No. 9, pp.777–783. Sensirion, A.G. (2009) SHT7x Datasheet Version 4.2. Shiming, D., Zheng, L. and Minglu, Q. (2009) ‘Indoor thermal comfort characteristics under the control of a direct expansion air conditioning unit having a variable-speed compressor and a supply air fan’, Applied Thermal Engineering, Vol. 29, Nos. 11–12, pp.2187–2193. Singh, J., Singh, N. and Sharma, J.K. (2006) ‘Fuzzy modelling and control of HVAC systems: a review’, Journal of Scientific & Industrial Research, Vol. 65, No. 6, pp.470–476. Thompson, R. and Dexter, A. (2005) ‘A fuzzy decisionmaking approach to temperature control in airconditioning systems’, Control Engineering Practice, Vol. 13, No. 6, pp.689–698. Tripolitakis, E., Kolokotsa, D., Kalaitzakis, K. and Stavrakakis, G. (2004) ‘Study and implementation of a fuzzy PD thermal comfort controller for embedded fieldbus systems applications’, WSEAS Transactions on Circuits and Systems, Vol. 3, No. 9, pp.2051–2057. Yu, Z. and Dexter, A. (2000) ‘Hierarchical fuzzy control of low-energy building systems using fuzzy decision trees’, Proceedings of Conference: Air Conditioning and the Low Carbon Cooling Challenge, 27–29 July, Windsor, UK.