Next Article in Journal
Optimizing Planting Density in Alpine Mountain Strawberry Cultivation in Martell Valley, Italy
Previous Article in Journal
A Plastid RNA Polymerase-Associated Protein Is Involved in Early Chloroplast Development in Rice
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Research and Design of Hybrid Optimized Backpropagation (BP) Neural Network PID Algorithm for Integrated Water and Fertilizer Precision Fertilization Control System for Field Crops

1
College of Mechanical and Electrical Engineering, Shihezi University, Shihezi 832003, China
2
Xinjiang Production and Construction Corps Key Laboratory of Modern Agricultural Machinery, Shihezi 832003, China
3
Key Laboratory of Northwest Agricultural Equipment, Ministry of Agriculture and Rural Affairs, Shihezi 832003, China
4
Bingtuan Energy Development Institute, Shihezi University, Shihezi 832003, China
*
Authors to whom correspondence should be addressed.
Agronomy 2023, 13(5), 1423; https://doi.org/10.3390/agronomy13051423
Submission received: 5 May 2023 / Revised: 17 May 2023 / Accepted: 17 May 2023 / Published: 21 May 2023

Abstract

:
China’s field crops such as cotton, wheat, and tomato have been produced on a large scale, but their cultivation process still adopts more traditional manual fertilization methods, which makes the use of chemical fertilizers in China high and causes waste of fertilizer resources and ecological environmental damage. To address the above problems, a hybrid optimization of genetic algorithms and particle swarm optimization (GA–PSO) is used to optimize the initial weights of the backpropagation (BP) neural network, and a hybrid optimization-based BP neural network PID controller is designed to realize the accurate control of fertilizer flow in the integrated water and fertilizer precision fertilization control system for field crops. At the same time, the STM32 microcontroller-based precision fertilizer application control system for integrated water and fertilizer application of large field crops was developed and the performance of the controller was verified experimentally. The results show that the controller has an average maximum overshoot of 5.1% and an average adjustment time of 68.99 s, which is better than the PID and PID control algorithms based on BP neural network (BP–PID) controllers; among them, the hybrid optimization of PID control algorithm based on BP neural network by particle swarm optimization and genetic algorithm(GA–PSO–BP–PID) controller has the best-integrated control performance when the fertilizer application flow rate is 0.6m3/h.

1. Introduction

Water–fertilizer integration is a modern agricultural technology that mixes the right amount of fertilizer with irrigation water and uses an irrigation system to irrigate the mixed water–fertilizer solution directly in the vicinity of the crop roots, thereby saving water resources, reducing fertilizer loss, and improving crop yield and quality [1,2,3]. This technology is widely used in modern agricultural farming because it can supply water and fertilizer to the crop precisely throughout the whole process; thus it can be designed for different growth periods according to water laws and the fertilizer requirements of the crop, regularly quantify water and nutrients, and provide them to the crop in proportion, which reduces labor costs and greatly improves the efficiency of agricultural farming [3,4,5]. This technology is widely used in modern field crop cultivation because it not only greatly reduces the waste of fertilizer caused by rough manual application, but also improves the efficiency of field crop cultivation [6].
Precision fertilization can reduce costs and also improve crop yield and quality, thus increasing agricultural efficiency [7]. However, the regulation process of fertilizer flow in the integrated water and fertilizer control system has the problem of volume delay in the transmission pipeline, which leads to time varying, lagging, and non-linear characteristics of the system, and there are still significant problems in precision and intelligence [8,9,10]. In the face of these problems, the traditional PID control gradually reveals its shortcomings and cannot obtain the expected control effect. Therefore, combining an intelligent optimization algorithm with PID technology to improve the performance of traditional PID systems and effectively solve the problem of precise control in integrated water and fertilizer control systems is of great significance to improve the quality of field crops, increase farmers’ income, and improve economic benefits as well as improve the soil environment and realize the ecologically sustainable development of field crop production [11,12,13].
Section 1 of this paper introduces the advantages and problems of water–fertilizer integration technology; Section 2 introduces the working principle of water–fertilizer integration system for field crops, establishes the mathematical model of precise fertilizer application in water–fertilizer integration systems for field crops, and gradually derives the principle of hybrid optimization algorithm; Section 3 uses Matlab software to establish the PID, BP–PID, and GA–PSO–BP–PID controller simulation models using Matlab software, analyzes the four transient performance indexes of the three control algorithms respectively, and builds a flow regulation test platform to experimentally verify the dynamic performance of the controller; in Section 4, the experimental results are analyzed and summarized; Section 5 summarizes the obtained conclusions.

2. Materials and Methods

2.1. Structural Components of Integrated Water and Fertilizer System for Field Crops

