Design and implementation of an automatic pressure-control system for a mobile sprayer for greenhouse applications

This article presents the design and development of an embedded automatic pressure-control system for a mobile sprayer working in greenhouses. The pressure system is mounted on a commercial vehicle, it is composed of two on/off electro-valves and one proportional electrovalve. The hardware developed is based on an embedded microprocessor and provides a low-cost and robust solution. The resulting embedded system has been tested on a spraying system mounted on a manned vehicle. Furthermore, an easy-tuning non-linear PI (Proportional Integral) controller to achieve the desired pressure profile is designed and implemented in the embedded system. Many physical experiments show the best performance of such controller compared with a typical PI controller. Experiments covering the pressure range from 2 to 14 bar obtained a mean error less than 0.3 bar. Summing up, a low-cost automatic pressure-control system is developed, it ensures a uniform decomposition of the liquid sprayed on plants, and it works properly over a wide variable-pressure range.


Introduction
Spraying constitutes one of the most important tasks related to any agricultural production system, especially in greenhouses.Generally, spraying tasks in greenhouses are performed manually where a human operator moves between crop rows using a hand-held sprayer.The main drawbacks of these manual tasks are that the deposition over the canopy is not uniform and causes large losses to the soil (Sánchez-Hermosilla pressure range (4-12 bar); (iv) the proposed control approach should be easily adapted to any kind of vehicle working in a greenhouse.

Spraying system
The spraying system considered in this work was mounted on a commercial vehicle called Tizona ® (Fig. 1a) developed within the framework of a development project between the University of Almería and the company Carretillas Amate ® (Project 400567: "Selfpropelled Platform for Spraying and Transportation Tasks").It constitutes an articulated vehicle with four powered wheels; its dimensions are 0.8 m wide, 2.25 m long and 1.9 m high at the top of the nozzles.The vehicle is driven by hydraulic motors fed by one variabledisplacement pump powered by 19 HP petrol engine, allowing a maximum velocity of 2 m s -1 .A hydraulic cylinder in the joint part permits turning motions with a minimum turning radius of 1 m.The mass with no load is 410 kg, reaching 1,040 kg with the pesticide tank full.
As mentioned above, this platform carries the spraying system, with a 500 L tank used to store the chemical products, two vertical boom sprayers with ten nozzles (Teejet DG 9502 EVS, Spraying Systems, Co., Wheaton, USA), two on/off electrovalves to activate the spraying (481414202, Arag, Rubiera, Italy), a proportional electrovalve (463022S, Arag, Rubiera, Italy) to regulate the output pressure, a double-membrane pump with pressure accumulator (Inmovilli M50, C-Dax, Turitea, New Zealand) providing a maximum flow of 49 L min -1 and a maximum pressure of 40 bar, and a pressure sensor (466112500, Arag, Rubiera, Italy) for closed-loop control purposes.Fig. 1b shows the spraying system mounted on the vehicle.A block diagram of this spraying system is displayed in Fig. 1c.
In this work, the pressure is controlled instead of the flow (both are directly related) because better spraying conditions can be achieved, mainly regarding the droplet size.Furthermore, pressure sensors have better accuracy when compared with flow sensors of similar cost.The main drawback is that the pressure signal becomes noisy.The noise source comes from a membrane pump, which produces continuous pulses in the flow and thus in the pressure.As detailed in the following subsection a low-pass filter attenuates this effect.et al., 2011), and health hazard for humans and the environment (Martinez et al., 2002;García & Gadea, 2004;Nuyttens et al., 2009).As an alternative to the spray guns, vehicles equipped with spraying systems with vertical spray booms that move through the crop rows give better spray distribution over the plant canopy and reduce the human risks.Nuyttens et al. (2009) notes that for a constant spay volume a human-driven vehicle reduces 60-fold the potential dermal exposure in comparison to a standard spray gun.Furthermore, the potential dermal exposure varied from 19.7 mL h -1 for a vehicle to 460 mL h -1 for a spray lance.
This paper focuses on research into developments automatic sprayers mounted on vehicles.In the literature, there are two main approaches: mobile robots and human-driven vehicles.An autonomous robot was reported in Mandow et al. (1996), where the objective was to demonstrate the autonomous navigation capabilities of the robot in a greenhouse using a constantpressure spraying system.In Adams et al. (2003), an inductive guidance system was developed for spraying at constant pressure.Subramanian et al. (2005) developed a mini-robot to perform spraying activities.In Guzmán et al. (2008), a variable-pressure automatic spraying system was developed for a tracked mobile robot working in greenhouses.The main advantage of previous developments is that mobile robots almost completely eliminate the need for the human presence in greenhouses.However, in general, these projects do not completely solve the problem of autonomous navigation in a full-scale greenhouse, especially with different lane configurations.Therefore, the current commercial solutions require a human operator who drives a vehicle and handles the spraying system.In this sense, however, Fumimatic ® and Tizona ® vehicles developed by IDM-Agrometal (www.idm-agrometal.com)and Carretillas Amate (www.carretillasamate.com),respectively, deserve special mention.In these vehicles the steering tools are in the front part of the vehicle far from the spraying bars.This configuration reduces human exposure to pesticides.
This work aimed at the design, implementation, and testing of an automatic spraying system with safe and efficient operation, minimizing human exposure to the chemicals sprayed.The main objectives are: (i) developing a low-cost solution in terms of the equipment required for control purposes; (ii) ensuring a uniform decomposition of the liquid sprayed on plants; (iii) implementation of a non-linear PI (Proportional Integral) control law that ensures good performance over the Automatic pressure-control system for a mobile sprayer for greenhouse applications

