Next Article in Journal
The Implementation of Response Surface Methodology and Artificial Neural Networks to Find the Best Germination Conditions for Lycopersicon esculetum Based on Its Phenological Development in a Greenhouse
Previous Article in Journal
The Role of Fallows in Sustainable Development
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Research and Design of Improved Wild Horse Optimizer-Optimized Fuzzy Neural Network PID Control Strategy for EC Regulation of Cotton Field Water and Fertilizer Systems

1
College of Mechanical and Electrical Engineering, Shihezi University, Shihezi 832003, China
2
Bingtuan Energy Development Institute, Shihezi University, Shihezi 832003, China
*
Author to whom correspondence should be addressed.
Agriculture 2023, 13(12), 2176; https://doi.org/10.3390/agriculture13122176
Submission received: 5 October 2023 / Revised: 17 November 2023 / Accepted: 17 November 2023 / Published: 21 November 2023
(This article belongs to the Section Digital Agriculture)

Abstract

:
Xinjiang is the largest cotton-producing region in China, but it faces a severe shortage of water resources. According to relevant studies, the cotton yield does not significantly decrease under appropriate limited water conditions. Therefore, this paper proposes a water and fertilizer integrated control system to achieve water and fertilizer conservation in the process of cotton field cultivation. This paper designs a fuzzy neural network Proportional–Integral–Derivative controller based on the improved Wild Horse Optimizer to address the water and fertilizer integrated control system’s time-varying, lag, and non-linear characteristics. The controller precisely controls fertilizer electrical conductivity (EC) by optimizing parameters through an improved Wild Horse Optimizer for the initial weights from the normalization layer to the output layer, the initial center values of membership functions, and the initial base width of membership functions in the fuzzy neural network. The performance of the controller is validated through MATLAB simulation and experimental tests. The results indicate that, compared with conventional PID controllers and fuzzy PID controllers, this controller exhibits excellent control accuracy and robustness, effectively achieving precise fertilization.

1. Introduction

As a strategic commodity, cotton is crucial in developing the national economy. However, in Xinjiang, China’s largest cotton-producing region, there is a severe shortage of water resources [1]. Relevant studies indicate that, under appropriate limited water conditions, the cotton yield does not significantly decrease [2,3,4]. Therefore, adopting water and fertilizer-integrated technology for cotton cultivation holds significant importance. This paper proposes a water and fertilizer integrated control system designed to achieve water and fertilizer conservation in the process of cotton field cultivation. However, in the actual fertilization process, factors, such as the volume delay of transmission pipelines and fertilizer flow rate, introduce time-varying, lag, and non-linear characteristics to the fertilization system. To mitigate the impact of these factors, researchers have proposed numerous emerging algorithms.
Jinbin Bai et al. [5] proposed a liquid fertilization variable control system based on the Beetle Antenna Search algorithm. Their experimental results validated that the actual response time of the variable-rate fertilization control system based on the Beetle Antenna Search algorithm could reach 2 s, with an average relative error of 1.27%.
Pengjun Wang et al. [6] proposed a Back-Propagation (BP) Neural Network PID (Proportional–Integral–Derivative) control algorithm based on Genetic Algorithm (GA) optimization. Their simulation results indicated that this control algorithm exhibited excellent stability, a short response time, and minimal overshoot, achieving precise fertilization effects.
Changxin Fu et al. [7] proposed a Fuzzy (Fuzzy logic control) PID control algorithm based on Particle Swarm Optimization (PSO), utilizing the particle swarm algorithm to optimize the gain parameters of the fuzzy PID controller. The effectiveness of this controller was validated through comparisons with commonly used control algorithms in existing systems.
Lepeng Song et al. [8] proposed a Fuzzy PID control algorithm based on genetic algorithm optimization. The membership functions and fuzzy control rules of the fuzzy controller were optimized through the genetic algorithm, reducing the dependence of control rules on empirical knowledge. Their simulation results demonstrated that the genetic algorithm-optimized fuzzy PID control algorithm was an effective and robust control solution.
Fenglei Zhu et al. [9] designed a PID controller using the GA-PSO algorithm to optimize the BP neural network. The design achieves precise control of the fertilizer flow rate. The experimental results show that the controller has excellent accuracy and robustness.
Mingqi Huang et al. [10] proposed a Partial Attraction Adaptive Fuzzy Algorithm (PAAFA). They designed a local attraction strategy to accelerate the convergence speed of PAAFA and reduce oscillation issues in the later stages of the algorithm. An adaptive inertia weight operator was introduced to balance the global and local search capabilities of PAAFA, preventing the algorithm from becoming trapped in local optima.
Zhiyun Zou et al. [11] proposed a novel Nonlinear Hammerstein Model Algorithmic Control (MAC) algorithm and compared it with linear MAC and PID controllers through simulations. Their simulation results demonstrated that the nonlinear Hammerstein MAC algorithm exhibited excellent stability and robustness, even with significant modeling errors.
Isabel S. Jesus et al. [12] employed a hybrid algorithm that combined the Smith predictor with fuzzy control to optimize a fractional-order control algorithm, addressing the system’s time-delay issues. The algorithm’s performance was assessed using two different approximation models. Their results indicated this algorithm’s excellent control effectiveness in nonlinear and time-delay systems.
The main objective of this paper is to utilize the proposed improved Wild Horse Optimizer (WHO) to optimize the Fuzzy Neural Network (FNN) PID control algorithm, thereby mitigating the impact of system time-varying, lag, and non-linearity characteristics.

