Next Article in Journal
Effects of Shelterbelt Transformation on Soil Aggregates Characterization and Erodibility in China Black Soil Farmland
Previous Article in Journal
Does Digital Finance Increase Relatively Large-Scale Farmers’ Agricultural Income through the Allocation of Production Factors? Evidence from China
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Practical Hybrid Control Approach for a Greenhouse Microclimate: A Hardware-in-the-Loop Implementation

1
Departamento de Automatización y Control Industrial, Escuela Politécnica Nacional, Quito 170525, Ecuador
2
Facultad de Ingenieria Agronomica, Universidad Técnica de Manabi, Porto Viejo 130105, Ecuador
3
Colegio de Ciencias e Ingenierias, Universidad San Francisco de Quito USFQ, Campus Cumbayá, Casilla Postal 17-1200-841, Quito 170157, Ecuador
*
Author to whom correspondence should be addressed.
Agriculture 2022, 12(11), 1916; https://doi.org/10.3390/agriculture12111916
Submission received: 11 October 2022 / Revised: 4 November 2022 / Accepted: 9 November 2022 / Published: 14 November 2022
(This article belongs to the Section Agricultural Systems and Management)

Abstract

:
In the present work, a hybrid scheme based on the on–off, PID, and Fuzzy-PI controllers is shown, which was applied to the model of a greenhouse for the control of the vapor pressure deficit inside the greenhouse ( V P D i n ) through variables for heating and cooling around operating points 0.55 (kPa) and 1.0 (kPa), respectively. The implementation of the hybrid scheme was carried out under the concept of hardware-in-the-loop. The performance tests indicated satisfactory results that can be applied to greenhouses.

1. Introduction

We inherited resources that have existed for hundreds of thousands of years; therefore, everything consumed by humans today originates from agriculture, cattle and fishing.
Furthermore, there are challenges due to the reduction of cultivated space, climate change, the need to use more sustainable production processes, and world population growth projections.
The contexts associated with the previous paragraphs indicate the importance for humanity to pay attention to agriculture and its impacts on the future. Furthermore, this shows that we must work together to produce solutions that can lessen the impacts that future climate scenarios and population growth will have on humanity.
Greenhouse production is gaining importance due to the efficiency in the use of water and nutrients, the possibility of producing crops in settings with severe soil-based production limits, and intentions to generate higher quality and ecologically friendly yields. Greenhouses are physical structures covered by translucent materials that serve to create specific microclimates and protect crops from stressful changes produced by excessive radiation that leads to high temperatures, very low temperatures, cold, pests, and animals, so that optimal conditions are obtained in the different stages of crop growth. In addition, it allows the production of out-of-season horticultural crops. The goal is to make as many products as possible at the highest quality and lowest cost.
The flexibility of greenhouses has made them structures for cultivation, for propagating huge quantities of seedlings, producing grass through hydroponic systems, and displaying plants from various environments in botanical gardens. Globally, greenhouse crops are grown under a wide range of climatic circumstances. Consequently, greenhouses are constructed with various components, structural shapes, and glazing materials to provide optimal environmental conditions for plant growth. Consequently, they function differently under each circumstance.
The various elements that make up a greenhouse as well as the multiple relationships make it a complex system in which energy, mass, and information are dynamic and of different magnitudes.
The crop is the main element of the system. It has different variables, such as climatic variations (temperature, humidity, active photosynthetic radiation, and carbon dioxide), nutrition (water and nutrients), biotics (pests, diseases, viruses, bacteria, and weeds), and cultural management (pruning, planting distances, fumigation).
These variables interact with each other with a high level of complexity, so it is necessary to examine and identify them in subsystems and, thus, achieve detailed knowledge of all interactions and processes.
With advances in computer technologies, it has become possible to monitor and control various parameters and implement more sophisticated control strategies based on modern control theories. These control schemes rely on mathematical models that describe the dynamics of the coupled crop–greenhouse systems to adjust setpoints dynamically to optimize crop growth for a given yield criterion.
Modern technologies, such as biotechnology and automatic control, have been applied to greenhouse cultivation; the greenhouse industry is quickly improving due to the rapid development of science and technology [1].
Greenhouse production is distributed from chilly high latitudes to hot equatorial latitudes. In these latter greenhouses, they are distributed from regions at altitudes of 2500 m to near sea level. In certain industrialized countries, sophisticated greenhouses can overcome adverse climate effects, such as extreme cold and heat, and produce crops yearly, improving agricultural yield and quality. However, greenhouse production is relatively backward in many other countries, particularly in poor countries, and is mainly utilized for off-season cultivation of low-quality–low-yielding crops.
Due to the complexities of greenhouse environments (including lags, multiple inputs, and multiple outputs (MIMO) [2], nonlinearity and difficulty in mathematical modeling), the implementation of classical control methods is difficult.
As a result of highly nonlinear interactions between biological and physical subsystems and the strong coupling of the two main control variables, temperature, and humidity, maintaining a stable greenhouse climate is difficult [2]. Temperature and humidity controls are crucial in next-generation greenhouses. Plants require optimum temperature/humidity and vapor pressure deficit conditions inside the greenhouse for optimum yield.
The main ways to control the climate inside a greenhouse include ventilation and heating, i.e., to modify the inside temperature and humidity conditions, shading and artificial light to change internal radiation, CO 2 injection to influence photosynthesis, and fogging/misting for humidity enrichment [3].
Several control techniques have been applied to greenhouses. Let us begin with optimal control; the solution methods are numerous and can be divided into indirect, which uses the Pontryagin minimum principle, and direct, which transforms the optimal problem into a nonlinear programming problem. Model predictive control (MPC) [4] includes different solutions using variable states and other autoregressive models. Robust control [5], adaptive control [6,7], intelligent control [8], fuzzy control [9], neural control [10], bioinspired control [11], and hybrid control [12,13,14]. The latter is an alternative that allows controllers to be designed within an operating range; they are a combination of simple control schemes to obtain a new controller that takes advantage of the positive characteristics of each one, which would not be achieved if it were a single controller; each one—in its range of operation—is designed to handle a manipulated variable and, thus, contribute to the hybrid scheme.
In this work, the greenhouse model proposed by [15] was used and validated using real data from [16]. Once the model is validated, a proportional–integral–derivative (PID), fuzzy logic (FL), and on–off controls were combined as a hybrid scheme to control the vapor pressure deficit (VPD) and keep temperature and humidity as close as possible around a setpoint despite disturbances. The proposed hybrid controller was implemented using the hardware-in-the-loop simulation [17] and then evaluated to see its performance (regarding disturbances) and the possibility of using it in a real greenhouse.
To summarize, a simple and effective alternative control strategy was developed to control the microclimate in the greenhouse. The greenhouse control problem is multivariable, but it may be handled by regulating a single variable called the vapor pressure deficit (VPD); the VPD has a relationship with the temperature and humidity variables; hence, adjusting VPD impacts both temperature and humidity. Furthermore, since the hybrid controller works in operating ranges for each variable that modifies the cooling or heating, it has shown how a multivariable problem can be solved simply if a hybrid scheme is applied as the strategy proposed in this work.
This document is organized as follows: Section 2 describes the mathematical model; in Section 3, the model validation is considered; Section 4 presents the control strategy approach; Section 5 shows the hybrid control design; in Section 6, the analysis of the results are presented, and finally the conclusions are offered.

2. Mathematical Model

This section presents the mathematical model for the greenhouse taken from [15]. First, the model is described, starting with differential equations that determine the internal dynamics of the greenhouse microclimate, then an analysis of the humidity units, a definition of VPD, and finally, identification and normalization of interest variables for the control system, are reviewed.

2.1. Greenhouse Climatic Dynamic Model