The water–fertilizer integrated system adopts a system of fertilizer and water co-delivery, that is, water and fertilizer are mixed and delivered for irrigation, which can make the fertilizer more evenly distributed in the soil and avoid fertilizer loss and waste caused by uneven fertilization in the traditional fertilizer application method [14,15,16,17]. In practice, since irrigation is a continuous action and the irrigation volume of each irrigation partition is controlled by a wireless electric valve, it is not necessary to think too much about the precision of irrigation in the water–fertilizer integrated precision control system, but the demand for nutrients of different crops has obvious differences, and even for the same crop, its demand for fertilizer is different during different growth periods [18]. Only through precise fertilization can we meet the needs of different crops in different growth periods and thus improve the yield and quality of crops, so the main research of this paper is about precise fertilization in an integrated water and fertilizer system for field crops [19]. The integrated water and fertilizer system for field crops consists of a reservoir, pump, filter, flow meter, fertilizer storage tank, peristaltic pump, control center, wireless electric valve, and drip irrigation belt. The regulating device mainly consists of a pump, peristaltic pump, flow sensor, wireless electric valve, and other devices, and the outlet is connected to the field drip irrigation belt, which constitutes a field crop water and fertilizer control system. As shown in Figure 1, the structure of the integrated water and fertilizer system for field crops is shown.
In particular, there are check valves on the irrigation mains to prevent the backflow of water, and similarly, there are check valves on the liquid fertilizer pipes to prevent the backflow of fertilizer. The fertilizer pump is connected to a flow meter to monitor the flow of supplied liquid fertilizer and calculate the remaining liquid fertilizer storage in the storage tank by collecting the applied fertilizer data. When the wireless electric valve is opened, the integrated water and fertilizer control system for field crops can be irrigated independently. If the peristaltic pump is powered to rotate its internal rotor, the change of roller position will cause the hose to be compressed and rebounded, thus causing the pump to suck in and press out fertilizer, resulting in simultaneous irrigation and fertilization. The control center uses an STM32F103ZET6 microcontroller combined with a hybrid optimization BP neural network PID control algorithm, with the set fertilizer flow rate as the desired value and the actual flow rate collected by the flow meter as the feedback value. When the flow meter detects deviation from the set value, the field crop water and fertilizer integration system changes the frequency of the peristaltic pump inverter to precisely adjust the fertilizer flow rate at the outlet of the peristaltic pump to achieve a more accurate fertilization effect.
In order to effectively solve the problem of accurate fertilization in the integrated system of water and fertilizer for field crops, a mathematical model is needed. Considering the fertilization characteristics of field crops and the complexity of the system, a first-order inertia plus delay link transfer function is used to describe the mathematical model of the system [20].
G s = K e τ s T s + 1
where K is the gain coefficient, τ is the delay time, and T is the time constant.
The fertilizer flow variation data were obtained by sampling the expected value of fertilizer flow using a 1-s sampling interval and used as input to the open-loop system. The data were fitted in Matlab using a first-order approximation to obtain K = 1, τ = 11 s, and T = 3.63. These parameters constitute the mathematical model of the integrated precision fertilizer application control system for field crops.

2.2. PID Controller Design Based on Hybrid Optimization BP Neural Network

2.2.1. Conventional PID Controller Design

To implement the hybrid optimization BP neural network-based PID controller design, a conventional PID controller needs to be established first. Conventional PID controller is one of the most widely used strategies in process control, which can solve most of the practical application problems in the field of automatic control, and its controller structure is shown in Figure 2 [21].
The PID controller gives the control quantity u(t) based on the deviation e(t) (i.e., the difference between the set value r(t) and the measured value y(t)) by calculating the deviation and applying it to the controlled object. u(t) is expressed as:
u t = K p e t + 1 T i 0 t e τ d τ + T d d e t d t
where K p is the scaling factor. T i is the integration time constant and T d is the differential time constant.
Formula (2) is a continuous PID control algorithm expression, but in the actual field crop water integration precision fertilization control system, e(t) needs to be obtained by sampling, so it is necessary to discretize Formula (2). Assuming that the sampling period is T and a total of k samples are performed, it is obtained that:
0 t e t d t T j = 0 k e j
d e t d t e k T e k 1 T T = e k e k 1 T
where Formula (3) is the integral part, and Formula (4) is the differential part; brought into Formula (2), the PID control algorithm expression can be obtained:
u k = K p e k + K i j = 0 k e j + K d e k e k 1
where K p is the proportionality factor, K i is the integration factor and K d is the differentiation factor; K i = K P T T i , K d = K P T d T .
Conventional PID control is divided into two types: position-based PID control and incremental PID control. Position-based PID control is commonly used for electro-hydraulic servo valves, while the controlled object in the precision fertilizer control system for integrated fertilizer application to field crops is the motor driving the peristaltic pump, which is suitable for incremental PID control, so incremental PID control is selected in this paper. The continuous time t is discretized and k is assumed to be the current sampling moment, which can be obtained recursively according to Formula (5).
u k 1 = K p e k 1 + K i j = 0 k 1 e j + K d e k 1 e k 2
Subtracting Formula (5) from Formula (6) yields:
u k = K p e k e k 1 + K i e k + K d e k 2 e k 1 + e k 2
Thus u(k) can be expressed as:
u k = u k 1 + u k
The K P , T i , T d , three parameters of the PID controller are the core part of the design of the integrated water and fertilizer precision fertilizer control system, this paper uses the Cohen-Coon method for the initial adjustment, and the adjustment formula is shown in Formula (9):
K p = T K τ 4 3 + τ 4 T T i = τ 32 + 6 τ T 13 + 8 τ T T d = τ 4 11 + 2 τ T
The mathematical model of the control object is shown in Formula (1), and the corresponding parameters are brought into the equation to obtain K p = 0.69, K i = 0.05, and K d = 1.78.
PID control in the field of linear system control technology is mature and commonly used, but there are shortcomings. For example, when the controlled object has complex nonlinear characteristics, it is difficult to establish an accurate mathematical model, and due to the uncertainty of the object and the environment, it is often difficult to achieve satisfactory control results.

2.2.2. BP Neural Network-Based PID Controller Design