2. Materials and Methods

2.1. System Structure and EC Regulation Process

2.1.1. Integrated Water and Fertilizer Control System Structural Design

Figure 1 illustrates the structure of the integrated water and fertilizer control device in a cotton field. The system comprises a water reservoir, fertilizer storage tanks, fertilizer mixing tanks, filtering apparatus, a water pump, and more. The filtering apparatus filters solid particles, suspended matter, and impurities in irrigation water or fertilizer, thereby protecting the water pump and fertilizer pump. The check valve prevents backflow and maintains system pressure stability [11]. The system achieves irrigation or simultaneous irrigation and fertilization by controlling the opening and closing of the corresponding solenoid valves. The system performs independent irrigation when solenoid valve 3 is open and solenoid valves 1, 2, and 4 are closed. When solenoid valves 1, 2, and 4 are open and solenoid valve 3 is closed, the system performs irrigation and fertilization. A peristaltic pump is chosen for the fertilizer pump because its internal components are sealed, preventing direct contact between the fertilizer and the pump’s mechanical parts, thus avoiding corrosion [12]. The system precisely adjusts the EC value of the mixed fertilizer by changing the frequency of the inverter connected to fertilizer pump 1.

2.1.2. Analysis of Water and Fertilizer EC Regulation Processes

When the system operates normally, the fertilizer volume in the mixing tank is in dynamic equilibrium and can be considered constant. Assume that the EC value of the fertilizer in the mixing tank is equal to the EC value in the outlet pipe [13]. According to the law of mass conservation, we have:
d V d C ( t ) d t = C f Q f + C w Q w C ( t ) Q
where V is the volume of fertilizer in the mixing tank, measured in liters (L); C ( t ) is the mass concentration of fertilizer in the mixing tank, measured in milligrams per liter (mg/L); C f is the mass concentration of the incoming fertilizer solution into the mixing tank, measured in milligrams per liter (mg/L); Q f is the flow rate of the incoming fertilizer solution into the mixing tank, measured in liters per second (L/s); C w is the mass concentration of water entering the mixing tank, measured in milligrams per liter (mg/L); Q w is the water flow rate entering the mixing tank, measured in liters per second (L/s); Q is the flow rate of fertilizer leaving the mixing tank, measured in liters per second (L/s); and t is the working time of the variable-frequency fertilization pump, measured in seconds (s).
The hose pump output flow rate is proportional to the frequency. Therefore, the formula for the flow rate Q f and frequency f ( t ) of the fertiliser mother liquor flowing into the mixing tank is as follows:
Q f = q f ( t )
where q is the scale parameter.
As the mass concentration is directly proportional to the EC value, the association of Equations (1) and (2) can be obtained:
d V E ( t ) d t = E f q f ( t ) + E w Q w E ( t ) Q
where E ( t ) is the EC value of the fertilizer liquid in the fertilizer mixing tank ( m S / c m ); E f is the EC value of the fertilizer mother liquor flowing into the fertilizer mixing tank ( m S / c m ); and E w is the EC value of water flowing into the mixing tank ( m S / c m ); the value is approximated as 0 [14].
A Laplace variation of Equation (3) yields:
E ( S ) = E f q V S + Q F ( s )
where E ( S ) is the pull-type variation of E ( t ) and F ( s ) is the pull-type variation of f ( t ) .
From Equation (4), the control response is characterized as a first-order linear system. In the actual test, the equipment operates with an outlet pressure of 0.2 MPa. E f = 10   m S / c m ; V = 50   L ; Q = 1.71   L / s . The lag time is 10 s. Substituting the above variables into Equation (4) yields the approximate transfer function of EC as:
G s = E ( S ) F ( s ) = 0.09 e 10 s 50 s + 1.71 = 0.05 e 10 s 29.2 s + 1

2.2. Design of Control Strategies

2.2.1. Design of PID Controller