Mass and energy balance equations define the microclimate in the greenhouse; the physical elements considered in the interaction were ceiling, plants, floor, and air. From the mathematical analysis carried out by [15], the differential equations of temperature and humidity were obtained, which are detailed in Equations (1) and (2), respectively.
Figure 1 shows the representation of the greenhouse structure used, as well as the variables that interact in it, i.e., N % , S m % , E c % , H c a p % , as manipulated variables, and T i n , RH i n and VPD i n as control variables, which are detailed below in their ranges, units, and concepts.
Air temperature inside the greenhouse, in ( C):
d T i n d t = 1 C p × ρ × H [ Q G R i n + Q H e a t e r L × E ( T i n T o u t ) ( q v × C p × ρ + w × k ) ] .
Absolute air humidity inside the greenhouse, in ( kg w a t e r · kg d r y a i r 1 ):
d W i n d t = 1 H × ρ [ E ( W i n W o u t ) q v × ρ ]
where C p is the specific heat of moist air ( J · kg 1 · K 1 ), ρ is the specific mass of air ( kg d r y a i r · m 3 ), H is the average greenhouse height (m), Q G R i n is the global radiation absorbed within the greenhouse ( W · m 2 ) that is calculated with Equation (3), Q H e a t e r is the thermal energy provided by the heating system ( W · m 2 ) that is calculated with Equation (6), L is the latent heat of vaporization of water ( J · kg 1 ), E is the evapotranspiration rate within the greenhouse ( kg · m 2 · s 1 ) that is calculated in Equation (7), ( T i n T o u t ) is the temperature difference between the inside and outside of the greenhouse ( C), respectively; ( W i n W o u t ) is the absolute air humidity inside and outside the greenhouse ( kg w a t e r · kg d r y a i r 1 ), respectively; q v is the ventilation rate ( m · s 1 ) that is calculated in Equation (9), w is a ratio of the glazing ( A g l ) to ground ( A f l ) surfaces (dimensionless), k is the overall heat transfer coefficient ( W · m 2 · C 1 ).
Global radiation absorbed inside the greenhouse, ( W · m 2 ):
Q G R i n = τ c × ( 1 ρ g ) × Q G R o u t L
where τ c is the transmittance of the glazing material (dimensionless), ρ g is the reflectance of the solar radiation in the ground (dimensionless), Q G R o u t L is the global radiation outside the greenhouse limited by the shading mesh (which can be plastic material), in ( W · m 2 ) shown below in Equation (4):
Q G R o u t L = Q G R o u t × ( 1 M f )
where Q G R o u t is the global radiation outside the greenhouse ( W · m 2 ) and M f is the mesh factor (dimensionless) that blocks 0 to 30% of the solar radiation incident on the greenhouse, allowing only 0 to 70% to pass through.
In the mathematical model of the greenhouse obtained from [15], a blockage of up to 70% of solar radiation is mentioned, which is a bit exaggerated because it would not allow enough light to pass through to the crop; consequently, the rate of photosynthesis would be affected according to [18]. For this reason, this range was placed, in this way, an improvement to the original mathematical model is presented in Equation (5).
M f = 0.3 100 × S m
where S m is the shading mesh factor (%); this is one of the manipulated variables that can be used to control the microclimate inside the greenhouse.
The heating system provides thermal radiation that is added to the one already contained in the greenhouse in ( W · m 2 ), which is shown below in Equation (6):
Q H e a t e r = N H × H c a p A f l
where N H is the number of heaters (1 for this work), H c a p is the heater capacity (W), and A f l is the area of the greenhouse floor surface (m 2 ).
The effect produced by the evaporative cooling system ( E C ) adds to the transpiration of the crop ( E T ), which is known as the evapotranspiration rate (E), given in units of ( kg · m 2 · s 1 ) in Equation (7):
E = E C + E T × 1 24 × 3600
where E C according to [15] is the evaporative cooling system that is a generic term for some type of fogging, given in units of ( kg · m 2 · d 1 ); this is another manipulated variable that can be used to control the microclimate inside the greenhouse. The crop transpiration, according to the quantity ( E T ) in one day ( kg · m 2 · d 1 ), which is shown in Equation (8), and depending on the case, one of three options can be used:
E T = 0.0003 × τ c × Q G R o u t L + 0.0021 for large crop 0.00006 × τ c × Q G R o u t L + 0.0004 for small crop 0 for no crop
The ventilation rate q v given in ( m · s 1 ) explains the physical meaning that is generated when opening or closing elements (side windows, zenithal windows, or some other mobile elements, even if it is forced ventilation), which allows the recirculation of external air with internal air as the greater opening, and will tend to look at the internal microclimate, such as the external one. Equation (9) describes what was mentioned,
q v = 0.187 0.003 120 2 × N 2 + 0.003
where N is the ventilation factor given by [15] in the range of 2 to 120 (h 1 ); this is one of the manipulated variables that can be used to control the microclimate inside the greenhouse.

2.2. Analysis of Units for Humidity

This subsection introduces the change from absolute to relative humidity units, then from relative to absolute units. Due to [15], the mathematical model for humidity is expressed in units of ( kg w a t e r · kg d r y a i r 1 ) because it refers to absolute humidity, while the commonalities for both the input and output of the greenhouse are expressed in units of relative humidity (%) because they provide more intuitive data; moreover, these are the units used by most humidity sensors, climatic databases, etc.
An improvement was investigated in [19,20] to give greater value to the mathematical model of [15]; it is necessary to know two more variables: temperature and height at sea level.

2.2.1. Change from Absolute to Relative Humidity Units

Equation (10) presents the mathematical expression of relative humidity (inside the greenhouse), which is a direct equivalence of the pressure ratio, given in (%).
R H i n = P V i n P V s a t i n × 100 %
where P V i n is the partial pressure of water vapor inside the greenhouse, in (atm), shown in Equation (11), and P V s a t i n is the saturation vapor pressure inside the greenhouse (atm), given in Equation (13),
P V i n = W i n × P a t m 0.622 + W i n
where W i n is the absolute humidity inside the greenhouse ( kg w a t e r · kg d r y a i r 1 ) and P a m t is the atmospheric pressure according to altitude (atm), shown in Equation (12):
P a t m = 1 2.25577 × 10 5 × H m 5.2559
where H m is the height above sea level in (m).
Saturation vapor pressure inside the greenhouse, in (atm):
P V s a t i n = 0.61078 × e 17.27 × T i n T i n + 237.3 × 1000 101 , 325
where T i n is the temperature inside the greenhouse given in ( C).

2.2.2. Change from Relative to Absolute Humidity Units

For the change of units inverse to what was conducted in the previous subsection, it is necessary to calculate the absolute humidity outside the greenhouse, given in ( kg w a t e r · kg d r y a i r 1 ), as shown in Equation (14):
W o u t = 0.622 × P V o u t P a t m P V o u t
where P a t m is calculated as already indicated in Equation (12) and P V o u t is the partial pressure of water vapor outside the greenhouse (atm) calculated in Equation (15) as shown below:
P V o u t = R H o u t 100 × P V s a t o u t
where R H o u t is the relative humidity outside the greenhouse (%) and P V s a t o u t is the saturation vapor pressure outside the greenhouse (atm) shown in Equation (16):
P V s a t o u t = 0.61078 · e 17.27 × T o u t T o u t + 237.3 × 1000 101 , 325
where T o u t is the temperature outside the greenhouse given in ( C).

2.3. Vapor Pressure Deficit (VPD)

According to [21], the V P D is “…the difference between saturation vapor pressure and the actual vapor pressure”, which is a somewhat abstract physical definition. In simple terms, V P D can be defined as an indicator of how dry the air is; looking at it in terms of relative humidity, it indicates how far it is from reaching maximum saturation.
V P D is measured in ( k P a ); it is a function of air temperature in ( C) and air humidity in (%), expressed in Equation (17) to the internal part of the greenhouse. It can also be applied to the outside using T o u t and R H o u t .
V P D i n = 0.61078 × e 17.27 × T i n T i n + 237.3 × 1 R H i n 100 .

2.4. Identification and Normalization of Interest Variables for the Control System

This subsection presents a summary of variables of the mathematical model that are of interest in the control of the microclimate in the greenhouse without first carrying out a good engineering practice that corresponds to the normalization of the manipulated variables, as described below.

