Sunteți pe pagina 1din 4

2011 Third International Conference on Measuring Technology and Mechatronics Automation

A Particle Swarm Optimization Approach for Optimal Design


of PID Controller for Temperature Control in HVAC

Zhangjun, Zhang Kanyu


Dept. of Mechanical & Electronic Engineering and Automation, Shanghai University;
Shanghai, 200072, China
tshzhangjun@tsinghua.org.cn

Abstract—Particle swarm optimization (PSO) is a novel


evolutionary algorithm which has a better convergence rate A. The mathematical model of the air-conditioned room
and computation precision compared with other evolutionary According to energy conservation law, the heat going
algorithms. From the perspective of optimization, the self- into the air-conditioned room in unit time minus the heat
tuning of PID controller parameters is to find the best global going out of the air-conditioned room in unit time is equal to
optimum value in the solution space of Kp,Ki,Kd . In this paper the rate of change of the heat storage in the room. Thus, for
an optimal design of PID controller based on particle swarm the air-conditioned room, the following formula is
optimization approach for temperature control in HVAC is established:
presented. The mathematical model of a HVAC system had The rate of change of the heat storage in the room=the
been approximate near the operating point for the PSO heat going into the room provided by [heater in unit time] +
algorithm to adjust PID parameters for the minimum
[sensible heat going into the heater in unit time] + [the heat
integrated absolute error (IAE) condition. The results show
going into the room from outside the room through the
that the adjustment of PID parameters has converted into the
optimal point and the good control response based on the
building envelope in unit time] + [the heat produced by
optimal values by the PSO technique. equipment, illumination, person in the room-the sensible
heat of the air emissions outside the room in unit time].
Keywords- PSO, PID, HVAC, Optimization, Particle swarm Thus, the above description yields the following equation:
dθ a
optimization
C1
dt
( )
= rq + Gs ρθ 0' + Q4 + Q2 − G5 ρθ a
I. INTRODUCTION
⎛ θ − θa ⎞
The main task of the central air conditioner is to keep the = ⎜ rq + Gs ρθ 0' + 4 + Q2 ⎟ − Gs ρθ a
temperature and the humidity of a room in a suitable range ⎝ R ⎠
decided by technological requirements. The room is the (1)
controlled plant of the central air conditioner. Researchers
use the traditional PID algorithms to control temperature and where C1 is the heat capacity coefficient of the room;
humidity of HVAC, which is most widely used in DDC θa is the temperature of the air in the room;
controller. Variety of interfering factors applied on the r is the latent heat of vaporization of steam;
HVAC leading to highly nonlinear cause the control results q: the steam going into the room in unit time;
being not satisfactory[1], and some researchers use Gs: air volume of the room;
intelligence algorithms to solve the nonlinear of the plant. ρ:the specific heat of the air;
The representative intelligence methods .are fuzzy control, θ4:the temperature of the building envelop
genetic algorithm, neural network which is used in the θ’0: the temperature of the air before steam
traditional PID controller[2]. In this paper, the author use heated
particle swarm optimization algorithms to tuning the PID Q2: the heat produced by equipment,
parameters Kp,Ki,Kd. Particle swarm optimization, whose illumination, person in the room
advantage is easy to implement as an evolution algorithm, Q4: heat transfer of the building envelope
can search for the optima quickly in multi-dimensional R: thermal resistance of the inner surface of the
solution space. Both the simulation and the effects of actual room.
control show better results with adaptability, robustness, Equation (1) can be simplified as
accuracy, which is more suitable for HVAC. dθ a
T1 + θ a = K1 (θ q + θ f )
II. THE MATHEMATICAL MODEL OF HVAC dt
(2)
Generally speaking, HVAC system consists of two main where Ki is the magnification of the controlled object
parts: air conditioning equipment and room. The Ti is the time constant of the controlled object
mathematical model of the two parts will be established at
following. θ q is the change of the air volume converted
from the adjusted variable

978-0-7695-4296-6/11 $26.00 © 2011 IEEE 230


