ELECTRICALLY DRIVEN FERTILIZER APPLICATOR CONTROLLED BY FUZZY LOGIC

The present study shows the development, simulation and actual implementation of a closed-loop controller based on fuzzy logic that is able to regulate and standardize the mass flow of a helical fertilizer applicator. The control algorithm was developed using MATLAB's Fuzzy Logic Toolbox. Both open and closed-loop simulations of the controller were performed in MATLAB's Simulink environment. The instantaneous deviation of the mass flow from the set point (SP), its derivative, the equipment ́s translation velocity and acceleration were all used as input signals for the controller, whereas the voltage of the applicator's DC electric motor (DCEM) was driven by the controller as output signal. Calibration and validation of the rules and membership functions of the fuzzy logic were accomplished in the computer simulation phase, taking into account the system's response to SP changes. The mass flow variation coefficient, measured in experimental tests, ranged from 6.32 to 13.18%. The steady state error fell between -0.72 and 0.13g s and the recorded average rise time of the system was 0.38 s. The implemented controller was able to both damp the oscillations in mass flow that are characteristic of helical fertilizer applicators, and to effectively respond to SP variations.


INTRODUCTION
The integration of mechanical systems with sensors that provide information about the operation of the system and actuators able to correct any flaws in the process or a change in operating conditions is being increasingly used in various equipment (ISERMANN, 2008).In agricultural machinery, conventional control systems, such as those used by UMEZU & CAPPELLI (2006), KIM et al. (2008), TOLA et al. (2008), are generally used.However, as these machines generally perform nonlinear processes (GARCIA et al., 2012), the design requirements can not be satisfied when conventional control methods, based on linear process models, are used.In projects of agricultural machinery, the practice of advanced control are weak, with little research in the area, as the study of MAZLOUMZADEH et al. (2008) andCRAESSAERTS et al. (2010), who used complex control systems for process improvement.
Among the advanced systems of control, fuzzy control has been shown to be widely used.
Several authors, such as: PRAVADALIOGLU (2005), RIGATOS (2009) and OMAR et al. (2011) list the advantages of the fuzzy control system as: they can be adjusted for different operating points of nonlinear systems, fit processes of multiple inputs, weight the influence of each variable on the sign of operation, and they are ease in describing, by linguistic rules, complex control models.RIGATOS (2009) reports that conventional controllers are unsuitable for the control of the performance of DC electric motors (DCEM), when operating with a change in its dynamics and its load.PRAVADALIOGLU (2005) developed a fuzzy proportional and integral (PI) control system in order to control a given type DCEM.The performance of the control system handles the duty cycle of the pulse width modulation (PWM), which controls the voltage applied to the body of the DCEM.CALLAI et al. (2007) designed an adaptive fuzzy control system from a fuzzy logic to act in a DCEM in a horizontal positioner.Several studies point to the use of fuzzy logic in order to mitigate effects of nonlinearities, and the use of DCEM as elements of performance due to its ease control.The objective of this study was to develop a fuzzy controller, simulate its use and implement it to regulate the mass flow rate of application, in a combination of a DCEM coupled to a dosing of helical fertilizer.