BP neural network-based PID control algorithm (hereinafter referred to as BP–PID) is a control strategy proposed to address the above problem. The nonlinear fitting capability of BP enables it to approximate any nonlinear continuous function with arbitrary accuracy, which gives it the ability to solve complex nonlinear systems and can be used for PID control [22]. Therefore, combining PID control and BP neural networking according to the characteristics of the three parameters of PID control with each other and mutual constraints, and using the mapping ability of BP neural network to nonlinear functions, makes the precision fertilizer application control system for integrated water and fertilizer of field crops adaptive, meaning it can automatically adjust the control parameters, adapt to the changes of the controlled process, improve control performance and reliability, and effectively improve the PID. It can effectively improve the limitations of PID control in complex nonlinear systems. The BP–PID controller structure is shown in Figure 3.
The BP neural network algorithm includes two processes: forward propagation of the sample input signal and backward transmission of the error. In forward propagation, the input sample data is passed to the output node through the implicit layer and then transformed nonlinearly to produce the corresponding output signal, which will enter the backward propagation of the error process if the true result is not consistent with the predicted result. The backpropagation of error is to reverse the output error through the hidden layer to the input layer by layer, assign the error to each layer, and use the error signal received by each layer as the basis for adjusting the weight of each unit. By adjusting the strength and threshold of the coupling between the input nodes and the hidden layer nodes, as well as the hidden layer nodes and the output nodes, the error is allowed to fall down the gradient, and the network parameters corresponding to the minimum error are obtained through repeated training and learning [23]. In this paper, a 4-5-3 style BP neural network structure is used as shown in Figure 4, i.e., 4 input layers, 5 hidden layers, and 3 output layers. The 4 input layers correspond to the desired set value r(k), actual output value y(k), deviation value e(k), and bias term, and 3 output layers correspond to K p , K i and K d of PID. j is the number of neurons in the input layer, i is the number of neurons in the hidden layer j is the number of neurons in the input layer, i is the number of neurons in the hidden layer, and l is the number of neurons in the output layer.
The BP neural network input layer output and the implicit layer input and output are:
O j 1 = x j k j = 1,2 , , M n e t i 2 k = j = 1 M ω i j 2 O j 1 k O i 2 k = f n e t i 2 k θ 2 i = 1,2 , , Q
where the superscripts (1) and (2) denote the input layer and the hidden layer respectively; M is the number of variables in the input layer of the neural network; θ ( 2 ) is the threshold of the hidden layer; ω i j 2 is the connection weight of the neurons in the input layer and the neurons in the hidden layer; Q is the number of neurons in the hidden layer; f(x) is the activation function of the hidden layer; and its expression is as follows:
f x = tan h x = e x e x e x + e x
The inputs and outputs of the output layer are:
n e t l 3 k = i = 1 Q ω l i 3 O i 2 k Q l 3 k = g n e t l 3 k β 3 l = 1,2 , 3
where the superscript (3) represents the output layer, ω l i 3 is the connection weight of the neuron in the hidden layer and the neuron in the output layer, the three outputs of the output layer correspond to the three adjustable parameters K p , K i and K d of PID controller, so l = 1, 2, 3; β 3 is the output layer threshold; g x is the output layer activation function, K d cannot be negative, its expression is transformed using the Sigmoid function as follows:
g x = 1 2 1 + tan h x = e x e x + e x
The above is the forward propagation process, when the difference between the actual output and the desired output value is not 0, the difference in the form of mean square value, as a variable to correct the connection weights, so that the error mean square value approaches 0, that is, the reverse error adjustment process, the error mean square value can be calculated from the performance indicator function, the expression is as follows:
E k = 1 2 r k y k 2 = 1 2 e 2 k
The connection weights ω i l 3 , ω l i 3 are adjusted with E(k) as the variable, and based on the negative gradient rule, the inertia term is adopted and α is added as the inertia factor to increase the convergence speed and reduce the probability of falling into a dead loop [24]. The output layer, implicit layer connection weights are updated as follows:
ω l i 3 k + 1 = η 1 E k ω l i 3 + α 1 Δ ω l i 3 k 1 + Δ ω l i 3 k ω i j 2 k + 1 = η 2 E k ω i j 2 + α 2 Δ ω i j 2 k 1 + ω i j 2 k
where α is the inertia factor; η is the learning rate.
Since the partial derivatives in Formula (15) are difficult to calculate directly, the following deformation calculation is done:
E k ω l i 3 = E k y k y k u k u k O l 3 k O l 3 k n e t l 3 k n e t l 3 k ω l i 3 k E k ω i l 2 = E k y k y k u k u k O l 3 k O l 3 k n e t l 3 k n e t i 3 k O i 2 k O i 2 k n e t i k n e t i 2 k ω i l 2
After simplification, approximation and other calculations, the updated formula for the output layer and implicit layer connection weights of the traditional BP neural network PID controller is obtained as follows:
w l i 3 k + 1 = α 1 w l i 3 k 1 + η 1 δ l 3 O i 2 k + w l i 3 k δ l 3 = e k s g n y k u k u k O l 3 k g n e t l 3 k β 3 k w i j 2 k + 1 = α 2 w i j 2 k 1 + η 2 δ i 2 O j 1 k w i j 2 k δ i 2 = f n e t i 2 k θ 2 k l = 1 3 δ l 3 w l i 3 k
In summary, the control process of the BP–PID control method can be summarized as follows:
(1)
determine the BP neural network structure, and determine the initial values of connection weights and thresholds by the mathematical model of the controlled object, select the appropriate inertia factor α and learning rate η , and determine the initial values of the proportional, integral and differential coefficients of the PID;
(2)
the flowmeter collects the actual instantaneous flow value of liquid fertilizer at the current moment, inputs the desired instantaneous flow value of liquid fertilizer, and calculates and inputs the metering deviation value of liquid fertilizer;
(3)
according to Formula (8), u(k) is calculated and input to the controlled object to obtain the actual instantaneous flow rate value of liquid fertilizer at the moment k = 1;
(4)
The learning update of the BP neural network part is carried out, and the parameters of the modified PID control are obtained according to Formulas (10)–(17) to realize the adaptive adjustment of the PID parameters.
(5)
When k = k + 1, return to Formula (8).
Through the process of adjusting the weights of the BP learning algorithm, the ideal data of the posting and model are trained, and the adaptive capability of online adjustment of the parameters is used to adjust the parameters of the PID in real time to achieve the optimization of the parameters by constantly adjusting the weights online, so that the control and identification effects can be obtained adaptively, quickly, and accurately.
BP–PID can use its learning ability to adjust the system parameters, but its algorithm for adjusting the weights and thresholds of the network is in the negative gradient direction, which leads to slow convergence of the algorithm in the training process. In the process of network learning training using the gradient descent method, the further ability is needed to make the training results reach the global optimum [25]. To address the defects of the BP neural network such as slow convergence speed and easy falling into local minima, the advantages of the strong global search ability of the genetic algorithm and strong local search ability and fast convergence speed of the particle swarm algorithm are used to optimize the BP neural network weights to obtain a new control method and form a hybrid optimization algorithm to improve the BP neural network.