Embedded system design
In this section the embedded controller board (Pawlowski et al., 2006) is described.The embedded controller designed interacts with the spraying-system actuators and the sensors to regulate the system pressure.Additionally, the information from spraying systems is completed with a velocity sensor.The data gathered is saved in a memory card and to be available to the user for analysis.Furthermore, the system developed incorporates one additional system to detect crop rows in order to open/close spraying bars automatically.This problem is solved using two ultrasonic sonars located on both sides of the vehicle.For security reason, the system is equipped with manual control of the spraying bars that enables to the operators to react under abnormal situations.These sensors detect plant lanes and thus chemical products are applied only to the desired area, avoiding the zones without plants.The system should facilitate the configuration of specific parameters to set up all work variables.In this case, an LCD (liquid crystal display) display and a small keyboard are used to handle the user interface.Another subsystem that needs to be considered is a communication interface.It is required to share work rapports generated at the end of the spraying tests.Finally, a power supply-subsystem is designed to ensure all voltage and current requirements for all the components and other subsystems considered in the hardware system developed.For meeting these requirements, each component and its characteristics (i.e.power requirement, output signals, required measure accuracy, etc.) were carried out.For cost reduction of the final product and fulfilment of specific features, the hardware is grouped into three separate boards.In this way, the power supply subsystem concerns elements having interfacing actua-tors.The second group deals with ultrasonic sonars and its driving electronics.The remaining subsystems are integrated with the main embedded controller board.
The next design step is dedicated to laying out electronic schemes, making the required connection between corresponding elements of each board.Then, the printed circuit boards (PCB) are generated for each systems group.The functionalities for each board are described below.

Valve-driver board
The main task of this board is to drive valve DC motors that are used to move the mechanical parts of the valves based on the low-power control signals from the microcontroller.The on/off valves are controlled using electromechanical relays.The proportional valve motor needs to be controlled in a different way, since it requires two-directional regulation.For this, an "H-bridge" based on MOSFET transistors (Luecke, 2004) was designed.This solution allows bidirectional control of the proportional valve, using only two logic signals.The board is connected with the microcontroller through four digital lines; two of these are used for the proportional valve and two for on/off valves.The same board is employed to locate power-supply elements used to convert 24 V from vehicle battery into 12 V and 5 V, which are needed for the different components of the board.Additionally, all high current paths are protected with fuses to protect active elements against overload or possible short-circuits.The valve driving board should be set into the ventilated housing due to thermal characteristics of the elements used.Fig. 2a shows the final board prototype.

Ultrasonic sonar board
The core idea of the use of ultrasonic sonar is to detect objects in the range of {0,1.5}m from both sides of the vehicle.As mentioned above, it enables chemical products to be applied only in desired areas, reducing costs and improving uniformity of the spray distribution.Taking into account the system requirements, we decided to build cost-effective ultrasonic sonar.This ultrasonic sonar composed of a transmitter circuit and a receiver circuit.To transmit sound waves, the active element must be excited by square signal at 40 kHz provided by the microcontroller.The signal emitted is reflected by the objects located in the detection area.The signal reflected is captured by the receiver, which converts sound vibration into electrical waves.Then, the signal received is amplified and filtered to separate the useful signal from noise.The following action consists of comparing the filtered signal with the reference.This action is carried out only for an established time window.The size of the time window determines the maximum sensing length, which for this project was set to 1.5 m.If the signal received has sufficient amplitude (valid reflected sound wave), a comparator sets a simple-state storage element to logical high state, flip-flop in this case, which maintains the high state until detected by the microcontroller.When microcontroller reads sonar states correctly, a reset signal is sent to the state storage element and the whole procedure is repeated again.The ultrasonic sonar board is shown in Fig. 2b.The board developed is placed close to the spray nozzles and therefore requires a special watertight housing to guarantee adequate protection.