2.4.1. Normalization of the Manipulated Variables

The normalization consists of placing each manipulated variable from 0 to 100 (%). There are four manipulated variables: ventilation factor (N), shading mesh ( S m ), evaporative cooling system ( E C ), and heating system ( H c a p ), which are carried out in Equations (18)–(21), respectively, starting with the ventilation rate:
N = 118 100 × N % + 2
where N is the ventilation rate that works in a range from 2 to 120 (h 1 ), and N % is changed to the range from 0 to 100 (%).
In the case of mesh shading, the factor is already in percentage units; therefore, only the name of the variable is changed:
S m = S m %
where both S m % and S m are in units of (%), but for the control system of the next section, S m % will be considered.
For the evaporative cooling system normalization, the equation is the following:
E C = 14.8 100 × E C %
where E C works in the range of 0 to 14.8 ( kg · m 2 · d 1 ), and E C % was changed to range from 0 to 100 (%).
For heating system normalization, the equation is the following:
H c a p = 75 , 000 100 × H c a p %
where H c a p works in the range from 0 to 75,000 (W), and H c a p % is changed to the range from 0 to 100 (%).

2.4.2. Summary of Variables of the Greenhouse Mathematical Model

Table 1 summarizes the manipulated, controlled, and disturbance variables with their corresponding units and ranges. From the point of view of control, the manipulated variables are the inputs, and the controlled variables are the outputs.
For a complete description of the mathematical model, Table 2 presents the values of constants that characterize the greenhouse and the environment in which it is located.
Measurements of greenhouse geometry (necessary for the mathematical model) have already been considered in Table 2. Still, it could be of interest to the reader to know the details about them, i.e., width: 9 m, length: 30 m, lateral height: 4 m, maximum height: 6 m, frontal area: 48.462 m 2 , and volume: 1453.845 m 3 (See Figure 1).

3. Open Loop Greenhouse Model Validation

In this section, the model validation for five full days is presented, starting with considerations for the validation tests and then the results through the calculation of errors and a validation example of a day.

3.1. Considerations for Validation

For the validation of the mathematical greenhouse model, real data measured instantly inside and outside the greenhouse were used. Data obtained from [16] were measured in Santa Rosa, Mérida-Venezuela (from 12 November 2006 to 16 November 2006) in an Arch roof shape type of greenhouse covered with a single layer polyethylene.
Considerations taken for validation were:
  • As the greenhouse model had more physical data than those known from the real greenhouse (in Santa Rosa, Mérida-Venezuela), it was necessary to assume some values to the simulation could be carried out:
    Ventilation of 50% throughout the day, then N % = 50 ( % ) .
    Shading mesh, an evaporative cooling system, and heating were not used. Thus, S m % = 0 ( % ) , E C % = 0 ( % ) , and H c a p % = 0 ( % ) .
    The existence of an abundant crop was considered; therefore, E T = 0.0003 · τ c · Q G R o u t L + 0.0021 ( kg · m 2 · d 1 )
  • The reflectance of solar radiation on the ground taken of [15] was ρ g = 0.5 ; after several tests, it was adjusted to ρ g = 0.4 , which gave better results on validation.
  • Data obtained from [16] have solar radiation in units of ( umol · m 2 · s 1 ), while the greenhouse model was in units of ( W · m 2 ); therefore, the factor Q G R o u t = 1 2.1 · Q G R o u t D a t a was used. The analysis for the change of units is explained in [22].

3.2. Model Validation for 5 Days of Data Measured in Santa Rosa, Mérida-Venezuela: From 12 November 2006 to 16 November 2006

The criterion used for validation was the calculation of errors, beginning with the mean square error ( R M S E ), in Equation (22), which allows knowing how far the measurement is from the real value in the same unit as the variable under analysis. The R-squared ( R 2 ) criterion was also used, such as in Equation (23), which provides intuitive information because results are in the per-unit range, where 1 means perfect validation while 0 means inadequate validation:
R M S E = 1 n i = 1 n y i y i ^ 2 ,
R 2 = 1 i = 1 n y i y i ^ 2 i = 1 n y i y i ¯ 2
where n is the number of samples, i indicates the sample number to be analyzed, y i is the real value (of real data), y i ¯ is the average of the actual data, and y i ^ is the sample value (of the model).
An example of the validation carried out (on 16 November 2006) is presented in Figure 2, where a small divergence is observed at the beginning of the solar radiation to later be very similar to the rest of the day The temperatures are similar, while relative humidity has small differences at the beginning and end of the day.
Table 3 presents the validation results (calculated with Equations (22) and (23)) for variables inside the greenhouse: solar radiation in ( W · m 2 ), temperature in ( C), and relative humidity in (%).
The average R M S E of radiation, temperature, and relative humidity of the simulated model, as well as the average R 2 , are indicators that the validation was satisfactory.

4. Proposed Control Strategy

In this section, the variable to be controlled is justified, as well as the appropriate range for it. The control proposal is based on the variables for heating and cooling that the greenhouse mathematical model has.

4.1. Variable to Control

In [23,24,25], an analysis of the importance of temperature and relative humidity is made. Still, the greatest importance is emphasized on the V P D crop (which in this work is symbolized with V P D i n ), taking advantage of the relevance that was given to V P D i n and its influence on the crop, it was decided to control this variable.

4.2. VPD Controllability Range

In [23], a deep analysis of the appropriate range for the V P D i n is made, which is a global concept applied to any crop, some criteria rescued are:
  • Range 0.75–1.5 (kPa): Optimum nutrient absorption and photosynthesis for most greenhouse crops.
  • Range 0.8–1.5 (kPa): Better CO 2 exchange, improvement of the hydraulic potential of the leaves, and regulation of the osmotic pressure. Moreover, photosynthesis and stomata conductance are ideal in this range.
  • Range 0.3–1.6 (kPa): Efficiency in water use is ideal, with better gas exchange and conductance in the stomata; it also improves the regulation of foliar abscisic acid.
Based on [23], the range taken for this project is 0.55 to 1.0 (kPa). See Table 4, where the interrelationship between V P D i n with temperature and humidity is shown, as well as the effects that occur when it is maintained in a certain range and some ways that exist to correct it.
With the analysis shown in Table 4, the direct relationship between temperature ( T i n ) and V P D i n is observed; therefore, manipulated variables for cooling are used in order to reduce V P D i n and the manipulated variable for heating to increase the V P D i n inside the greenhouse.

4.3. Control Proposal for the Greenhouse Microclimate

The mathematical model of the greenhouse obtained from [15] has three control variables for cooling, which help to reduce V P D i n , and a variable for heating to increase V P D i n ; this is used at night and on days with extreme humidity with low temperatures.
According to [15], the temperature (hence, the V P D i n ) in the greenhouse can be limited with ventilation, such that, at maximum, ventilation generates similar environmental conditions inside and outside of the greenhouse.
In extreme heat and low humidity conditions, ventilation is required, and other agents help reduce temperature and raise the humidity and, therefore, lower V P D i n . At this point, it would be best to use shading mesh as a second way to cut down on solar radiation in the greenhouse. If this does not work, there is an evaporative cooling system (which can be fogging) that adds moisture to the air inside the greenhouse, which lowers the temperature and, in turn, the V P D i n .

5. Hybrid Controller Design

This section presents the design of the hybrid controller, which is a compound of four controllers—three for cooling and one for heating. First, the discrete design of enabling and disabling each controller is shown (as required by the system), and then the design.

5.1. Design of Enabling and Disabling Each Controller

The design is thought to satisfy the heating and cooling needs of the greenhouse to maintain V P D i n within the range of 0.55 (kPa) to 1 (kPa), which is justified in the analysis carried out in the previous section.
Figure 3 shows V P D i n in one day, where the design of the control system is presented graphically; in Figure 4, the same is shown, but from the control point of view. The descriptions of the variables are:
  • e: error of the feedback control loop for cooling that can be positive ( e + ) or negative ( e );
  • e c : error of the feedback control loop for heating that can be positive ( e c + ) or negative ( e c );
  • V P D i n : vapor pressure deficit inside the greenhouse, which is the variable controlled by cooling (fogging) or the heating system.
