Optimal Irrigation Strategy using Economic Model Predictive Control

A R T I C L E I N F O A B S T R A C T Article history: Received: 05 August, 2020 Accepted: 17 November, 2020 Online: 24 November, 2020 In many countries, irrigation water is one of the major contributors to water scarcity. In the present study, a novel optimized irrigation system which minimizes water consumption in irrigation is presented. The system is based on a predictive control algorithm, which foresees the water need of the crop, and regulates the time and amount of irrigation to maintain the soil moisture around an optimal level, while taking into account system constraints. The predictive feature of the algorithm requires a model of the soil moisture, which is obtained from the actual meteorological data of the Kingdom of Bahrain. The optimization problem is formulated as an Economic Model Predictive Control (EMPC) problem and implemented using MATLAB. The simulation experiments show that the novel system yields a reduction of water consumption around 8% and 16% compared with the PID and On-off controllers, respectively, while maintaining an optimal soil moisture level.


Introduction
Reducing water consumption is a fundamental constituent of water management, particularly in water-scarce areas. In many countries, irrigation water is one of the major contributors to water scarcity, and reducing irrigation water while increasing water efficiency is a way to overcome this issue. This work, which is an extension of the paper originally presented in 2019 8th International Conference on Modeling Simulation and Applied Optimization (ICMSAO) [1], looks at different practices used to reduce the use of irrigation water and proposes the use of an advanced optimization technique as possible solution to the problem.
Different mulching practices, irrigation techniques and irrigation strategies can reduce water consumption in irrigation. Mulching refers to the practice of covering the soil with protective material to reduce evapotranspiration. Irrigation techniques (dripping, furrow, sprinkler etc.) refer to the way irrigation water is applied, which also affects evapotranspiration. Irrigation strategies refer to the timing and the amount to irrigation water provided to the crop. Irrigation scheduling, which refers to when and how much to irrigate, is a fundamental concept associated with irrigation strategies [2], [3]. Although mulching practices, irrigation techniques and irrigation strategies are all important tools, in [2] it is found that for optimal results, the irrigation strategy should be improved first, followed by mulching practices and the irrigation technique. Therefore, in the present study we will focus on irrigation strategies and, in particular, on water-efficient irrigation technology.
Technological developments include automated irrigation systems, that irrigate at set times and for a certain amount of time. Although these automated techniques present advantages in terms of increased water efficiency and reduced farmers'intervention, the performances of these open loop control systems in terms of water consumption are not yet optimal. The main reason of their unsatisfactory performance is that they can cause under-or overwatering, since weather and crop conditions are not taken into account. This of course can lead to spoiled crop and water wastage.
Greater expectation is placed on technologies which include sensors and closed-loop watering systems [4]- [6]. The simplest approach uses sensors in an on/off control scheme, where irrigation is turned on or off depending on the reading of a moisture sensor above or below set values.
More complex control strategies, which often are model-based, have been described in different papers [7]- [10]. In general, modelbased control strategies require models of the soil moisture dynamics including variables such as climatological data, crop water needs, water saturation etc. [7], [8]. Among such advanced control strategies is Model Predictive Control (MPC), as proposed in the research described in [9] and [10]. The models presented in [9] and [10] are based on the water balance equation, which requires measuring or estimating the initial soil moisture, rainfall, ASTESJ ISSN: 2415-6698 water capacity of the soil and evapotranspiration (ET). From these measurements, the water balance equation gives an estimation of the soil moisture. In these papers, the MPC algorithm is formulated as an optimization problem, which reduces set point tracking errors.
Similarly to the work presented in [9] and [10], our work describes the development of a soil moisture dynamic model and its application in a predictive control setting. However, the predictive control strategy here proposed is based on Economic Model Predictive Control (EMPC), which aims at maximizing the economic performance of the irrigation system rather than reducing tracking errors. Constraints in the optimization problem are used to guarantee that optimal soil moisture is obtained. Moreover, in the present study the soil moisture model is based on atmospheric conditions of the Kingdom of Bahrain [11].
The remainder of this paper is organized as follows. Section 2 describes the derivation of the soil moisture model based on the water balance equation and the measurement of meteorological data of the Kingdom of Bahrain. Section 3 describe the principles of MPC and presents EMPC as a special case of the MPC policy. In Section 4 the outcomes of employing the EMCP are shown and comparisons are drawn with On-off and PID automated irrigation systems. Finally, conclusion and recommendations are included in Section 5.