Main embedded controller board
The most important element of the entire spraying system is the controlling hardware element, which in our case it is based on a microcontroller.Currently, the microcontroller market contains a wide variety of products with different hardware configurations.For our system, the following sensors and actuators must be interfaced within the embedded controller: a pressure sensor, a velocity sensor (encoder), two proximity sensors based on ultrasonic sonar, two on/off electromechanical valves, and one proportional electro-mechanical valve for pressure control with digital controls.Other important components are: one LCD graphical display; a keyboard to create a user interface that permits onsite spraying system configuration; a real-time clock (RTC) to create time stamped measures as well periodical rapports; a SD (secure digital) memory card which is used to save all sensor measurements and work parameters; RS-232 and USB interfaces for communication purposes; JTAG (Joint Test Action Group) interface for programming/debugging the programming loaded in the microcontroller; and all corresponding connectors for interfacing external system components.
In this case, an 8-bit ATmega64 AVR microcontroller from the company Atmel Corp. ( 2009) was selected.This device contains all peripherals needed to handle previously described components and covers all signal requirements for sensor/actuator interfacing.The final board for main embedded controller is shown in Fig. 2c.
Notice that all interfaces are embedded into one microcontroller chip, so that a small board is easily incorporated in the vehicle control panel.Another important advantage of the hardware built is the use of JTAG interface, which allows an easy onsite firmware update of the embedded controller.The software was written in C++ language with short assembler routines for critical section.The developed system prototype was first tested under laboratory condition in order to detect eventual hardware and software bugs.Afterwards, the developed embedded

Modelling
For adequate control system design, the dynamic behaviour of the plant to be controlled must be analysed and the corresponding dynamical model must be obtained.After analysing the process dynamics, we observed that the system presented a non-linear behaviour (see Fig. 3).Then, different tests were carried out to check whether the process dynamics could be approximated around the desired operating point.Firstly, we carried out several open-loop experiments checking the response of the spraying system with different proportional valve-opening steps (5%, 10%, 20%) covering the full working ranges of 0% to 100% and 100% to 0%.Note that these ranges cover pressures from 0 to 40 bar.
As shown in Fig. 3a, a noisy pressure signal results with large oscillations at maximum pressure (range 30-40 bar).In order to attenuate such undesired noise, a low-pass filter has been designed with a crossover frequency of 4.4 Hz.
From the experiments shown in Fig. 3b, it can be observed that the pressure response to an open-loop step input in the valve aperture around a particular operating point can be approximated by a first-order system.It can be modelled using the following transfer function (Åström & Murray, 2008): where k is the static gain, which is the ratio between the change in the output amplitude in steady state and the input step amplitude; t r is the delay time, or time lapse during which the output of the system does not react after the step is made in the input (in this work the delay time is zero for all operating points); and τ is the time constant, which is the time lapse since the instant at which the output starts to evolve until it reaches 63% of its new steady-state value.
Once the model structure is defined, the next step is to choose the correct value for its parameters, which are usually operating-point dependent.The reaction curve method was used for identifying these parameters (Åström & Murray, 2008) based on the open-loop-step responses.
As observed in Fig. 3b, the output pressure presents different dynamics at each operating point.In this work, a model is obtained for each specific operating point belonging to the operational range considered (4-16 bar).Therefore, the reaction curve method is used around the desired operating range in order to achieve the different parameter sets.

