# Intelligent Tuning of PID Using Metaheuristic Optimization for Temperature and Relative Humidity Control of Comfortable Rooms

Authors: K. Janprom; W. Permpoonsinsup; S. Wangnipparnto
Journal: Journal of Control Science and Engineering
 (2020)

---

## Abstract

In order to provide the comfortable areas for human, the comfortable rooms are the basic needs area, controlled temperature, and relative humidity (RH). The aim of this study is to control and maintain the temperature and RH of the comfortable room using a proportional integral derivative (PID) controller tuned by metaheuristic optimization. In tuning gains of the PID controller, the modern metaheuristic optimizations, ant colony optimization (ACO), and symbiotic organism search (SOS) are applied and the performance of the proposed control system is compared to that of the traditional methods. In the experimental testing, the controlled room size is tested in the area of width 7.80 m, length 8.00 m, and height 3.80 m. The simulation results show that the performance of the proposed control system-tuned gains of PID controllers by using SOS algorithm has the least steady-state error with 15% rise time and also the overshoot can reach the setpoint. In the case of disturbance occurring in the system, the proposed control system is able to approach the setpoint. Therefore, the PID controller tuned by SOS algorithm can regulate the temperature and humidity of the comfortable room, proficiently.


---

## Body

## 1. Introduction

One of the most important in human life for working, resting, and others is in a comfortable environment for performing activities. Its effectiveness concentrates on work efficiency, quality of life, labour productivity, and also human health. By human nature, an average human being spends 90 percent of his life in a room to perform various activities [1]. As mentioned previously, a room that makes human comfortable is a crucial part considered while performing indoor activities. In schools, a comfortable environmental condition can increase learning by students [2]. In hospitals, a comfortable room can reduce seclusion, restraint use, and assaultive behaviors of clients [3]. To construct a comfortable room, both environmental conditions and human factors affect the thermal comfort. For environmental conditions, temperature and RH play an important role. There are many research studies about thermal comfort rooms with an air-conditioned system such as drying room [4] and garment workshop room in schools [2] and hospitals [3]. According to the American Society of Heating, Refrigerating and Air-Conditioning Engineers (ASHRAE) standard, thermal comfort is the condition of the mind expressing satisfaction with the thermal environment. Thailand is a country situated in tropical zones. The comfortable temperature range of ASHRAE standard is between 22°C and 27°C. Also, the thermal comfort for the humid tropical range is between 24°C and 27°C limit with an RH of 50% to 60% [5].In order to control the temperature and RH within the comfort range, PID controllers are widely applied. The proper design of the PID controller plays an important role in balancing the temperature and RH. Xiaochen and Chunxuan [6] studied how to control the temperature and RH of an air-conditioned room using a PID controller design method based on internal model control (IMC-PID) for controlling the multivariable system. Febiyani et al. [2] studied the influence of temperature and RH on meat-dry room, which caused overuse of energy, by using a digital separation method. The analysis showed that there was a clear pairing in drying room control. The deviation of RH control would increase 1–1.5%, and the accuracy of temperature control will increase up to ±0.1°C. Gouda [7] studied the strategic development of controlling fuzzy ventilation to ventilate hot air and reduce humidity in a laboratory. The combination of improving the condition and the steady state in creating comfort conditions was studied to set the range of setpoint. In general, the capacity of ventilation control system based on sprinkle process decreases the energy usage and improves environmental condition. Hung et al. [8] studied an interesting controlling method by advance setting of the intelligent predetermined control method (IPCM) in order to improve the use of energy and water. An increase in temperature with a stable RH under the condition of no load is considered to test the possibility of IPMC. The results showed that IPCM could save energy and water and also had complexity in controlling temperature and humidity accurately. Outanoute et al. [9] introduced a method focused on using artificial intelligence in constructing a model of temperature and RH within a glass house. Recurrent artificial neural network, time relay, and MATLAB/Simulink were also used. The experiment showed that this method could predict the temperature and RH within a glass house with high accuracy. Behrooz et al. [10] suggested a new model using fuzzy cognitive map (FCM) to control the parameter of air conditioning (A/C) of direct expansion (DX). The design of FCM suitable for air-conditioning systems might increase the efficiency of energy use and save more energy for building automation.Over the last decades, metaheuristic algorithms are becoming an increasingly popular part of the optimization method implanted to simplify the difficulties. It is inspired by natural behaviors and biological events. Most of the ACO and SOS methods are widely applied in the simulation systems. However, these are not applied to the real systems. Evidently, ACO and SOS are very challenging algorithms to be considered. The ACO is a metaheuristic algorithm proposed to solve hand combinatorial optimization problems. It is inspired from the behavior of real ants with the pheromone trail laid by them. The ACO can be applied to different fields of work, especially for tuning PID. Chiha et al. [11] proposes a new tuning PID controller method using multiobjective ACO compared to Ziegler–Nichols (Z-N), genetic algorithm (GA), and ACO. Qiu et al. [12] applied ACO tuning to the PID algorithm for precision control of functional electrical simulation. On the other hand, the SOS was first introduced in 2014 as a new metaheuristic optimization algorithm by Cheng and Prayogo [13]. It describes the symbiotic interaction strategies among organisms in order to survive in an ecosystem. Many research studies apply SOS to tune the PID controllers for wastewater treatment process [14], integrated power system, multiarea power system, and load frequency control [15]. Furthermore, there are some studies combining SOS and ACO with many techniques for tuning PID. Huang [16] combines two metaheuristic algorithms, genetic algorithm (GA) and ACO, for finding the optimal kinematic controller of four-wheeled omnidirectional mobile robots. Their simulation results present better performance in achieving both trajectory tracking and stabilization. Çelik and Öztürk [17] propose a hybrid SOS and simulated annealing (hSOS-SA) technique applied to tune PID controllers for automatic voltage regulators (AVRs). The results were more accurate and more stable than using the original SOS. Truong et al. [18] improved SOS algorithms by integrating Quasi-Opposition-Based Learning (QOBL) and Chaotic Local Search (CLS) for global optimization problems. The proposed algorithm provides a more accurate solution than the original SOS. There are many studies which applied the metaheuristic optimization for tuning the PID controller and also improved these algorithms to obtain better solutions for various problems. However, only a few research studies established in real-world systems. Blondin et al. introduce a novel combination of ACO and Nelder–Mead method (ACO-NM) to find an optimum tuning for PID controllers. They present for solving the real automatic voltage regulator (AVR) problems. The ACO-NM obtains better or equivalent solutions [19]. Mandava and Vundavilli propose the newly Modified Chaotic Invasive Weed Optimization (MCIWO) algorithms for tuning to obtain gains of Kp, Ki, and Kd for the biped robot [20]. The MCIWO is seen to converge quickly when compared with the PSO-based controller. Therefore, it is unsure how metaheuristic optimization performs in tuning the optimal PID controller applied for the real-world systems.As mentioned earlier, this study aims to apply metaheuristic algorithms ACO and SOS in tuning the PID controller for controlling temperature and RH by constructing the real comfortable room system. In Section2, the information about comfortable room and four optimization control techniques of Z-N, pole placement, ACO, and SOS are briefly described. Meanwhile, the comfortable room plant and the optimal parameters of ACO and SOS are illustrated in Section 3. The results of this study are therefore investigated and discussed to show how ACO and SOS perform in Section 4. Finally, the overview of this study is summarized in Section 5.