System Identification
This section presents the grey-box modeling of the soil moisture dynamics using difference equations. Grey-box modeling is a method for identifying the system's dynamics that uses measurement obtained from experimental data combined with physical knowledge of the system. For parameters estimation, state space models are often used, where the state, input and output of the system are related by difference equations.

Physical Modelling 2.1.1. Water-balance equation
The model developed here is based on the water-balance equation represented graphically in Figure 1 [9], [10]: where k is the sampling time, M is the moisture of the soil, IR is the irrigation water, RAIN is the precipitation, CR is the capillary rise, ETc is the crop evapotranspiration, DP is the deep percolation and RO is the water runoff.
Equation (1) expresses the variation in soil moisture as the difference between the water influx (capillary rise, precipitation and irrigation) and the water losses (evaporation, transpiration, water runoff and deep percolation) [10].
Geomorphological and meteorological data of the Kingdom of Bahrain show a generally flat land and very scarce precipitations. Therefore, it is reasonable to assume that water runoff, precipitation, and capillary rise are negligible. Under these assumptions, (1) can be reduced to: Equation (2) reduces the dependency of soil moisture to three variables: irrigation, evapotranspiration and deep percolation.

Evapotranspiration Estimation
Evapotranspiration is defined as the movement of water from the soil and the crop into the atmosphere. Many factors influence evapotranspiration rate, such as crop type and growth stage, weather factors (air temperature, wind, humidity etc.), environmental conditions (e.g. soil salinity) and land management (use of fertilizers and pesticides, etc.) [12].
Different approaches exist to estimate evapotranspiration [13]. In the present study, the FAO Blaney-Criddle estimation approach has been used. Despite being a simpler method compared to others, it has been proven to be satisfactory under a variety of weather conditions [14], [15].
Using this method, the actual evapotranspiration ETc is estimated for a particular type of crop C as: In (3), the crop coefficient Kc depends on the crop type and the growth stage of the crop. ETo is the estimation of the evapotranspiration from the reference crop with hypothetical qualities (actively growing green grass of 8-15 cm height). In the present study, ETo is assumed to be affected by climatic parameters, according to the following empirical FAO Blaney -Criddle equation: where Tmean is the average daily temperature [°C] and p is the average annual percentage of daytime.

Deep Percolation
Deep percolation (DP) is a hydrologic process, where water penetrates below the roots of the crop. The quantity of percolation during irrigation depends on the characteristics of the soil as well as the soil humidity.
In the present study, DP is assumed to be directly proportional to M with proportionality constant Kp: when M increases, DP increases due to differential pressure [16]. This is expressed by the following equation: In (5), Kp is a constant that depends on the type of soil (sandy, clay, silt, loamy, etc) Substituting (3) and (5) in (2) we get a difference equation which leads to a model of the water balance dynamic in the form: where Ks=1-Kp.

Model Structure
Equation (6) gives a mathematical model which contains two parameters, Ks and Kc. In our work, these parameters are unknown, meaning that the value of crop coefficient and the type of soil used in our experiment are unknown. Therefore, a gray-box system identification process, which uses a the first principles model of the system and data coming from direct system measurements, was used to estimate the values of the unknown parameters.
The linear difference equation (6) can be re-written in the form of a discrete state space model as: where M(k), IR(k), ET0(k) are the state vector, the input signal, and the disturbance of the system.
The state-space model (7) and (8) presents two parameters, Ks and Kc, that need to be estimated from measured data.