Figure 3 also contains information on the conditions in which the triggers for each controller will be activated and deactivated. For ventilation and heating, it simply must be within the design range: 0.1 e 0.4 and −0.2 e c 0, respectively. For the shading mesh, there are two conditions for activation: the ventilation is at least 90% and the error of V P D i n is e −0.03; for deactivation, it is enough to have an error of e 0.3. For evaporative cooling, there are three activated conditions: ventilation and shading mesh at 100%, in addition to an error e −0.05, while deactivation only requires the condition of e 0.02.
When the cooling works, it blocks the ventilation by 10%; this criterion is attributed to two reasons: (1) there is a steady state condition of ventilation for the design of the controller and, more importantly, (2) water vapor that generates the cooling evaporative satisfies the objective of humidifying the environment in addition to reducing the temperature (consequently reducing the V P D i n ), because if ventilation is high, the water vapor generated would go to the external environment due to a high exchange in the circulating air mass inside the greenhouse.
The operation proposed for the hybrid controller was formalized with the control scheme (Figure 4) that was created as a possible solution to the problem through subsystems that were the controllers: on–off (for the shading mesh), fuzzy (for ventilation), and proportional–integral (PI) for evaporative cooling and heating.
The design of each controller in its operating range is described below.

5.2. Design for Ventilation Controller

The design of a fuzzy-PI controller is carried out in this subsection, starting with obtaining the greenhouse dynamic at the point of operation through the reaction curve [26], followed by the design of the PI controller, and finally, the combination of a fuzzy-PI that uses the proportional and integral part of the PI controller (as inputs) to calculate the ventilation output using fuzzy inference rules.

5.2.1. Reaction Curve to the Greenhouse with the Ventilation System

In a dynamic greenhouse model, and a change in the ventilation, it is required that the system (greenhouse) be at the operating point ( V P D i n = 1 (kPa)), which is achieved by considering the differential equation derivatives as null. The results of applying the aforementioned calculation and assuming the test in the early hours of the morning ( T i n = 20 ( C), Q G R o u t = 200 (W/m 2 )), the values in a stable state were obtained, which are summarized in Table 5.
From the values in the stable state, the reaction curve method [26] was applied to the open loop greenhouse, in which the input (as a step) is the ventilation system and the output is the V P D i n .
To cover the possibility of different behaviors for the rise and fall of the value of V P D i n , a simulation experiment was carried out for a positive step and a negative step of 10%.
The average of the two experiments is presented in Equation (24), which expresses the dynamics of the V P D i n before changes of 10% of the ventilation system:
G v ( s ) = 0.040475 ( 258.738 ) s + 1 .

5.2.2. Design of a PI Controller for the Ventilation System

The tuning technique for the PI controller is presented in [27], which has an adjustment parameter ( τ c ) to give greater response speed or better rejection of disturbances. Other tunings can be found in [28].
Applying the tuning technique, which allows adjusting the controller with τ c = 0.55 τ resulted in the constants of the PI controller K p = 44.921 and τ i = 258.738 , which are summarized in the transfer function that represents the PI controller for the evaporative cooling system given in Equation (26).
G c v ( s ) = K p τ i s + 1 τ i s ,
G c v ( s ) = 44.921 ( 258.738 ) s + 1 ( 258.738 ) s .

5.2.3. Design of a Fuzzy-PI Controller for the Ventilation System

As shown in Figure 5, the proposed scheme takes advantage of the properties of a PI controller (Equation (26)) to improve its operation through inference rules that relate the two inputs P and I, thus obtaining a fuzzy output. The design of the diffuse part was taken according to work carried out by [29].
Membership functions were divided into seven sets; in this way, there are two inputs and an output with this distribution; see Table 6.
The details of membership functions are shown in Figure 6, where it can be seen that triangular shapes were used for the design, both for inputs and outputs. Universes of discourse used for this design are as follows: P: −11 to 11, I: −35 to 35, and fuzzy-PI output: −125 to 125.
The control logic was determined by the degree of membership reached from the combination of the rules of inference; in this way, the controller will give a greater or lesser output signal for the ventilation. Forty-nine rules are presented in Table 7, as a result of covering all possible combinations of linguistic variables of the inputs.
To finish with the design of the fuzzy controller, it is important to indicate the surfaces generated by the combinations of the inference rules and the resulting outputs, which are presented in Figure 7.
In addition, for implementation, saturators must be placed in the inlets and outlets, taking into account that the ventilation in the mathematical model is given in percentage; therefore, it must be saturated up to a maximum of 100%.

5.3. Design for Shading System Controller

The design for the shading mesh is an on–off controller with hysteresis, as indicated in Figure 8; note that the proposed range is the same as the permissive range for activation of this controller already mentioned in the analysis of Figure 3; in this way, it can be seen as an applied gain of 100% within the range: −0.03 e 0.3.

5.4. Design for Evaporative Cooling System Controller

The design of the PI controller was carried out in an open loop; for this, it is necessary to capture the greenhouse dynamic for changes in the manipulated variable (evaporative cooling); in this way, an approximate transfer function was obtained (in the Laplace domain) that allowed designing the controller around the point of operation. The method is detailed in [26] and applied below:

5.4.1. Reaction Curve to the Greenhouse with the Evaporative Cooling System

For the dynamic greenhouse model, and a change in evaporative cooling, the system (greenhouse) is required to be at the operating point ( V P D i n = 1 (kPa)), which is achieved by considering the differential equations with derivatives as null. The results of applying the aforementioned calculation and assuming the test in the morning hours ( T i n = 20 ( C), Q G R o u t = 700 (W/m 2 )), and the values in the stable state were obtained, which are summarized in Table 8 below:
From the values in the stable state, the reaction curve method [26] was applied to the open loop greenhouse, in which the input (the step) was the evaporative cooling system and the output was the vapor pressure deficit ( V P D i n ).
To cover the possibility of different behaviors for the rise and fall of the value of V P D i n , this experiment was carried out for a positive step and a negative step of 10%.
The average of the two experiments is presented in Equation (27), which expresses the dynamics of the V P D i n before changes of 10% of the evaporative cooling system:
G e ( s ) = 0.02329 ( 195.763 ) s + 1 .

5.4.2. Design of a PI Controller for the Evaporative Cooling System

The tuning technique for the PI controller used is the one presented in [27,30] (page 126); the method has an adjustment parameter ( τ c ) to give a greater response speed or a better rejection of disturbances.
Applying the tuning technique, which allows for adjusting the controller with τ c = 0.21 τ , resulted in the constants of the PI controller, K p = 204.461 and τ i = 195.763 , which are summarized in the transfer function that represents the PI controller for the evaporative cooling system given in Equation (29).
G c e ( s ) = K p τ i s + 1 τ i ,
G c e ( s ) = 204.461 ( 195.763 ) s + 1 ( 195.763 ) s .

5.5. Design for Heating System Controller

The design of the PI controller was carried out in an open loop; for this, it was necessary to capture the dynamics of the greenhouse for changes in the manipulated variable (heating system); in this way, an approximate transfer function was obtained (in the Laplace domain) that allowed designing the controller around the point of operation. The method is detailed in [26] and is applied below:

5.5.1. Reaction Curve to the Greenhouse with the Heating System

For the dynamic greenhouse model, and a change in the heating system, it is required that the system (greenhouse) be at the operating point ( V P D i n = 0.55 (kPa)), which is achieved by considering the differential equation derivatives as null. The results of applying the aforementioned calculation and assuming the test in early hours of the night ( T i n = 18 ( C), Q G R o u t = 50 (W/m 2 )), and the values in the stable state were obtained, which are summarized in Table 9.
From the values in the stable state, the reaction curve method [26] was applied to the open loop greenhouse, in which the input (as a step) is the heating system and the output is the vapor pressure deficit ( V P D i n ).
To cover the possibility of different behaviors for the rise and fall of the value of V P D i n , this experiment was carried out for positive and negative steps of 10%.
The average of the two experiments is presented in Equation (30), which expresses the dynamics of the V P D i n before changes of 10% of the heating system:
G c ( s ) = 0.03606 ( 373.076 ) s + 1 .