MATERIAL AND METHODS
The proposed control system, whose block diagram is shown in Figure 1, has the function to control the mass flow of fertilizer application.The manipulated variable (control signal) was the tension that acts on the power circuit and that, in turn, changes the voltage applied to the DCEM body.Thus, DCEM rotation is changed and hence the mass flow rate of fertilizer applied is also changed.The measured variables are the mass flow at the outlet of the injector and the speed of the equipment.Both are used by the controller to set the magnitude of the control signal.The mathematical model of the feeder of fertilizer used in the simulation was described and experimentally validated by GARCIA et al. (2012).This model describes the variation of mass applied as a function of time, the angular velocity and the position of the helicoids injector.The model, shown in eq. ( 1), approaches the applied oscillating mass flow caused by the helical injector for a sinusoidal function, in which the amplitude and frequency are modified depending on the angular velocity ( ) of the helicoid and the efficiency of transport, represented in the model by fill fator (f).
( 1) where, -instant mass flow of the injector, kg s -1 ; η -transport efficiency; A -usable area of the helicoid cross section, mm 2 ; p -helicoid thread pitch, mm; and -angular position and speed of the edge of the helicoid in relation to the unloading point, rad and rad s -1 ; f -fill factor, adimensional; K -relation between maximum and minimum observed flow (it may be approximated to 0,5); -fertilizer specific mass, kg m -3 .
Dimensional parameters related to the dosing of Agromac fertilizer, Fertisystem model used in the simulation were: inner radius of 12.9 mm, outer radius of 33.5 mm, usable area of 1,413 mm 2 and pitch of 19 mm.The material used for the experimental tests, replacing the fertilizer, consisted of plastic beads with specific mass of 500 kg m -3 and angle of repose of 0.70rad (40º).It was chosen not to use fertilizer in the experiments due to its high corrosivity, as it could damage the electronic equipment and instrumentation during the experimental procedures.
The DCEM was considered an ideal electrical machine, as described by FITZGERALD et al. (2006).In DCEM controlled by the body, speed is controlled by the body voltage, as eq.( 2): (2) where, v A -tension applied in the body circuit, V; R -body resistance, Ω; A i -body current, A; L -inductance, H; t -time, s, and k E -constant of back emf, V s rad -1 .
The coupling of electrical and mechanical parts to the field current in the DCEM, is kept constant.In this case, the flow is constant and the torque becomes directly proportional to the body current.The mathematical model is set and the motor load was represented by transfer functions by applying the Laplace Transform in eqs.( 3) and ( 4): (3) (4) where, K E and K T -constant of back emf of DCEM and the constant of torque, V s rad -1 and N m A -1 , respectively; J -moment of inertia of the DCEM body combined and with the load, kg m -2 , and B -viscous friction of DCEM, N m s -1 rad.
As it was considered the used DCEM from the ideal type and the system as linear, the global behavior may be approximated adding up their effects.Thus: (5) where, F d -dry friction of DCEM, N m.
The mathematical model of the transmission mechanism refers to a set of ideal gear.Internal friction and losses due to slips were disregarded.The moment of inertia of the set was introduced in the DCEM model, so this was not considered.
According to SHAW & SIMÕES (2007), the classical control theory has limitations when applied to nonlinear processes and of high complexity ones.These limitations make it unsuitable the use in control systems of helical injectors, which have nonlinear operating characteristics (GARCIA et al., 2012).According to EMINOGLU & ALTAS (1998), in experiments with a DC motor, it was observed that, in addition to the error, its deviation was important to control the angular speed of the motor shaft factor.Accordingly, the input variables of the fuzzy controller are defined by the following equations.
(6) (7) where, y r and y(k) -reference signal and the measured signal, respectively, and e(k) and de(k) -error between the input signal and the measured signal and the error deviation, respectively.
The signal actuation voltage was supplied by the fuzzy controller with proportional and integral (PI) action, eq.( 8).The integral action in the performance was increased in order to mitigate the error in the system scheme.The proposed control system comprises two proportional integral fuzzy controllers (PI) in parallel, each with two input variables.The first case has as input the error of the mass flow and its variation, and the second, the speed of displacement of the equipment and its variation (acceleration).The input acceleration was considered in order to correct the mass flow rate due to possible variations in the speed of the equipment during operation.Signs of performance of both controllers were summed to generate the performance in DCEM, as shown in Figure 2.This structure was adopted due to the ease of manipulation of earnings for each variable in performance, over a four controller inputs and one output.In addition, with the division into two controllers, one can decrease the total number of rules that were used in the fuzzy control strategy, making the system less complex and increasing the processing speed of the controller.In fuzzy logic, standardized input and output speeches were used as recommended by YAGER and FILEV (1994), setting the inputs with limiters from -1 to 1. Five membership functions were used for each variable in the input.The low number aims at simplifying the number of rules of the controller, that is, decreasing the number of inference rules.In both controllers is used to Mamdani fuzzy strategy.Thus, 25 rules that cover all combinations of membership functions used were introduced.The linguistic terms used in the input variables were: GP (very positive), MP (medium positive), ZR (zero), GN (very negative) and NM (medium negative).Used in the output are seven membership functions for smooth operation, as recommended by SHAW & SIMÕES (2007).The linguistic terms used in the membership functions of the output variables were: very negative (GN), medium negative (NM), low negative (PN), zero (ZR), low positive (PP), medium positive (MP) and very positive (GP).
The mathematical model of the set composed of the fertilizer applicator mechanism, the DCEM and the control system, were simulated using MATLAB -SIMULINK.The controller logic was programmed with the help of "Fuzzy Logic Toolbox" of MATLAB.In the simulation it was used the Dormand-Prince Method (ode5) in the time domain, with fixed pitch between iterations of 0.001s.This method, with reduced interactions between the steps, was used in order to minimize possible errors caused by the numerical resolution.The defuzzification method used was the centroid, due to its property of smooth control action to the variation of the input signal.
The behavior of the fertilizer application system, simulated in open loop control, was obtained by application of MATLAB-SIMULINK, whose block diagram is shown in Figure 3.The simulation includes a signal generator operation, with the mathematical model corresponding to the DCEM, with a zero-order model, which is the transmission of angular momentum through a gear pair and the mathematical model of the fertilizer helical injector.The DCEM mathematical model was based on eqs.( 4) and ( 5) and implemented in the program in the DC Motor (Figure 3) subsystem.The mathematical model of the fertilizer applicator, proposed by GARCIA et al. (2012), was implemented in SIMULINK software in the Injector Model subsystem (Figure 3).The input to the system is a sign of activity corresponding to the angular speed of the drive shaft of the injector (rad s -1 ).The output of the model is the mass flow rate (g s -1 ).
The simulated behavior, in a closed-loop control, was obtained through a MATLAB-SIMULINK program, whose block diagram is shown in Figure 4.A signal generator program was added to the simulation, with the function of providing different excitation signals in the system and a Butterworth low pass filter of the first order, with a cutoff frequency of 25.13 rad s -1 (4 Hz) in order to attenuate noises produced by errors in the numerical resolution.The fertilizer application system was simulated compared to a unit ramp deviation in the set point of mass flow.Three crescent ramps were used (0 to 5 g s -1 , 5 to 10 g s -1 and 10 to 15 g s -1 ) and three decrescent (15 to 10 g s -1 , 10 to 5 g s -1 and 5 to 0g s -1 ).
The experimental validation of the control system was performed through a test bench which was used to interface with the computer, a National Instruments data acquisition board, USB-6009 model, whose main features are: 8 analog inputs and 2 analog outputs; maximum acquisition rate of 48,000 samples per second and a resolution of 14 bits.The control system was developed in MATLAB-SIMULINK and the computer used was a conventional notebook, running with the Windows 7 operating system.Figure 5 shows the block diagram of the test bench with the proposed system.FIGURE 5. Block diagram of the test bench interface.
In the implementation of the fuzzy controller the same structure as the strategy used in the simulations (Figure 2) was used; thus, it was inserted an analog input block for reading the signal from the mass flow and a block of analog output of the "Data Acquisition" tool of the MATLAB program to send the actuation signal corresponding to the performance of DCEM body tension.Furthermore, a low-pass analog filter was inserted in the program in order to filter the signal obtained arising from the load cell of the mass flow sensor.
The tests followed the recommendations of ASABE EP367.2Standard.According to this standard, the main points to be evaluated in VRA equipment are: response time of the controller, system error and response to disturbances in the mass flow rate of application.To verify the ability of VRA, the standard simulation suggests deviations in the set point.With this, one can determine the adaptability of the control system.In these tests multiple steps were applied to the input signal according to the maximum flow applied by the injector.The operation points were changed every 5 seconds initially from 0 to 90%, then 90% to 75%, from 75% to 90%, from 90 to 50% and from 50% to 90%, respectively.For each level of flow, an analysis of variance (Tukey's test, 95% confidence) was performed to establish if there are significant differences between the mean flows applied by the fertilizer applicator for different levels.

RESULTS AND DISCUSSION
Membership functions of both fuzzy controllers were constructed as shown in the graphs in Figure 6.In Figures 6a and 6b it can be noted that the membership functions corresponding to the error of the mass flow and its variation were concentrated near the zero error, in order to obtain a better fit at the point of operation.The membership functions of input fuzzy controller corresponding to the movement speed were normalized (-1 to 1) for absolute values 0 to 2m s -1 .The construction of the distribution of the membership functions for speed and acceleration followed the Mamdani Standard.The determination of universes of discourse and arrangement of membership functions were adopted, in principle, from the behavior analysis of the theoretical response of the mass flow error and its variation in different operating situations.In this sense, a positive error of the mass flow rate, calculated by eq. ( 8), indicates that the current flow is below the set point, and therefore the system is applying less fertilizer than necessary.Otherwise, the flow is applied above the set point and the system is applying more than necessary.Regarding the variation of the mass flow rate calculated by eq.( 9), a positive and increasing variation indicates that the value of the mass flow is decreasing, otherwise, it is increasing.
Rule bases of membership functions, obtained this way, were modified in order to mitigate the consequences resulting from hysteresis and nonlinearity characteristics of the system.Adjusting these parameters was strongly influenced by subjective knowledge based on practical observation of the behavior of the controlled system.Table 1 shows the modified rules.It is observed that for cases where the error is very positive (GP) or medium positive (MP) -conditions in which the mass flow of fertilizer is below the set point -and the variation of the error indicates that the mass flow rate is decreasing (GP or MP) was found to need very positive action (GP) in DCEM to increase the flow provided by metering the fertilizer, thus the mass flow approaches the set point for minimizing the error.Similarly, when the flow is above the set point (NG or MN) and there is a large or medium negative change of the error (GN, MN) the action must be very negative (GN) to quickly lower the mass flow and consequently reduce the error in relation to the set point as quickly as possible.In other cases, the form of action will depend on the combination of the conduct of the error and its variation with the purpose to minimize the effects of hysteresis and nonlinearity.The construction of the rule base of the fuzzy subsystem for speed and acceleration was performed from the specialist knowledge acquired by experimental observations and sought to remedy the effects of speed and acceleration of the equipment applied by the mass flow metering.The set of rules is presented in Table 2. Figure 7 shows the response surface generated by the Fuzzy Toolbox of MATLAB from the pertinence functions and rules of inference adopted.In these areas, it is noteworthy that there are no regions with abrupt changes of operation based on the input of the controller, which shows that the constructed rules (Table 1 and Table 2), as well as the use of seven membership functions for the signal actions, were appropriate.The gains of the fuzzy controllers for both input parameters and for the output (Figure 2) were obtained and adjusted by means of successive simulations.Table 3 shows the optimized values of the gains that were used in determining the performance of the proposed system for fertilizer application.Figure 8 shows the disturbances imposed at the set point of mass flow, the sign of actuation in the DCEM and the simulation results obtained for the mass flow of fertilizers, with and without the fuzzy control system operating.It can be seen from the result of simulation in open loop that the oscillation characteristic of application, inherent to the metering mechanism, is maintained.This is due to the filling factor and the angular position of the helicoid which cause fluctuation in mass flow application.It is also observed that the average mass flow rate obtained with the maximum signal actuation (24V DC) was approximately 22g s -1 .When the fuzzy controller is embedded, it generates a lagged cyclical actuation signal behind the oscillatory feature of the mass flow rate applied, typical of the helical feeders.This operating strategy, introduced by GARCIA et al. ( 2012), enables to eliminate almost entirely the unwanted non-uniformity of the applied fertilizer in the row of plants.Observe also that the error of the mass flow rate applied, both in ascending ramp, as for descending, was virtually nil in relation to the change in the value of the mass flow reference.This is due to the correct formulation of the rule bases for the membership functions and the quick response of the dynamics of DCEM used.It appears that, even in closed loop, after about 13g s -1 , the signal performance becomes saturated and the implementation is increasingly uneven.This defines, for this product, the recommended maximum nominal flow.Note that if this value is below that obtained with the system operating in open loop, which does not constitute a problem, since the system of objective control the uniformity of application, which is satisfactorily achieved.Figure 9 shows the experimental result obtained by the proposed system operating in closedloop control.It is observed that the control system was able to track changes in operating point as well as minimize the oscillation of the application rate.Figure 9A shows the signal obtained by the mass flow filter without using the sensor.In order to reduce noise from the mass flow sensor, a Butterworth low pass filter was implemented.One cut frequency of 12.56 rad s -1 (2Hz), defined in function of the maximum angular speed of the DCEM, was used.The experimental results obtained using the low-pass filter is shown in Figure 9b.It is noted in this figure that much of the noise was eliminated without, however, significantly reduce or misalignment between the signal.The small delay observed in the experimental results, compared to the simulated result, is mainly due to the fact that the model used in the simulation did not take into account the transport delay between the output of the helical injector and the position of the mass flow sensor.Table 4 shows the descriptive statistics and response time of the system to the experimental results of multiple steps in the set point of mass flow.For each set point the transient and steady state was analyzed.It is observed that the coefficient of variation (CV) of the mass flow rate for each flow level was between 6.32 and 13.18%, with an average CV of 11.34%.The steady state error varied between -0.72 and 0.13 g s -1 , with an average error of -0.27 g s -1 , which corresponds to a relative error ranging from -5.62 to 1.87% (Table 4).TOLA et al. ( 2008) using a slotted rotor and fertilizer as a raw material, achieved a relative error within a range of ±5%.
The response time of the system was determined as 0.38 s, the mean value observed in experimental tests.Due to the characteristic of actuation of the controller, it was observed that the response times were also higher for steps with larger amplitudes.It can be seen that the control system is able to adequately correct the mass flow rate applied to each set point.By observing the results of CV, it is possible to verify that they are smaller than observed in the literature.However, it is noteworthy that these results were due to operational tests and not of bench testing, as those obtained in this work.KIM et al. (2008), in operational tests using a pneumatic injector, obtained a CV of the mass flow rate of around 12%.GARCIA et al. (2012) verified in experimental tests applying fertilizer with a helical injector driven by a fixed angular speed, CV of approximately 20%.On the other hand, CAMACHO TAMAYO et al. (2009), under similar conditions, obtained CV around 32%.
Assuming an operating condition where the displacement speed of the equipment is 2 m s -1 , the response time (0.38 s) corresponds to an offset of 0.76 m, which is an appropriate response to operation, since this short space traversed by the device alters the magnitude of the mass flow and the system enters steady state operation.It is noteworthy that the conditions of the tests induced abrupt and large amplitude variations in the set point, such as 0 to 90% of the maximum flow value, which are not usually found in normal operating conditions.

CONCLUSIONS
The simulation system proved to be relevant to the configuration of the fuzzy control strategy and the tune (fine adjustment) of the parameters of the controller, since in this way it was possible to change them in order to visualize the influence of each of the final result.This work proved that the strategy of varying the angular speed of the helicoids during a cycle of operation, done by varying the voltage of the DCEM responsible for triggering the mechanism was adequate to improve uniformity of application of fertilizer.
The use of a fuzzy logic based controller and the construction of an appropriate set of rules are effective in eliminating the effects of nonlinearities in the system.The control system used was capable of reducing the oscillatory characteristic of the mass flow applied by the injector system, as well as it was efficient to keep up with changes in the SP.

FIGURE 1 .
FIGURE 1. Block diagram of the proposed control system.
) -actuation in the process; u(k) -signal of actuation of the fuzzy controller, and K c e K i -proportional gain and integral output gain of the actuation signal, respectively.

FIGURE 2 .
FIGURE 2. Logical structure used to obtain the DCEM actuation signal.

FIGURE 3 .
FIGURE 3. Program in MATLAB-SIMULINK for simulation of the behavior of the open-loop system.

FIGURE 4 .
FIGURE 4. Program in MATLAB-SIMULINK for simulation of the behavior of the closed-loop system.

FIGURE 6 .
FIGURE 6. Membership functions for input and output variables of fuzzy controller: (a) mass flow error; (b) deviation of the mass flow error.

FIGURE 7 .
FIGURE 7. Response surface of the actuation of the control strategy generated by fuzzy toolbox; (a) performance signal of the fuzzy controller as a function of error and error variation of the fertilizer mass flow; (b) performance signal of the fuzzy controller for equipment speed and acceleration.

FIGURE 8 .
FIGURE 8. Simulation system response of fertilizer application for ramp ascending and descending excitation signals.(a) DCEM actuation signal with the open-loop system, (b) the set point and mass flow applied with the open-loop system, (c) DCEM actuation signal with closed-loop control; and (d) set point and mass flow applied with the closed-loop control.

FIGURE 9 .
FIGURE 9. Chart of mass flow obtained with the experimental proposed system.(a) without a filter in the flow sensor signal (b) with a filter in the flow sensor signal.

TABLE 1 .
Inference rules for the mass flow error and its derivative.

TABLE 2 .
Inference rules for the equipment displacement speed and acceleration.

TABLE 3 .
Fuzzy controller gains

TABLE 4 .
Experimental results for the set point variation, as a percentage of maximum flow, of mass flow for the fertilizer applicator operating with the proposed control system.
* Values with the same letter are not statistically different in accordance with the Tukey's test (95% of reliability).