An incremental PID control algorithm was used to ensure the stability of the PID controller as it approaches the equilibrium point [15,16,17]. Its calculation formula is as follows.
u k = u k 1 + u k u k = K p e k e k 1 + K i e k + K d e k 2 e k 1 + e k 2
where u k is the control output of the current moment; u k 1 is the control output of the previous moment; u k is the control output increment at the current moment; K p is the proportionality coefficient; K i is coefficient of integration; K d is the differential of integration; e k is the error of the current moment; e k 1 is the error of the previous moment; and e k 2 is the error of the previous two moments.
For digital control algorithms, the choice of the sampling period T is crucial. If T is too short, the change in the deviation signal is not apparent. If T is too long, the algorithm causes errors [18]. The selection of T is empirical, primarily in engineering. Through the work of practical experience, I roughly selected T and carried out some experiments repeatedly modified to determine the sampling period T = 10 s.
The parameter tuning methods for incremental PID control algorithms include the expanded critical proportionality method, expanded response curve method, and normalized parameter tuning method [19]. In this paper, the expanded critical proportionality method is used to rectify K p , K i , and K d . The steps are as follows:
1.
Set the integral gain K i   and the differential gain K d to 0. Operate in a control system with a sampling period T. Gradually increasing the proportional gain K P to the system produces equal amplitude oscillations, at which time the proportional gain is the critical proportionality K u and the corresponding oscillation period is the critical oscillation period T u .
2.
The direct digital control effect is compared with the analog control effect using the analog controller as a benchmark. Using the error square integral as the evaluation function, the expression for the degree of control Q is as follows:
Q = [ 0 e 2 t d t ] D D C [ 0 e 2 t d t ] A C
where DDC is direct digital control and AC means analog control.
When the control degree is 1.05, the control effect of the digital controller and the analog controller is comparable When the degree of control is 2.0, the digital controller provides poorer control quality than the analog regulator.
3.
According to the degree of control, the preliminary determination of the relevant parameters is shown in Table 1.
4.
Bring the initially determined parameters into the system to run, observe the control effect, and make appropriate adjustments to the parameters according to the actual situation.
This paper uses a fuzzy neural network to perform the self-tuning of PID controller parameters to improve the adaptability of the controller. This approach aims to achieve better control performance in practical applications.

2.2.2. Parameter Tuning of the Controller Based on Fuzzy Neural Networks

Fuzzy Neural Networks (FNNs) combine expert knowledge and practical experience of fuzzy control with the learning and parameter correction capabilities of neural networks. They can perform fuzzy inference with a limited number of fuzzy rules and better approximate nonlinear systems [20]. It is especially suitable for nonlinear and large lag problems. Figure 2 shows the structure of the fuzzy neural network PID controller.
Based on the Mamdani fuzzy inference method, the vague neural network topology structure with two inputs and three outputs is designed, as shown in Figure 3. The fuzzy neural network consists of five layers: an input layer, fuzzification layer, fuzzy inference layer, normalization layer, and output layer.
Input Layer: It contains 2 nodes representing the error between the actual EC value and the target value, as well as the rate of change of the error. Its role is to pass the input variables to the next layer. The input–output expressions are as follows:
I n 1 ( 1 ) = e ( t )       I n 1 ( 2 ) = e t
O u t 1 ( i ) = I n 1 ( i ) ( i = 1,2 )
Fuzzification Layer: It has 2 inputs, each of which corresponds to 7 fuzzy subsets (NB, NM, NS, ZO, PS, PM, and PB), with 14 nodes in total. Each neuron node of the fuzzification layer represents an affiliation function. In this study, the gaussian function is used as the affiliation function. The input and output expressions are:
It has 2 inputs, each corresponding to 7 fuzzy subsets, totaling 14 nodes. Each neural node in the fuzzy layer represents a membership function. This study uses gaussian membership functions. The input and output expressions are:
I n 2 ( i , j ) = O u t 1 ( i ) ( i = 1,2 ; j = 1,2 , , 7 )
O u t 2 ( i , j ) = e x p { [ I n 2 ( i , j ) C i , j ] 2 b i , j 2 } ( 1 = 1,2 ; j = 1,2 , , 7 )
where C i , j is the belonging function’s centered value and b i , j is the membership function’s base width.
Fuzzy Inference Layer: It contains 49 nodes. Each neural node in this layer corresponds to a fuzzy rule. Each neuron in this layer matches fuzzy rules by establishing connections with the fuzzy layer. The input and output expressions are:
I n 3 ( k ) = O u t 2 ( 1 , j 1 ) · O u t 2 ( 2 , j 2 ) ( k = 1,2 , , 49 ; j 1 , j 2 = 1,2 , , 7 )
O u t 3 ( k ) = I n 3 ( k ) ( k = 1,2 , , 49 )
Normalization Layer: It contains 49 nodes. Its role is to normalize the output of the fuzzy inference layer. The input and output expressions are:
I n 4 ( l ) = O u t 3 ( k ) ( k = l = 1,2 , , 49 )
O u t 4 ( l ) = I n 4 ( l ) l = 1 49 I n 4 ( l ) 3 ( l = 1,2 , , 49 )
Output Layer: It contains 3 nodes. It is used to perform defuzzification. The input and output expressions are:
I n 5 ( m ) = l = 1 49 w m l O u t 4 ( l ) ( m = 1,2 , 3 ; l = 1,2 , , 49 )
O u t 5 ( m ) = I n 5 ( m ) ( m = 1,2 , 3 )
where w m l is the weight coefficient from the normalization layer to the output layer.
The controller’s parameters are the correction values of the initial parameters. The expression is given below:
K P = K P + K P K i = K i + K i K d = K d + K d
After the FNN-PID controller completes forward propagation, it compares the actual output value y ( t ) with the desired output value r ( t ) and analyzes whether the error meets the expected requirements. If the conditions are not met, the normalization layer to output layer weights w m l , the membership function center value C i , j , and the membership function base width b i , j are updated in reverse according to the objective function. In this study, we define the performance metric function of the learning algorithm as:
E k = 1 2 r k y k 2
This paper uses the gradient descent method to adjust the relevant parameters. The inertia term is added to improve the optimization process’s convergence and stability. The formula is as follows:
w m l ( k + 1 ) = w m l ( k ) η 1 E ( k ) w m l ( k ) + α 1 ( w m l ( k 1 ) w m l ( k 2 ) ) C i , j ( k + 1 ) = C i , j ( k ) η 2 E ( k ) C i , j ( k ) + α 2 ( C i , j ( k 1 ) C i , j ( k 2 ) ) b i , j ( k + 1 ) = b i , j ( k ) η 3 E ( k ) b i , j ( k ) + α 3 ( b i , j ( k 1 ) b i , j ( k 2 ) )
where η is the learning rate, η ( 0,1 ) , and α is the inertia factor, α ( 0,1 ) .
FNN has a large number of parameters to be optimized, and the initial parameters have a significant impact on the control effect [21]. Therefore, the improved Mustang algorithm is introduced to find the optimal values of the weights from the normalization layer to output layer weights w m l , the membership function center value C i , j , and the membership function base width b i , j .