Parameters Estimation
Parameter estimation was carried out using Matlab System Identification Toolbox R2018a, which provides a tool for deriving mathematical models of dynamic systems given measured inputoutput data. The toolbox was used to estimate the values of Ks and Kc, through a gray-box model estimation process. Figure 2 shows the process of model identification. A set of measurements (see Figure 3), called identification data, was collected using a data acquisition system implemented on an Arduino Uno microcontroller board.
The experimental setup consists of a temperature sensor LM35, and a soil moisture sensor FC-28. The temperature sensor outputs a voltage which is directly proportional to the instantaneous temperature. The soil moisture sensor measures the volumetric soil moisture as a function of electric conductivity in the soil. In our experiment, the position of the soil moisture sensor was fixed at 10 cm depth. The sensor was calibrated by taking two measures; one with the soil entirely wet and one with the soil entirely dry. The moisture was expressed in percentage, with the values of the measurements mapped from 0 (dry soil) to 100 (soaked soil). For our experiments, the soil moisture M and the temperature T near the moisture sensor were synchronously measured every hour over a period of two days. The irrigation IR was modeled as a pulse signal, since it provides a great amount of water but for a limited time [10].
The Blaney-Cradle equation block in Figure 2 estimates ETo using (4). In our experiment, the value of the variable p in (4) was substituted by the actual percentage of daytime for the time of the year in which the experiment was conducted. In the same way, the variable Tmean was substituted by the actual temperature T measured at time k.

Model Validation
To validate the model obtained in the previous section the output of the simulated model was compared with measured data.
For this purpose, another set of input data was measured and then inputted to the derived model of the system. The input data set used in the validation is shown in Figure 4.  Figure 5 shows the difference between the output of the model and the measured soil moisture. The plots show a good agreement between simulated and measured outputs, with negligible time delay between the irrigation event and the change in soil moisture dynamics.
A further comparison between simulated and measured outputs to verify the reliability of the identified model was done calculating the Mean Absolute Error (MAE) as follows: where ̂− is the difference between the predicted and the measured output value and T=48 is the total number of samples. The obtained MAE value of 2% is considered an indication of a valid model.

EMPC Basic Concepts
The term Predictive Control refers to a control design method characterized by [17]: • use of a model to forecast the system output at future time instants (prediction horizon); • computation of an input control sequence that optimizes a given objective function; • receding horizon strategy, where the input control sequence is computed by taking into account the predicted outputs, but only the first control signal of the sequence is applied to the system.
The different algorithms which belongs to the Predictive Control group present differences in terms of the chosen system models (impulse, step, state-space, CARIMA, fuzzy models, etc.), disturbance (constant, decaying, filtered white noise etc.) and in the cost-function to be minimised.
A general MPC mathematical formulation is given by the following optimization problem [18]: where the variables x ∈ R n and u ∈ R m denote the state and control action at the instant k and Hc denotes the control horizon. The notation + | , with k ∈ Z, indicates the estimation of the future variables based on the measurements at current time instant k.
Traditional MPC controllers minimize a quadratic cost function which tracks output and manipulated variable references. The general prediction model can be expressed by the discrete equation: where the predicted states depend on the future states and control actions from instant k to instant k+Hp.
The minimization problem is usually subject to a set of constraints which have to be satisfied over the predictive horizon. These constraints are due to physical or operational limitations of the real system and they take the general form: At each time instant, MPC measures or estimates current state xk and predicts the system state evolution over the prediction horizon Hp using the current state and the model of the system. The optimal control sequence over the control horizon Hc is found solving the minimization problem (10). Only the first control action is applied to the system, and the remaining results are discarded.
In absence of disturbances and plant-model mismatch, the optimization problem could be solved as an open-loop problem, and the input sequence found at k=0 could be applied to the system for all k≥0. In a more realistic scenario, the behavior of the real system differs from the predicted model output. To cater for this mismatch, the optimal control problem is solved again at the next sampling time. Using the state measurement/estimation at time k+1, the cycle of prediction and optimization is repeated, moving the horizon forward ( Figure 6). In recent years, the EMPC approach has been proposed with successful applications in various fields [19].
Contrary to traditional MPC, EMPC is employed to maximize profitability, rather than minimize tracking errors. This can be done by defining a cost function that, directly or indirectly, measures the process economics [20]. The formulation of cost function depends on the particular applications, such as the operating profit, production rates, product selectivity, and product yield. In EMPC the cost function, as well as the plant dynamics and the constraints can be linear or nonlinear. Therefore, generic performance cost functions and nonlinear optimization algorithms are used to solve the minimization problem. The structure of the basic EMPC algorithm is shown in Figure 7.