2.2.3. Design of Hybrid Optimization BP Neural Network-Based PID Controller

The particle swarm optimization algorithm is an optimization algorithm that simulates the phenomenon of biological clusters in nature, which has a fast convergence speed at the early stage of evolution, but a slow convergence speed and low convergence accuracy at the late stage of evolution, and falls easily into the situation of local minima; the genetic algorithm has good parallel computing ability and strong global search ability. Given their complementary advantages, the two algorithms are combined, and the hybrid optimization of genetic algorithms and particle swarm optimization (hereinafter referred to as GA–PSO) algorithm optimizes the connection weights of the BP neural network and applies the optimized optimal weights to the BP neural network. Thereafter, the BP neural network adjusts the weighting coefficients by its self-tuning capability and automatically adjusts the PID control parameters to achieve the goal of optimal control parameters. The hybrid optimization of PID control algorithm based on BP neural network by particle swarm optimization and genetic algorithm (hereinafter referred to as GA–PSO–BP–PID algorithm) is a hybrid algorithm that combines genetic algorithm (GA), particle swarm optimization (PSO), backpropagation (BP), and proportional-integral-derivative (PID) control to optimize a parametric PID controller. The GA–PSO-BP–PID controller structure is shown in Figure 5.
Since most of the GA–PSO improvement algorithms make the algorithm itself complicated, the GA–PSO hybrid optimization algorithm proposed in this paper uses crossover and mutation operations instead of the terms in the standard particle swarm algorithm formulas for particle updates through the crossover and mutation ideas of genetic algorithms. Therefore, it simplifies the algorithm and avoids using the formula to calculate the particle positions, which not only utilizes the characteristics of the particle swarm algorithm to quickly converge to the optimal solution position in the early stage, but also brings into play the global search ability of the genetic algorithm and effectively avoids the premature phenomenon of the population [26].
The velocity and position of any particle in the PSO algorithm is updated during the update process according to the following two Formulas:
V i k + 1 = ω V i k + c 1 r 1 p i x i k + c 2 r 2 p g x i k
X i k + 1 = X i k + V i k + 1
where k is the number of iterations; c 1 , c 2 is the acceleration factor; ω is the inertia coefficient; r 1 , r 2 are random numbers between [0, 1].
From Formulas (18) and (19), the update of the particle expresses as:
X i k + 1 = X i k + ω V i k + c 1 r i p i x i k + c 2 r 2 p g x i k
In Formula (20), the second term ω V i ( k ) is the inertia originally possessed by the particle, which corresponds to the variational operation in GA for the velocity term at the previous moment; similarly, the first, third, and fourth terms of Formula (20) correspond to the crossover operation in GA for the particle with the individual extremal particle and the global extremal particle.
Therefore, firstly, the second term ω V i ( k ) in Formula (20) is replaced by the variation operation in GA. Instead of multiplying the velocity term of the particle by the original velocity using the inertia coefficient, the velocity of the particle is updated by the variation operation; then the terms 1, 3 and 4 in Formula (20) are replaced by the crossover operation in GA: the particle is first crossed with its individual extremum and then with the global extremum. Finally, the particle that completes the crossover operation is added with the velocity term corresponding to it to complete the particle update.
In the iterative process, the fitness value of each individual is calculated using the fitness function and is evaluated. The ITAE metric has the advantages of fast, smooth, and low overshoot, and is adopted in most of the literature, so it is introduced into the performance evaluation of the precision fertilizer application control system for field crops in this paper as an important reference index for the controller, and as an important reference index for the GA–PSO hybrid optimization algorithm as an adaptation function. The so-called ITAE criterion, i.e., the time multiplied absolute error integral minimization criterion, can be expressed as:
I T A E = 0 t e t d t
Formula (21) is the mathematical model of the continuous control system, but because the computer uses digital sampling control, the integral part and differential part in Formula (21) cannot be identified. Therefore, it is necessary to discretize the sampling moment points. With T as the period of sampling and k as the serial number of sampling, the discrete formula of the ITAE function is:
ITAE = k = 0 n e k T · k T · T
where T is the sampling period and k is the sampling moment.
Instead of the gradient descent method of the traditional BP algorithm, the above GA–PSO hybrid optimization algorithm is used for the parameter optimization process of the BP neural network to search for all the weights of the BP neural network and use them as the coded information of the particle swarm individuals. This not only avoids the problem of large computational effort caused by the gradient descent method of derivation but also reduces the risk of falling into local minima. In the optimization process, the memory function of the particle swarm algorithm is used to retain the global optimum, so that each particle quickly approaches the global optimum solution and accelerates the convergence speed. The GA–PSO hybrid optimization algorithm performs an iterative optimization search with ITAE as the objective function and then obtains the optimal weights of the BP algorithm for a given number of iterations.
In summary, the flow of the BP neural network with hybrid optimization of genetic algorithms and particle swarm optimization (hereinafter referred to as GA–PSO-BP) algorithm designed in this paper is shown in Figure 6.