DOI 10.1109/ICMTMA.2011.63
θf is the change of the air volume converted B. The mathematical model of the combined air
conditioner
from the disturbance
According to heat balance principle, when the object is in Referencing to the analysis and modeling process of the
equilibrium, the heat going into the air-conditioned room in air-conditioning room described above, a simple
unit time is equal to the heat going out from the air- mathematical model of the combined air conditioner can be
established. Taking into account the lag of the heat transfer
dθ a
conditioned room in unit time, that is: when = 0 时, of the cooling coil, the transfer function of the combined air
dt conditioner can be derived as follows:
the following expression is true: θ a = θ a∞ , θ q = θ q∞ , K f e −τs
G2 ( s ) = (8)
θ f = θ f∞ , where the subscript ∞ representatives the value Tf s + 1
under the steady state. The formula (3) is the PID algorithm.
III.OPTIMAL PID CONTROLLERS WITH PSO APPROACH FOR
1 t de(t ) TEMPERATURE CONTROL OF THE AIR-CONDITIONED ROOM
u (t ) = K p e(t ) +
Ti ∫ e(t )dt + T
0
d
dt Particle swarm optimization algorithm (PSO) is an
(3) efficient search and optimization technique developed by
Kennedy and Eberhart in 1995[3]. The algorithm is based on
Substituting θ a = θ a∞ , θ q = θ q∞ , θ f = θ f∞ into formula a swarm of particles flying through the search space. In the
(3) yields: concept of PSO, all individuals in the swarm have the same
θ a 0 = K1 (θ q 0 + θ f 0 ) (4) characteristics and behaviors, and each individual contains
parameters for position and velocity. The position of each
When the air conditioning room is in the changing particle represents a potential solution to the optimization
status, problem. The velocity is governed by a set of rules that
θ a = θ a∞ + Δθ a , θ q = θ q∞ + Δθ q , θ f = θ f∞ + Δθ f , control the dynamics of the swarm. In order to apply the
substituting them into equation (2) yields equation (5). PSO idea, matters such as representation of initial
resentation of position and velocity strategies, fitness
function identification and the limitation should first be
dΔθ a considered. In the proposed PSO algorithm the five essential
Ti + Δθ a = −θ a∞ + K (θ a∞ + θ f∞ ) + K1 (Δθ q + Δθ f )
dt parameters that are considered are as following:
(5) 1. Particle: candidate solution to a problem;
Substitute equation (5) into equation (4), the following 2. Velocity: rate of position change;
equation is derived as: 3. Fitness: the best solution achieved;
dΔθ a 4. pbest: best value obtained in previous particle;
Ti + Δθ a = K1 (Δθ q + Δθ f ) (6) 5. gbest: best value obtained so far by any particle in
dt the population
Equation (6) is the incremental differential equation of The proposed PSO consist of seven steps that is the
the temperature of the air conditioning room. Taking initial generation swarm of particles, the fitness function, the
Laplace transform on equation (6), considering the lag of the position and velocity update and finally the termination
air conditioning room, a reasonable transfer function is criterion. [6]
derived as follows: Step 1: Initialize a swarm of n particles with random
K1e −τs (7) positions and velocities within the specified range.
G1 ( s ) =
T1s + 1 The initial swarm particles are initialized to contain 100
points of particles with random position and velocity. The
The transfer function (7) of the air conditioning room
points had been randomly selected in the possible range of
includes three parameters:
the three PID parameters Kp,,Ki,,Kd.
1. Magnification K1
The only task is to determine the exact values of Kp, Ki
Magnification K1 can be interpreted as the required cold
and Kd. The optimum group of values that can make the
while the room temperature reduces one degree.
system perform best should be selected. The criterion of
2. Time constant T1
performance is determined according to the demand of
Time constant T1 reflect the required time or speed when
control system design. In this paper, particle swarm
the controlled variables reach a new steady-state value at
interference. optimization (PSO) algorithm is applied to search the
optimum Kp, Ki and Kd.
3. Lag time τ
Three dimension particles is defined as [Kp,,Ki,,Kd]
Adjustable parameter, such as the room temperature,
does not change immediately under interference. Lag time is whose position is determined by Kp, Ki and Kd. If there are n
the time when the parameter delay to change under particles in a swarm, then the dimension of the swarm is n×3.
interference. Step 2: For each particle, calculate the corresponding
PID parameters and step response of control system; then,
evaluate its fitness function.

231
In order to reduce the overshoot and setting time of the controller parameter. Otherwise, loop to step 2 until a
response of the control system, the fitness function is defined maximum number of iterations is met.
as follows:
IV. SIMULATION RESULTS
J ( K ) = ∫ (ω1 e(t ) + ω2 e(t ) )dt

(9) According to the analysis of Ⅱand accessing to relevant
0
information, the transfer function of the air-conditioned
where e(t) is the system error, and ė(t) is the derivative of
room is
e(t). The smaller value of the fitness function, the better
performance of the system response with the specified Kp, 8e −24 s
G1 ( s ) = (12)
Ki and Kd. 58s + 1
Each particle’s fitness is then examined with the fitness The transfer function of the combined air-conditioner is:
function based on the minimum integrated absolute error e −6 s
(IAE) condition. A particular particle is considered as fit if G2 ( s) = (13)
and only if it matches the IAE condition. Otherwise, the 2s + 1
particle will be automatically ignored and removed.
Step 3: Compare particle's fitness evaluation with its Simulation results are as follows:
pbest, if current value is larger than pbest, then set pbest
equal to the current value, and Pi=Xi.
Step 4: Compare particle's fitness evaluation with gbest.
if current value is larger than gbest, then set gbest equal to
the current value, and Pg=Xi.
Step 5: For each particle, change the velocity and
position of the particle according to equation (10) and
equation(11) which will be described later. If the position of
the particle is out of the specified range, produce new
position and velocity randomly within the specified range to
replace the current ones.
Velocity depends on the rate of position change of the
particle’s position. This process is done iteratively on the
particles of the swarm and fitted particles are stored as the Figure 1. Tuning curves of temperature with PID algorithm
personal current best (pbest). The iteration of updated rules
of position and velocity leads to the exploration of the whole Figure 1 is the changing process of the room temperature
regions that turn out to be the final outcomes. with the initial temperature value 30℃ using conventional
The velocity of the particle Vii can be represented by PID algorithm.
another vector Vii = [Vi Vi Vi ]. The best position previously
1 2 3