## 2. Theories

### 2.1. Principle of Comfortable Room

In order to make people feel comfortable, a comfortable room is designed and controlled following the ASHRAE 55 standard which sets the prediction index for predicting comfort condition of a person to the surrounding environment. This is called the predicted mean vote (PMV). The comfort temperature is defined between 23 and 27°C, and RH is in the range of 30–70%. The principle of refrigeration is the process of extracting heat from a room that requires a temperature drop by using the heat transfer process through the refrigerant. Then, the refrigerant transfers heat to the outside air by using the vapor process, condensation, expansion, and evaporation. However, the A/C system is able to control the temperature in the control area according to the desired conditions. The A/C system can control not only the temperature but also the RH, quality, circulation air, and noise levels in air-conditioned or working areas [5].


### 2.2. Relative Humidity and Moisture Content

Relative humidity is the ratio of water vapor pressure to the saturation water vapor pressure at the same temperature and pressure. RH can be expressed as follows:(1)RH=PwsPws×100%,where Pw is a partial pressure of the actual water vapor present in the air and Pws is a saturation of pure water vapor at the same temperature.The moisture content or humidity ratio is the mass ratio of water vapor in humid air to the mass of dry air. It can be formulated as(2)ω=mwma,where mw and ma are the masses of water vapor and dry air, respectively [6].Figure1 shows the states of temperature, RH, and moisture content in the air-conditioning system. The condition of the air at various positions goes to the position state 1. The air has a high, dry bulb temperature (Tdb), and a certain amount of RH is passed through the evaporator coil. The temperature decreases by 100%. RH and some water droplets come out of the cooling system set becoming air at position 2. The air will pass through the heater wire causing the temperature to rise while the specific humidity is stable becoming climate at position 3. Then, the air will pass through the humidifier to become the air with desired RH and desired temperature in a comfortable room at position 4.Figure 1
States of air properties in the comfortable room. (a) A/C system. (b) Psychometric chart.
(a)
(b)


### 2.3. Optimal Control Techniques

#### 2.3.1. Ziegler–Nichols Method

The process of selecting the control parameters is known as controller tuning. In 1942, Z-N suggested rules for tuning PID controllers [21]. The values of PID parameters are set based on the experimental step responses, or the value of that results in marginal stability when only proportional control action is used. Z-N rules are useful when mathematical models of plants are not known. Such rules suggest a set of values that will provide a stable operation of the system. However, the result of the system may exhibit a large maximum overshooting in the step response, which is unacceptable. In such cases, the series of fine tunings for an acceptable result are obtained. In fact, the Z-N tuning rules provide an educated guess for the parameter values and provide a starting point for fine tuning, rather than giving the final settings for and in a single shot. Figure 2 shows the Z-N diagram open loop and close loop. The switch is selected for the manual positioning in the process of open-loop test. Consequently, the switch will be selected for auto positioning in the process of closed-loop test [21].Figure 2
Z-N′ open-loop and closed-loop methods.From Figure2, a step-by-step signal block is used to examine the system response using an open-loop test, choosing the switch for manual positioning, and closed-loop test, also by selecting the switch for auto positioning. In this research, an open-loop test is examined to find the plant model and the parameters of PID controller are shown in (3) and Table 1, respectively. The transfer function of open-loop test can be approximated by using the first-order system with a delay time as(3)CSUS=GPS=Ke−LsTs+1,where T, L, and K are the time constant, delay time, and process gain, respectively, CS is a process response, US is a unit-step input signal, and GpS is a process transfer function [21].Table 1
Z-N tuning rule based on step response of plant by the open-loop method [21].
Type of controller
K
p
T
i
T
d
P
T
/
L
∞
0
PI
0.9
T
/
L
L
/
0.3
0
PID
1.2
T
/
L
2
L
0.5
LFigure3 indicates the open-loop test when the signals enter into the loop by the unit-step response. Table 1 shows the Z-N rule based on step response of the plant’s open-loop method, and also, the gain values of the controller, Kp, Ti, and Td, a proportional gain, a integral time, and a derivative time, respectively, are demonstrated [21].Figure 3
Unit-step response of a plant [21].


#### 2.3.2. Pole Placement Method

The pole placement method is a controller designed by specifying the controller gains ofKp, Ki (integral gain), and Kd (derivative gain) showing effectiveness of the poles of the closed system in meeting the desired pole location by comparing the coefficients with the second-order system relative to the natural frequency ωn and damp damping ratio ξ value as(4)Gs=ωn2s2+2ξωns+ωn2,where ωn is a natural frequency and ξ is a damping ratio [21].