Non-linear control system
Most of non-linear control problems are solved using straightforward control strategies such as gainscheduling or mean values controllers.However, these solutions behave properly only at specific operation points and may result in overshoot (Lee et al., 2000).More specifically, mean value controllers usually give worse results near domain limits, and gain-scheduling controllers may have behaviour problems if there is a controller change during reference tracking.A non-linear controller is developed to avoid splitting into intervals the controller domain (Rodríguez et al., 2011).In this case, process model parameters are approximated as output-dependent functions (depending on spraying pressure).In this case, process model parameters are approximated as output-dependent functions (depending on spraying pressure): where k(p) and τ(p) are the system static gain and time constant, respectively, interpolated with respect to spraying pressure, p. Adjusting these functions correctly is essential in order to get a proper closed-loop response and to avoid unexpected situations such as unstable behaviour.In this work, a PI controller was used to control the system because of its simplicity and good results in industry.Note that a PID (Proportional Integral Derivative) controller is discarded due to the negative influence of the noise in the derivative action.This controller is defined as (Åström & Murray, 2008) where K p and τ I are the PI controller proportional gain and integral time, respectively.In this case, the pole-zero cancellation method was for tuning purposes (Åström & Murray, 2008).Therefore, according to this method the controller tuning parameters are expressed as τ τ τ τ where τ BC is the time constant of the closed-loop system.Finally, the proportional gain is It is clear that using the non-linear model described in [3], controller tuning parameters depending on it also change according to pressure-output operating point described, in this case, by both polynomial functions for static gain and time constant, as explained in the Results section.

System modelling
Several open-loop experiments were performed to obtain the dynamic model of the spraying system using different amplitude opening steps (5%, 10% and 20%) over similar operating points.The analysis of the results shows that the output-pressure behaviour changes when the same valve-opening steps are made at different operating points, as shown in Table 1, confirming the non-linear characteristics of the system.
In a preliminary approach, the system was modelled as a first-order dynamical system with no delay with fixed parameters set as the mean of the different measured ones at several operating points using the reaction curve method.In this way, the gain is given by As previously commented, a non-linear approach was followed -that is, a second-order polynomial used to adjust the model parameters depending on the operating point was calculated.Fig. 4a,b shows the quadratic polynomials adjusting the gain and the time constant, respectively.According to Fig. 4a, the equation that relates the gain to the operating point is where p refers to operating point.Then, according to Fig. 4b, the equation that deals with time constant is given by Once the system was characterized taking into account the different system behaviour, two polynomials adjusting the gains and constant times were obtained.Afterwards, the control strategy previously presented was tested through simulations and physical experiments in order to check the performance over the pressure range considered, and hence, control performance was validated over the different operating points with different system dynamics.

Control results
As previously discussed, we designed a non-linear PI controller where proportional gain and integral time depends on polynomials addressed in Eqs.[8] and [9].Hence, the non-linear PI controller is defined as At this point, we are showing simulation experiments, comparing a typical fixed-parameters PI controller, where the mean system gain and time-constant values were considered, as well as the proposed nonlinear PI controller.The non-linear split model was used as a reference comparing the different control strategies developed.As a result, Figs. 5 and 6 show the performance for all operating points (Fig. 5a deals with pressure, Fig. 5b displays the control inputs, the evolution of the proportional gain and the integral time are plotted in Figs.6a and 6b, respectively).Note that the second-order polynomials obtained fit well in the chosen working domain, but having values outside this domain can make the system unstable.In order to avoid this, we included a restriction in the non-linear PI controller when the pressure output falls below a minimum value.After simulations, physical experiments were conducted comparing the performance of a fixed-parameter PI controller and the proposed non-linear PI controller.Note that these controllers were running on the low-cost embedded hardware system detailed in the M&M section.In this sense, the proposed low-cost embedded control was tested through many physical experiments under real conditions.The sampling period was selected according to the system dynamics (system time constant) as 0.34 s.A dead zone, in relation to the error between the pressure set-point and the actual pressure estimate, was used to smooth the control input.In particular, we tested several values, obtaining the best results for ± 0.2 bar.
It should be noted that, before achieving the autonomous control and due to non-linear behaviour of the process, the system is firstly moved manually to an  947 Automatic pressure-control system for a mobile sprayer for greenhouse applications operating point in the range for which the control strategy was designed.In general, the starting pressure was 2 bar.
The proposed control system implemented on the low-cost embedded hardware is able to reach desired specification satisfactorily despite variations in the (open-loop) plant dynamics.As mentioned above, in the pressure system presented in this work, such variations appear along the different operating points of the process.Therefore, the system was tested through a group of different steps in order to verify that the control approaches, fixed PI (using the mean system gain and time constant) and the non-linear PI controller, achieve a small tracking error.Fig. 7 shows one experiment with steps of 5% and a pressure range from 2 to 14 bar.It can be observed that the pressure correctly follows the proposed references by the nonlinear PI control approach (Fig. 7a) and the control signals performed well (Fig. 7b).Note that despite large perturbations due to the use of the membrane pump, the controller achieved a good disturbance rejection.It is important to point out the small steady-state error in steps around 10 bar, this being due to the dead-zone included for the control error in order to avoid excessively fluctuating control signals (see Fig. 4).The evolution of the pressure-dependent parameters of the non-linear PI controller is plotted in Fig. 8.Note that when pressure increases, the value of the proportional gain also increases (Fig. 8a); as confirmed in Table 1, greater pressure means a smaller system gain (in our case the proportional gain is the inverse to the system gain).For the case of the integral time constant, when the pressure increases, the value of the integral time decreases (Fig. 8b).The constant values at the beginning and end of the experiment are because the polynomials adjusting the system gains and time constants were defined for pressures higher than 4 bar.
After 15 physical experiments comparing the performance of the fixed PI controller (nine experiments) and the proposed non-linear PI approach (six experiments) the mean error using the fixed PI approach was 0.33 bar with a standard deviation of 0.72 bar, which implies an error of 2.75% and 6% within the range considered (from 2 to 14 bar).In the case of the nonlinear controller, a mean error of 0.33 bar with a standard deviation of 0.65 bar was found, implying 2.75% and 5.4% in the range.