2.2.3. Optimized Design Based on Improved Wild Horse Optimizer

The Wild Horse Optimizer (WHO), a novel intelligent optimization algorithm simulating the living behavior of wild horse populations, possesses strengths such as strong adaptability, simplicity, and easy implementation [22]. Figure 4 shows the structure of the fuzzy neural network PID controller optimized by the improved WHO algorithm.
1.
Population Initialization: A single horse is generated by expanding the weights from the normalizing layer to the output layer w m l by rows and vectorially merging them with the centroid of the affiliation function C i , j and the base width of the affiliation function b i , j . The single-horse vector contains a total of 175 elements. The vector is initialized using Xavier [23]. Set the population’s size, the stallion percentage, and the subgroup number. The remaining horses in the herd are randomly and evenly distributed into these groups.
2.
Fitness Function: The fitness function responds to the individual’s strengths and weaknesses and provides criteria and motivation for selection. When calculating the fitness function, only the forward propagation of the FNN is performed. The fitness function is as follows:
W = 4 0 T ( y ( t ) y 0 ) d t + 3 y 0 t α + 3 T ( y m y 0 ) y 0 T P I D
where T P I D represents the steady-state time for the PID algorithm output to reach the set value; y ( t ) denotes the real-time final output value of the system; y 0 denotes the target’s set value; t α denotes the steady-state time after using the optimization algorithm for the output to reach the set value and achieve balance; and y m denotes the final output of the system’s maximum value.
3.
Grazing Behavior: The remaining horses in the population search around the leader in a circle centered on the position of the population leader [24]. The expression is:
X ¯ i , G j = 2 Z c o s ( 2 π R Z ) × ( S t a l l i o n j X i , G j ) + S t a l l i o n j
where X ¯ i , G j is the updated position, R is a random number with values in [−2, 2], mainly for angle control between the individual and the leader, S t a l l i o n j is the position where the stallion is located, and X i , G j is the position where the horse was originally located. aaaa is the adaptive mechanism, and the calculation formula is shown below:
P = R 1 < T D R ; I D X = ( P = = 0 ) ; Z = R 2 · I D X + R 3 · ( ~ I D X )
where P is a vector composed of 0 s and 1 s; R 1 and R 3 are randomly generated vectors with values in the interval [0, 1] by the standard distribution; P = R 1 < T D R indicates that if an element in R 1 takes a value less than T D R ; the corresponding position of the vector P takes the value of 1, otherwise, it is 0; the index of the random vector R 1 satisfying the condition (P == 0) is returned into IDX; R 2 is a random number in the range [0, 1]; · is the dot product operator; ~ denotes binary inversion; and T D R is an adaptive factor that decreases linearly from 1 to 0. The expression is as follows:
T D R = 1 i t e r m a x i t e r
where i t e r represents the iterations’ current number and m a x i t e r denotes the iterations’ maximum number.
4.
Mating behavior: When a foal matures, it leaves the population to engage in mating behavior and its location is updated in the following manner:
X G , k P = C r o s s o v e r ( X G , i q , X G , j z )
where X G , k P denotes the position of foal P in population k , X G , i q and X G , j z are the same; and C r o s s o v e r is the mating mode.
The mating process of animals in the biological world involves the exchange of genes and the process of mutation [24]. Therefore, in this study, we incorporated the crossover and mutation operations from genetic algorithms instead of the original mating formula. This harnesses the global search capabilities of genetic algorithms, avoiding the premature convergence of the population. The process is as follows:
Crossover operation: This involves exchanging parts of the chromosome between individuals with a certain probability. The crossover method used in this study is uniform crossover, where the coding strings in pairs are exchanged with the same crossover probability. We set the crossover probability to 0.6.
Mutation operation: This involves randomly changing the position of a certain string in an individual with a certain probability. The specific process is as follows: 1. Identify the mutation point. 2. Mutate the gene value at the mutation point. We set the mutation probability to 0.1.
5.
Leadership Behavior: Leadership behavior: The leader of each group leads the group to a suitable area. Each group moves in the direction of this suitable area. Next, the leaders compete for this suitable area so the ruling group can use it. Other groups are allowed to use it once the verdict group leaves [25]. Equation (26) reflects this process.
S t a l l i o n G i ¯ = 2 Z c o s ( 2 π R Z ) × ( W H S t a l l i o n G i ) + W H R 3 > 0.5 2 Z c o s ( 2 π R Z ) × ( W H S t a l l i o n G i ) W H R 3 < 0.5
where S t a l l i o n G i ¯ denotes the leader’s next position of group i , Z is the adaptive mechanism, S t a l l i o n G i is the leader’s current position, W H is the suitable area’s position, and R 3 is a random number taking values within [0, 1].
The leadership selection process formula is as follows:
S t a l l i o n G i = X i , G j i f   c o s t ( X i , G j ) < c o s t ( S t a l l i o n G i ) S t a l l i o n G i e l s e
where c o s t ( X i , G j ) is the fitness of individual X i , G j and c o s t ( S t a l l i o n G i ) is the same.
6.
Termination Condition: This study takes the maximum number of iterations as the final condition and sets the number of iterations to 100 generations. The fitness during the iteration process is shown in Figure 5.
From Figure 5, it can be observed that the improved Wild Horse Optimizer combines the advantages of genetic algorithms and successfully avoids the issue of the premature stabilization of the population. For example, from the 36th to the 37th generation, the fitness function value immediately decreases from 2.90 to 2.81. This is because introducing the genetic algorithm’s mutation and crossover operations allows the algorithm to avoid being trapped in local optima. As the number of iterations increases, the fitness value stabilizes when reaching the 63rd iteration, and the controller’s parameters approach the optimal solution.