#### 2.3.3. Ant Colony Optimization

ACO is, a population-based metaheuristic algorithm, inspired by the real behavior of ants hunting for food. ACO is used to find the optimal solutions to solve the nonlinear problems. The ants move on the graph based on stochastic process and bias of a pheromone. Generally, ants will travel from their nest to the food source and return to the nest after getting the food. While travelling, ants will release a chemical called pheromone for other ants to follow, either by smelling or tracing the tract of pheromone. After a while, pheromone will evaporate due to its chemical property. Due to this property, the route which is too long will cause total evaporation of pheromone. However, for a short route, there is more chance to produce pheromone while going out and returning before evaporation of pheromone. When lots of ants travel together or travel many times, the density of pheromone will decrease because the evaporation is higher, and if there are few ants, there will be less pheromone since there is more evaporation. Few ants will also cause dilution of pheromone, hence not attracting other ants [22]. Thus, ACO is used in real-world problems for finding the best path on a weighted graph.Theoretically, the ants choose the nodes or the cities to travel and release a pheromone by a probabilistic state transition rule [23]:(5)τijαηijβ.The ants select the node by multiplying the relative influence of pheromone factor,τij, with an exponential power of a constant α, and heuristic factor, ηij, with an heuristic information power of a constant β.The probability distribution for choosing the next node can be written as(6)pij=τijαηijβ∑h∈Sτijαηijβ,where h is the selected node belonging to S, S is a set of nodes, and α ≥ 0 and β ≥ 0 are the constants that determine the relative influence of the pheromone values and the heuristic values on the decision of the ant with probability 1−q0, 0≤q0≤1.In ACO, the heuristic factor is computed as(7)ηij=1fXj,j∈S,where fX is an objective function of X at j.In the computation of the global updating rule, the different pheromone factors can be defined as(8)Δτijk=QLk,ifkthant use edgei,jin its tour,0,otherwise,where Q is a constant related to the quality of pheromone trails laid by ants and Lk is the cost of the tour performed by the kth ant.In the following local updating rule, the pheromone factor of the next step can be calculated as(9)τijt+n=ρτijt+Δτijt,where Δτijt=∑k=1mτijt, m is the number of ants, ρ is a coefficient, ρ∈0,1 of persistence of the trail during a cycle, and 1−ρ is the evaporation of trail between generations ng and ng+1. Figure 4 indicates the diagram of ACO.Figure 4
Diagram of ACO.


#### 2.3.4. Symbiotic Organisms Search

SOS is a step of searching living organisms. It is of up-to-date development having a high tendency for metaheuristic optimization. Furthermore, SOS is a natural philosophy inspired by the behavior of reaction between organisms living in the nature. In general, the process of organisms developing a symbiotic relationship is considered a kind of strategy in adapting with the change in the environment [24]. The SOS algorithm has two control parameters: ecosize and maximum function evaluation (MaxFE). The ecosize represents the number of organisms in the ecosystem. MaxFE represents the maximum number of iterations.The cycle of the three types of research will imitate the biological relationship called mutualism, commensalism, and parasitism. When processing the three steps, SOS is able to transfer the population, called ecological solution, which is possible in the area with a tendency of researching in the best path of the area. Figure5 shows the diagram of SOS:(10)Xinew=Xi+rand0,1×Xbest−Mutual_Vector×BF1,Xjnew=Xj+rand0,1×Xbest−Mutual_Vector×BF2,Mutual_Vector=Xi+Xj2.Figure 5
Diagram of SOS.To solve the problem of new value,Xi is calculated according to the commensal between organisms. In computing the new organism Xinew, Xi will be updated only when moved properly to a new place:(11)Xinew=Xi+rand−1,1×Xbest−Xj.OrganismXj is sampled from the ecology and functions as the starting point of parasite vector trying to replace Xj in the ecological system. The two types of organisms will be evaluated to check the capacity. If the parasite vector has a higher value, it will kill Xj. If the strength of Xj is better than that of Xj, it will have immunity against the parasite and parasite vector will not be able to survive in the ecological system [25].


### 2.4. PID Controller

PID controller is a feedback control system used widely in the industrial processes and buildings. The error signal is obtained by the difference of variability in the process and the setpoint value required. The controller tries to reduce the error as much as possible by adjusting the input signal of the process. The variant of PID adjusts according to the nature of the system. Block diagram of PID controller is shown in Figure6 [26].Figure 6
Block diagram of PID controller.PID parameter calculation depends on three variables: proportion (P), integration (I), and derivative (D). Proportion is set by using the result of the error. An integral is set based on the principle of error sum occurred while derivative is set from the basis of the changing rate of the error. The weight gained from the combination of these three variants will be used for adjusting the process.Adjusting the parameter constant in PID controllers can help to develop the model for controlling suitable process needed. The response of the controller will be in the form of controller vibration up to the error, overshoots, and oscillation. The PID method may not be guaranteed to be the most suitable controller or able to make the process always stable.For real use application, only one or two models are applied depending on the process. PID is also known as proportional integral (PI), proportional derivative (PD), proportional (P), or integral (I) controller. PID controller Mv(t) is based on the combination of three variables as follows:(12)Mvt=Pout+Iout+Dout.where Pout,Iout, and Dout are the results of proportional, integral, and derivative output signals of PID controller system, respectively, U(t) is the desired process value or setpoint (SP), C(t) is the measured process value (PV), and e(t) is an error, calculated as C(t)-U(t).


## 2.1. Principle of Comfortable Room

In order to make people feel comfortable, a comfortable room is designed and controlled following the ASHRAE 55 standard which sets the prediction index for predicting comfort condition of a person to the surrounding environment. This is called the predicted mean vote (PMV). The comfort temperature is defined between 23 and 27°C, and RH is in the range of 30–70%. The principle of refrigeration is the process of extracting heat from a room that requires a temperature drop by using the heat transfer process through the refrigerant. Then, the refrigerant transfers heat to the outside air by using the vapor process, condensation, expansion, and evaporation. However, the A/C system is able to control the temperature in the control area according to the desired conditions. The A/C system can control not only the temperature but also the RH, quality, circulation air, and noise levels in air-conditioned or working areas [5].