5.5.2. Design of a PI Controller for the Heating System

The tuning technique for the PI controller used is the one presented in [27]; the method has an adjustment parameter ( τ c ) to give a greater response speed or a better rejection of disturbances.
Applying the tuning technique, which allows adjusting the controller with τ c = 0.55 τ resulted in the constants of the PI controller, K p = 50.421 and τ i = 373.076 , which are summarized in the transfer function that represents the PI controller for the heating system given in Equation (32).
G c c ( s ) = K p τ i s + 1 τ i ,
G c c ( s ) = 50.421 ( 373.076 ) s + 1 ( 373.076 ) s .

6. Results and Analysis

This section first presents the implementation of the designed controllers in a programming card, and, after that, the operating tests, for day 16 and day 13, in that order, using real data for disturbances (the ones already used to validate the mathematical model).

6.1. Hardware-in-the-Loop Implementation

The proposed implementation of controllers to the hardware-in-the-loop mode is shown in Figure 9. From the point of view of the digital controller, this involves one group of input data and another group of output data via serial communication from and to a computer, with the greenhouse represented as a mathematical model.
In addition, MATLAB–Simulink had the plant implemented as a mathematical model and the references of the control system for the high and low V P D i n levels. The disturbances used to validate the system were on the computer and were loaded from Excel data, taken from [16]. This way, the digital controller (Arduino DUE) was outside the computer, but the plant, disturbances, and references were inside it.

6.1.1. Activation and Deactivation of Each Control System

The enabling and disabling of each controller within a digital controller is simple; it is enough to place conditionals to fulfill the design, as presented in Figure 10 through the flow diagrams.
In the previous section, all controllers were designed for a continuous system based on experimental information in the MATLAB–Simulink simulator (with the reaction curve at an operating point); however, for an application in a digital controller, it is necessary to convert the transfer functions of the controllers (that are in the Laplace domain) to a discrete function, in difference equations, as conducted below.

6.1.2. Sampling Time for Digital Controller

For the implementation of hardware-in-the-loop, there was a particular case in which the simulator solved the model mathematically, then sent a response to the digital controller, which returned the calculation of the manipulated variables by serial communication. Therefore, the sampling of the system signal is determined by the serial communication, which (for this project) was set to 0.1 (s), the samplings of the time data were exchanged at 115,200 (Bauds).
This time was fast enough to obtain information from the greenhouse (which was simulated inside the computer); at the same time, it did not lead to much effort from the controller. To validate this, Shannon’s theorem can be applied to the time constants of the transfer functions G v ( s ) , G e ( s ) , and G c ( s ) (Equations (24), (27), and (30)) in the closed loop [31], according to the method proposed in [32]. In this way, it is observed that the sampling value of 0.1 (s) is less than that required by the system and, therefore, is suitable for the digital control of the greenhouse of this project. See Equation (33):
T m = 0.1   ( s ) .

6.1.3. Correction Factor for the Time Constants of the Controllers due to the Simulation in the Hardware-in-the-Loop Way

A challenge to consider in simulating the control of a greenhouse where the controller is not inside the computer is that the simulation time is not the same for the controller concerning that calculated by the simulator inside the PC.
The greenhouse mathematical model is simulated for 24 h, given in seconds (86,400 (s)). However, to test the controllers, it is not possible to wait several hours to obtain results; therefore, the technique applied is the simulation of the model at a shorter time; thus, a digital controller assumes that the greenhouse is affected by disturbances at that speed (much faster than would normally occur). The question is, how much faster? These, however, are not fixed data that can be given because they depend on the characteristics of the computer; for example, for this project, the computer had the following characteristics: Processor Intel(R) Core(TM) i7-10870H CPU @ 2.20GHz 2.21 GHz and installed RAM 16.0 GB (15.8 GB usable). Performance tests were carried out in the MATLAB–Simulink simulator version R2021b (ode 45).
According to what was exposed, it is necessary to execute performance tests on the system with the digital controller exchanging data to obtain the time the simulation is executed. It must be conducted under similar conditions without executing more processes than the same simulation on the computer to obtain similar results. The results of the experiments carried out were 348.7 (s), 349.4 (s), and 352.7 (s) for Tests 1, 2, and 3, respectively. The measurement of the simulation time in the hardware-in-the-loop with a digital controller (Arduino DUE) for the three experiments was approximately 350 (s); therefore, the factor that is applied to modify the time constants for the controllers is indicated in Equation (34):
T f = T r e a l T s i m u l a t e d = 350 86 , 400 .
Hence, transfer functions that represent the three PI controllers designed in the previous section (Equations (26), (29), and (32)) would be redefined as follows in Equations (35)–(37):
G c v r ( s ) = 44.921 ( 258.738 ) ( T f ) s + 1 ( 258.738 ) ( T f ) s ,
G c e r ( s ) = 204.461 ( 195.763 ) ( T f ) s + 1 ( 195.763 ) ( T f ) s ,
G c c r ( s ) = 50.421 ( 373.076 ) ( T f ) s + 1 ( 373.076 ) ( T f ) s .
where G c v r ( s ) is the transfer function of the redefined ventilation controller, G c e r ( s ) is the transfer function of the redefined evaporative cooling controller, and G c c r ( s ) is the transfer function of the redefined heating controller.
To implement these designs in the digital controller, they must be found in equations in the difference, which is possible through some of the discrete equivalent conversions; therefore, this is developed below.

6.1.4. Conversion of Designed Controllers from a Continuous System to a Discrete One

According to [32], a controller already designed for a continuous system (in the Laplace domain) can be “translated” or approximated to one in a discrete domain as long as the sampling time is adequate, which has already been calculated in Equation (33). Therefore, the discrete trapezoidal equivalent (also known as Tustin) is used. Next, the conversion of the PI controllers to equations in the differences for digital controllers takes place.
The trapezoidal or Tustin method is applied, which approximates a function from s to one in z according to [32], the equivalence in Equation (38):
s = 2 T m × z 1 z + 1 .
In Equations (35)–(37), the factor that modifies the time constants of the controllers ( T f ) was introduced; in Equation (39), it is placed in a generic way.
G c r ( s ) = K p ( τ i × T f ) s + 1 ( τ i × T f ) s .
Now the discrete equivalent (Equation (38)) is replaced in Equation (39); therefore, the transfer function changes to the discrete-time domain; see the below Equation (40):
G c r ( z ) = K p τ i × T f 2 T m × z 1 z + 1 + 1 τ i × T f 2 T m × z 1 z + 1 .
The time constants are grouped (in Equation (41)) to reduce the space of the calculation that is carried out below,
T 2 = 2 τ i × T f T m .
Therefore, Equation (42) represents Equation (40), which was expanded to have a generic expression for the case of a PI controller changing from the Laplace domain to a discrete domain.
G c r ( z ) = K p × T 2 + 1 T 2 × z T 2 1 T 2 + 1 z 1 .
Replacing constants of Equation (42) for each case of the controller, ventilation, cooling, and heating, the results are presented in Equations (43)–(45) in that same order.
G c v r ( z ) = 47.064 z 0.9089 z 1 ,
G c e r ( z ) = 217.352 z 0.8814 z 1 ,
G c c r ( z ) = 52.089 z 0.9360 z 1 .
In general, the inverse z transform can also be applied to Equation (42), to obtain a mathematical expression in a difference equation. As mentioned in Equation (46):
u ( k ) = u ( k 1 ) + K p T 2 + 1 T 2 e ( k ) K p T 2 + 1 T 2 T 2 1 T 2 + 1 e ( k 1 ) .
Finally, if constants are substituted in Equation (46) for each controller, the mathematical expressions can be obtained in difference equations for each controller: for ventilation, evaporative cooling, and heating, respectively, in Equations (47)–(49).
u v ( k ) = u ( k 1 ) ( 47.064 ) e ( k ) + ( 47.064 ) ( 0.9089 ) e ( k 1 ) ,
u e ( k ) = u ( k 1 ) ( 217.352 ) e ( k ) + ( 217.352 ) ( 0.8814 ) e ( k 1 ) ,
u c ( k ) = u ( k 1 ) + ( 52.089 ) e ( k ) ( 52.089 ) ( 0.9360 ) e ( k 1 ) .
These last three difference equations were implemented in the digital controller (Arduino DUE), equivalent to the PI controllers that were designed in the previous section. In addition, the controller for the shading mesh does not require special treatment because it is an on–off with hysteresis; for this reason, it was not taken into account for these transformations.
Next, the operation tests of the greenhouse model were subjected to the hybrid controller designed under the concept of hardware-in-the-loop.