3. Results

3.1. Simulation Results

We conducted MATLAB simulation experiments to evaluate the performance of the improved Wild Horse Optimizer-optimized fuzzy neural network PID controller (WHO-FNN-PID) proposed in this paper. Simultaneously, we simulated and compared it with a conventional PID controller (PID) and a fuzzy neural network PID controller (FNN-PID) to compare with the WHO-FNN-PID controller. The sampling period was set to 1 ms, the system delay time was 10 s, the input signal was a unit step signal, and the simulation time was 1000 s. The control effects of the three controllers under a unit step response are shown in Figure 6.
We used dynamic performance indicators to evaluate the control effects of the controllers for a more accurate comparative analysis. The rise time is the time after stimulation by a step signal for the system to reach a steady state for the first time. Peak time represents the time it takes for the system to reach its peak value after being stimulated by a stepped response. The regulation time means the time the system needs to reach a stable state. Maximum overshoot indicates how much the system response output exceeds the setpoint. Table 2 shows the dynamic performance of the three controllers.

3.2. Test Validation

3.2.1. System EC Value Adjustment Experiment

This paper constructed a cotton field water and fertilizer system EC value regulation platform using the STM32F103ZET6 microcontroller as the control component to verify the performance of the precision fertilization control system designed in this paper. The experimental setup is shown in Figure 7. The mixing fertilizer tank used in the experiment was 5 m3 from Boli Electromechanical Technology Co., Ltd. (Shihezi, China). The experimental process maintained the stability of the liquid level of the water–fertilizer mixture with a volume of 3 m3. The fertilizer stock solution was prepared using potassium nitrate, resulting in a solution with an electrical conductivity of 10 mS/cm. The hose pump had a maximum conveying flow rate of 1 m3/h, a power of 1.5 KW, and a voltage of 380 V. The frequency converter had an output frequency between 0 and 400 Hz, with a rated voltage of 380 V. The EC sensor was an integrated EC transmitter from Jianda Renke with the model RS-EC-N01-3. We used the USB2805C data acquisition card from Beijing Altai Technology Development Co., Ltd. (Shenyang, China) to monitor and collect the flow data of the system. The conversion accuracy of this acquisition card was 16 bits, with a sampling rate of 500 KHz, supporting single-ended input and differential input, providing five input ranges, and the system measurement accuracy was 0.01%.

3.2.2. Test Results

The range of EC values of mixed fertilizer solutions suitable for cotton growth is {1.2 mS/cm, 1.8 mS/cm} in the actual irrigation process. This study’s target EC values were 1.4 and 1.6 mS/cm. The experimental results are shown in Figure 8 and Figure 9, and the performance indicators are in Table 3 and Table 4.

4. Discussion

4.1. Analysis of Simulation Results

Figure 6 shows that, compared with the WHO-FNN-PID algorithm, the PID and FNN-PID algorithms exhibit more significant oscillations and overshoot. At the same time, the WHO-FNN-PID algorithm demonstrates a faster stabilization speed. Regarding response speed, these three algorithms are similar. Therefore, the advantages of the WHO-FNN-PID algorithm are evident under simulation conditions.
According to the data in Table 2, the adjustment time of the PID controller is 710.02 s, significantly lagging behind the other two algorithms, indicating that the PID controller has a poor ability to adapt to the time variability of the system. The FNN–PID controller improved in various dynamic performance indicators compared with the PID controller, indicating that tuning the PID controller through the FNN algorithm successfully enhanced the controller’s performance. The significant reduction in peak time (36.84 s) and regulation time (209.58 s) by the WHO-FNN-PID algorithm demonstrates its more sensitive handling of system lag.