## 2.2. Relative Humidity and Moisture Content

Relative humidity is the ratio of water vapor pressure to the saturation water vapor pressure at the same temperature and pressure. RH can be expressed as follows:(1)RH=PwsPws×100%,where Pw is a partial pressure of the actual water vapor present in the air and Pws is a saturation of pure water vapor at the same temperature.The moisture content or humidity ratio is the mass ratio of water vapor in humid air to the mass of dry air. It can be formulated as(2)ω=mwma,where mw and ma are the masses of water vapor and dry air, respectively [6].Figure1 shows the states of temperature, RH, and moisture content in the air-conditioning system. The condition of the air at various positions goes to the position state 1. The air has a high, dry bulb temperature (Tdb), and a certain amount of RH is passed through the evaporator coil. The temperature decreases by 100%. RH and some water droplets come out of the cooling system set becoming air at position 2. The air will pass through the heater wire causing the temperature to rise while the specific humidity is stable becoming climate at position 3. Then, the air will pass through the humidifier to become the air with desired RH and desired temperature in a comfortable room at position 4.Figure 1
States of air properties in the comfortable room. (a) A/C system. (b) Psychometric chart.
(a)
(b)


## 2.3. Optimal Control Techniques

### 2.3.1. Ziegler–Nichols Method

The process of selecting the control parameters is known as controller tuning. In 1942, Z-N suggested rules for tuning PID controllers [21]. The values of PID parameters are set based on the experimental step responses, or the value of that results in marginal stability when only proportional control action is used. Z-N rules are useful when mathematical models of plants are not known. Such rules suggest a set of values that will provide a stable operation of the system. However, the result of the system may exhibit a large maximum overshooting in the step response, which is unacceptable. In such cases, the series of fine tunings for an acceptable result are obtained. In fact, the Z-N tuning rules provide an educated guess for the parameter values and provide a starting point for fine tuning, rather than giving the final settings for and in a single shot. Figure 2 shows the Z-N diagram open loop and close loop. The switch is selected for the manual positioning in the process of open-loop test. Consequently, the switch will be selected for auto positioning in the process of closed-loop test [21].Figure 2
Z-N′ open-loop and closed-loop methods.From Figure2, a step-by-step signal block is used to examine the system response using an open-loop test, choosing the switch for manual positioning, and closed-loop test, also by selecting the switch for auto positioning. In this research, an open-loop test is examined to find the plant model and the parameters of PID controller are shown in (3) and Table 1, respectively. The transfer function of open-loop test can be approximated by using the first-order system with a delay time as(3)CSUS=GPS=Ke−LsTs+1,where T, L, and K are the time constant, delay time, and process gain, respectively, CS is a process response, US is a unit-step input signal, and GpS is a process transfer function [21].Table 1
Z-N tuning rule based on step response of plant by the open-loop method [21].
Type of controller
K
p
T
i
T
d
P
T
/
L
∞
0
PI
0.9
T
/
L
L
/
0.3
0
PID
1.2
T
/
L
2
L
0.5
LFigure3 indicates the open-loop test when the signals enter into the loop by the unit-step response. Table 1 shows the Z-N rule based on step response of the plant’s open-loop method, and also, the gain values of the controller, Kp, Ti, and Td, a proportional gain, a integral time, and a derivative time, respectively, are demonstrated [21].Figure 3
Unit-step response of a plant [21].


### 2.3.2. Pole Placement Method

The pole placement method is a controller designed by specifying the controller gains ofKp, Ki (integral gain), and Kd (derivative gain) showing effectiveness of the poles of the closed system in meeting the desired pole location by comparing the coefficients with the second-order system relative to the natural frequency ωn and damp damping ratio ξ value as(4)Gs=ωn2s2+2ξωns+ωn2,where ωn is a natural frequency and ξ is a damping ratio [21].


### 2.3.3. Ant Colony Optimization

ACO is, a population-based metaheuristic algorithm, inspired by the real behavior of ants hunting for food. ACO is used to find the optimal solutions to solve the nonlinear problems. The ants move on the graph based on stochastic process and bias of a pheromone. Generally, ants will travel from their nest to the food source and return to the nest after getting the food. While travelling, ants will release a chemical called pheromone for other ants to follow, either by smelling or tracing the tract of pheromone. After a while, pheromone will evaporate due to its chemical property. Due to this property, the route which is too long will cause total evaporation of pheromone. However, for a short route, there is more chance to produce pheromone while going out and returning before evaporation of pheromone. When lots of ants travel together or travel many times, the density of pheromone will decrease because the evaporation is higher, and if there are few ants, there will be less pheromone since there is more evaporation. Few ants will also cause dilution of pheromone, hence not attracting other ants [22]. Thus, ACO is used in real-world problems for finding the best path on a weighted graph.Theoretically, the ants choose the nodes or the cities to travel and release a pheromone by a probabilistic state transition rule [23]:(5)τijαηijβ.The ants select the node by multiplying the relative influence of pheromone factor,τij, with an exponential power of a constant α, and heuristic factor, ηij, with an heuristic information power of a constant β.The probability distribution for choosing the next node can be written as(6)pij=τijαηijβ∑h∈Sτijαηijβ,where h is the selected node belonging to S, S is a set of nodes, and α ≥ 0 and β ≥ 0 are the constants that determine the relative influence of the pheromone values and the heuristic values on the decision of the ant with probability 1−q0, 0≤q0≤1.In ACO, the heuristic factor is computed as(7)ηij=1fXj,j∈S,where fX is an objective function of X at j.In the computation of the global updating rule, the different pheromone factors can be defined as(8)Δτijk=QLk,ifkthant use edgei,jin its tour,0,otherwise,where Q is a constant related to the quality of pheromone trails laid by ants and Lk is the cost of the tour performed by the kth ant.In the following local updating rule, the pheromone factor of the next step can be calculated as(9)τijt+n=ρτijt+Δτijt,where Δτijt=∑k=1mτijt, m is the number of ants, ρ is a coefficient, ρ∈0,1 of persistence of the trail during a cycle, and 1−ρ is the evaporation of trail between generations ng and ng+1. Figure 4 indicates the diagram of ACO.Figure 4
Diagram of ACO.