3. Results

3.1. Analysis of Simulation Results

Three different control methods, PID, BP–PID, and GA–PSO–BP–PID, were used in the simulation experiments in Matlab software, the sampling period was set to 1 ms, and the system delay time was 11 s. The three controllers were constructed with the following parameters:
Conventional PID control: According to the parameters obtained in the conventional PID controller design in chapter 3.1 above, K p = 0.69, K i = 0.05, K d = 1.78, and the input step signal is simulated.
BP–PID control: For BP neural network PID, the structure of the neural network is selected as 4-5-3 according to Section 3.2 above, the learning rate η is set to 0.28, the inertia factor α is set to 0.04, and the initial value of the weighting coefficient is taken as a random number on the interval [−1.0, 1.0]. Since the adjustable parameters K p , K i , and K d are taken as non-negative Sigmoid functions, their values are between (0, 1).
GA–PSO–BP–PID control: GA–PSO–BP–PID controller first sets the algorithm parameters, where the BP neural network parameters are set in line with the above PID control for building BP neural networks, the GA–PSO part sets the particle population size to 100, the number of iterations k to 1000, the value of inertia coefficient ω to 0.6, the acceleration factor c 1 , c 2 is set to 1.85, and the above algorithm parameters are used to initialize the population, find the optimal extrema, and update it for iterative optimization search.
Figure 7 shows the iterative optimization search process for the optimal individual fitness value of the GA–PSO hybrid optimization algorithm and the variation curve of the steady-state performance index ITAE obtained after 1000 iterations.
From Figure 7, it can be seen that after the GA–PSO hybrid optimization algorithm starts, the fitness value ITAE gradually stabilizes and cancan jump out of the local optimal solution as the number of iterations increases. At about 190 iterations, the ITAE metrics stabilized.
To compare more intuitively, the unit step signal is used as the input signal, and four transient performance indicators, namely rise time, peak time, regulation time, and maximum overshoot, are added for comparison, and the simulation time is 100 s. The unit step response comparison simulation results of the three controllers are shown in Figure 8, and the four transient performance indexes are shown in Table 1.
As can be seen from Figure 8, the GA–PSO–BP–PID algorithm is the first to reach the reference curve with the shortest rise time, and the overall response is soon stabilized, although the rise time is not much different compared with the PID algorithm, the PID algorithm produces larger oscillations and overshoot, and the GA–PSO-BP–PID algorithm has an obvious overall advantage in performance. The overall advantage of the GA–PSO–BP–PID algorithm is obvious; the GA–PSO–BP–PID algorithm produces some overshoot compared with the BP–PID algorithm, but the longer rise time, peak time, and regulation time of the BP–PID algorithm make its overall performance decrease and inferior to GA–PSO–BP–PID algorithm.
From the transient performance indexes of the three controllers analyzed in Table 1, all four transient performance indexes of the PID algorithm are inferior to the GA–PSO–BP–PID algorithm, and in terms of overshoot, although the overshoot of the BP–PID algorithm is 1.04%, which is better than that of the GA–PSO-BP–PID algorithm by 3.6%, its rise time and peak time are much longer than that of the GA–PSO–BP–PID. The GA–PSO-BP–PID algorithm can balance the response speed and the stability of the control process, and the overall performance is superior.

3.2. Flow Rate Adjustment Test of Water–fertilizer Integrated Precision Fertilizer Application Control System

3.2.1. Testing Device and System Design

To be able to accurately simulate the operation of the integrated water and fertilizer precision fertilization control system for field crops in the laboratory and to test the control speed and stability of the control algorithm, this paper builds a test platform using the implementation components for integrated water and fertilizer precision fertilization in an actual farm environment, connects the flow meter to the test platform, and interacts with the computer and control system through the RS-485 serial bus to compare test different control strategies. The schematic diagram of the testbed composition is shown in Figure 9.
The flow rate adjustment test platform adopts a STM32F103ZET6 microcontroller as the control element of water and fertilizer integrated precision fertilization control system, and writes the program with the programming software Keil μ Vision4; adopts peristaltic pump as liquid fertilizer conveying device, whose maximum conveying flow rate is 1 m3/h, rated power is 1.5 kW, rated voltage is 380 V; adopts inverter with rated power of 2.2 kW. The output frequency is 0–400 Hz, rated voltage is 380 V; a model LDG-MIK electromagnetic flowmeter with an accuracy of 0.5% is used, as well as a USB3100 model data collector from Altech with total sampling speed of 20 KS/S, 12-bit resolution, single-ended 8-channel analog input, 4-channel programmable I/O, and 1-channel 32-bit counter. The AD cache of 4K points FIFO can meet the real-time acquisition of data required in this test and convert the analog signal to digital for further processing by computer. The flow regulation test platform is shown in Figure 10.
A STM32F103ZET6 microcontroller according to the control amount of targeted control of the system, where the control algorithm uses a hybrid-optimized BP neural network PID control algorithm, electromagnetic flowmeter signal received by the I/O port, calculated by the STM32F103ZET6 microcontroller, and then converted into a variable voltage signal to determine the instantaneous flow rate; the output frequency of the inverter is adjusted accordingly. Eventually, the fertilizer flow rate at the outlet of the mixing tank is changed. During operation, the volume of liquid in the mixing tank is kept at 50 L.

3.2.2. Analysis of Test Results

The fertilizer flow rate of the integrated water and fertilizer precision fertilizer control system for field crops is determined by the fertilizer demand of the field crops planted in the field, and the fertilizer demand varies from field crop to field crop. The flow rate was set to 0.3 m3/h, 0.5 m3/h, and 0.8 m3/h to accommodate the demand for fertilizer flow rate for different crops. The test results of the three controllers are shown in Figure 11, Figure 12 and Figure 13 as well as Table 2, Table 3 and Table 4.

4. Discussion

Comprehensive analysis of the results in Figure 11, Figure 12 and Figure 13 and Table 2, Table 3 and Table 4 shows that the performance of the three controllers also changes under different fertilizer application flow rates. Although the maximum overshoot of 3.09% at 0.8 m3/h was lower than that of 5.31% for the BP–PID controller based on hybrid optimization, its rise time, peak time, and regulation time were longer than those of the BP–PID controller based on hybrid optimization, and the maximum overshoot of 3.09% at 0.3 m3/h was lower than that of the PID controller based on hybrid optimization. However, the rise time, peak time, and regulation time are longer than those of the hybrid-optimized BP–PID controller, and all transient performance indexes are inferior to those of the hybrid-optimized BP–PID controller when the fertilizer flow rate is 0.3 m3/h and 0.5 m3/h; the anti-disturbance ability and robustness are poor. Therefore, from the experimental results of three common fertilizer application flow rates, by using the hybrid optimization-based BP neural network PID algorithm to control the precision fertilizer application control system for integrated water and fertilizer application of field crops, the overall performance is better than the control using PID algorithm and the control using BP neural network PID.
To better demonstrate the superiority of the hybrid optimization-based BP neural network PID algorithm studied in this paper for precision fertilizer application control system for field crops, we selected similar literature for comparative analysis, in which Zihao Meng studied the application characteristics of PSO–BP–PID algorithm for precision fertilizer application control system [27]. In the comparative analysis, the GA–PSO–BP–PID algorithm proposed in this paper does better in optimizing the regulation time and maximum overshoot at the same fertilizer application flow rate, but is inferior to the PSO–BP–PID algorithm in optimizing the rise time and peak time. This is because the GA–PSO–BP–PID algorithm is more focused on overall optimization and also higher in accuracy, which allows it to better control the stability and accuracy of the system and thus better optimize the regulation time and maximum overshoot. However, this may also lead to a slightly poorer performance in optimizing rise time and peak time, as these metrics focus more on the dynamic performance of the system, while the GA–PSO–BP–PID algorithm focuses more on the steady-state performance of the system.
In summary, the control method proposed in this paper combines the advantages of hybrid optimization techniques and BP neural networks, which can better cope with the control requirements in practical applications and improve the performance level of the integrated precision fertilizer application control system for field crops with nonlinear time lag characteristics.

5. Conclusions

In this paper, a precision fertilizer application control system for integrated water and fertilizer control of field crops is studied. Firstly, a mathematical model is established for the precision fertilizer application control system of integrated water and fertilizer system of field crops, after which the data of flow rate changes are obtained after sampling and the first-order approximation method is used and fitted to finally derive the transfer function of the system. Since the self-learning of its BP neural network depends on the selection of initial weights, which makes the control effect unsatisfactory, this paper adds a GA–PSO hybrid optimization algorithm based on the PID adaptive control of the BP neural network, which causes the BP neural network self-learning to speed up. The simulation study of the hybrid optimization-based BP neural network PID control algorithm is carried out using MATLAB, and the analysis of the simulation results concludes that its control effect on the precision fertilizer application control system of integrated water and fertilizer for field crops is superior.
To further illustrate the superiority of the control algorithm proposed in this paper, this paper uses the precision fertilizer flow rate adjustment test bench as a platform, which can monitor the fertilizer flow rate in the integrated precision fertilizer control system in real-time, and when the fertilizer pump flow rate is set to 0.3 m3/h, 0.5 m3/h, and 0.8 m3/h, the average maximum overshoot is 5.1% and the average adjustment time is 68.99 s. The peak time and regulation time were the shortest at 0.6 m3/h, 51.89 s, and 28.65 s, respectively, and the maximum overshoot was the smallest at 0.6 m3/h, 3.16%. The results show that the hybrid optimization-based BP neural network PID control algorithm can regulate the integrated fertilizer application flow rate of field crops to the desired value in the shortest time with a small overshoot, while the best effect is achieved at the application flow rate of 0.6 m3/h, which improves the decision level of the controller and achieves good control effect.
The hybrid optimization-based BP neural network PID controller for integrated precision fertilizer application control system for field crops combines the advantages of GA, PSO, BP, and PID control, which can effectively solve the adverse effects of time varying, time lagging, and non-linearity of the model on the controller, and has good dynamic performance and robustness to meet the needs of agricultural production. The integrated water and fertilizer fertilization of field crops can help reduce the pollution of groundwater and surface water by chemical fertilizers and protect the ecological environment of farmland. The research in this paper provides a theoretical basis for precise control to achieve water conservation and weight loss and ecological sustainability of field crop production as well as to enhance the modernization of smart agriculture for field crops, which promotes the formation of a modernized smart agriculture system and improves the technical level of precise fertilizer application control for field crops.

Author Contributions

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

Funding

This research was funded by National Key R&D Program of China (No. 2022ZD0115804), Major Science and Technology Projects in Xinjiang Uygur Autonomous Region (No. 2022A02012-4) National Natural Science Foundation of China (No. 52065055), Corps Science and Technology Plan Projects (2022BC004).

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Zhang, M.; Li, Y.; Liu, J.; Wang, J.; Zhang, Z.; Xiao, N. Changes of soil water and heat transport and yield of tomato (Solanum lycopersicum) in greenhouses with Micro-Sprinkler irrigation under plastic film. Agronomy 2022, 12, 664. [Google Scholar] [CrossRef]
  2. Wang, H.; Li, J.; Cheng, M.; Zhang, F.; Wang, X.; Fan, J.; Wu, L.; Fang, D.; Zou, H.; Xiang, Y. Optimal drip fertigation management improves yield, quality, water and nitrogen use efficiency of greenhouse cucumber. Sci. Hortic. 2019, 243, 357–366. [Google Scholar] [CrossRef]
  3. Xiuyun, X.; Xufeng, X.; Zelong, Z.; Bin, Z.; Shuran, S.; Zhen, L.; Tiansheng, H.; Huixian, H. Variable Rate Liquid Fertilizer Applicator for Deep-fertilization in Precision Farming Based on ZigBee Technology. IFAC-PapersOnLine 2019, 52, 43–50. [Google Scholar] [CrossRef]
  4. Ren, P.; Huang, F.; Li, B. Spatiotemporal patterns of water consumption and irrigation requirements of wheat-maize in the Huang-Huai-Hai Plain, China and options of their reduction. Agric. Water Manag. 2022, 263, 107468. [Google Scholar] [CrossRef]
  5. Ying-Zi, Z.; Hai-Tao, C.; Shou-Yin, H.; Wen-Yi, J.; Bin-Lin, O.; Guo-Qiang, D.; Ji-Cheng, Z. Design and Experiment of Slave Computer Control System for Applying Variable-rate Liquid Fertilizer. J. Northeast Agric. Univ. 2015, 22, 73–79. [Google Scholar] [CrossRef]
  6. 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]
  7. Ben-Gal, A.; Beiersdorf, I.; Yermiyahu, U.; Soda, N.; Presnov, E.; Zipori, I.; Crisostomo, R.R.; Dag, A. Response of young bearing olive trees to irrigation-induced salinity. Irrig. Sci. 2017, 35, 99–109. [Google Scholar] [CrossRef]
  8. Bhite, B.R.; Pawar, P.S.; Bulbule, S.V. Standardization of Stage Wise Requirement of Nutrients in Sweet Orange. Trends Biosci. 2017, 10, 5644–5647. [Google Scholar]
  9. Fontanier, C.H.; Aitkenhead-Peterson, J.A.; Wherley, B.G.; White, R.H.; Thomas, J.C. Effective rainfall estimates for St. Augustine grass lawns under varying irrigation programs. Agron. J. 2021, 113, 3720–3729. [Google Scholar] [CrossRef]
  10. Ahmad, U.; Nasirahmadi, A.; Hensel, O.; Marino, S. Technology and Data Fusion Methods to Enhance Site-Specific Crop Monitoring. Agronomy 2022, 12, 555. [Google Scholar] [CrossRef]
  11. Ahmad, U.; Begum, U. Enhancing production of Zea mays genotypes by K application in Peshawar, Pakistan. Indian J. Agric. Res. 2017, 51, 257–261. [Google Scholar] [CrossRef]
  12. Adeyemi, O.; Grove, I.; Peets, S.; Norton, T. Advanced monitoring and management systems for improving sustainability in precision irrigation. Sustainability 2017, 9, 353. [Google Scholar] [CrossRef]
  13. Chen, J.; Gao, Y.; Qian, H.; Jia, H.; Zhang, Q. Insights into water sustainability from a grey water footprint perspective in an irrigated region of the Yellow River Basin. J. Clean. Prod. 2021, 316, 128329. [Google Scholar] [CrossRef]
  14. Dong, Y.; Fu, Z.; Peng, Y.; Zheng, Y.; Yan, H.; Li, X. Precision fertilization method of field crops based on the Wavelet-BP neural network in China. J. Clean. Prod. 2020, 246, 118735. [Google Scholar] [CrossRef]
  15. 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]
  16. Joseph, S.B.; Dada, E.G.; Abidemi, A.; Oyewola, D.O.; Khammas, B.M. Metaheuristic algorithms for PID controller parameters tuning: Review, approaches and open problems. Heliyon 2022, 8, e09399. [Google Scholar] [CrossRef]
  17. Yang, T.; Zheng, X.; Vidyarthi, S.K.; Xiao, H.; Yao, X.; Li, Y.; Zang, Y.; Zhang, J. Artificial Neural Network Modeling and Genetic Algorithm Multiobjective Optimization of Process of Drying-Assisted Walnut Breaking. Foods 2023, 12, 1897. [Google Scholar] [CrossRef]
  18. Tang, G.; Lei, J.; Du, H.; Yao, B.; Zhu, W.; Hu, X. Proportional-integral-derivative controller optimization by particle swarm optimization and back propagation neural network for a parallel stabilized platform in marine operations. J. Ocean Eng. Sci. 2017, 139, 116–126. [Google Scholar] [CrossRef]
  19. Huang, J.; He, L. Application of Improved PSO—BP Neural Network in Customer Churn Warning. Procedia Comput. Sci. 2018, 131, 1238–1246. [Google Scholar] [CrossRef]
  20. Ren, C.; An, N.; Wang, J.; Li, L.; Hu, B.; Shang, D. Optimal parameters selection for BP neural network based on particle swarm optimization: A case study of wind speed forecasting. Knowl. Based Syst. 2014, 56, 226–239. [Google Scholar] [CrossRef]
  21. Marino, S.; Aria, M.; Basso, B.; Leone, A.P.; Alvino, A. Use of soil and vegetation spectroradiometry to investigate crop water use efficiency of a drip irrigated tomato. Eur. J. Agron. 2014, 59, 67–77. [Google Scholar] [CrossRef]
  22. Wang, H.; Xiang, Y.; Zhang, F.; Tang, Z.; Guo, J.; Zhang, X.; Hou, X.; Wang, H.; Cheng, M.; Li, Z. Responses of yield, quality and water-nitrogen use efficiency of greenhouse sweet pepper to different drip fertigation regimes in Northwest China. Agric. Water Manag. 2022, 260, 107279. [Google Scholar] [CrossRef]
  23. Qi, W.; Zhang, Z.; Wang, C.; Huang, M. Prediction of infiltration behaviors and evaluation of irrigation efficiency in clay loam soil under Moistube® irrigation. Agric. Water Manag. 2021, 248, 106756. [Google Scholar] [CrossRef]
  24. Feng, H.; Ma, W.; Yin, C.; Cao, D. Trajectory control of electrohydraulic position servo system using improved PSO-PID controller. Automat. Construct. 2020, 127, 103722. [Google Scholar] [CrossRef]
  25. Yu, Y.; Xu, Y.; Wang, F.; Li, W.; Mai, X.; Wu, H. Adsorption control of a pipeline robot based on improved PSO algorithm. Complex Intell. Syst. 2020, 4, 964–977. [Google Scholar] [CrossRef]
  26. Wang, J.; Zhu, Y.; Qi, R.; Zheng, X.; Li, W. Adaptive PID control of multi-DOF industrial robot based on neural network. J. Ambient Intell. Humaniz. Comput. 2020, 11, 95–102. [Google Scholar] [CrossRef]
  27. Meng, Z.; Zhang, L.; Wang, H.; Ma, X.; Li, H.; Zhu, F. Research and Design of Precision Fertilizer Application Control System Based on PSO-BP-PID Algorithm. Agriculture 2022, 12, 1395. [Google Scholar] [CrossRef]
Figure 1. Structure of water and fertilizer integration system for field crops.
Figure 1. Structure of water and fertilizer integration system for field crops.
Agronomy 13 01423 g001
Figure 2. Conventional PID controller structure.
Figure 2. Conventional PID controller structure.
Agronomy 13 01423 g002
Figure 3. BP–PID controller structure.
Figure 3. BP–PID controller structure.
Agronomy 13 01423 g003
Figure 4. BP neural network structure.
Figure 4. BP neural network structure.
Agronomy 13 01423 g004
Figure 5. GA–PSO-BP–PID controller structure.
Figure 5. GA–PSO-BP–PID controller structure.
Agronomy 13 01423 g005
Figure 6. GA–PSO-BP algorithm modeling process.
Figure 6. GA–PSO-BP algorithm modeling process.
Agronomy 13 01423 g006
Figure 7. Optimal individual adaptation value iterative optimization search process.
Figure 7. Optimal individual adaptation value iterative optimization search process.
Agronomy 13 01423 g007
Figure 8. Simulation results.
Figure 8. Simulation results.
Agronomy 13 01423 g008
Figure 9. Schematic diagram of the structure of the flow regulation test platform.
Figure 9. Schematic diagram of the structure of the flow regulation test platform.
Agronomy 13 01423 g009
Figure 10. Flow regulation test platform.
Figure 10. Flow regulation test platform.
Agronomy 13 01423 g010
Figure 11. Regulation curves of 0.3 m3/h.
Figure 11. Regulation curves of 0.3 m3/h.
Agronomy 13 01423 g011
Figure 12. Regulation curves of 0.5 m3/h.
Figure 12. Regulation curves of 0.5 m3/h.
Agronomy 13 01423 g012
Figure 13. Regulation curves of 0.8 m3/h.
Figure 13. Regulation curves of 0.8 m3/h.
Agronomy 13 01423 g013
Table 1. Transient performance index of three controllers.
Table 1. Transient performance index of three controllers.
Controller TypeRise Time (s)Peak Time (s)Regulation Time (s)Maximum Overshoot
PID12.4213.6925.2658.61%
BP–PID27.3932.9619.911.04%
GA–PSO-BP–PID11.9512.5011.773.6%
Table 2. Transient performance indexes of 0.3 m3/h.
Table 2. Transient performance indexes of 0.3 m3/h.
Controller TypeRise Time (s)Peak Time (s)Regulation Time (s)Maximum Overshoot
PID20.0230.6481.8577.4%
BP–PID70.91106.6109.27.37%
GA–PSO-BP–PID32.0274.69122.36.83%
Table 3. Transient performance indexes of 0.5 m3/h.
Table 3. Transient performance indexes of 0.5 m3/h.
Controller TypeRise Time (s)Peak Time (s)Regulation Time (s)Maximum Overshoot
PID20.6730.289.2650.48%
BP–PID71.76105.661.834.5%
GA–PSO-BP–PID33.4551.8928.653.16%
Table 4. Transient performance indexes of 0.8 m3/h.
Table 4. Transient performance indexes of 0.8 m3/h.
Controller TypeRise Time (s)Peak Time (s)Regulation Time (s)Maximum Overshoot
PID20.0430.92110.2675.5%
BP–PID74.97106.1462.913.09%
GA–PSO-BP–PID33.3953.4856.025.31%
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

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. https://doi.org/10.3390/agronomy13051423

AMA Style

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(5):1423. https://doi.org/10.3390/agronomy13051423

Chicago/Turabian Style

Zhu, Fenglei, Lixin Zhang, Xue Hu, Jiawei Zhao, Zihao Meng, and Yu Zheng. 2023. "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 13, no. 5: 1423. https://doi.org/10.3390/agronomy13051423

APA Style

Zhu, F., Zhang, L., Hu, X., Zhao, J., Meng, Z., & Zheng, Y. (2023). 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, 13(5), 1423. https://doi.org/10.3390/agronomy13051423

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