4.2. Analysis of Test Results

By observing Figure 8 and Table 3, when the target EC value is 1.4 mS/cm, although the PID controller responded quickly (28.40 s), it had a significant overshoot (72.21%) and a long regulation time (709.32 s). After introducing the FNN algorithm for parameter optimization, the dynamic performance of the FNN–PID controller was significantly improved, with a reduction of 411.28 s in regulation time and a decrease of 34.27% in overshoot. In comparison, the WHO-FNN–PID controller performed the best in all dynamic performance indicators, with the maximum overshoot reduced to 8.32% and regulation time shortened to 192.17 s.
By observing Figure 8 and Table 4, when the target EC value is 1.6 mS/cm, the dynamic performance of the PID controller and FNN–PID controller changed little compared with the target EC value of 1.4 mS/cm. The WHO-FNN–PID controller showed a slight reduction in regulation time (201.35 s) and maximum overshoot (7.71%), indicating that the WHO-FNN–PID controller had a certain sensitivity to changes in the target EC value. When the flow rate increased, the WHO-FNN–PID controller still maintained good control performance.
System time-varying and lag characteristics can extend the rise, peak, and regulation times. The WHO-FNN-PID controller exhibited shorter rise, peak, and regulation times in the two experiments, demonstrating its robust adaptability to time-varying and lag characteristics. For nonlinear systems, uncertainties in rise, peak, and regulation time may arise, along with a larger maximum overshoot. However, in both experiments, the WHO-FNN-PID controller’s rise, peak, and regulation times were relatively consistent, and the maximum overshoot remained within a small range. This indicates that the WHO-FNN-PID algorithm was less influenced by nonlinearity.
Therefore, the WHO-FNN-PID algorithm demonstrated outstanding performance in dealing with systems that exhibit time-varying, lag, and nonlinear characteristics. It exhibited strong adaptability and stability, meeting the control requirements in practical applications.

5. Conclusions

This paper investigates a cotton fields integrated water and fertilizer control system, mathematically fits the EC flow control process, and establishes the corresponding transfer function. An improved Wild Horse Optimizer algorithm is proposed for optimizing the fuzzy neural network PID control algorithm. The algorithm adjusts PID parameters using a fuzzy neural network and optimizes them using the improved Wild Horse Optimizer. Through simulation experiments, the designed algorithm’s superior control performance is verified. Additionally, a system EC value adjustment platform is built based on the STM32F103ZET6 microcontroller, and performance experiments are conducted on conventional PID control algorithms, FNN-PID control algorithms, and the novel improved WHO-fuzzy-PID algorithm proposed in this paper. The experimental results demonstrate that the novel hybrid optimized fuzzy fractional-order PID control algorithm proposed in this paper can reduce the impact of factors such as time-varying behavior and nonlinearity in the water and fertilizer EC value adjustment process.

Author Contributions

Conceptualization, H.W. (Hao Wang) and L.Z.; software design, H.W. (Hao Wang); software validation, J.Z.; resources, H.W. (Huan Wang); data curation, F.Z.; writing—original draft, H.W. (Hao Wang); writing—review and editing, X.W. and X.H. All authors have read and agreed to the published version of the manuscript.

Funding

This study was funded by National Key R&D Program of China (2022ZD0115804), Major Science and Technology Projects in Xinjiang Uygur Autonomous Region (2022A02012-4), and Xinjiang Agricultural Machinery Research, Development, Manufacturing and Promotion Application Integration Project (YTHSD2022-03).