### 2.3.4. Symbiotic Organisms Search

SOS is a step of searching living organisms. It is of up-to-date development having a high tendency for metaheuristic optimization. Furthermore, SOS is a natural philosophy inspired by the behavior of reaction between organisms living in the nature. In general, the process of organisms developing a symbiotic relationship is considered a kind of strategy in adapting with the change in the environment [24]. The SOS algorithm has two control parameters: ecosize and maximum function evaluation (MaxFE). The ecosize represents the number of organisms in the ecosystem. MaxFE represents the maximum number of iterations.The cycle of the three types of research will imitate the biological relationship called mutualism, commensalism, and parasitism. When processing the three steps, SOS is able to transfer the population, called ecological solution, which is possible in the area with a tendency of researching in the best path of the area. Figure5 shows the diagram of SOS:(10)Xinew=Xi+rand0,1×Xbest−Mutual_Vector×BF1,Xjnew=Xj+rand0,1×Xbest−Mutual_Vector×BF2,Mutual_Vector=Xi+Xj2.Figure 5
Diagram of SOS.To solve the problem of new value,Xi is calculated according to the commensal between organisms. In computing the new organism Xinew, Xi will be updated only when moved properly to a new place:(11)Xinew=Xi+rand−1,1×Xbest−Xj.OrganismXj is sampled from the ecology and functions as the starting point of parasite vector trying to replace Xj in the ecological system. The two types of organisms will be evaluated to check the capacity. If the parasite vector has a higher value, it will kill Xj. If the strength of Xj is better than that of Xj, it will have immunity against the parasite and parasite vector will not be able to survive in the ecological system [25].


## 2.3.1. Ziegler–Nichols Method

The process of selecting the control parameters is known as controller tuning. In 1942, Z-N suggested rules for tuning PID controllers [21]. The values of PID parameters are set based on the experimental step responses, or the value of that results in marginal stability when only proportional control action is used. Z-N rules are useful when mathematical models of plants are not known. Such rules suggest a set of values that will provide a stable operation of the system. However, the result of the system may exhibit a large maximum overshooting in the step response, which is unacceptable. In such cases, the series of fine tunings for an acceptable result are obtained. In fact, the Z-N tuning rules provide an educated guess for the parameter values and provide a starting point for fine tuning, rather than giving the final settings for and in a single shot. Figure 2 shows the Z-N diagram open loop and close loop. The switch is selected for the manual positioning in the process of open-loop test. Consequently, the switch will be selected for auto positioning in the process of closed-loop test [21].Figure 2
Z-N′ open-loop and closed-loop methods.From Figure2, a step-by-step signal block is used to examine the system response using an open-loop test, choosing the switch for manual positioning, and closed-loop test, also by selecting the switch for auto positioning. In this research, an open-loop test is examined to find the plant model and the parameters of PID controller are shown in (3) and Table 1, respectively. The transfer function of open-loop test can be approximated by using the first-order system with a delay time as(3)CSUS=GPS=Ke−LsTs+1,where T, L, and K are the time constant, delay time, and process gain, respectively, CS is a process response, US is a unit-step input signal, and GpS is a process transfer function [21].Table 1
Z-N tuning rule based on step response of plant by the open-loop method [21].
Type of controller
K
p
T
i
T
d
P
T
/
L
∞
0
PI
0.9
T
/
L
L
/
0.3
0
PID
1.2
T
/
L
2
L
0.5
LFigure3 indicates the open-loop test when the signals enter into the loop by the unit-step response. Table 1 shows the Z-N rule based on step response of the plant’s open-loop method, and also, the gain values of the controller, Kp, Ti, and Td, a proportional gain, a integral time, and a derivative time, respectively, are demonstrated [21].Figure 3
Unit-step response of a plant [21].


## 2.3.2. Pole Placement Method

The pole placement method is a controller designed by specifying the controller gains ofKp, Ki (integral gain), and Kd (derivative gain) showing effectiveness of the poles of the closed system in meeting the desired pole location by comparing the coefficients with the second-order system relative to the natural frequency ωn and damp damping ratio ξ value as(4)Gs=ωn2s2+2ξωns+ωn2,where ωn is a natural frequency and ξ is a damping ratio [21].


## 2.3.3. Ant Colony Optimization

ACO is, a population-based metaheuristic algorithm, inspired by the real behavior of ants hunting for food. ACO is used to find the optimal solutions to solve the nonlinear problems. The ants move on the graph based on stochastic process and bias of a pheromone. Generally, ants will travel from their nest to the food source and return to the nest after getting the food. While travelling, ants will release a chemical called pheromone for other ants to follow, either by smelling or tracing the tract of pheromone. After a while, pheromone will evaporate due to its chemical property. Due to this property, the route which is too long will cause total evaporation of pheromone. However, for a short route, there is more chance to produce pheromone while going out and returning before evaporation of pheromone. When lots of ants travel together or travel many times, the density of pheromone will decrease because the evaporation is higher, and if there are few ants, there will be less pheromone since there is more evaporation. Few ants will also cause dilution of pheromone, hence not attracting other ants [22]. Thus, ACO is used in real-world problems for finding the best path on a weighted graph.Theoretically, the ants choose the nodes or the cities to travel and release a pheromone by a probabilistic state transition rule [23]:(5)τijαηijβ.The ants select the node by multiplying the relative influence of pheromone factor,τij, with an exponential power of a constant α, and heuristic factor, ηij, with an heuristic information power of a constant β.The probability distribution for choosing the next node can be written as(6)pij=τijαηijβ∑h∈Sτijαηijβ,where h is the selected node belonging to S, S is a set of nodes, and α ≥ 0 and β ≥ 0 are the constants that determine the relative influence of the pheromone values and the heuristic values on the decision of the ant with probability 1−q0, 0≤q0≤1.In ACO, the heuristic factor is computed as(7)ηij=1fXj,j∈S,where fX is an objective function of X at j.In the computation of the global updating rule, the different pheromone factors can be defined as(8)Δτijk=QLk,ifkthant use edgei,jin its tour,0,otherwise,where Q is a constant related to the quality of pheromone trails laid by ants and Lk is the cost of the tour performed by the kth ant.In the following local updating rule, the pheromone factor of the next step can be calculated as(9)τijt+n=ρτijt+Δτijt,where Δτijt=∑k=1mτijt, m is the number of ants, ρ is a coefficient, ρ∈0,1 of persistence of the trail during a cycle, and 1−ρ is the evaporation of trail between generations ng and ng+1. Figure 4 indicates the diagram of ACO.Figure 4
Diagram of ACO.


