Application of PSO-BPNN-PID Controller in Nutrient Solution EC Precise Control System: Applied Research
Abstract
:1. Introduction
- (1)
- Combination of fuzzy control and PID: Wang Xiaolong designed a fuzzy PID controller to control the precise ratio of water and fertilizer [1]. Zhang Yubin et al. applied fuzzy PID control technology based on the EC value and pH value and developed a precise water and fertilizer irrigation control system [2]. Wang Haihua et al. adopted a PI and fuzzy subsection control strategy to better solve the lag and instability problems of water and fertilizer EC regulation [3]. Li Li et al. analyzed the situation of an actual closed cultivation system. To meet their requirements, the structure of the nutrient solution to control the secondary mixed fertilizer was designed, and a mathematical model of the dynamic process of the nutrient solution was established. At the same time, a PI control algorithm was also designed, and their testing verified that the steady-state time dimension of the system was 100 s, the overshoot was 3%, and the control performance was excellent [4].
- (2)
- Combination of heuristic algorithm and PID: the BP neural network has a strong nonlinear mapping ability and self-adaptive ability, and its self-learning ability can be used to output the optimal PID controller parameter combination corresponding to a certain optimal control and thus achieve the desired control effect. However, the initial value of the weight of the traditional BP neural network is randomly selected according to experience. This method leads to slow convergence of the network, which makes it easy to fall into the local optimal solution, and the final result has a large degree of instability [4]. Because the particle swarm algorithm has memory, it can transfer the memory of the best position of the particle in the history of the group to other particles and has the advantages of having fewer parameters to be adjusted and a simple structure, so the particle swarm algorithm was selected to weight the BP neural network. Optimization was performed in the design of PSO-BPNN-PID to improve the control effect. In recent years, scholars have carried out a series of studies in this area. Jiang Liu et al. designed a PID controller based on the BP neural network algorithm and analyzed the vehicle dynamics. The simulation results showed that the dynamic performance of the vehicle was effectively improved under different input conditions [5]. In order to reduce the influence of temperature on the micro-gyroscope, Xia Dunzhu et al. proposed a temperature compensation control method. First, a BP (back-propagation) neural network and polynomial fitting were used to build the temperature model of the micro-gyroscope. Considering the requirements of simplicity and real-time performance, piecewise polynomial fitting was adopted in the temperature compensation system. Then, an integral-separated PID temperature control system was adopted, with a proportional–integral–derivative control algorithm to stabilize the internal temperature of the micro-gyroscope and achieve its optimum performance. The experimental results showed that the combined temperature compensation and control method of the micro-gyroscope could be realized effectively in a prototype of the micro-micro-gyroscope [6]. Alex Alexandridis et al. proposed a new approach to controlling the general properties of nonlinear systems, using an inverse radial basis function neural network model that was able to combine disparate data from a variety of sources. The results revised the ability of the proposed control scheme to process and manipulate a variety of data. Through the data fusion method, it was shown that the method responded in a faster and less oscillatory manner [7]. Jun Wang et al. proposed a closed-loop motion control system based on a BP neural network (BPNN) PID controller, which used a Xilinx field programmable gate array (FPGA) solution. The results showed that the proposed system could realize self-tuning PID control parameters and had the characteristics of reliable performance, high real-time performance, and strong anti-interference ability. Compared with MCU, the convergence speed was far more than three orders of magnitude, proving its superiority [8]. Yuan Jianping [7] used the GA-PSO-BP-PID algorithm to control the greenhouse environment, and the simulation results obtained using MATLAB showed that the stability and robustness of the control system were better than conventional BP-PID [9]. Li Hang et al. used an improved genetic algorithm to optimize the BP neural network to achieve better control over the gas concentration [10]. The abovementioned BP neural network research has achieved good results in the field of environmental control but not in the field of nutrition. Therefore, based on the above research, this paper develops an EC control system for a nutrient solution consisting of a sensing layer, a network layer, and an application layer. The sensing layer consists of multiple LoRa sub-nodes and one LoRa master node, where the master node is connected to the water and fertilizer integration system. By combining LoRa and NB-IoT to form a wireless sensor network, comprehensive sensing, reliable transmission, and the intelligent application of water and fertilizer control information are realized. The nutrient solution EC regulation model of the water–fertilizer integration system is further constructed, and the PSO-BPNN-PID controller is designed by combining PSO optimization with the BP-PID coupling control method, and the initial weights of BPNN are continuously optimized by the PSO algorithm to achieve the optimal weights, and the optimal weights are input into BP neural network to automatically adjust the PID control parameters Kp, Ki, and Kd to find the optimal control parameters. After a MATLAB simulation with a good control effect, further, through the self-organized network communication performance test and nutrient solution EC control system test, it is proved that the nutrient solution EC control system has excellent performance and can meet the needs of actual production.
2. Working Principle of the Integrated Water and Fertilizer Device
2.1. Working Principle
2.2. Controller Selection
3. Design of EC Regulation System of Nutrient Solution
3.1. Sensing Layer
3.1.1. Design and Implementation of LoRa Wireless Communication
3.1.2. NB-IoT Master Node Communication with NB-IoT Child Nodes
- (1)
- LoRa transmission configuration
- (2)
- LoRa communication protocol
- (3)
- System software design
- ① Keil program compilation tool
- ② System task design
3.2. Network Layer
3.3. Application Layer
4. Nutrient Solution System Control Model
5. PSO-BPNN-PID Control Model
5.1. PSO-BPNN-PID Structure
5.2. PSO-BPNN-PID Algorithm
- Step 1: Established BP neural network.
- Step 2: PSO optimization.
- Step 3: BP neural network training.
- Step 4: PID control.
6. Simulation and Experimentation
6.1. Analysis of Results
6.2. System Testing
6.2.1. Wireless Sensor Network Acquisition System Test
6.2.2. Nutrient Solution Regulation Test
6.3. Test Results and Analysis
7. Conclusions
- (1)
- In this study, we built a precise EC control system platform for nutrient solutions and developed an EC information perception system composed of multiple LoRa slave nodes, NB-IoT master nodes, and a host computer. The system startup time was about 3.56~3.87 s; the command time was approximately 1.1235 s. The command time was thus in the range of 1.122~1.124 s, and the data delay was about 1.50~11.4 s. The system startup time, command issuing time, data reporting time, and data receiving time intervals were all relatively fast, the delay in issuing commands was small, and the data could be reported according to the time required by the user. The system can maintain good running performance.
- (2)
- Based on the PSO optimization method, a BP-PID nutrient solution EC control model with a structure of 4-5-3 was constructed. Under the same initial conditions, when the input EC = 2 mS/cm, the PSO-BPNN-PID method was used to control the EC value of the nutrient solution. The optimized PID scaling factors were Kp = 81, Ki = 0.095, and Kd = 0.044; the control steady state time was about 43 s; the overshoot was about 0.14%; and the system’s EC value was stable at 1.9997 mS/cm–2.0027 mS/cm. Compared with BPNN-PID and the traditional PID, we achieved steady-state time savings of 16.2% and 67%; the overshoot was reduced by 99.3% and 7.1%; the system control performance was excellent.
- (3)
- When inputting values of 1 mS/cm, 1.5 mS/cm, 2 mS/cm, and 2.5 mS/cm, we used a Smith PSO-BPNN-PID system to verify the system simulation model, respectively. The results showed that the fluctuation range of EC was 0.003 mS/cm cm~0.119 mS/cm, the steady-state time was 40 s~60 s, and the overshoot was 0.3%~0.14%. The average amount of fertilizer absorbed by the four channels measured in the test was 693.25 L/h, and the control accuracy of the EC value was +0.07, which meets the needs of actual production.
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Wang, X. Research and Development of Water and Fertilizer Precise Proportioning Control System; Northwest Sci-Tech University of Agriculture and Forestry: Xianyang, China, 2018. [Google Scholar]
- Zhang, Y.; Wei, Z.; Zhu, X.; Hu, Y.; Li, L. Control strategy and verification of precision water and fertilizer irrigation system. J. Drain. Irrig. Mach. Engin 2017, 35, 1088–1095. [Google Scholar]
- Wang, H.; Fu, Q.; Meng, F.; Mei, S.; Wang, J. Optimal design and experiment of fuzzy and PI segmented regulation and control of fertilizer liquid EC. Tran. Chin. Soc. Agric. Eng. 2016, 32, 110–116. [Google Scholar]
- Yong, W.; Ibrahim, A.N. Field Study of PID Parameter Tuning Investigation in Peristaltic Dosing Pump Control for Use in Automated Fertilizer Mixing System. MEKATRONIKA 2020, 2, 13–22. [Google Scholar] [CrossRef]
- Liu, J.; Li, X.; Zhang, X.; Chen, X. Modeling and simulation of energy-regenerative active suspension based on bp neural network pid control. Shock Vib. 2019, 6, 1–8. [Google Scholar] [CrossRef]
- Xia, D.; Chen, S.; Wang, S.; Li, H. Microgyroscope Temperature Effects and Compensation-Control Methods. Sensors 2009, 9, 8349–8376. [Google Scholar] [CrossRef]
- Alex, A.; Marios, S.; Nikolaos, P.; Elias, Z.; Haralambos, S. An inverse neural controller based on the applicability domain of rbf network models. Sensors 2018, 18, 315. [Google Scholar]
- Wang, J.; Li, M.; Jiang, W.; Huang, Y.; Lin, R. A Design of FPGA-Based Neural Network PID Controller for Motion Control System. Sensors 2022, 22, 889. [Google Scholar] [CrossRef]
- Yuan, J.; Shi, Y.; Jiang, Y.; Jiang, Y.; Jiang, P. Research on Improved BP Neural Network PID Controller in Greenhouse Environmental Control. Electron. Meas. Technol. 2019, 42, 19–24. [Google Scholar]
- Li, H.; Fan, D.; Hu, X.; Zhou, S. Research on improved BP neural network PID controller in gas concentration control. J. Sichuan Uni. Nat. Sci. Edit. 2020, 57, 1103–1109. [Google Scholar]
- Yuan, H.; Li, L.; Wang, J.; Wang, H.; N, A. Design and experiment of integrated nutrient solution control equipment for greenhouse water and fertilizer. Tran. Chin. Soc. Agric. Eng. 2016, 32, 27–32. [Google Scholar]
- Li, J.; Hong, T.; Feng, R.; Yue, X.; Luo, Y. Venturi variable fertilization device design and experiment based on pulse width modulation. Tran. Chin. Soc. Agric. Eng. 2012, 28, 105–110. [Google Scholar]
- Liu, Y. Research on the Key Technology of Greenhouse Precision Irrigation and Fertilization System; Nanjing Agricultural University: Nanjing, China, 2015. [Google Scholar]
- Niu, Y. Research on Facility Agriculture Precision Water and Fertilizer Management System and Its Intelligent Equipment Technology; Shanghai University: Shanghai, China, 2016. [Google Scholar]
- Fan, L. Design of Nutrient Solution Conductivity Sensor and Measurement System; Nanjing Agricultural University: Nanjing, China, 2016. [Google Scholar]
- Kang, J.; Meng, W.; Abraham, A.; Liu, H. An adaptive pid neural network for complex nonlinear system control. Neurocomputing 2014, 135, 79–85. [Google Scholar] [CrossRef]
- Ngo, H.Q.T.; Nguven, H.D.; Truong, Q.V. A design of pid controller using fpga-realization for motion control systems. In Proceedings of the 2020 International Conference on Advanced Computing and Applications (ACOMP), Quy Nhon, Vietnam, 25–27 November 2020; pp. 150–154. [Google Scholar]
- Yang, Y.; Wu, E. Simulink simulation of bp neural network pid controller based on s-function. Electron. Des. Eng. 2014, 22, 29–31. [Google Scholar]
- Song, Z.; Xu, X.; S, T.; Cui, Y.; Si, Y. Research on water and fertilizer control system based on PSO-BP optimized PID model. Chin. J. Agric. Mach. 2021, 42, 83–88. [Google Scholar]
- Wei, J.; Zhang, L.; Li, Z. Design and implementation of neural network pid controller based on fpga. Autom. Instrum. 2017, 10, 106–108. [Google Scholar]
- Bari, S.; Zehra Hamdani, S.S.; Khan, H.U.; Rehman, M.U.; Khan, H. Artifificial neural network based self-tuned pid controller for flflight control of quadcopter. In Proceedings of the 2019 International Conference on Engineering and Emerging Technologies (ICEET), Lahore, Pakistan, 21–22 February 2019; pp. 1–5. [Google Scholar]
- Hernández-Alvarado, R.; García-Valdovinos, L.G.; Salgado-Jiménez, T.; Gómez-Espinosa, A.; Fonseca-Navarro, F. Neural Network-Based Self-Tuning PID Control for Underwater Vehicles. Sensors 2016, 16, 1429. [Google Scholar] [CrossRef] [Green Version]
- Zhu, R.; Wu, H. Dc motor speed control system based on incremental pid algorithm. Instrum. Tech. Sens. 2017, 7, 121–126. [Google Scholar]
- Hong, H.; Ni, L.; Sun, H. Design and simulation of a self-driving precision compass based on BP+PID control. Mech. Des. 2021, 38, 78–84. [Google Scholar]
- Liu, J. Advanced PID Control MATLAB Simulation, 4th ed.; Publishing House of Electronics Industry: Beijing, China, 2016. [Google Scholar]
- Chui, J.; Zhou, Y.; Zhang, F.; Yin, Q.; Xiang, D. FPGA implementation of convolutional neural network based on pipeline architecture. J. Beijing. Univ. Chem. Tech. 2021, 39, 111–118. [Google Scholar]
- Liu, H.; Yang, Z.; Ai, Y. Research on dc motor control system based on particle swarm optimization algorithm. Mod. Electron. Tech. 2018, 41, 121–124. [Google Scholar]
- Yang, J.; Du, W.; Wu, S.; Li, L.; Wei, L. Hardware implementation and improvement of bp neural network based on fpga. Comput. Eng. Des. 2018, 39, 1733–1737. [Google Scholar]
- Zhang, Y.; Dai, W. Design and verification of neural network sliding mode controller based on FPGA. In Proceedings of the 2021 IEEE International Conference on Consumer Electronics and Computer Engineering (ICCECE), Guangzhou, China, 15–17 January 2021; pp. 255–258. [Google Scholar]
- Tian, L.; Li, J.; Zhao, X.; Zhang, L.; Wang, Y. Design and experiment of variable fertilizer absorption system of water and fertilizer integrated fertilizer applicator. J. Agric. Mech. Res. 2019, 41, 74–79. [Google Scholar]
- Li, J.; Tian, L.; Zhou, M.; Li, Z.; Wang, Y. Design and test of key components of water-fertilizer integrated fertilizer applicator. China Rural Water Hydropower 2018, 10, 148–152. [Google Scholar]
- Wang, Y.; Liu, J.; Li, J.; Cai, J.; Li, J.; Yang, T. Performance analysis of “bypass suction” mode of parallel four-venturi tube fertilizer applicator. J. Drain. Irrig. Mach. Engin 2021, 39, 959–965. [Google Scholar]
Sender | Receiver | ||
---|---|---|---|
Target group address | 0xXXXX | local group address | 0x5678 |
Module channel | 0xXXXX | module channel | 0x18 |
Send data | Receive address high + receive address low + receive channel + data (data) | Output Data | User data (data) |
0x56 0x78 0x18 0x11 0x22 0x33 | 0x11 0x22 0x33 |
Serial Number | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
---|---|---|---|---|---|---|---|
Number of bytes | 1 | 2 | 2 | 2 | n | 2 | 1 |
Code | STA (E8) | AD | C | LEN | DATA | CRC | END (E6) |
D15 | D14 | D13 | D12 | D11 | D10 | D9 | D8 |
If D15~D8 = 0, it is the communication between the collector and the background; if D15~D8 = 1, it is the communication between the collector and Bluetooth. | |||||||
D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
Transmission direction | Exception flag | Function code |
wij | wki | |||||||
---|---|---|---|---|---|---|---|---|
−0.3234 | 0.3269 | −0.3827 | −0.0136 | 0.0208 | 0.3921 | 0.0192 | −0.4522 | −0.0991 |
0.4135 | −0.2866 | −0.3405 | −0.4651 | −0.4179 | 0.0088 | −0.1617 | −0.4256 | −0.3543 |
0.2692 | 0.2864 | −0.4887 | 0.1367 | −0.3415 | 0.1173 | 0.1547 | 0.4085 | 0.3075 |
−0.1759 | 0.1077 | −0.1479 | 0.2126 | |||||
0.3873 | −0.0634 | 0.3556 | 0.1271 |
Control Method | Target EC (mS.cm−1) | Steady State EC (mS.cm−1) | EC Volatility (mS.cm−1) | Steady State Time (s) | Overshoot (%) |
---|---|---|---|---|---|
PSO-BPNN-PID | 1 | 0.9904–1.0003 | 0.0126 | 40 | 0.3 |
1.5 | 1.4990–1.5001 | 0.0011 | 45 | 0.06 | |
2 | 1.9997–2.0027 | 0.0003 | 43 | 0.14 | |
2.5 | 2.4901–2.5020 | 0.119 | 60 | 0.08 |
Frequency | Startup Time/s | Time for Each Issued Command/s | Data Reporting Time/s | Data Receiving Interval/s | Delay/s |
---|---|---|---|---|---|
1 | 3.87 | 1.123 | 12.156 | 15.967 | 3.81 |
2 | 3.58 | 1.124 | 13.982 | 15.982 | 1.50 |
3 | 3.78 | 1.124 | 12.699 | 16.699 | 3.76 |
4 | 3.56 | 1.124 | 12.835 | 14.835 | 1.62 |
5 | 3.71 | 1.124 | 12.363 | 15.363 | 3.02 |
6 | 3.87 | 1.123 | 12.872 | 15.872 | 2.95 |
7 | 3.58 | 1.123 | 12.635 | 15.635 | 3.05 |
8 | 3.78 | 1.122 | 11.985 | 14.985 | 2.47 |
9 | 3.56 | 1.124 | 12.213 | 16.213 | 4.28 |
10 | 3.71 | 1.124 | 11.987 | 15.987 | 3.38 |
Average value | 3.7 | 1.1235 | 12.5727 | 15.7538 | 2.984 |
Frequency | Startup Time/s | Time for Each Issued Command/s | Data Reporting Time/s | Data Receiving Interval/s | Delay/s |
---|---|---|---|---|---|
1 | 3.87 | 1.123 | 12.156 | 20.544 | 8.39 |
2 | 3.58 | 1.124 | 13.982 | 22.563 | 8.58 |
3 | 3.78 | 1.124 | 12.699 | 21.512 | 8.81 |
4 | 3.56 | 1.124 | 12.835 | 20.367 | 7.53 |
5 | 3.71 | 1.124 | 12.363 | 23.762 | 11.40 |
6 | 3.87 | 1.123 | 12.872 | 22.634 | 9.76 |
7 | 3.58 | 1.123 | 12.635 | 20.318 | 7.68 |
8 | 3.78 | 1.122 | 11.985 | 21.024 | 9.04 |
9 | 3.56 | 1.124 | 12.213 | 21.356 | 9.14 |
10 | 3.71 | 1.124 | 11.987 | 20.946 | 8.96 |
Average value | 3.7 | 1.1235 | 12.5727 | 21.5026 | 8.929 |
Fertilizer Intake | EC Value | ||||
---|---|---|---|---|---|
Fertilizer Channel | Measured data of Fertilizer Intake(L/h) | Test Number | Target Value (mS/cm) | Measured Value (mS/cm) | Error |
1 | 700.00 | 1 | 0.5 | 0.43 | −0.07 |
2 | 660.00 | 2 | 1 | 0.92 | −0.08 |
3 | 675.00 | 3 | 1.5 | 1.65 | +0.15 |
4 | 738.00 | 4 | 2 | 1.82 | −0.18 |
average value | 693.25 | 5 | 2.5 | 2.57 | +0.07 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Wang, Y.; Liu, J.; Li, R.; Suo, X.; Lu, E. Application of PSO-BPNN-PID Controller in Nutrient Solution EC Precise Control System: Applied Research. Sensors 2022, 22, 5515. https://doi.org/10.3390/s22155515
Wang Y, Liu J, Li R, Suo X, Lu E. Application of PSO-BPNN-PID Controller in Nutrient Solution EC Precise Control System: Applied Research. Sensors. 2022; 22(15):5515. https://doi.org/10.3390/s22155515
Chicago/Turabian StyleWang, Yongtao, Jian Liu, Rong Li, Xinyu Suo, and Enhui Lu. 2022. "Application of PSO-BPNN-PID Controller in Nutrient Solution EC Precise Control System: Applied Research" Sensors 22, no. 15: 5515. https://doi.org/10.3390/s22155515
APA StyleWang, Y., Liu, J., Li, R., Suo, X., & Lu, E. (2022). Application of PSO-BPNN-PID Controller in Nutrient Solution EC Precise Control System: Applied Research. Sensors, 22(15), 5515. https://doi.org/10.3390/s22155515