103 Int. J Latest Trends Agr. Food Sci.
Vol-2 No 2 June 2012
Using Proportional Integral Derivative and Fuzzy Logic with Optimization for Greenhouse Temperature Control Abdul Rahman O. Alghannam Head of Department of Department of Agriculture Systems Engineering, College of Agricultural and Food Sciences, King Faisal University, P.O. Box 420, Al-Hassa 31982, Saudi Arabia. Email:
[email protected],
[email protected]
Abstract - Several Studies were undertaken to evaluate
Keywords: Greenhouse environment, theoretical modeling,
the efficiency of different greenhouse control systems.
control system, sensible heat modeling,
Since one of the fastest growing modern technologies in
temperature modeling.
control systems used in greenhouses as well as in other
1. Introduction
fields is fuzzy logic, further research is needed to study the accuracy of the system compared to PID control
Generally, control systems with on/off switching
system for the same environment and modeling them
have been satisfactory for greenhouse climate
with the same mathematical model. In this research
management for some growers; however, for research
fuzzy logic controller was tested theoretically and
and commercial purposes, more precise control is
experimentally compared with four PID controllers’
needed
settings namely, P, PI, PD, and PID in terms of their
switching system used in greenhouses environmental
accuracy
control are; they are incapable to maintain set point
and
feasibility
to
control
greenhouse
[1]
.
Some of the drawbacks of the on/off
temperatures accurately and due to the non-linearity
temperature. An optimization procedure was used to determine
of this system, it is hard to design a controller to [2]
the best control parameters for PID and Fuzzy Logic
maintain a fixed temperature
controllers. Five tests were conducted to cool the
advantages of this system are its easiness to use and
greenhouse using evaporative cooling system during
maintain and its affordability [2].
summer season.
.
However, the
On the other hand, fuzzy logic is simple to use if
Results of the research indicated that PI and PD
incorporated with analog-to-digital converters, and 4-
controllers were the most efficient controllers in the
bit or 8-bit one-chip micro controllers. This can
controllers output or ventilation rate behavior with a
easily be upgraded by changing rules to improve
zero overshoot and small maximum and minimum
performance or add new features to the system . In
error from the set point. However, the Fuzzy Logic
many cases, fuzzy control can be used to improve
controller made the closest mean to the set point. No
existing controller systems by adding an extra layer
significant difference was noticed between the control
of intelligence to the current control method.
behavior of fuzzy logic controller and the PID
Furthermore, fuzzy logic control systems are still
controllers.
young in the climate control of greenhouse.
Therefore,
fuzzy
logic
controller
is
considered an equivalent and alternative to PID
research conducted by
controller in greenhouse climate control.
6%
was
achieved
[3]
In a
, an energy saving of about
in
greenhouse
set
point
determination using fuzzy sets. Conducted similar ___________________________________________________________________________________ International Journal of Latest Trends in Agriculture & Food Sciences IJCSET, E-ISSN: 2049-5684 Copyright © ExcelingTech, Pub, UK (http://excelingtech.co.uk/)
research in livestock buildings
[4]
. Recently,
[5]
has
104 Int. J Latest Trends Agr. Food Sci.
Vol-2 No 2 June 2012
developed a theoretical approach for fuzzy logic
control systems, a very simple greenhouse sensible
controller for broilers and greenhouse systems. In
heat
most of the commercial greenhouses, traditional
implemented to reduce other parameters or coupling
control systems may be sufficient for the parameters
effect
control. However, more precise systems are needed
Furthermore, for the scope of this project summer
for other applications such as propagation greenhouse
conditions were implemented and the original heat
systems. Furthermore, fuzzy logic systems could be
balance loads was reduced to the following heat loads
used as an alternative controller for the greenhouse
as shown in Figure 1
system
[5]
.
With
the
fast
growing
balance on
equation
the
developed
precision
of
the
by
[6]
was
controllers.
computer
applications in agriculture, there is a need to test and evaluate more advance controllers to reach the best and most affordable greenhouse climate control
qso + qvi = qw + qvo
(1)
The transient thermal behavior of inside air temperature:
systems. The objective of this research is to study the ρC p V
accuracy of the fuzzy logic system compared to the
dTi = aIA f − UA s(Ti − To)− ρC p V& (Ti − Tc) dt
(2)
PID for the same environment and modeling them with the same mathematical model. The two systems
Where:
were applied theoretically and practically using an analog output signal, which constitutes a requirement for more robust control system.
ρC p V
Since the
temperature is one of the important parameters, this research will be limited to the control of this variable and then the control could be extended to include other parameters.
dTi dt = Change of Storage
Ti = Inside air temperature. To = Ambient air temperature. Tc = Air temperature coming out of the evaporative cooling pad.
qs qw qvo qvi
Figure 1. Sensible heat balance for a greenhouse summer cooling and ventilation.
2. Materials and Methods
ρ = Air density. CP = Specific heat.
1.
Theoretical Modeling
There are various mathematical models that differ in their representation to the actual greenhouse environment, their accuracy, and their contained parameters.
However in this study,. Since the
essence of this research is to study and compare the
V = Volume of greenhouse. a = Solar heating efficiency. I = Solar irradiance. Af = Area of floor. U = Greenhouse overall heat transfer coefficient. As = Area of greenhouse covering. V&
= Ventilation rate.
105 Int. J Latest Trends Agr. Food Sci.
Vol-2 No 2 June 2012
equations. The outputs of the modeling were the best-
PID Controller The Proportional, Integral, and Derivative are
optimized limits for the input and output.
usually used in a variety of combinations with one another to achieve the right control process.
the greenhouse was the Integral of the Absolute
Theoretical methods were based on an algorithm designed by
[7]
The decided performance or criterion index for
. A greenhouse theoretical PID
magnitude of the Error (IAE) for two reasons simplicity and error size.
controller was developed using MATLAB. The PID parameters were tuned automatically through the program using performance index IAE for two
t
IAE = ∫ e dt 0
reasons simplicity and error size. The theoretical
(3)
model was inclusive to most applicable disturbances associated with greenhouse summer energy balance
Height defuzzification was implemented to
Figure 2. Greenhouse Dimensions loads. The output of this modeling, were PID tuned
get the crisp output.
parameters and the IAE associated with the tuning. The tuned parameters were then implemented in the experimental
PID
controller.
Four
different
optimization PID procedures were implemented theoretically and experimentally and compared
m
∑c w i
y=
i
k =1 m
∑w
i
k=1
(4)
regarding their feasibility and accuracy. These four
2. Materials
procedures are P, PI, PD, and PID.
This research took place in a greenhouse in the Plant Science Farm at the University of Idaho. The
Fuzzy Logic Controller (FLC) A greenhouse theoretical Fuzzy Logic Controller was also developed using MATLAB.
The FLC
parameters were tuned through the program using the same
performance
index
and
energy
balance
greenhouse had galvanized steel frames and double layer air inflated polyethylene cover. The dimensions of the greenhouse are shown in figure 2.
106 Int. J Latest Trends Agr. Food Sci.
Vol-2 No 2 June 2012
Converter. 37 Pin Screw Terminal accessory with
2.1. Greenhouse Dimensions In order to install a complete cooling /
vertical 37 Pin Male Connector.
ventilation greenhouse control system, the following components were required: 2.2. Evaporative
2.5. Computer Hardware/Software
Cooling
and
A Pentium-100 MHZ PC-computer with 64 MB
Ventilation
RAM and 1 GB Hard Drive. Labtech Notebook
System 20 pieces 0.9144 m x 0.3048 m x 0.1016 m of
control software. MATLAB programming software.
3. Experimental Methods
Munters Kool cells. Stainless steel gutters, drain, sides, top cover. Two 1/3 HP sump pumps. PVC fittings and pipes. Four 0.9144 m x 1.2192 m aluminum shutters operated with an ON/OFF CAM motors. Two 189.27 liters capacity tanks Figure 2. Two exhaust fans with a flow of 2.175 m3/s each. Two exhaust fan motors are Dayton Fractional ½ HP
The greenhouse has galvanized steel frames and double layer air inflated polyethylene cover. One variable frequency Boston Gear ACX drive (inverter) was used for the control of the fans motors’ speed. This inverter provides adjustable speed for control of conventional AC motors.
Motors Sensors’ Calibration 2.3. Control System components The HX11C OMEGA temperature sensors were Four HX11C OMEGA temperature sensors. One variable frequency Boston Gear ACX drive (inverter) for the control of the motors’ speed inverter provides adjustable speed for control of conventional AC motors. The controller converts the fixed frequency and voltage of the AC line power source to a sine coded pulse width modulated adjustable voltage and
designed to give 0-5 volt reading. These sensors were first calibrated using constant temperature media. Afterwards, the calibration outputs were converted to Celsius
temperatures
using
linear
regression.
Thereafter, the regression slope and intercept were placed in the interface icon for the display purpose and control.
frequency output. With the revolution in microcomputers, various Three 120volt Relays for the operation of the back shutters, pumps, and front shutters. Five small (5 volts) relays; three of them are used to operate the bigger relays (120volts) and the other two to operate the drive and the heater.
types of automated control software’s became available. Labtech Notebook is one of those control software programs that provide an interface between the user and the control instrumentation system. This software is an object oriented that consists of icons
Wires, transistors, resistors, and diodes, op-amp chips
that
are
designed
to
work
with
certain
were used in circuits to amplify the computer signal
instrumentation computer boards. Various types of
and protect the computer boards.
input and output icons are available. Input icons enable the user to read the signal of the sensor including
2.4. Data Acquisition CIO-DAS08
ADC
(Analog
to
Digital
Converter). CIO-DAC02 DAC (Digital to Analog Converter). Two back plates with 37 Pin Cable used with the Analog to Digital Converter. One back plate with 25 Pin Cable used with Digital to Analog
resistance
analog,
digital,
measurement,
counter, RTD
frequency,
measurements,
thermocouple reading, and strain gage reading. The output icons are designed to implement control processes such as open loop, closed-loop analog or digital, On/Off icons to control relays or actuators. Furthermore, the open and close loop icon can send a stream of analog output to the control device. The
107 Int. J Latest Trends Agr. Food Sci.
Vol-2 No 2 June 2012
interface of the system is in Engineering Units;
For the fuzzy logic control procedure, the
however, the true input and output are in 0-10 DC
optimum ventilation rates calculated by FLC were
volts.
converted to voltage using the regression curves. The resulting voltages were then plugged in C-Icon program to apply the fuzzy logic rules and send them
Control Computer
Digital Output
Analog A/D and D/A
Relays
Inverter
Sensors’
Greenhouse
Pad
Fan
to the inverter, which controlled the speed of the fans. Figure 3. Flow chart of the control algorithm. Control algorithm
System Response Measurement and Parameters: The deviation of a system response was evaluated by standard performance measures such as
The control algorithm was designed to do the following: Four On/Off icons were assigned to send
rise time, peak time, overshoot, settling time, and steady state error.
signals to the relays that control pumps, heater, back shutters, and front shutters as shown in Figure 3.
1.
The rise time The rise time is the time that the response of
One analog closed-loop icon was assigned to control the inverter by sending 0-10 volts as decided by the closed-loop control. Through this analog icon,
a system takes to reach the desired set point of the system. 2.
The Peak Time
the PID parameters were tuned until the optimum tuning was reached. Furthermore, the PID values of the theoretical simulation were directly plugged into that icon to compare the two methods.
The peak time is the time that a response of a system takes to rise to the peak of the response.
108 Int. J Latest Trends Agr. Food Sci.
3.
Vol-2 No 2 June 2012
Overshoot
the experimental curve demonstrates a significant
The overshoot is the temperature value with which the response of a system overshoots the
overshoot with good tracking to the set point with a mean of 24.85°C.
Furthermore, the experimental
curve shows ripples that are due to the delay effect
desired set point.
mentioned earlier. 4.
Settling Time The experimental results of the ventilation rate
The settling is the time needed for a system response to settle with set point without fluctuation. 5.
demonstrated less fluctuation and good middle values, which indicates a good control of the fan speed to keep up with the set point as shown in
Steady State error
The steady state error is the error appears after the decay of the transient response and after continuous pattern is achieved.
Figure (6). Proportional Derivative Controller Test (PD) The implementation of the optimized values PD theoretically and experimentally resulted in no
4. Results and Discussion The following tests were conducted at noon or just afternoon to test the cooling system and controller in the extreme summer conditions. All the tests were performed to cool the greenhouse from 40 °C to 25 °C to assure fair comparison.
overshoot for the experimental air temperature drop as shown in Figure (7).
Furthermore, the mean
temperature around the set point was 25.32°C. This test showed a good control of all the curves because of the few ripples existed with the delay effect. Smooth steady theoretical behavior is shown in the
Proportional Controller Test (P)
graph.
Applying the best value of the P theoretically
The experimental ventilation rate shown in
and experimentally, gave the results depicted in
Figure (8) indicates an optimum control among all
Figure (4). The theoretical graph shows a smooth
the experimental control curves. In this curve, there
temperature drop and an overall steadiness, except a
is less fluctuation or on/off effect, whereas most of its
little overshoot below the set point. On the other
ventilation rate was around the middle 2.2 – 2.7 m3/s.
hand, the experimental results of this test show a
Full capacity of ventilation 4.35 m3/s is demonstrated
close overall agreement with the theoretical except
from the beginning of the test to the attainment of the
that the curve is not smooth.
set point in a time exactly as the drop time of
An overshoot of
0.093°C is observed in the system response. A delay existed in the graph that is probably due to the uneven air distribution and delay of the fan response. A mean of 24.88 °C was obtained during this test.
representation
using
Proportional Integral Derivative Controller Test (PID) The behavior of temperature at the optimum PID
Proportional-Integral Controller Test (PI) Temperature
temperature, which is 156 seconds.
values is shown in Figure (9). Smooth theoretical the
PI
temperature behavior is shown in the figure with
optimized parameters values are depicted in Figure
slight
(5). The theoretical simulation and the actual data
Experimentally there was more overshoot and delay
amount
of
overshoot
but
no
ripples.
are showing a very close agreement. However, there
fluctuations around the set point. Little delay existed
is a significant drop time difference between them.
at the beginning of the experiment for about 10
The theoretical simulation curve shows a general
seconds, which might be attributed to the air mixing
steady behavior except that it has a little overshoot
delay. The PID controller made a good tracking to set
below the set point and ripples around it. Whereas,
point with a mean of 24.79°C.
109 Int. J Latest Trends Agr. Food Sci.
Vol-2 No 2 June 2012
mean temperature to the set point, which are 24.9.
Fuzzy Logic Controller (FLC) The optimized fuzzy logic control parameter was plugged into the theoretical and experimental
However, it made highest settling time and overshoot of 228 seconds and 1.1865°C respectively.
5. Conclusion
controllers and resulted in the two curves depicted in Figure (10). Some wrinkles existed in the theoretical
1.
All controllers were able to control the
curve at the intersection with the set point; however,
greenhouse air temperatures precisely within a
the rest of the curve is smooth. On the other hand,
reasonable range of error.
experimental test of the fuzzy logic control, showed
2.
The PI controller showed the shortest overshoot
good agreement with the theoretical except little
time, which is 126 seconds, with no overshoot,
divergence from the experiment start to about 100
short settling time, and minimum error.
seconds.
Good tracking of the set point is
demonstrated
with
an
average
of
3.
The P controller was able to keep lowest error
4.
The PD controller showed no overshoot and
24.92°C.
Nevertheless, the experimental ventilation rate in
off the set point. minimum error.
Figure (11) shows a better behavior from the start time until the drop time of the temperature, which is
5.
The FL controller was easy to implement and
184 seconds. Yet all of the control was similar to an
was very effective in tracking the set point.
on/off and no in between values of ventilation rate.
Moreover, it made the best average set point.
Comparison between the Five Controllers
6.
The little divergence between the theoretical and experimental results could be attributed to the
All the theoretical curves are within the same
unstable disturbances of the solar radiation, heat
drop time but different wrinkling behavior around the
transfer, and possibly turbulence that resulted
set point. Looking at the experimental curves P and FLC gave similar drop time behavior, whereas, the
from the distribution fan currents. 7.
The delay in the fan response was due to the fact
other controllers namely, PI, PD, and PID were
that the data were collected every two seconds
almost coincident in their drop.
and the fan takes five seconds to reach its full
Table (1) shows the comparison between the five
speed and approximately another two seconds to
control systems theoretically and experimentally. The
redistribute the new temperature wave to the
five essential system response measurements to
entire greenhouse. This delay is what appears as
distinguish between curves are rise time, overshoot,
ripples in the air temperature drop curves.
settling time, steady state error, and mean. The curve
8.
curves can be attributed to the delay in pad
that has short rise time, settling time, minimum
saturation and the air mixing.
overshoot, minimal error, and close mean to set point is considered the best controlled curve. From the
The beginning delay in some of the experimental
9.
Although there was a difference between the
table, PI controller and PD controller showed the best
theoretical and the actual greenhouse models, the
overall behavior in rise time, settling time, overshoot
optimization through the mathematical model
and errors, which respectively 126-156, 132-194, 0-0.
showed good control of the greenhouse climate
This means that they are better to be used in the
and shortened the tuning time, whereas, the
greenhouse control. On the other hand, the P
experiment might last days to get good tuning
controller showed the least maximum and minimum
parameters through manual tuning because of the
error which are -0.812 to 1.18°C from the set point
weather dependency.
whereas the PID showed the highest Maximum and
10. Taking into consideration the simplicity of the
minimum error which are –1.48 to 2.34 from the set
fuzzy logic controller design and adjustment, the
point.
fuzzy logic controller has the advantage that it
The fuzzy logic controller has the closest
110 Int. J Latest Trends Agr. Food Sci.
Vol-2 No 2 June 2012
can be designed and adjusted by some one who
3136. St. Joseph, Michigan, USA.
doesn’t have engineering background. In other
[6] Albright L. D. 1990. Environment Control for
words
it
doesn’t
need
a
background
in
Animals and Plants. The American Society
mathematical modeling to implement it.
of Agricultural Engineers. 2950 Niles Road, St. Joseph, Michigan 49085-9659,
References
USA.
[1] Takakura, T., T. O. Manning, G.A. Giacomelli,
[7] Edwards D. and H. T. Choi. 1997. Use of Fuzzy
And W. J. Roberts.1994. Feedforward
Logic to Calculate the Statistical Properties
Control for A Floor Heat Greenhouse.
of Strange Attractors in Chaotic Systems.
Transactions of the American Society of
Fuzzy Sets and Systems 88(1997) 205-217.
Agricultural Engineers 37(3): 939-945. [2] Chao, K. and R. S. Gates. 1996. Design of Switching Control Systems for Ventilated Greenhouses. Transactions of the American Society
of
Agricultural
Engineers
39(4):1513-1523. [3] Ehrlich, H., M. Kuhne, and J. Jakel. 1996. Development of Fuzzy Control System for Greenhouses. Acta Horticulturae 406:463470. [4] Zhang, Y. and L. Christianson. 1991. An Introduction of Fuzzy Control for moisture Balance Ventilation. American Society of Agricultural Engineers Paper No.91-4077. St. Joseph, Michigan, USA.
[5] Gates, R. S., K. Chao, and N. Sigrimis. 1999. Fuzzy Control Simulation of Plant and Animal Environments. American Society of Agricultural Engineers Paper No.99-
Tables Table 1. Comparison between the five control systems theoretically and experimentally. Controller P PI PD PID FLC
Theoretical Experimental Theoretical Experimental Theoretical Experimental Theoretical Experimental Theoretical Experimental
Rise Time (s) 182 190 182 126 194 156 182 132 192 184
Overshoot (°C) 0.1 0.0935 0.1 0.0 0.1 0.0 0.1 0.3364 0.1 1.1865
Settling Time(s) 192 194 192 132 226 194 192 144 196 228
Mean (°C) 25 24.8 25.1 24.8 25.2 25.3 25 24.7 25 24.9
Set Point Error (°C) Max Min 0.1 -0.1 1.18 -.812 0.2 -0.3 1.55 -1.12 0.0 -0.4 1.42 -1.48 0.2 -0.2 2.34 -1.48 0.1 -0.1 1.42 -1.30
111 Int. J Latest Trends Agr. Food Sci.
Vol-2 No 2 June 2012
Figures T h e o rit ic a l a n d E x p e rim e n t a l R e s u lt s u s in g P = 4 3 7 . 7 50
45
Temperature (°C)
40
35
30
25
20
0
100
200
300
400
500 T i m e (s )
600
700
800
900
1000
Figure 4. Theoretical and experimental results of air temperature behavior using P controller T h e o r i t i c a l a n d E x p e r i m e n t a l R e s u lt s u s in g P = 2 1 . 9 3 7 5 ; I= . 0 0 0 7 6 5 6 2 ; 50
45
Temperature (°C)
40
35
30
25
20
0
1 00
200
3 00
40 0
500 T im e (s )
60 0
700
800
900
1 000
Figure 5. Theoretical and experimental results of air temperature behavior using PI controller Th e E x p e rim e n t a l V e n t ila t io n R a t e o f th e P I C o n t ro lle r 5 4.5 4
Ventilation Rate m3/s
3.5 3 2.5 2 1.5 1 0.5 0
0
100
200
300
400
500 Tim e (s )
600
700
800
900
1000
Figure 6. Experimental results of ventilation rate using PI controller Th e o rit ic a l a n d E x p e rim e n t a l R e s u lt s u s in g P = 1 0 . 0 6 8 8 , D = 0 . 0 1 8 7 50
45
Temperature (°C)
40
35
30
25
20 0
100
200
300
400
500 Tim e (s )
600
700
800
900
1000
Figure 7. Theoretical and experimental results of air temperature behavior using PD controller
112 Int. J Latest Trends Agr. Food Sci.
Vol-2 No 2 June 2012
Th e E x p e rim e n t a l V e n t ila t io n R a t e o f t h e P D C o n t ro lle r 5 4 .5 4
Ventilation Rate m3/s
3 .5 3 2 .5 2 1 .5 1 0 .5 0 0
100
200
300
400
500 Tim e (s )
600
700
800
900
1000
Figure 8. Experimental results of ventilation rate using PD controller. T h e o ri t i c a l a n d E x p e ri m e n t a l R e s u l t s u s i n g P = 4 8 3 . 0 5 5 6 I= . 0 0 1 1 D = 0 . 0 9 8 3 50
45
Temperature (°C)
40
35
30
25
20
0
100
200
300
400
500 T i m e (s )
600
700
800
900
1000
Figure 9. Theoretical and experimental results of air temperature behavior using PID controller T h e o ri t i c a l a n d E x p e r i m e n t a l F L C R e s u l t s , E r ro r = 0 . 0 0 2 2 , V e n t i l a t i o n R a t e = 4 . 1 7 3 8 50
45
Temperature (°C)
40
35
30
25
20
0
100
200
300
400
500 T i m e (s )
600
700
800
900
1000
Figure 10. Theoretical and experimental results of air temperature behavior using FLC controller. T h e E x p e ri m e n t a l V e n t i la t io n R a t e o f t h e F u z z y L o g ic C o n t ro ll e r 5 4.5 4
Ventilation Rate m3/s
3.5 3 2.5 2 1.5 1 0.5 0
0
100
200
300
400
500 T im e ( s )
600
700
800
900
1000