## 2.3.4. Symbiotic Organisms Search

SOS is a step of searching living organisms. It is of up-to-date development having a high tendency for metaheuristic optimization. Furthermore, SOS is a natural philosophy inspired by the behavior of reaction between organisms living in the nature. In general, the process of organisms developing a symbiotic relationship is considered a kind of strategy in adapting with the change in the environment [24]. The SOS algorithm has two control parameters: ecosize and maximum function evaluation (MaxFE). The ecosize represents the number of organisms in the ecosystem. MaxFE represents the maximum number of iterations.The cycle of the three types of research will imitate the biological relationship called mutualism, commensalism, and parasitism. When processing the three steps, SOS is able to transfer the population, called ecological solution, which is possible in the area with a tendency of researching in the best path of the area. Figure5 shows the diagram of SOS:(10)Xinew=Xi+rand0,1×Xbest−Mutual_Vector×BF1,Xjnew=Xj+rand0,1×Xbest−Mutual_Vector×BF2,Mutual_Vector=Xi+Xj2.Figure 5
Diagram of SOS.To solve the problem of new value,Xi is calculated according to the commensal between organisms. In computing the new organism Xinew, Xi will be updated only when moved properly to a new place:(11)Xinew=Xi+rand−1,1×Xbest−Xj.OrganismXj is sampled from the ecology and functions as the starting point of parasite vector trying to replace Xj in the ecological system. The two types of organisms will be evaluated to check the capacity. If the parasite vector has a higher value, it will kill Xj. If the strength of Xj is better than that of Xj, it will have immunity against the parasite and parasite vector will not be able to survive in the ecological system [25].


## 2.4. PID Controller

PID controller is a feedback control system used widely in the industrial processes and buildings. The error signal is obtained by the difference of variability in the process and the setpoint value required. The controller tries to reduce the error as much as possible by adjusting the input signal of the process. The variant of PID adjusts according to the nature of the system. Block diagram of PID controller is shown in Figure6 [26].Figure 6
Block diagram of PID controller.PID parameter calculation depends on three variables: proportion (P), integration (I), and derivative (D). Proportion is set by using the result of the error. An integral is set based on the principle of error sum occurred while derivative is set from the basis of the changing rate of the error. The weight gained from the combination of these three variants will be used for adjusting the process.Adjusting the parameter constant in PID controllers can help to develop the model for controlling suitable process needed. The response of the controller will be in the form of controller vibration up to the error, overshoots, and oscillation. The PID method may not be guaranteed to be the most suitable controller or able to make the process always stable.For real use application, only one or two models are applied depending on the process. PID is also known as proportional integral (PI), proportional derivative (PD), proportional (P), or integral (I) controller. PID controller Mv(t) is based on the combination of three variables as follows:(12)Mvt=Pout+Iout+Dout.where Pout,Iout, and Dout are the results of proportional, integral, and derivative output signals of PID controller system, respectively, U(t) is the desired process value or setpoint (SP), C(t) is the measured process value (PV), and e(t) is an error, calculated as C(t)-U(t).


## 3. Methodology

### 3.1. Mathematical Model for Tuning the Gain of PID Controller

In this paper, the mathematical modelling has been proposed for tuning the PID controller and novel parameter optimization is constructed as follows:(13)objective function:minimizeMSEsubjected to:1≤Kp≤3,0.01≤Ki≤0.05,0≤Kd≤0.1.where MSE = ∑i=1nCs−Rs2, Cs is a temperature or RH setpoint, and R(s) is a temperature or RH output.The interval of three constraintsKp, Ki, and Kd is collected covering from the maximum and minimum values in each case of tuning Kp, Ki, and Kd with Z-N and pole placement as shown in Table 2.Table 2
Parameter gain of PID controller using various design methods.
Case
Design methods/search parameter methods
K
p
K
i
K
d
Rise time (sec)
Overshoot (%)
1
Z-N
Temperature
1.500
0.0160
0.001
190
10.4
2
Pole placement
2.500
0.0190
0.001
170
6.0
3
ACO
2.650
0.0220
0.001
148
8.0 (0.2, 13.8)
4
SOS
2.587
0.0221
0.001
148.2
6.8 (3.8, 19.9)
5
Z-N
RH
1.380
0.0030
0.001
—
—
6
Pole placement
1.740
0.0240
0.001
105
12.8
7
ACO
1.800
0.0280
0.001
92
14.1 (16.4, 4.5)
8
SOS
1.858
0.0276
0.001
92
13.0 (3.7, 22.0)


### 3.2. Experimental Comfortable Room Setup