Institutional Review Board Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Jia, S. An Assessment of the Water Resources Carrying Capacity in Xinjiang. Water 2022, 14, 1510. [Google Scholar]
  2. Luo, H.-H.; Zhang, H.-Z.; Zhang, Y.-L.; Zhang, W.-F. Effects of water storage in deeper soil layers on the root growth, root distribution and economic yield of cotton in arid area with drip irrigation under mulch. Chin. J. Appl. Ecol. 2012, 23, 395–402. [Google Scholar]
  3. Zhu, Y.; Zheng, B.; Luo, Q.; Jiao, W.; Yang, Y. Uncovering the Drivers and Regional Variability of Cotton Yield in China. Agriculture 2023, 13, 2132. [Google Scholar] [CrossRef]
  4. Guo, J.; Zheng, L.; Ma, J.; Li, X.; Chen, R. Meta-Analysis of the Effect of Subsurface Irrigation on Crop Yield and Water Productivity. Sustainability 2023, 15, 15716. [Google Scholar] [CrossRef]
  5. Bai, J.; Tian, M.; Li, J. Control System of Liquid Fertilizer Variable-Rate Fertilization Based on Beetle Antennae Search Algorithm. Processes 2022, 10, 357. [Google Scholar] [CrossRef]
  6. Wang, P.; Chen, Y.; Xu, B.; Wu, A.; Fu, J.; Chen, M.; Ma, B. Intelligent Algorithm Optimization of Liquid Manure Spreading Control. Agriculture 2023, 13, 278. [Google Scholar] [CrossRef]
  7. Fu, C.; Ma, X.; Zhang, L. Fuzzy-PID Strategy Based on PSO Optimization for pH Control in Water and Fertilizer Integration. IEEE Access 2022, 10, 4471–4482. [Google Scholar] [CrossRef]
  8. Song, L.; Wen, L.; Chen, Y.; Lan, Y.; Zhang, J.; Zhu, J. Variable-Rate Fertilizer Based on a Fuzzy PID Control Algorithm in Coastal Agricultural Area. J. Coast. Res. 2020, 103, 490–495. [Google Scholar] [CrossRef]
  9. Zhu, F.; Zhang, L.; Hu, X.; Zhao, J.; Meng, Z.; Zheng, Y. Research and Design of Hybrid Optimized Backpropagation (BP) Neural Network PID Algorithm for Integrated Water and Fertilizer Precision Fertilization Control System for Field Crops. Agronomy 2023, 13, 1423. [Google Scholar] [CrossRef]
  10. Huang, M.; Tian, M.; Liu, Y.; Zhang, Y.; Zhou, J. Parameter optimization of PID controller for water and fertilizer control system based on partial attraction adaptive firefly algorithm. Sci. Rep. 2022, 12, 12182. [Google Scholar] [CrossRef]
  11. Zou, Z.; Yu, M.; Wang, Z.; Liu, X.; Guo, Y.; Zhang, F.; Guo, N. Nonlinear Model Algorithmic Control of a pH Neutralization Process. Chin. J. Chem. Eng. 2013, 21, 395–400. [Google Scholar] [CrossRef]
  12. Jesus, I.S.; Barbosa, R.S. Smith-fuzzy fractional control of systems with time delay. AEU Int. J. Electron. Commun. 2017, 78, 54–63. [Google Scholar] [CrossRef]
  13. Zhou, W.; An, T.; Wang, J.; Fu, Q.; Wen, N.; Sun, X.; Wang, Q.; Liu, Z. Design and Experiment of a Targeted Variable Fertilization Control System for Deep Application of Liquid Fertilizer. Agronomy 2023, 13, 1687. [Google Scholar] [CrossRef]
  14. Deng, H.; Pan, X.; Zhang, H.; Xiao, Z.; Xiao, R.; Zhao, Z.; Chen, T. Comprehensive Regulation of Water–Nitrogen Coupling in Hybrid Seed Maize in the Hexi Oasis Irrigation Area Based on the Synergy of Multiple Indicators. Water 2023, 15, 3927. [Google Scholar] [CrossRef]
  15. Estofanero, L.; Edwin, R.; Garcia, C. Predictive Controller Applied to a pH Neutralization Process. In Proceedings of the 12th International-Federation-of-Automatic-Control (IFAC) Symposium on Dynamics and Control of Process Systems including Biosystems (DYCOPS), FEESC, Florianopolis, Brazil, 23–26 April 2019; pp. 202–206. [Google Scholar]
  16. Chen, W.; Hu, L.; Wang, G.; Yuan, J.; Bao, G.; Shen, H.; Wu, W.; Yin, Z. Design of 4UM-120D Electric Leafy Vegetable Harvester Cutter Height off the Ground Automatic Control System Based on Incremental PID. Agriculture 2023, 13, 905. [Google Scholar] [CrossRef]
  17. Chen, X.; Yang, X.; Pang, H.; Ou, Y. Design and implementation of an optical module based on an improved incremental proportional integral differential algorithm. J. Intell. Fuzzy Syst. 2021, 40, 6287–6294. [Google Scholar]
  18. Cao, K.; Gu, J.; Mao, J.; Liu, C. Sampled-Data Stabilization of Fractional Linear System under Arbitrary Sampling Periods. Fractal Fract. 2022, 6, 416. [Google Scholar] [CrossRef]
  19. Wang, G.S. The Study of Digital Control Switching Power Supply Based on si825x. Master’s Thesis, Southwest Jiaotong University, Chengdu, China, 2010. [Google Scholar]
  20. Mori, H. Fuzzy neural network applications to power systems. In Proceedings of the 2000 Winter Meeting of the IEEE Power Engineering-Society, Singapore, 23–27 January 2000; pp. 1284–1288. [Google Scholar]
  21. Yang, Y.P.; Xu, X.M.; Zhang, W.Y. Design neural networks based fuzzy logic. Fuzzy Sets Syst. 2000, 114, 325–328. [Google Scholar] [CrossRef]
  22. Naruei, I.; Keynia, F. Wild horse optimizer: A new meta-heuristic algorithm for solving engineering optimization problems. Eng. Comput. 2022, 38 (Suppl. 4), 3025–3056. [Google Scholar] [CrossRef]
  23. Chen, L.; Zhao, Y.; Ma, Y.; Zhao, B.; Feng, C. Improving Wild Horse Optimizer: Integrating Multistrategy for Robust Performance across Multiple Engineering Problems and Evaluation Benchmarks. Mathematics 2023, 11, 3861. [Google Scholar] [CrossRef]
  24. Zeng, C.; Qin, T.; Tan, W.; Lin, C.; Zhu, Z.; Yang, J.; Yuan, S. Coverage Optimization of Heterogeneous Wireless Sensor Network Based on Improved Wild Horse Optimizer. Biomimetics 2023, 8, 70. [Google Scholar] [CrossRef]
  25. Zheng, R.; Hussien, A.G.; Jia, H.-M.; Abualigah, L.; Wang, S.; Wu, D. An Improved Wild Horse Optimizer for Solving Optimization Problems. Mathematics 2022, 10, 1311. [Google Scholar] [CrossRef]