6.2. Operation Tests to the Hybrid Control System Submitted to Real Disturbances

Real measurement data were used to test the greenhouse model with the designed hybrid scheme in a digital controller. Measurements of 5 days were available (from 12 November 2006 to 16 November 2006) taken in Mérida-Venezuela at 1926 masl [16], which were the same ones that were already used for validating the greenhouse, obtaining good results.
Next, the tests ran on the following days: 16 November 2006 and 13 November 2006.

6.2.1. First Operation Test to the Hybrid Control System Submitted to Real Disturbances of Day: 16 November 2006

For this test, disturbance data from 16 November 2006 were applied. In Figure 11, three external variables affected the greenhouse: radiation, temperature, and relative humidity; the same graphic also corresponds to the variables mentioned inside the greenhouse.
Outside, the radiation had high variation; there was likely the passage of clouds that blocked the incidence of the sun’s rays on the greenhouse and even rain in short periods. Note that radiation absorbed inside the greenhouse had a similar relationship until the first minutes of 10h when a sudden change occurred; this is because the shading mesh was activated in this part (see Figure 12, regarding the time of the shading mesh); therefore, an additional part of the solar radiation was blocked from this point.
Considering the temperature (Figure 11), approximately at noon, the internal part was more similar to the external one; this was due to the ventilation that was applied when there was a higher internal temperature to equal what the outside was.
The internal relative humidity of the greenhouse (Figure 11) was lower than the external at all times, except from 11 h to 13 h; this is logical because, in that space of time, the control system activated the evaporative cooling to limit the V P D i n and the temperature (through increasing humidity) inside.
Analyzing the control actions (Figure 12), we observed that they complied with the proposed design, in which the ventilation, shading mesh, and evaporative cooling were activated (in that order) to try to keep the V P D i n limited above. At the same time, the heating system worked at night and in early morning hours to limit the V P D i n . Even the ventilation blockage (in 10 (%)) was fulfilled when the evaporative cooling system was activated.

6.2.2. Second Operation Test to the Hybrid Control System Submitted to Real Disturbances on 13 November 2006

The actual disturbance data for this day (obtained from [16]) demands use of the control system to a greater extent compared to the previous case. For example, Figure 13 shows how the incidence of solar radiation in the greenhouse was high, almost all day without major variations; this means that temperature was also higher; consequently, the day was drier, which is why the external humidity decreased to values less than 50%.
The change in internal radiation due to the action of the shading mesh was much more evident (Figure 13). The external and internal temperatures were similar between 12 h and 14 h because the evaporative cooling worked at that time; this is more noticeable in the internal relative humidity because it increased considerably. In Figure 14, one can see that this occurred because the water vapor of evaporative cooling works at more than 50% of its capacity for around 3 h, so it is logical that internal humidity increases.
The hybrid control system designed through the hardware-in-the-loop concept kept the V P D i n range considered for this project; therefore, development was satisfactory and met its objective.

7. Conclusions

This work presented a hybrid control solution using hardware-in-the-loop for simulating and controlling the microclimate inside a greenhouse. This research is a simulation study developed with a low-cost controller (Arduino) to prove that the proposed control scheme can be applied and has given successful results. Suppose the hybrid controller approach wants to be used for industrial applications. In that case, we recommend controllers, such as a programmable logic controller (PLC) or an industrial computer since they are usually heavy-duty and are used in manufacturing plants.
Microclimate control in a greenhouse involves the interaction of several parameters that vary simultaneously and interact with each other; among the main ones are air temperature, humidity, and absorbed radiation. Therefore, the solution given in this work to control V P D i n was successful in terms of simplicity and practicality because this variable collects information on humidity, temperature, and other variables in such a way that, when controlling the V P D i n effectively, temperature, humidity, and other associated variables are kept within the appropriate ranges.
The hybrid controller implemented in Arduino was tested by a hardware-in-the-loop simulation in the greenhouse model. The hybrid controller system was implemented in the Arduino system, step-by-step, to show the methodology and help others interested in this area; the temperature and humidity presented responses that were as close as possible to the setpoint despite disturbances.
The hybrid controller allows for more control actions within a certain range. This makes it modular, which is important if one needs more (or fewer) actuators for cooling (or heating). Thus, it may be introduced to the system without undoing previous work, which would necessitate calibration.
This hybrid-type controller provides a simple but effective solution to the greenhouse microclimate issue. Our research offers a cost-effective solution for this complicated system without diminishing existing controller techniques.

Author Contributions

Conceptualization, G.C., R.J. and O.C.; methodology, G.C., R.J. and O.C.; software, G.C., M.H. and H.A.; validation, G.C., M.H. and H.A.; formal analysis, O.C. and R.J.; investigation, O.C. and R.J.; resources, O.C.; data curation, G.C. and R.J.; writing—original draft preparation, G.C. and M.H.; writing—review and editing, G.C., M.H., H.A., R.J. and O.C.; visualization, G.C.; supervision, O.C.; project administration, O.C.; funding acquisition, O.C. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Universidad San Francisco de Quito through the Poli-Grants Program under grant 17461.

Acknowledgments