The experimental comfortable room is set within the area of width 7.80 m, length 8.00 m, and height 3.80 m with two sets of 25,000 BTU air conditioners. Figure7 shows the structure of a comfortable room. The real comfortable room system is constructed as shown in Figure 8.Figure 7
Schematic diagram of a comfortable room.Figure 8
Experimental research setup.Based on Figures7 and 8, tools in comfortable room used in this study consist of dSPACE, heat tank, heater, and evaporator. The dSPACE is a tool for receiving and sending signals both from analog to digital, and vice versa. Heat tank refers to the heater, which boils water to increase RH required by the system. The heater is a machine used to increase the temperature as required by the system. Evaporator is an air-conditioning set which increases or reduces the temperature as required by the system. In order to compute the ACO and SOS algorithms, the MATLAB/Simulink is applied for designing, controlling, and processing the procedure.Figure9 shows the steps of conducting the research to control temperature and RH using the PID controller. To calculate the most suitable parameter, the following four methods of state water level are determined as follows:Step 1: collect data and review related researchStep 2: construct mathematical models of the original and up-to-date modelStep 3: design the original PID controller (using MATLAB/Simulink) consisted of controlling by pole placement and Z-N methodsStep 4: design an up-to-date PID controller (using MATLAB/Simulink) for controlling by pole placement and Z-N methodsFigure 9
Steps of conducting research.


### 3.3. Parameter Setting

The schematic of a comfortable room when PID controllers are added and the control interface for controlling temperature and RH after gaining the PID controller are shown in Figures10(a) and 10(b).Figure 10
Experimental setting. (a) Comfortable room system. (b) PID control interface.
(a)
(b)For solving most of optimization problems, the number of ants (NA) and ecosize are usually chosen between 10 and 50. MSE is used to determine the optimal case based on the least MSE. The parametersα, β, and ρ of the ACO are set at 0.5, 0.5, and 0.05, respectively. The parameter settings of the ACO are determined by step testing in the range, namely, 0<α<1, 0<β<1, and 0<ρ<0.1 [27]. Five different cases of NA and ecosize are examined which varies from 5, 10, 20, 30, and 50. For ACO, the optimal NA is 20 and 5 for temperature and RH, respectively. For SOS, the most suitable ecosize is 30 for both temperature and RH. The number of iterations is determined under the condition of converging to the least MSE. The stopping criteria are set to 100 iterations for both ACO and SOS. All parameter settings for the real comfortable room are shown in Table 3.Table 3
Parameter setting of ACO and SOS.
Metaheuristic algorithms
Parameters
Values
ACO
Number of iterations, N
100
Number of ants, NA
5, 10, 20, 30, 50
α
0.5
β
0.5
Evaporation rate,ρ
0.05
SOS
Ecosize
5, 10, 20, 30, 50
MaxFE
100The data of Z-N are calculated from Table1, and the data of pole placement are computed from (3). The collected data of the ACO and SOS are simulated using MATLAB/Simulink. The setpoint of the RH is set at 60% in case of temperature control chosen from the smallest mean square error. For controlling the RH, the setpoint is set at 25°C of temperature.


## 3.1. Mathematical Model for Tuning the Gain of PID Controller

In this paper, the mathematical modelling has been proposed for tuning the PID controller and novel parameter optimization is constructed as follows:(13)objective function:minimizeMSEsubjected to:1≤Kp≤3,0.01≤Ki≤0.05,0≤Kd≤0.1.where MSE = ∑i=1nCs−Rs2, Cs is a temperature or RH setpoint, and R(s) is a temperature or RH output.The interval of three constraintsKp, Ki, and Kd is collected covering from the maximum and minimum values in each case of tuning Kp, Ki, and Kd with Z-N and pole placement as shown in Table 2.Table 2
Parameter gain of PID controller using various design methods.
Case
Design methods/search parameter methods
K
p
K
i
K
d
Rise time (sec)
Overshoot (%)
1
Z-N
Temperature
1.500
0.0160
0.001
190
10.4
2
Pole placement
2.500
0.0190
0.001
170
6.0
3
ACO
2.650
0.0220
0.001
148
8.0 (0.2, 13.8)
4
SOS
2.587
0.0221
0.001
148.2
6.8 (3.8, 19.9)
5
Z-N
RH
1.380
0.0030
0.001
—
—
6
Pole placement
1.740
0.0240
0.001
105
12.8
7
ACO
1.800
0.0280
0.001
92
14.1 (16.4, 4.5)
8
SOS
1.858
0.0276
0.001
92
13.0 (3.7, 22.0)


## 3.2. Experimental Comfortable Room Setup

The experimental comfortable room is set within the area of width 7.80 m, length 8.00 m, and height 3.80 m with two sets of 25,000 BTU air conditioners. Figure7 shows the structure of a comfortable room. The real comfortable room system is constructed as shown in Figure 8.Figure 7
Schematic diagram of a comfortable room.Figure 8
Experimental research setup.Based on Figures7 and 8, tools in comfortable room used in this study consist of dSPACE, heat tank, heater, and evaporator. The dSPACE is a tool for receiving and sending signals both from analog to digital, and vice versa. Heat tank refers to the heater, which boils water to increase RH required by the system. The heater is a machine used to increase the temperature as required by the system. Evaporator is an air-conditioning set which increases or reduces the temperature as required by the system. In order to compute the ACO and SOS algorithms, the MATLAB/Simulink is applied for designing, controlling, and processing the procedure.Figure9 shows the steps of conducting the research to control temperature and RH using the PID controller. To calculate the most suitable parameter, the following four methods of state water level are determined as follows:Step 1: collect data and review related researchStep 2: construct mathematical models of the original and up-to-date modelStep 3: design the original PID controller (using MATLAB/Simulink) consisted of controlling by pole placement and Z-N methodsStep 4: design an up-to-date PID controller (using MATLAB/Simulink) for controlling by pole placement and Z-N methodsFigure 9
Steps of conducting research.


## 3.3. Parameter Setting