Figure 1. Structural diagram of water and fertilizer integration control equipment.
Figure 1. Structural diagram of water and fertilizer integration control equipment.
Agriculture 13 02176 g001
Figure 2. Fuzzy neural network PID controller design.
Figure 2. Fuzzy neural network PID controller design.
Agriculture 13 02176 g002
Figure 3. Fuzzy neural network topology.
Figure 3. Fuzzy neural network topology.
Agriculture 13 02176 g003
Figure 4. The improved WHO algorithm optimizes the structure of the fuzzy neural network PID controller.
Figure 4. The improved WHO algorithm optimizes the structure of the fuzzy neural network PID controller.
Agriculture 13 02176 g004
Figure 5. Change curve of fitness function during iteration process.
Figure 5. Change curve of fitness function during iteration process.
Agriculture 13 02176 g005
Figure 6. Comparison of the three controllers’ effects under unit step response.
Figure 6. Comparison of the three controllers’ effects under unit step response.
Agriculture 13 02176 g006
Figure 7. System EC value control test platform.
Figure 7. System EC value control test platform.
Agriculture 13 02176 g007
Figure 8. Control curves of the three controllers when the EC target value is 1.4 mS/cm.
Figure 8. Control curves of the three controllers when the EC target value is 1.4 mS/cm.
Agriculture 13 02176 g008
Figure 9. Control curves of the three controllers when the EC target value is 1.6 mS/cm.
Figure 9. Control curves of the three controllers when the EC target value is 1.6 mS/cm.
Agriculture 13 02176 g009
Table 1. Expansion of the criticality scale calculation table.
Table 1. Expansion of the criticality scale calculation table.
Degree of Control T / T u K P / K u T i / T u T d / T u
1.050.0140.630.490.14
1.20.0430.470.470.16
1.50.090.340.430.2
Table 2. The three controllers’ dynamic performance indicators.
Table 2. The three controllers’ dynamic performance indicators.
Controller TypeRise Time (s)Peak Time (s)Regulation Time (s)Maximum Overshoot
PID29.2350.98710.0273.41%
FNN–PID30.7646.81313.3437.60%
WHO-FNN–PID29.5236.84209.588.51%
Table 3. Dynamic performance indicators with 1.4 mS/cm EC setpoint for the three controllers.
Table 3. Dynamic performance indicators with 1.4 mS/cm EC setpoint for the three controllers.
Controller TypeRise Time (s)Peak Time (s)Regulation Time (s)Maximum Overshoot
PID28.4050.15709.3272.21%
FNN–PID29.5746.29298.0437.94%
WHO-FNN–PID28.2336.23192.178.32%
Table 4. Dynamic performance indicators with 1.6 mS/cm EC setpoint for the three controllers.
Table 4. Dynamic performance indicators with 1.6 mS/cm EC setpoint for the three controllers.
Controller TypeRise Time (s)Peak Time (s)Regulation Time (s)Maximum Overshoot
PID28.9151.81712.3373.32%
FNN–PID29.0447.07300.6737.88%
WHO-FNN–PID28.8737.77201.357.71%
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wang, H.; Zhang, L.; Wang, H.; Hu, X.; Zhao, J.; Zhu, F.; Wu, X. Research and Design of Improved Wild Horse Optimizer-Optimized Fuzzy Neural Network PID Control Strategy for EC Regulation of Cotton Field Water and Fertilizer Systems. Agriculture 2023, 13, 2176. https://doi.org/10.3390/agriculture13122176

AMA Style

Wang H, Zhang L, Wang H, Hu X, Zhao J, Zhu F, Wu X. Research and Design of Improved Wild Horse Optimizer-Optimized Fuzzy Neural Network PID Control Strategy for EC Regulation of Cotton Field Water and Fertilizer Systems. Agriculture. 2023; 13(12):2176. https://doi.org/10.3390/agriculture13122176

Chicago/Turabian Style

Wang, Hao, Lixin Zhang, Huan Wang, Xue Hu, Jiawei Zhao, Fenglei Zhu, and Xun Wu. 2023. "Research and Design of Improved Wild Horse Optimizer-Optimized Fuzzy Neural Network PID Control Strategy for EC Regulation of Cotton Field Water and Fertilizer Systems" Agriculture 13, no. 12: 2176. https://doi.org/10.3390/agriculture13122176

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