Discussion
The main novelty of this work is that it faces the problem of phytosanitary applications within a general control framework, both a low-cost embedded hardware system, and a modelling and control approach based on widely accepted control paradigms that have been developed and integrated.Regarding the first element, embedded hardware, we developed a low-cost microprocessor-based system which controls a spraying system.For instance, in Guzmán et al.  ( 2004,2008), a PC-based workstation with several I/O cards was used to handle a spraying system.This constituted a bulky and expensive solution compared with the hardware developed here.Furthermore, in both papers a Windows-based operating system was employed, and hence, real-time specifications were not completely ensured.Here, an embedded program runs directly in the microprocessor, which ensures real-time operation.
On the other hand, regarding the control system, different control strategies have been studied in order to provide a good tracking performance around the desired pressure.In this case, a non-linear PI approach has been selected as the best option.This strategy shows the proper performance for different set-points.In this context, the works of Moltó et al. ( 2001) and Solanelles et al. (2006) are similar to the one presented here.The main difference is that these works are designed to operate in open field, so that a set of ultrasonic sensors are used to regulate the pressure applied to the trees based on the actual amount of leaf mass and the canopy width of tree crops.However, these works do not address the issue of variable-pressure feedback control because they simply open or close electrovalves depending on the tree width and predefined pressure values.
Regarding the physical experiments conducted in this work, we confirmed that for experiments covering the range from 2 to 14 bar (desired pressure range) the mean errors were less than 0.3 bar.According to our experience, these errors can be considered acceptable.Although a smaller error could be expected in relation to the non-linear PI controller, it is important to remark that the limited range in which the pressure-dependent parameters are employed (recalling that polynomial functions cover the range from 4 to 14 bar), we expect that for a larger range the difference will be higher.
Future works will deal with the use of the vehicle speed within the pressure control strategy to change the pressure set point depending on such vehicle speed.

Figure 1 .
Figure 1.Automatic spraying system used in this research.(a) Manually driven vehicle and spraying system.(b) Detail and (c) block diagram of the spraying system.Pipes with pressurePipes without pressure

Figure 2 .
Figure 2. The valve driver board (a), the ultrasonic sonar board (b) and the embedded controller board (c).
Automatic pressure-control system for a mobile sprayer for greenhouse applications controller was integrated and wired into the vehicle electric installation.

Figure 3 .
Figure 3. Open-loop test of the spraying system showing the effect of the software low-pass filter attenuating the noise of the real pressure signal.(a) Opening test of 5%: noisy signal without filter and filtered signal using low-pass filter and (b) zoom of the filtered signal.

Figure 4 .
Figure 4. Polynomials adjusting model parameters depending on pressure.(a) Quadratic polynomial adjusting (a) gains in relation to pressure, (b) time constants in relation to pressure.

Figure 5 .Figure 6 .
Figure 5. Closed-loop simulation comparing the performance of the fixed parameters PI controller and the non-linear PI controller proposed in this work.(a) Pressure, (b) control inputs.

Figure 7 .
Figure 7. Closed-loop real experiments using the developed low-cost embedded PI non-linear control system.(a) Pressure and (b) control inputs.

Figure 8 .
Figure 8. Tuning parameters of non-linear PI controller: (a) evolution of the proportional gain and (b) of the integral time.

Table 1 .
Results of open-loop tests using steps of 5%: output pressure and model parameters (k, τ, t r ) at each operation range