The schematic of a comfortable room when PID controllers are added and the control interface for controlling temperature and RH after gaining the PID controller are shown in Figures10(a) and 10(b).Figure 10
Experimental setting. (a) Comfortable room system. (b) PID control interface.
(a)
(b)For solving most of optimization problems, the number of ants (NA) and ecosize are usually chosen between 10 and 50. MSE is used to determine the optimal case based on the least MSE. The parametersα, β, and ρ of the ACO are set at 0.5, 0.5, and 0.05, respectively. The parameter settings of the ACO are determined by step testing in the range, namely, 0<α<1, 0<β<1, and 0<ρ<0.1 [27]. Five different cases of NA and ecosize are examined which varies from 5, 10, 20, 30, and 50. For ACO, the optimal NA is 20 and 5 for temperature and RH, respectively. For SOS, the most suitable ecosize is 30 for both temperature and RH. The number of iterations is determined under the condition of converging to the least MSE. The stopping criteria are set to 100 iterations for both ACO and SOS. All parameter settings for the real comfortable room are shown in Table 3.Table 3
Parameter setting of ACO and SOS.
Metaheuristic algorithms
Parameters
Values
ACO
Number of iterations, N
100
Number of ants, NA
5, 10, 20, 30, 50
α
0.5
β
0.5
Evaporation rate,ρ
0.05
SOS
Ecosize
5, 10, 20, 30, 50
MaxFE
100The data of Z-N are calculated from Table1, and the data of pole placement are computed from (3). The collected data of the ACO and SOS are simulated using MATLAB/Simulink. The setpoint of the RH is set at 60% in case of temperature control chosen from the smallest mean square error. For controlling the RH, the setpoint is set at 25°C of temperature.


## 4. Results and Discussion

Block diagram of PID controller with Z-N and pole placement methods is shown in Figure11. Block diagram of PID controller with ACO and SOS designed for tuning PID is shown in Figure 12. From Figures 11(a) and 11(b), the PID controller in a comfortable room is tuned by traditional Z-N and pole placement methods. Although both Z-N and pole placement methods are widely used in tuning PID, they are approximation methods and there is no rule to verify the correctness of the gain value of the parameters. Consequently, ACO and SOS are applied to find the optimal value of parameters gain as in Figures 12(a) and 12(b). Table 2 indicates the parameter gain values of PID controllers using Z-N, pole placement, ACO, and SOS The comparisons of response of the simulation of closed loop control of the temperature and RH are shown in Figures 13(a) and 13(b), respectively.Figure 11
Block diagram of PID controller by the Z-N and pole placement method. (a) Temperature plant. (b) RH plant.
(a)
(b)Figure 12
Block diagram PID controller by the ACO and SOS methods. (a) Temperature plant. (b) RH plant.
(a)
(b)Figure 13
Simulation closed-loop control. (a) Temperature (°C). (b) RH (%).
(a)
(b)According to Table2, the gain values of Kp, Ki, and Kd with the least MSE are collected. The 95% confidence interval is examined to declare the best results for the real comfortable room system. The simulation results of the RH control using the 4-methodology comparison including Z-N, pole placement, ACO, and SOS found that there are two best rise time responses from the ACO and the SOS method. It can be seen the overshoot of both ACO and SOS satisfies within the range of 95% confidence interval in case of temperature controlling whereas the rise time of ACO is shorter than SOS. Consequently, the overshoot of SOS is within the range of 95% confidence interval while ACO cannot be used for RH control.Therefore, the optimal case of gaining values ofKp, Ki, and Kd by ACO and SOS is the best to control the temperature and RH, respectively, compared to others. After the optimal gained values of Kp, Ki, and Kd are found, the simulation results are used in designing and controlling the comfortable room as shown in Figure 14. For the real comfortable room system, the gained values of Kp, Ki, and Kd from the best experimental case for temperature and RH control are applied to examine their performance. Temperature and RH vary along upward and downward steps. The temperature is within the interval of 20–25°C, 25–30°C, and 30–35°C for upward variation. For downward variation, the temperature decreases at three intervals of 35–30°C, 30–25°C, and 25–20°C. In the same way, RH is monitored upward for 50–60% and 60–70% and downward for 70–60% and 60–50%.Figure 14
Process response of temperature at RH constant. (a) Upward temperature setpoint (°C). (b) Downward temperature setpoint (°C).
(a)
(b)As shown in Figure14, the process response of temperature is considered by 60% of RH. It can be seen that the optimal parameters gain PID of ACO algorithm is capable of controlling the temperature oscillated near the setpoint.The optimum experimental results of SOS algorithm for controlling RH are applied to control temperature as shown in Figure15. The results of the upward sequent control of the RH ranging 50–60% and 60–70% and the downward sequent control of the RH ranging 70–60% and 60–50% reveal the controllable RH, followed by the RHSP signal. Figure 16 shows the process response results load interruption. As a result, SOS algorithm can be also used to control RH in a comfortable room, proficiently. It shows the responses of the control system in the comfortable room. The system can manipulate temperature and RH in the case of the load change condition. This leads to an oscillation of the temperature and the RH. However, the SOS control system is in charge of regulating the temperature and the RH back to the set point, efficiently.Figure 15
Process response of RH at temperature constant. (a) Upward RH setpoint (%). (b) Downward RH setpoint (%).
(a)
(b)Figure 16
The process response results during load interruption. (a) Downward temperature setpoint (°C). (b) Upward RH setpoint (%).
(a)
(b)


## 5. Conclusion

In this study, the metaheuristic optimization algorithm is applied to find the optimal gain values of the PID controller in controlling temperature and RH for the real comfortable room system. Two metaheuristic algorithms of SOS and ACO are chosen to investigate by comparing with the Z-N and pole placement. The simulation results show that the optimal gain values of the PID controller derived from the ACO algorithm influence the fast achievement to a setpoint of the temperature. The SOS algorithm achieves the best performance with RH control. In order to apply the best simulation result with the real comfortable room system, the results are still able to control both temperature and RH, even though there is load changing in the comfortable room. For future work, the multiobjective functions of ACO and SOS algorithms are modified for controlling temperature and RH to accuracy for the real comfortable room system.



---

*Source: 2596549-2020-01-24.xml*