EMPC Problem Formulation
In our work, we utilize an EMPC approach to minimize water consumption while maintaining the soil moisture close to an optimum value. We consider a linear economic stage cost function; additionally, both plant dynamics and constraints are linear. Because of this, our formulation of the EMPC problem is linear. The fundamental steps of the devised EMPC algorithm are the following: • At the time k, measure M(k) and compute the optimal control sequence ( ) by solving a stochastic optimization problem over the control horizon Nc.
• Apply only the first computed value IR(k/k) as input to the system.
• At the time k+1, measure M(k+1) and repeat the optimization.
At each time instant k, a vector ( ) of the moisture predicted values is computed, using the model given by (7) and (8): The stochastic optimization problem becomes deterministic if we assume that ETo does not change over the prediction horizon Np., i.e.: where ETo(k) is calculated using (4) and the current measured temperature T(k).
Let's define the future control signals as the vector: Combining (13), (14) and (15) with the model (7) and (8) we obtain: where: The purpose of the designed control system is to obtain optimal economic performance. The following stage cost is assumed to reflect the nominal economic cost of irrigating the system over one sampling period, that is: The cost function does not consider the cost of operating the valves or the cost of pumping water, since their minimization is not considered an objective in the present study.
The resulting optimization problem adopted in our EMPC controller formulation is: In addition to the stage cost, the objective function contains the terms ( + ) which represent soft economic constraints.
The minimization problem (21) is subject to: where ̅ ( ), ̅ ( ) are vectors of size Np defined as follows: The value Mopt represents the soil moisture that should be kept constant for optimal operating conditions. The variable v(k) is a slack variable that is introduced to allow for small variation of the soil moisture M(k) around the optimal value. That is, we nominally want to satisfy M(k)=Mopt, and when these constraints are violated, an additional cost ( + ) is paid, weighted by the penalty parameter ρ. The choice of the parameter ρ is critical; when it is chosen too small, the value of the soil moisture might be far from the optimal one; when it is chosen too big, we might incur into infeasibility issues.

Simulation Results
The performances of PID controller, On-off controller and the proposed EMPC are compared. Not surprisingly, the behavior of the three control techniques is very different, as it can be observed in Figure 8 and Figure 9.
The On-off controller uses the measurement from a moisture sensor to switch the irrigation pump on or off based on whether the measurement is below or above maximum and minimum limits. The output from the device is either 100% on or off, with no middle state. Figure 8 shows the outcome using the On-off controller. In this example, the soil moisture minimum and maximum levels are fixed at 50% and 70%. As expected, the output presents a variation of the moisture level (overshoot) around the optimal value of 65%. Reducing the thresholds could help improving the underwatering issue, but it would imply a higher switching of the actuators and a persistent overwatering problem. In Figure 9 the outcomes of the PID and EMPC approaches are shown. It can be noticed that the EMPC maintains the value of the soil moisture around the optimal value better that the PID controller in presence of disturbances, since it considers the effect of ETo(k) on the moisture level over the prediction horizon. The three irrigation systems are also compared in terms of accumulated error, defined as: where the error is the difference between the optimal soil moisture and the simulated soil moisture. The cumulative error gives an indication of the ability of the controller to keep the soil moisture close to the optimal value. As it can be seen in Figure 10, the EMPC has smaller cumulative error compared to the other irrigation methods.
The total water consumption over the 48 hours period is around 2400 ml for the On-off controller, 2160 ml for the PID based system and 2000 for the EMPC. Therefore, the EMPC yields a reduction of water consumption around 8% and 16% compared with the PID and On-off controllers, respectively, while keeping the soil moisture within optimal values. The simulations demonstrate that the EMPC scheme applied to an irrigation system provides benefits compared to conventional irrigation methods, since it maintains the moisture level near the nominal optimum, while providing economic benefit.

Conclusions
This work presents the process of developing an optimal controller regulating the time and amount of irrigation to maintain the soil moisture around an optimal level, while taking into account system constraints. The proposed control strategy, based on EMPC techniques, was implemented in MATLAB and results were compared with traditional irrigation methods based on PID and On-Off controllers. The results suggest that EMPC applied to irrigation systems can lead to increased efficiency and reduced water consumption.
Further improvement of this work would require a more accurate model of the system. A current limitation is given by the model developed, which can be improved by collecting sensors measurements over a sparse area and under different operating conditions, and using more complicated approaches to estimate ETo such as the FAO Penman Montheith technique.
Furthermore, developments on this work could explore the implementation of the proposed EMPC algorithm on hardware and evaluate the feasibility of such strategy in real time.