The authors, thank to the USFQ Advanced Control Systems Research Group, Quito, Ecuador.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Albright, L.D.; Arvanitis, K.; Drysdale, A. Environmental control for plants on earth and in space. IEEE Control Syst. Mag. 2001, 21, 28–47. [Google Scholar]
  2. Giraldo, S.A.C.; Flesch, R.C.; Normey-Rico, J.E. Multivariable greenhouse control using the filtered smith predictor. J. Control Autom. Electr. Syst. 2016, 27, 349–358. [Google Scholar] [CrossRef]
  3. Liu, Z.; Jiao, X.; Zhu, C.; Katul, G.G.; Ma, J.; Guo, W. Micro-climatic and crop responses to micro-sprinkler irrigation. Agric. Water Manag. 2021, 243, 106498. [Google Scholar] [CrossRef]
  4. Bersani, C.; Fossa, M.; Priarone, A.; Sacile, R.; Zero, E. Model Predictive Control versus Traditional Relay Control in a High Energy Efficiency Greenhouse. Energies 2021, 14, 3353. [Google Scholar] [CrossRef]
  5. Moreno, J.; Berenguel, M.; Rodríguez, F.; Baños, A. Robust control of greenhouse climate exploiting measurable disturbances. In Proceedings of the 15th Triennial World Congress, Barcelona, Spain, 28–30 September 2002; Volume 35, pp. 271–276. [Google Scholar]
  6. Berenguel, M.; Yebra, L.J.; Rodríguez, F. Adaptive control strategies for greenhouse temperature control. In Proceedings of the 2003 European Control Conference (ECC), Cambridge, UK, 1–4 September 2003; IEEE: Piscatway, NJ, USA, 2003; pp. 2747–2752. [Google Scholar]
  7. Su, Y.; Yu, Q.; Zeng, L. Parameter self-tuning pid control for greenhouse climate control problem. IEEE Access 2020, 8, 186157–186171. [Google Scholar] [CrossRef]
  8. Nugroho, A.P.; Okayasu, T.; Fushihara, H.; Hirano, O.; Mitsuoka, M.; Inoue, E. Development of intelligent control system for greenhouse. In Proceedings of the Joint Simposium of Asian Federation of Information Technology in Agriculture (AFITA) and World Congress of Computers in Agriculture and Natural Resource (WCCA), Torino, Italy, 19–21 October 2012. [Google Scholar]
  9. Syam, R.; Piarah, W.H.; Jaelani, B. Controlling smart green house using fuzzy logic method. Int. J. Smart Mater. Mechatron. 2016, 2, 116–120. [Google Scholar] [CrossRef]
  10. Belhaj Salah, L.; Fourati, F. A greenhouse modeling and control using deep neural networks. Appl. Artif. Intell. 2021, 35, 1905–1929. [Google Scholar] [CrossRef]
  11. Oliveira, P.M.; Solteiro Pires, E.; Boaventura-Cunha, J.; Pinho, T.M. Review of nature and biologically inspired metaheuristics for greenhouse environment control. Trans. Inst. Meas. Control 2020, 42, 2338–2358. [Google Scholar] [CrossRef]
  12. Andaluz, G.M.; Leica, P.; Herrera, M.; Morales, L.; Camacho, O. Hybrid Controller based on Null Space and Consensus Algorithms for Mobile Robot Formation. Emerg. Sci. J. 2022, 6, 429–447. [Google Scholar] [CrossRef]
  13. Espín, J.; Estrada, S.; Benítez, D.; Camacho, O. A hybrid sliding mode controller approach for level control in the nuclear power plant steam generators. Alex. Eng. J. 2022, 20, 1651. [Google Scholar] [CrossRef]
  14. Obando, C.; Chávez, D.; Leica, P.; Camacho, O. Sliding Mode Controller Based on a Hybrid Surface for Tracking Improvement of Non-Linear Processes. IFAC-PapersOnLine 2020, 53, 11747–11752. [Google Scholar] [CrossRef]
  15. Fitz-Rodríguez, E.; Kubota, C.; Giacomelli, G.A.; Tignor, M.E.; Wilson, S.B.; McMahon, M. Dynamic modeling and simulation of greenhouse environments under several scenarios: A web-based application. Comput. Electron. Agric. 2010, 70, 105–116. [Google Scholar] [CrossRef]
  16. Briceño Medina, L.Y.; Jaimez Arellano, R.E.; Espinoza Briceño, W.E. Influencia de la condición climática de diferentes localidades en el microclima del invernadero: Región Andina y Central de Venezuela. Interciencia 2010, 35, 380–387. [Google Scholar]
  17. Mihalič, F.; Truntič, M.; Hren, A. Hardware-in-the-Loop Simulations: A Historical Overview of Engineering Challenges. Electronics 2022, 11, 2462. [Google Scholar] [CrossRef]
  18. Fernández, M.; Gyenge, J. Técnicas de medición en ecofisiología vegetal. In Conceptos y Procedimientos; Ediciones Instituto Nacional de Tecnología Agropecuaria (INTA): Buenos Aires, Argentina, 2010. [Google Scholar]
  19. Cardoso, G.; Puzhi, M.; Zhinín, S. Simulación de los procesos psicrométricos. Rev. Fac. Cienc. Químicas 2016, 15, 25–39. [Google Scholar]
  20. de Medeiros-Junior, R.; de Lima, M.; de Medeiros, M. Discussion about Models for Estimation of Relative Humidity-Case Study of the Brazilian Coast versus Influence in Concrete Durability Discusión Acerca de Modelos para la Estimación de la Humedad Relativa-Estudio de Caso de la Costa Brasileña Frente; Technological Institute of Aeronautics—ITA: Sao Paulo, Brazil, 2014. [Google Scholar]
  21. Shamshiri, R.R.; Jones, J.W.; Thorp, K.R.; Ahmad, D.; Man, H.C.; Taheri, S. Review of optimum temperature, humidity, and vapour pressure deficit for microclimate evaluation and control in greenhouse cultivation of tomato: A review. Int. Agrophys. 2018, 32, 287–302. [Google Scholar] [CrossRef]
  22. Escobedo-Sánchez, M.; Conejo-Flores, R.; Durón-Torres, S.; García, J. Radiación fotosintéticamente activa evaluada en la ciudad de Zacatecas. Rev. Energ. Quím. Fís. 2020, 7, 1–11. [Google Scholar] [CrossRef]
  23. Gutiérrez Hernández, J.O. Control del dÉficit de presión de Vapor (dpvc) en Cultivos de Invernadero con Sistemas de Nebulización. Ph.D. Thesis, Universidad Autónoma Chapingo, Texcoco, Mexico, 2020. [Google Scholar]
  24. Zhang, D.; Du, Q.; Zhang, Z.; Jiao, X.; Song, X.; Li, J. Vapour pressure deficit control in relation to water transport and water productivity in greenhouse tomato production during summer. Sci. Rep. 2017, 7, 43461. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  25. Akpenpuun, T.D.; Na, W.H.; Ogunlowo, Q.O.; Rabiu, A.; Adesanya, M.A.; Addae, K.S.; Kim, H.T.; Lee, H.W. Effect of Greenhouse Cladding Materials and Thermal Screen Configuration on Heating Energy and Strawberry (Fragaria ananassa var. “Seolhyang”) Yield in Winter. Agronomy 2021, 11, 2498. [Google Scholar] [CrossRef]
  26. Smith, C.A.; Corripio, A.B. Principles and Practices of Automatic Process Control; John Wiley & Sons: Hoboken, NJ, USA, 2005. [Google Scholar]
  27. Skogestad, S.; Grimholt, C. The SIMC Method for smooth PID controller tuning. In PID Control in the Third Millennium; Springer: London, UK, 2012; pp. 147–175. [Google Scholar]
  28. O’Dwyer, A. Handbook of PI and PID Controller Tuning Rules; World Scientific: Singapore, 2009. [Google Scholar]
  29. Giraldo, S.A.C.; Gómez, D.S.H.; Blandón, J.H.G. Control y monitoreo de temperatura para un horno de curado de prendas índigo utilizando lógica difusa y controles pi. Rev. Politéc. 2013, 9, 69–81. [Google Scholar]
  30. Camacho, O.; Rosales, A.; Rivas, F. Control de Procesos; EPN Editorial: Valencia, Spain, 2020. [Google Scholar]
  31. Jacquot, R.G. Modern Digital Control Systems; Routledge: London, UK, 2019. [Google Scholar]
  32. Åström, K.J.; Wittenmark, B. Computer-Controlled Systems: Theory and Design; Courier Corporation: Chelmsford, MA, USA, 2013. [Google Scholar]