visited by the i-th particle is denoted as Pi = [Pi1 Pi2 Pi3], and


Pg =[Pg1 Pg2 Pg3] as the best position ever visited in the
swarm, then Pg becomes the best solution found so far, and
the velocity of the particle and its new position will be
determined according to the two equations (9) and (10),
V idk +1 = ωVidk + c1r1 ( Pidk − X idk ) + c2 r2 ( Pgdk − X gd
k
)
(10)
X idk +1 = X idk + Vidk +1 (11)
where ω is the inertia weight, c1 and c2 are positive
constants, r1 and r2 are two random numbers in the range
[0,1], d=1,2,3, 1≤i≤n. In this paper, we defineω=1.1, c1=
c2 =2, n=100, and we restrict Xi in the range [0, 1.1]×[0, Figure 2. Tuning curves of temperature with PSO-PID algorithm
1.1]×[0, 1.1], and Vi in the range [-0.5, 0.5]×[-0.5, 0.5]×[-
0.5, 0.5]. Figure 2 is the changing process of the room temperature
Step 6: If the current gbest is not larger enough than that with the initial temperature value 30℃ using particle swarm
of the last iteration, initialize the whole swarm with random optimization-based PID algorithm.
positions and velocities in the specified range. It is apparently that the dynamic quality in figure 2 is
Step 7: If the number of iterations reaches the maximum, better than that in figure 1 from several point of view,such
then stop. The latest gbest is regarded as the optimal PID as the maximum overshoot, settling time, rise time, damping
ratio and undamped natural frequency.

232
The scale of the coordinate of figure 1 and figure 2 is not
the same, so the PID curve and the PSO-PID curve is drawed
together in figure 3, from which the difference is easily to
see, and the control effect of PSO-PID method is much
better than that of the PID method.

Figure 6. Convergence curve of PID parameter Kd

It is obviously that the PSO-PID algorithm has a very


good convergence seen from these three figures.
V. CONCLUSIONS
This paper has described the application of Particle
Swarm Optimization (PSO) for the optimal PID controller
Figure 3. Comparison of the control effect between design of an air-conditioned room. Based on PSO and
the PID method and the PSO-PID method
classical PID algorithm, a PSO-PID controller using the
The following three figures is the convergence curves of minimum integrated absolute error (IAE) condition as fitness
the three PID parameters Kp, Ki and Kd. function is developed. The PSO-PID controller can search
the optimal controller parameters on-line, plays a significant
role in minimizing the maximum overshoot, the rise time,
and the settling time.
The good performance of PSO-PID is verified by the
application of hotel room. The results show that the PSO-
PID controller achieves better performance than the classic
one especially in the changing and complex environment.

REFERENCES
[1] Zhang Shaojun , Building Intelligent Systems Technology,
Machinery Industry Press,2006, Beijing China
[2] Zhiliang Ding; Changde Wang; Guangming Tan; Guanghua
Guan;The Application of the Fuzzy Self-Adaptive PID Controller to
the Automatic Operation Control of Water Transfer Canal System
Figure 4. Convergence curve of PID parameter Kp Intelligent Computation Technology and Automation, 2009. ICICTA
'09. Second International Conference on Volume: 2, pp.822-825
[3] J. Kennedy, R. Eberhart, “Particle Swarm Optimization”, In
Proceedings of IEEE International Conference on Neural Networks,
1995, pp.1942-1948.
[4] Emrani, S.; Salehizadeh, S. M. A; Dirafzoon, A.; Menhaj, M. B.;
Individual particle optimized functional link neural network for real
time identification of nonlinear dynamic systems. Industrial
Electronics and Applications (ICIEA), 2010 the 5th IEEE Conference
on Digital Object Identifier: 10.1109/ICIEA.2010.5514748 2010,
pp.35-40
[5] Xuquan Li; Zhigang Shi; Songtao Hu; A novel control method of a
variable volume air condition system for indoor thermal environment.
Computer Engineering and Technology (ICCET), 2010 2nd
International Conference on Volume 2 Digital Object Identifier:
10.1109/ICCET.2010.5485616 , pp.V2-566 - V2-570
[6] Wang Dingwei, Wang Junwei, Wang Hongfeng, Zhang Ruiyou.
Intelligence Optimization Method, Higher Education Press,2007,
Figure 5. Convergence curve of PID parameter Ki Beijing, China

233

S-ar putea să vă placă și