Microsoft Word - 17-2871_s_ETASR_V9_N4_pp4405-4410 Engineering, Technology & Applied Science Research Vol. 9, No. 4, 2019, 4405-4410 4405 www.etasr.com Jomaa et al.: Greenhouse Modeling, Validation and Climate Control based on Fuzzy Logic Greenhouse Modeling, Validation and Climate Control based on Fuzzy Logic Manel Jomaa UR-LAPER, Department of Physics, Faculty of Sciences of Tunis, University of Tunis El Manar, Tunis, Tunisia manel.jomaa@enit.utm.tn Fernando Tadeo Departamento de Ingenieria de Sistemas y Automatica, Institute of Sustainable Processes, University of Valladolid, Valladolid, Spain fernando.tadeo@uva.es Mehdi Abbes Laboratoire Analyse et Commande des Systemes, National Engineering School of Tunis, Tunis, Tunisia mehdi.abbes@enit.rnu.tn Abdelkader Mami UR-LAPER, Department of Physics, Faculty of Sciences of Tunis, University of Tunis El Manar, Tunis, Tunisia abdelkader.mami@fst.utm.tn Abstract—This paper deals with the modeling and control of the air temperature and humidity in greenhouses. A physical model of the greenhouse used in the Simulink/Matlab environment is elaborated to simulate both temperature and indoor humidity. As a solution to the non-linearity and complexity of the greenhouse system, a fuzzy logic method is developed to control the actuators that are installed inside the greenhouse for heating, ventilation, humidification and cooling to obtain a suitable microclimate. Keywords-greenhouse; fuzzy logic controller; air temperature; humidity; Simulink; Matlab I. INTRODUCTION Agricultural production is a central economy field in many countries. Tunisia is considered one of the best worldwide agricultural product exporters. Nowadays, greenhouse is the main solution to climate change effects. Its main purpose is to effectively control the environment and protect the plants by creating a favorable climate. Among the conditions in a greenhouse, this paper focuses on indoor temperature and humidity. An optimal vegetation yield can be produced from the precise configuration of these conditions [1]. Numerous methods of greenhouse control have been studied and developed. The regulations inside the greenhouse consist of evaporation, fogging and ventilation systems. This paper presents a control system useful for adaptation despite the non- linearity and complexity of greenhouse dynamics [2, 3]. Various types of climate control greenhouse systems have been previously mentioned. In [4, 5], a feedback controller approach has been discussed. The type of climate control mentioned in [6] has been developed to the optimal control method. Neural networks were studied in [7-9]. Authors in [10, 11] offer a regulation of temperature and humidity inside the greenhouse with a fuzzy logic regulator. In [12], the Takagi-Sugeno method of the air temperature control is described. In [13-15], model predictive control (MPC) was used. The proposed work starts with the simulation of the dynamic greenhouse model followed by its validation and its control via Fuzzy Logic. II. GREENHOUSE MODEL The model of the proposed input-output system can be seen in [16]. The considered variables are: intT is the interior temperature and intH is the humidity variable. The adjustment of these variables will be obtained by αMV which is the ventilation system, wMV which is the heating system, and fogMV which is the fogging system. The measurable disturbances consist of wind speed, solar radiation, and outside humidity and temperature [16]. A. Proposed Model The first step of the proposed study is the development of the dynamic model of the greenhouse using the Simulink/Matlab. Many physical models like the energy balance and mass balance have been suggested to describe the dynamics of the greenhouse climate [17, 18]. B. Greenhouse Model with Simulink A derived simple model is required to design a control system that analyzes and guesses the correct variables of cooling, heating and ventilation systems. The model consists of conventional dynamic equations that correspond to the indoor air temperature iT , soil temperature mT , and indoor humidity iX [17]. The differential equations are given by the heat and humidity balance. 1) Heat Balance The dynamic model of the air temperature and the thermal mass temperature inside the greenhouse are described by (1) Corresponding author: Manel Jomaa Engineering, Technology & Applied Science Research Vol. 9, No. 4, 2019, 4405-4410 4406 www.etasr.com Jomaa et al.: Greenhouse Modeling, Validation and Climate Control based on Fuzzy Logic and (9) [17]: ( ) dTi v c Q Q Q C Q Q Q Wi p s cc m sat e n v dt ρ = − + − + − + (1) where: sQ is the solar energy supplied to the air volume determined by (2): 0SiAsQ τ= (2) ccQ is the energy exchange by the conduction and the convection phenomena that are explained using (3): ( )oTiTcAiAccQ −= (3) mQ is the energy exchange between the thermal mass and the inside air determined by (4): ( )iTmTmhiAmQ −= (4) eQ is the energy loss due to the crop evapotranspiration: eQ Eλ= (5) nQ is the energy loss by the nebulization: nQ fogλ= (6) vQ is the energy exchange due to the window ventilation: ( )v p i oQ c G T Tρ= − (7) W is the energy provided from the heating system: max 100 wMV W W= (8) The thermal mass temperature inside the greenhouse is described by (9): m i m sm m f dT A C Q Q Q dt = − − (9) Knowing that: sm m sQ Qα= (10) Equation (10) is the energy stored by the thermal mass during the day and (11) is the energy loss through the ground: m ref f i a ref T T Q A k Z  − =       (11) 2) Humidity Balance The model of the relative humidity inside the greenhouse is determined by (12) [17]: ( )ii v sat dX V F C E fog dt ρ = + + (12) where: vF is the water rate in the air renewal flow: ( )v o iF G X Xρ= − (13) E is the crop evapotranspiration identified by (14): ( )2 1 i n p iA R L c D gwb E gwb gws ρ γ λ ∆ + =     ∆ + +        (14) fog is the water rate of the fogging system: max 100 fogMV fog fog   =     (15) The greenhouse that is used for the validation is situated at the C.R.T.EN Borj Cedria Park of science and technology in Tunisia, in a semi-urban environment. The greenhouse axes are in the East-West direction. The dimensions are 12.5m length, 8m width and 3m height. The acquisition of both external weather conditions (wind speed, temperature, radiation, and humidity) and internal climate greenhouse data are connected to a Campbell 21X data logger. The measurements of external and internal relative humidity are performed via HMP35C sensors with 3% precision and a range between 0% and 100%. The external and internal temperatures are measured in a range from -35°C to +50°C. The solar radiation is measured by a pyranometer with 5% precision [3]. Figure 1 shows the solar radiation measured in the 29th, 30th and 31st of March, 2001 whereas Figure 2 presents the wind speed, measured at the same dates. Fig. 1. Reached cover solar radiations, March, 29–31, 2001 Fig. 2. Wind speed March, 29–31, 2001 Figures 3-5 present the simulation results, for the same time period, of internal air temperature (K), internal soil temperature (K) and relative humidity (%). Engineering, Technology & Applied Science Research Vol. 9, No. 4, 2019, 4405-4410 4407 www.etasr.com Jomaa et al.: Greenhouse Modeling, Validation and Climate Control based on Fuzzy Logic Fig. 3. Simulation results of the air temperature inside the greenhouse Fig. 4. Simulation results of the soil temperature inside the greenhouse Fig. 5. Simulation results of the relative humidity inside the greenhouse The simulated results obtained via Simulink are compared with the detailed model discussed and described in [3]. The same parameters of the greenhouse are used in both cases. Fig. 6. Measured and simulated internal air temperatures Fig. 7. Measured and simulated results of internal air humidity Figure 6 presents the simulated and measured indoor air temperature. Figure 7 shows the simulated and measured results of the indoor relative humidity. It can be seen that a good agreement is obtained between the simulated and the measured results of both temperature and relative humidity. In order to activate the actuators, power should be supplied. In this case, a logic control is selected and its pseudo-code is briefly described in Figure 8. Figures 9-11 present the heating, ventilation and humidifying rates that are delivered by the control algorithm in Figure 8. Fig. 8. Algorithm block diagram Fig. 9. Heating rate Fig. 10. Ventilation rate Fig. 11. Humidifying rate Engineering, Technology & Applied Science Research Vol. 9, No. 4, 2019, 4405-4410 4408 www.etasr.com Jomaa et al.: Greenhouse Modeling, Validation and Climate Control based on Fuzzy Logic III. FUZZY LOGIC CONTROLLER Fuzzy logic has been considered an attractive solution for various engineering problems due to features such as its robustness, simplicity and flexibility. Three stages must be satisfied to design this type of control system: Fuzzification, inference rules and defuzzification [20]. The main aim of this system is to control the climate inside the greenhouse and boost its effectiveness. A. The Structure of The Control System The input variables of temperature and humidity in the fuzzy logic controller are represented by T∆ with outside temperature and H∆ with outside humidity knowing that: ( ), , , ,T T T NB NM Z PM PBdesired indoor∆ = − ∈ (16) where outside temperature ∈(PM, Z, PG). ( ), , , ,H H H NB NM Z PM PBdesired indoor∆ = − ∈ (17) and outside humidity ∈(PM, Z, GP) where         BigPositivePB MediumPositivePM ZeroZ MediumNegativeNM BigNegativeNB _: _: : _: _:      BigPositivePB ZeroZ MediumPositivePM _: : _: The methodology described in Figure 8 was used to develop this command. During the control we took into account the external environmental conditions (outside temperature and outside humidity). The output variables are the heating rate (Heating), the ventilation rate (Ventilation) and the humidifying rate (Humidifying). (Heating, Ventilation) ∈ (Zero, Medium, High) (Humidifying) ∈ (Zero, Medium, High) The fuzzy inference method that is used in this work is the Mamdani method and the defuzzification technique is based on the center of gravity method. B. Decoupling Fuzzy Logic Controller Figure 12 presents the input variables of the temperature and outside temperature and Figure 13 presents the input variables of the humidity and outside humidity. Figure 15 presents the output variables of heating, ventilation and humidifying rates. IV. SIMULATION RESULTS The main objective of control is to smoothly regulate air temperature and humidity inside the greenhouse to their desired values ( desiredT , desiredH ). We controlled the actuators by lowering their rates in order to reduce energy. The value of the desired temperature is 15°C at night and 28°C at day. The desired relative humidity is 70%. The tracking performance of temperature and humidity inside the greenhouse are illustrated in Figures 15 and 16 during simulation time of one day. Fig. 12. Membership functions of temperature error (∆T) and outside temperature Fig. 13. Membership functions of humidity error (∆H) and outside humidity Fig. 14. Membership functions of heating, ventilation and humidifying rates Engineering, Technology & Applied Science Research Vol. 9, No. 4, 2019, 4405-4410 4409 www.etasr.com Jomaa et al.: Greenhouse Modeling, Validation and Climate Control based on Fuzzy Logic Fig. 15. Simulation results of the greenhouse temperature with fuzzy logic controller Fig. 16. Simulation results of the greenhouse humidity with fuzzy logic controller The provided heating and ventilation rates are displayed in Figures 17 and Figure 18. A regulator fuzzy logic controller is applied to control the humidifying system in order to regulate the relative humidity at its set point value, as presented in Figure 19. Fig. 17. Heating rate Fig. 18. Ventilation rate Fig. 19. Humidifying rate V. CONCLUSION In this article, a greenhouse model has been proposed and validated. A comparison between the simulated and measured results of the internal air temperature and the relative humidity has been made using the parameters proposed in [3]. A good agreement has been obtained between the calculated and measured data, which indicates the efficiency of the proposed model. Based on this model, a fuzzy logic controller has been developed to satisfy the demands in terms of temperature and humidity, using the measured data. The results showed a stable behavior of both temperature and humidity with a low rate of heating, ventilation and humidification. This behavior has been achieved without using the dehumidifier system in order to reduce energy consumption. In the future, we will focus on developing an improved control model for the greenhouse climate and testing the stability and robustness of the fuzzy logic controller with more variables representing the complete state of the greenhouse. In addition, we will design a power system based on renewable energy sources in order to reduce the use of grid utilities. NOMENCLATURE A [m²] Windows area [50m²] a Constant for renewal volumetric flow Ac Loss coefficient of conduction and convection Ai [m²] Greenhouse surface area [100m²] Cm Thermal mass heat capacity Cp [J Kg -1 °C -1 ] Air heat capacity [1003J·Kg -1 °C -1 ] Csat Air saturation coefficient Di [kpa] Air water vapor deficit E [kgH2O S -1 ] Crop evapotranspiration fog[kgH2O S -1 ] Water rate of fogging system Fv [kgH2O S -1 ] Water rate in the air renewal flow G [m 3 S -1 ] Renewal air flow gwb [m S -1 ] Boundary-layer conductance gws [m S -1 ] Stomatal conductance hm [W m -1 K -1 ] Conductivity coefficient between air and thermal mass Hi [%] Inside relative humidity Ho [%] Outside relative humidity L Leaves area index MVfog [%] Fogging system manipulated variable MVw [%] Heating system manipulated variable MVα [%] Windows opening manipulated variable psat [kPa] Saturation pressure p [kPa] Atmospheric pressure [98.1kPa] Qcc [W] Energy exchange by conduction and convection phenomena Qe [W] Energy loss due to crop evapotranspiration Qf [W] Energy loss through ground Qm [W] Energy exchange with thermal mass Qn [W] Energy loss by nebulization Qs [W] Solar energy supplied to air volume Qsm [W] Energy stored by thermal mass during the day Qv [W] Energy exchange due to window ventilation Rn [W m -2 ] Solar radiation absorbed by the crop So [W m -2 ] Solar radiation Ti [°C] Inside temperature Tm [°C] Thermal mass temperature To [°C] Outside temperature Tref [°C] Ground temperature at reference depth Vi [m 3 ] Greenhouse volume [300m 3 ] V [ms -1 ] Wind speed W [W] Energy from the heating system Wmax [W] Maximum power of the heating system Xi [kgH2O kgair -1 ] Inside absolute humidity Engineering, Technology & Applied Science Research Vol. 9, No. 4, 2019, 4405-4410 4410 www.etasr.com Jomaa et al.: Greenhouse Modeling, Validation and Climate Control based on Fuzzy Logic Xo [kgH2O kgair -1 ] Outside absolute humidity Xsat [kgH2O kgair -1 ] Absolute saturation humidity Zref [m] Reference depth α [°] Opening window angle ∆ [kPa °C -1 ] Slope of water vapor saturation γ [kPa °C -1 ] Psychometric constant λ [J Kg -1 ] Latent heat of vaporization ρ [Kgair m -3 ] Air density [1.25 Kgair m -3 ] τ Transmission coefficient of the greenhouse REFERENCES [1] L. M. Mortensen, “Growth responses of some greenhouse plants to environment: III. Design and function of a growth chamber prototype”, Scientia Horticulturae, Vol. 16, No. 1, pp. 57-63, 1982 [2] L. Meihui, D. Shangfeng, C. Lijun, H. Yaofeng, “Greenhouse Multi- Variables Control by Using Feedback Linearization Decoupling Method”, Chinese Automation Congress, Jinan, China, Octomber 20-22, 2017 [3] M. Abbes, A. Farhat, A. Mami, G. D. Tanguy, “Pseudo bond graph model of coupled heat and mass transfers in a plastic tunnel greenhouse”, Simulation Modelling Practice and Theory, Vol. 18, No. 9, pp. 1327-1341, 2010 [4] G. D. Pasgianos, K. G. Arvanitis, P. Polycarpou, N. Sigrimis, “A nonlinear feedback technique for greenhouse environmental control”, Computer and Electronics Agriculture, Vol. 40, No. 1-3, pp. 153-177, 2003 [5] C. J. Taylor, P. C. Young, A. Chotai, A. R. Mcleod, A. R. Glasock, “Modelling and proportional-integral-plus control design for free air carbon dioxide enrichment systems”, Journal of Agricultural Engineering Research, Vol. 75, No. 4, pp. 365-374, 2000 [6] E. J. V. Henten, J. Bontsema, “Time-scale decomposition of an optimal control problem in greenhouse climate management”, Control Engineering Practice, Vol. 17, No. 1, pp. 88-96, 2009 [7] X. Luan, P. Shi, F. Liu, “Robust adaptive control for greenhouse climate using neural networks”, International Journal of Robust and Nonlinear Control, Vol. 21, No. 7, pp. 815–826, 2011 [8] R. Linker, I. Seginer, P. O. Gutman, “Optimal CO2 control in a greenhouse modeled with neural networks”, Computers and Electronics in Agriculture, Vol. 19, No. 3, pp. 289–310, 1998 [9] P. M. Ferreira, E. A. Faria, A. E. Ruano, “Neural network models in greenhouse air temperature prediction”, Neurocomputing, Vol. 43, No. 1-4, pp. 51-75, 2002 [10] M. Azaza, K. Echaieb, F. Tadeo, E. Fabrizio, A. Iqbal, A. Mami, “Fuzzy decoupling control of greenhouse climate”, Arabian Journal for Science and Engineering, Vol. 40, No. 9, pp. 2805-2812, 2015 [11] P. Salgado, J. B. Cunha, “Greenhouse climate hierarchical fuzzy modelling”, Control Engineering Practice, Vol. 13, No. 5, pp. 613–628, 2005 [12] M. Nachidi, F. Rodriguez, F. Tadeo, J. L. Guzman, “Takagi-sugeno control of nocturnal temperature in greenhouses using air heating”, ISA Transactions, Vol. 50, No. 2, pp. 315-320, 2011 [13] M. Y. E. Ghoumari, H. J. Tantau, J. Serrano, “Non-linear constrained MPC: Real-time implementation of greenhouse air temperature control”, Computers and Electronics in Agriculture, Vol. 49, No. 3, pp. 345–356, 2005 [14] J. P. Coelho, P. B. de Moura Oliveira, J. B. Cunha, “Greenhouse air temperature predictive control using the particle swarm optimisation algorithm”, Computers and Electronics in Agriculture, Vol. 49, No. 3, pp. 330–344, 2005 [15] Q. Zou, J. Ji, S. Zhang, M. Shi, Y. Luo, “Model Predictive Control Based on Particle Swarm Optimization of Greenhouse Climate for Saving Energy Consumption”, World Automation Congress, Kobe, Japan, September 19-23, 2010 [16] M. Jomaa, F. Tadeo, A. Mami, “Modelling and Control of Greenhouses Powered by a Renewable Energy System”, 18th International Conference on Sciences and Techniques of Automatic Control and Computer Engineering, Monastir, Tunisia, December 21-23, 2017 [17] X. Blasco, M. Martinez, J. M. Herrero, C. Ramos, J. Sanchis, “Model- based predictive control of greenhouse climate for reducing energy and water consumption”, Computers and Electronics in Agriculture, Vol. 55, No. 1, pp. 49-70, 2007 [18] K. A. Joudi, A. A. Farhan, “A dynamic model and an experimental study for the internal air soil temperatures in an innovative greenhouse”, Energy Conversion and Management, Vol. 91, pp. 76-82, 2015 [19] R. C. Miranda, E. V. Ramos, R. R. Peniche-Vera, G. Herrera-Ruiz, “Fuzzy greenhouse climate control system based on a field programmable gate array”, Biosystems Engineering, Vol. 94, No. 2, pp. 165-177, 2006