Figure 1. Greenhouse variables.
Figure 1. Greenhouse variables.
Agriculture 12 01916 g001
Figure 2. Comparison between real data measured (in Santa Rosa, Mérida-Venezuela on 16 November 2006) and the model data calculated.
Figure 2. Comparison between real data measured (in Santa Rosa, Mérida-Venezuela on 16 November 2006) and the model data calculated.
Agriculture 12 01916 g002
Figure 3. V P D i n in a day.
Figure 3. V P D i n in a day.
Agriculture 12 01916 g003
Figure 4. Control loop with the corresponding ranges.
Figure 4. Control loop with the corresponding ranges.
Agriculture 12 01916 g004
Figure 5. Fuzzy-PI controller for the ventilation system.
Figure 5. Fuzzy-PI controller for the ventilation system.
Agriculture 12 01916 g005
Figure 6. Membership functions.
Figure 6. Membership functions.
Agriculture 12 01916 g006
Figure 7. Fuzzy surface.
Figure 7. Fuzzy surface.
Agriculture 12 01916 g007
Figure 8. ON–OFF controller design for the shading mesh.
Figure 8. ON–OFF controller design for the shading mesh.
Agriculture 12 01916 g008
Figure 9. Schematic of hardware-in-the-loop.
Figure 9. Schematic of hardware-in-the-loop.
Agriculture 12 01916 g009
Figure 10. Discrete logic flow diagram for activation and deactivation of each control system.
Figure 10. Discrete logic flow diagram for activation and deactivation of each control system.
Agriculture 12 01916 g010
Figure 11. Disturbances affecting the system and internal variables of the controlled greenhouse on 16 November 2006.
Figure 11. Disturbances affecting the system and internal variables of the controlled greenhouse on 16 November 2006.
Agriculture 12 01916 g011
Figure 12. Controlled variable ( V P D i n ) and manipulated variables on 16 November 2006.
Figure 12. Controlled variable ( V P D i n ) and manipulated variables on 16 November 2006.
Agriculture 12 01916 g012
Figure 13. Disturbances affecting the system and internal variables of the controlled greenhouse on 13 November 2006.
Figure 13. Disturbances affecting the system and internal variables of the controlled greenhouse on 13 November 2006.
Agriculture 12 01916 g013
Figure 14. Controlled variable ( V P D i n ) and manipulated variables on 13 November 2006.
Figure 14. Controlled variable ( V P D i n ) and manipulated variables on 13 November 2006.
Agriculture 12 01916 g014
Table 1. Manipulated, controlled and disturbance variables.
Table 1. Manipulated, controlled and disturbance variables.
VariableUnitRange
Manipulated variables N % %0–100
S m % %0–100
E C % %0–100
H c a p % %0–100
Controlled variables T i n C-
R H i n %-
V P D i n kPa-
Disturbance variables Q G R o u t W · m 2 -
T o u t C-
R H o u t %-
Table 2. Constants that characterize the greenhouse.
Table 2. Constants that characterize the greenhouse.
SymbolValueUnitDescription
A f l 162m 2 Area of the greenhouse floor surface
A g l 372.6m 2 Area of the glazing surface
C p 1010 J kgk Specific heat of moist air
H5.375mAverage greenhouse height
H m 1926mHeight above sea level
k6.2 W m 2 C Heat transmission coefficient of glazing
L 2.5 × 10 6 J kg Latent heat of vaporization of water
N H 1Number of heaters
w2.3Ratio of glazing surface to floor surface
ρ 1.2 kg d r y a i r m 3 Specific mass of air
ρ g 0.4Reflectance of ground solar radiation
τ c 0.87Transmittance of the glazing material
H c a p 75,000WSingle heater capacity
Table 3. Calculation of errors for validation.
Table 3. Calculation of errors for validation.
RadiationTemperatureR. Humidity
DayRMSE
W m 2
R 2 RMSE
( C)
R 2 RMSE
(%)
R 2
12 November 200667.370.971.150.946.220.93
13 November 200669.200.961.380.936.310.92
14 November 200676.070.961.520.936.030.95
15 November 200662.200.971.120.935.810.92
16 November 200648.210.970.820.954.820.92
Average:64.610.971.200.945.840.93
Table 4. Analysis of the relationship between V P D i n , temperature, and humidity.
Table 4. Analysis of the relationship between V P D i n , temperature, and humidity.
VPD in (kPa) T in ( C) RH in (%)Effects on the CropHow to Correct
HighHighLowPlants transpire too much.Ventilation.
(>1 kPa) They become dehydrated, so they close their stomata for self-protection, causing burns or withering on the leaves.Shading mesh, increase irrigation, evaporative cooling system.
OptimumOkOkOptimal growth.No need.
LowLowHighGenerates adequately.
(<0.55 kPa) Environment for pest growth.Heating system.
Table 5. Steady state values at the operating point of V P D i n = 1 (kPa) to design the ventilation system controller.
Table 5. Steady state values at the operating point of V P D i n = 1 (kPa) to design the ventilation system controller.
Manipulated Variables
VariableValueUnitsDescription
N % 0%Ventilation factor
S m % 0%Shading mesh factor
E C % 0%Evaporative cooling factor
H c a p % 0%Heating factor
Controlled Variables
VariableValueUnitsDescription
T i n 20 CAir temperature inside the greenhouse
R H i n 57.232%Relative humidity inside the greenhouse
V P D i n 1.0kPaVapor pressure deficit inside the greenhouse
Disturbance Variables
VariableValueUnitsDescription
Q G R o u t 200W/m 2 Global radiation outside the greenhouse
T o u t 14.254 CAir temperature outside the greenhouse
R H o u t 81.006%Relative humidity outside the greenhouse
Table 6. Linguistic variables of the fuzzy controller.
Table 6. Linguistic variables of the fuzzy controller.
Proportional
(Input 1)
Integral
(Input 2)
OutputDescription
pBNiBNuBNBig negative
pMNiMNuMNMedium negative
pSNiSNuSNSmall negative
pZiZuZZero
pSPiSPuSPSmall positive
pMPiMPuMPMedium positive
pBPiBPuBPBig positive
Table 7. Inference Rules of the fuzzy controller.
Table 7. Inference Rules of the fuzzy controller.
iBNiMNiSNiZiSPiMPiBP
pBNuZuZuZuZuZuZuZ
pMNuZuZuZuZuZuZuZ
pSNuZuZuZuZuSPuMPuBP
pZuZuZuZuZuSPuMPuBP
pSPuZuZuZuZuSPuMPuBP
pMPuZuZuZuSPuSPuMPuBP
pBPuZuZuZuMPuMPuBPuBP
Table 8. Steady state values at the operating point of V P D i n = 1 (kPa) to design the evaporative cooling system controller.
Table 8. Steady state values at the operating point of V P D i n = 1 (kPa) to design the evaporative cooling system controller.
Manipulated Variables
VariableValueUnitsDescription
N % 10%Ventilation factor
S m % 100%Shading mesh factor
E C % 0%Evaporative cooling factor
H c a p % 0%Heating factor
Controlled Variables
VariableValueUnitsDescription
T i n 20 CAir temperature inside the greenhouse
R H i n 57.195%Relative humidity inside the greenhouse
V P D i n 1.0kPaVapor pressure deficit inside the greenhouse
Disturbance Variables
VariableValueUnitsDescription
Q G R o u t 700W/m 2 Global radiation outside the greenhouse
T o u t 13.730 CAir temperature outside the greenhouse
R H o u t 84.728%Relative humidity outside the greenhouse
Table 9. Steady state values at the operating point of V P D i n = 0.55 (kPa) to design the heating system controller.
Table 9. Steady state values at the operating point of V P D i n = 0.55 (kPa) to design the heating system controller.
Manipulated Variables
VariableValueUnitsDescription
N % 0%Ventilation factor
S m % 0%Shading mesh factor
E C % 0%Evaporative cooling factor
H c a p % 0%Heating factor
Controlled Variables
VariableValueUnitsDescription
T i n 18 CAir temperature inside the greenhouse
R H i n 73.347%Relative humidity inside the greenhouse
V P D i n 0.55kPaVapor pressure deficit inside the greenhouse
Disturbance Variables
VariableValueUnitsDescription
Q G R o u t 50W/m 2 Global radiation outside the greenhouse
T o u t 16.566 CAir temperature outside the greenhouse
R H o u t 79.993%Relative humidity outside the greenhouse
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Cevallos, G.; Herrera, M.; Jaimez, R.; Aboukheir, H.; Camacho, O. A Practical Hybrid Control Approach for a Greenhouse Microclimate: A Hardware-in-the-Loop Implementation. Agriculture 2022, 12, 1916. https://doi.org/10.3390/agriculture12111916

AMA Style

Cevallos G, Herrera M, Jaimez R, Aboukheir H, Camacho O. A Practical Hybrid Control Approach for a Greenhouse Microclimate: A Hardware-in-the-Loop Implementation. Agriculture. 2022; 12(11):1916. https://doi.org/10.3390/agriculture12111916

Chicago/Turabian Style

Cevallos, Gustavo, Marco Herrera, Ramon Jaimez, Hanna Aboukheir, and Oscar Camacho. 2022. "A Practical Hybrid Control Approach for a Greenhouse Microclimate: A Hardware-in-the-Loop Implementation" Agriculture 12, no. 11: 1916. https://doi.org/10.3390/agriculture12111916

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop