The pesticide application system acquires the canopy characteristic parameters of the tree through the camera and calculates the required pesticide application rate, Q0(t), as the input. The difference between the spray volume measured by the flow sensor and the actual spray volume is used to obtain the deviation in spray volume and its rate of change, and , which are used as inputs to the controller. The output from the controller actuates the solenoid valve to control the flow rate and achieve precise pesticide application. Pressure control employs the same dual closed-loop strategy to ensure accurate spray volume control and maximize droplet deposition control.
2.2.1. Development of the Mathematical Model for Precision Pesticide Application System
- (1)
Study of the Relationship Between Application Flow Rate, Pressure, and Solenoid Valve Input Voltage
This study precisely measured the spraying system’s pressure and flow characteristics to ensure its stability. Considering that the solenoid valve’s maximum operating voltage is 24 V, the tests were conducted within a voltage range of 0 to 24 V to accurately detect the flow rate and pressure output under different voltages.
First, the relationship between the spraying flow rate and the input voltage of the solenoid valve was investigated. Under specific conditions, the spraying flow rate mainly depends on the opening degree of the flow control solenoid valve, which corresponds to the input voltage. When the input voltage
U ≤ 2.4 V, the flow rate is close to zero; when 3.6 V ≤
U ≤ 21.6 V, the application flow rate increases as the solenoid valve opening increases; when
U ≥ 22.8 V, the flow rate tends to stabilize, indicating that the solenoid valve has entered the control dead zone, as shown in
Figure 6 (red). Therefore, it can be determined that the effective control range of the flow solenoid valve is 3.6 V to 21.6 V. The relationship between the application flow rate and input voltage is given by Equation (8). (Note: The relevant model was developed based on the precision spraying system and a specific type of solenoid valve used in this study under particular experimental conditions. The equipment’s structural design and dynamic response characteristics influence the associated parameters, thus exhibiting a certain degree of specificity.)
Next, the relationship between the application pressure and the solenoid valve input voltage was investigated. The application pressure remains relatively constant when
U ≤ 2.4 V or
U ≥ 22.8 V. When 3.6 V ≤
U ≤ 21.6 V, the application pressure decreases as the solenoid valve opening increases, as shown in
Figure 6 (blue). The relationship between the application pressure and input voltage is expressed by Equation (9).
- (2)
Modeling of the Pesticide Application Control System
In the pesticide application system, solenoid valve opening adjustment is key to precisely controlling flow rate and pressure. As shown in
Figure 7, the system adopts a single closed-loop control strategy, where the flow/pressure sensor continuously monitors the pipeline parameters. Based on the monitored data, the controller outputs a voltage
U(
s) to adjust the solenoid valve opening, ensuring precise control of flow rate and pressure. This paper constructs the corresponding mathematical model by analyzing the relationship between flow rate, pressure, and solenoid valve input voltage.
The discretized pressure and flow models of the pesticide application system, derived from Equations (8) and (9), are shown in Equations (10) and (11).
2.2.2. Design of a Fuzzy Adaptive Control Algorithm Based on ESO
The control structure diagram of the ESO-based fuzzy adaptive controller is shown in
Figure 8.
The proportional
Kp, integral
Ki, and derivative
Kd coefficients of the PID controller are composed of two parts: one part is the preset original PID [
23] parameters
Kp*,
Ki*, and
Kd*, and the other part is the adjustment values Δ
Kp, Δ
Ki, and Δ
Kd calculated by the fuzzy control algorithm [
24] based on real-time feedback signals. These two components are combined to form the actual PID controller parameters in this study, enabling the dynamic self-tuning of the parameters in the fuzzy adaptive PID controller. The basic equation for self-tuning is given in Equation (12).
- (1)
Establishment of the State Observer for the Precision Pesticide Application Control System
The ESO, or extended state observer, is formulated as shown in Equation (13):
where
y(
t) represents the current measurement,
represents the current calculated estimate,
denotes the difference between the estimate and the measurement,
is the derivative of the estimated value calculated by the ESO,
is the total disturbance value observed by the ESO,
h is the sampling period, and
λ is the gain coefficient. The nonlinear function plays
a decisive role in the performance of the observer.
is the filtering factor, and
is the nonlinear factor, typically taken as empirical values of
,
.
the function is shown in Equation (14).
The coefficients a, b, and c of the ESO directly affect the observer’s performance. Therefore, it is necessary to tune the values of a, b, and c in this study. To simplify the complexity of parameter tuning, the ESO is transformed into a linear observer form:
The characteristic equation obtained by applying the Laplace transform [
25] to Equation (15) is as follows:
Taking the flow model as an example, as shown in
Section 2.2.1, the flow model established in this study is a third-order model. From the characteristic equation
of the third-order extended state observer, the following can be obtained:
In Equation (17),
wc is the system bandwidth, with values of
wc = 100, 200, and 300; the frequency-domain characteristic curves are shown in
Figure 9. As
wc increases, the curve shifts to the right, the phase lag decreases, the ESO estimation error convergence rate increases, and the system’s dynamic performance improves.
In the frequency-domain analysis, the optimal values of the extended state observer (ESO) parameters are determined by identifying the frequency bands where the control effect is most prominent, thereby providing a basis for tuning the ESO parameters. The tuning results are shown in
Table 2.
After completing the disturbance observation and calculation, a disturbance compensation module for the pressure and flow controllers is designed. Based on the ESO observation results, this module compensates for the total system disturbance in real-time, thereby improving the system’s resistance to disturbances [
26]. The form of disturbance compensation is shown below:
In Equation (19), u represents the actual output value of the controller, u0 is the theoretical output value of the controller, and d(t) is the system disturbance compensation.
- (2)
Definition of Input and Output Fuzzy Sets
To achieve fuzzy adaptive PID control, the input variables (error e in pesticide flow rate/pressure and the rate of change in the error de/dt) and the output variables ΔKp, ΔKi, and ΔKd are each divided into seven fuzzy sets. These sets are described using linguistic variables: “NB (Negative Big), NM (Negative Medium), NS (Negative Small), ZE (Zero), PS (Positive Small), PM (Positive Medium), PB (Positive Big).” Considering practical engineering requirements, the fuzzy domain for both the error and the rate of change in the error is defined as [−3, 3], with values exceeding this range being treated as boundary values to enhance system robustness.
In Equation (20), E represents the input error’s fuzzy domain and the error’s rate of change.
- (3)
Establishment of Fuzzy Control Rules
Based on expert experience, a fuzzy rule base is established. In this study, fuzzy control rule tables for Δ
Kp, Δ
Ki, and Δ
Kd are formulated, as shown in
Table 3. The fuzzy control rules are derived from the expertise of specialists in agricultural spraying control rather than being automatically generated through data-driven machine learning methods.
- (4)
Establishment of Fuzzy Rule Lookup Table
Based on fuzzy inference, the fuzzy output is defuzzified using the centroid method to obtain precise output values, which are then rounded to one decimal place. The control parameter lookup tables for Δ
Kp, Δ
Ki, and Δ
Kd are constructed, as shown in
Table 4. However, before combining these values with the original PID parameters, these adjustment values must be multiplied by the corresponding scaling factors
Kup,
Kui, and
Kud.
The sampling bias and the rate of bias change are first processed through fuzzy handling, and new control parameters are determined based on fuzzy control rules. Then, the ESO (extended state observer) is used to detect and compute system disturbances, generating a compensation signal. Finally, after parameter adjustment, the controller combines the disturbance compensation to compute the output, which is the system control quantity.
In this paper, the incremental PID algorithm [
27] is chosen, and its equation is as follows:
In the Equation, e(t), e(t − 1), and e(t − 2) represent the errors between the actual and theoretical values of the system at time t, t − 1, and t − 2, respectively. Kp, Ki, and Kd are the PID parameters after self-tuning. d(t) is the system disturbance compensation, while u(t) and u(t − 1) represent the system output at time t and t − 1, respectively. The term Δu(t) represents the increment of the output at time t.