LQR Control and Optimization for Trajectory Tracking of Biomimetic Robotic Fish Based on Unreal Engine
Abstract
:1. Introduction
- Firstly, a visual simulation platform for underwater robots that simulates the real ocean environment is established. At present, the simulation environment developed based on the Unreal Engine is mostly employed to simulate the sky and land. This paper builds an Unreal Engine-based simulation scene of the real ocean environment and offers a dynamic and visualized underwater robot simulation platform.
- Secondly, a discrete linear quadratic regulator (DLQR) controller is designed for the biomimetic robotic fish. As the target trajectory in the simulation experiment is composed of discrete points, the LQR is discretized. Using the LQR controller, the simulation and comparison experiments that involve tracking the trajectory of the biomimetic robotic fish are carried out in three states: straight line, no-angle mutation curve, and angle mutation curve.
- Thirdly, the DLQR controller is further optimized using the PSO and DTW methods. When selecting the weighted Q and R matrices of the DLQR controller, in order to reduce the workload of testing and the influence of human factors and the local optimum, a trajectory tracking control strategy based on particle swarm optimization (PSO)-DLQR is proposed. For the time series misalignment problem of the discrete system tracking trajectory, a dynamic time warping algorithm is introduced as the performance index of PSO, which improves the convergence of the algorithm.
2. Mathematical Model of a Biomimetic Robotic Fish
2.1. Dynamic Modeling of Biomimetic Robotic Fish
2.2. Path Tracking Error Model
3. Design of DLQR Controller
4. PSO-Based Optimization of DLQR Controller
- Step 1: Particle population initialization: we initialize the number of populations as N = 10, the feasible solution dimension as D = 6, and the maximum number of iterations as 100. Moreover, the Q matrix parameters are restricted to , the R matrix parameters are limited to , the inertia weight is w = 0.7298, the cognitive learning factor is , and the social learning factor is .
- Step 2: The particle population individual , which is, in turn, assigned to Q and R matrices, is brought into the Riccati algebraic differential equation to calculate the optimal state feedback matrix K. The trajectory tracking program of the biomimetic machine fish is run to correctly calculate and record the coordinate data points of the actual motion trajectory. The reference and actual trajectory are brought into Equation (11) to calculate and evaluate the fitness function values iteratively, and the optimal historical position pbest and the optimal global position gbest of the particle population are obtained.
- Step 3: If the terminal condition is satisfied, we output the global optimal Q and R matrix parameters and end the program. Otherwise, we continue the execution.
- Step 4: We update the velocity and position of the particle and turn to Step 2 to continue the execution. According to the optimal historical position and the optimal global position of the particle, the velocity and position are updated using Equations (13) and (14).
5. Establishment of UE-Based Simulation Platform
- Step 1: Build an ambient light source. Add “Directional Light”, “Sky Light”, and “Visual Effects” from “Light Sources” to the “Sky Atmosphere”, “Volume Clouds”, and “Exponential Height Fog” in the viewport area. In order to simulate effects such as ambient light effect and refraction and reflection of the water surface, materials and writing scripts should be complemented.
- Step 2: Build the undersea landscape. In the “Landscape Mode”, draw the undersea landscape, add surface materials and undersea obstacles, and add some underwater elements to enrich the scene, such as seaweed, rocks, shipwrecks, etc.
- Step 3: Add the ocean water body. Add the “Water” plug-in in “Selection Mode”, and adjust the land and seafloor shape, curve, etc.
- Step 4: Simulate ocean waves. According to the Gerstner Wave formula, the offset value and normal value are calculated to simulate the effect of sharp crests of water waves. The Gerstner Wave calculation formula can be expressed as
- Step 5: Add the biomimetic robotic fish model and associate the model with AirSim. The control script is written in Python to run and call the control interface of the AirSim platform for real-time dynamic control simulation implementation in the ocean scene edited using Unreal Engine.
6. Results and Discussion
6.1. Tracking a Straight Line
6.2. Tracking a Circular Curved Trajectory
6.3. Tracking a Four-Leaf Clover Trajectory
6.4. Discussion
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Conflicts of Interest
References
- Sang, F.; Wu, H.; Liu, Z.; Fang, S. Digital twin platform design for Zhejiang rural cultural tourism based on Unreal Engine. In Proceedings of the 2022 International Conference on Culture-Oriented Science and Technology (CoST), Lanzhou, China, 18–21 August 2022; pp. 274–278. [Google Scholar]
- Li, Y.; Zhang, Q.; Xu, H.; Lim, E.; Sun, J. Virtual monitoring system for a robotic manufacturing station in intelligent manufacturing based on Unity 3D and ROS. Mater. Today Proc. 2020, 70, 24–30. [Google Scholar] [CrossRef]
- Yang, C.; Lee, T.; Huang, C.; Hsu, K. Unity 3D production and environmental perception vehicle simulation platform. In Proceedings of the 2016 International Conference on Advanced Materials for Science and Engineering (ICAMSE), Tainan, Taiwan, 12–13 November 2016; pp. 452–455. [Google Scholar]
- Ma, C.; Zhou, Y.; Li, Z. A new simulation environment based on Airsim, ROS, and PX4 for quadcopter aircrafts. In Proceedings of the 2020 6th International Conference on Control, Automation and Robotics (ICCAR), Singapore, 20–23 April 2020; pp. 486–490. [Google Scholar]
- Huang, H.; Tang, Q.; Li, J.; Zhang, W.; Bao, X.; Zhu, H.; Wang, G. A review on underwater autonomous environmental perception and target grasp, the challenge of robotic organism capture. Ocean Eng. 2020, 195, 106644. [Google Scholar] [CrossRef]
- Arena, P.; Bucolo, M.; Buscarino, A.; Fortuna, L.; Frasca, M. Reviewing bioinspired technologies for future trends: A complex systems point of view. Front. Phys. 2021, 9, 750090. [Google Scholar] [CrossRef]
- Wang, M.; Dong, H.; Li, X.; Zhang, Y.; Yu, J. Control and optimization of a biomimetic robotic fish through a combination of CPG model and PSO. Neurocomputing 2019, 337, 144–152. [Google Scholar] [CrossRef]
- Yan, Z.; Yang, H.; Zhang, W.; Gong, Q.; Lin, F.; Zhang, Y. Biomimetic fish trajectory tracking based on a CPG and model predictive control. J. Intell. Robot. Syst. 2022, 105, 29. [Google Scholar] [CrossRef]
- González-García, J.; Narcizo-Nuci, N.A.; Valdovinos, L.G.G.; Jiménez, T.S.; Espinosa, A.G.; Urquizo, E.C.; Cabello, J.A.E. Model-free high order sliding mode control with finite-time tracking for unmanned underwater vehicles. Appl. Sci. 2021, 11, 1836. [Google Scholar] [CrossRef]
- Liu, X.; Zhang, M.; Chen, Z. Trajectory tracking control based on a virtual closed-loop system for autonomous underwater vehicles. Int. J. Control 2020, 93, 2789–2803. [Google Scholar] [CrossRef]
- Liu, S.; Liu, Y.; Wang, N. Nonlinear disturbance observer-based backstepping finite-time sliding mode tracking control of underwater vehicles with system uncertainties and external disturbances. Nonlinear Dyn. 2017, 88, 465–476. [Google Scholar] [CrossRef]
- Zhang, J.; Xiang, X.; Zhang, Q.; Li, W. Neural network-based adaptive trajectory tracking control of underactuated AUVs with unknown asymmetrical actuator saturation and unknown dynamics. Ocean Eng. 2020, 218, 108193. [Google Scholar] [CrossRef]
- Huang, B.; Zhou, B.; Zhang, S.; Zhu, C. Adaptive prescribed performance tracking control for underactuated autonomous underwater vehicles with input quantization. Ocean Eng. 2021, 221, 108549. [Google Scholar] [CrossRef]
- Yan, Z.; Yang, H.; Zhang, W.; Lin, F.; Gong, Q.; Zhang, Y. Biomimetic fish tail design and trajectory tracking control. Ocean Eng. 2022, 257, 111659. [Google Scholar] [CrossRef]
- Kong, S.; Sun, J.; Qiu, C.; Wu, Z.; Yu, J. Extended state observer-based controller with model predictive governor for 3-D trajectory tracking of underactuated underwater vehicles. IEEE Trans. Ind. Inform. 2021, 17, 6114–6124. [Google Scholar] [CrossRef]
- Heshmati-Alamdari, S.; Nikou, A.; Dimarogonas, D.V. Robust trajectory tracking control for underactuated autonomous underwater vehicles in uncertain environments. IEEE Trans. Autom. Sci. Eng. 2021, 18, 1288–1301. [Google Scholar] [CrossRef]
- Nagarkar, M.P.; Bhalerao, Y.J.; Patil, G.J.V.; Patil, R.N.Z. Multi-objective optimization of nonlinear quarter car suspension system—PID and LQR control. Procedia Manuf. 2018, 20, 420–427. [Google Scholar] [CrossRef]
- Tahir, Z.; Jamil, M.; Liaqat, S.A.; Mubarak, L.; Tahir, W.; Gilani, S.O. Design and development of optimal control system for quad copter UAV. Indian J. Sci. Technol. 2016, 9, 10-17485. [Google Scholar] [CrossRef] [Green Version]
- Elkhatem, A.S.; Engin, S.N. Robust LQR and LQR-PI control strategies based on adaptive weighting matrix selection for a UAV position and attitude tracking control. Alex. Eng. J. 2022, 61, 6275–6292. [Google Scholar] [CrossRef]
- Ghoreishi, A.; Nekoui, M.A.; Basiri, S.O. Optimal design of LQR weighting matrices based on intelligent optimization methods. Int. J. Intell. Inf. Process. 2011, 2, 63–74. [Google Scholar]
- Bucolo, M.; Buscarino, A.; Fortuna, L.; Gagliano, S. Generalizing the Letov formula for the discrete-time case. Int. J. Dyn. Control 2023, 11, 94–100. [Google Scholar] [CrossRef]
- Boukadida, W.; Benamor, A.; Messaoud, H. Multi-objective design of optimal sliding mode control for trajectory tracking of SCARA robot based on genetic algorithm. J. Dyn. Syst. Meas. Control Trans. ASME 2019, 141, 031015. [Google Scholar] [CrossRef]
- Deng, X.; Sun, X.; Liu, R.; Wei, W. Optimal analysis of the weighted matrices in LQR based on the differential evolution algorithm. In Proceedings of the 2017 29th Chinese Control and Decision Conference (CCDC), Chongqing, China, 28–30 May 2017; pp. 832–836. [Google Scholar]
- Gupta, J.; Datta, R.; Sharma, A.K.; Segev, A.; Bhattacharya, B. Evolutionary computation for optimal LQR weighting matrices for lower limb exoskeleton feedback control. In Proceedings of the 2019 IEEE International Conference on Computational Science and Engineering (CSE) and IEEE International Conference on Embedded and Ubiquitous Computing (EUC), New York, NY, USA, 1–3 August 2019; pp. 24–29. [Google Scholar]
- Kumar, E.V.; Raaja, G.S.; Jerome, J. Adaptive PSO for optimal LQR tracking control of 2 DoF laboratory helicopter. Appl. Soft Comput. 2016, 41, 77–90. [Google Scholar] [CrossRef]
- Zou, Q.; Du, X.; Liu, Y.; Chen, H.; Wang, Y.; Yu, J. Dynamic path planning and motion control of microrobotic swarms for mobile target tracking. IEEE Trans. Autom. Sci. Eng. 2022, 1–15. [Google Scholar] [CrossRef]
- Rudenko, A.; Palmieri, L.; Herman, M.; Kitani, K.M.; Gavrila, D.M.; Arras, K.O. Human motion trajectory prediction: A survey. Int. J. Robot. Res. 2020, 39, 895–935. [Google Scholar] [CrossRef]
- Koenig, N.; Howard, A. Design and use paradigms for gazebo, an open-source multi-robot simulator. In Proceedings of the 2004 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Sendai, Japan, 28 September–2 October 2004; Volume 3, pp. 2149–2154. [Google Scholar]
- Michel, O. Cyberbotics Ltd. Webots™: Professional mobile robot simulation. J. Adv. Robot. Syst. 2004, 1, 39–42. [Google Scholar] [CrossRef] [Green Version]
- Rohmer, E.; Singh, S.P.N.; Freese, M. V-REP: A versatile and scalable robot simulation framework. In Proceedings of the 2013 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Tokyo, Japan, 3–7 November 2013; pp. 1321–1326. [Google Scholar]
Tracking Methods | PSO_DLQR | PSO_MPC |
---|---|---|
DTW distance (m) | 6.027 | 15.054 |
Average DTW (m) | 0.007 | 0.019 |
Tracking Methods | PSO_DLQR | PSO_MPC |
---|---|---|
DTW distance (m) | 18.147 | 15.684 |
Average DTW (m) | 0.011 | 0.001 |
Tracking Methods | PSO_DLQR | PSO_MPC |
---|---|---|
DTW distance (m) | 65.009 | 49.129 |
Average DTW (m) | 0.041 | 0.031 |
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. |
© 2023 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, M.; Wang, K.; Zhao, Q.; Zheng, X.; Gao, H.; Yu, J. LQR Control and Optimization for Trajectory Tracking of Biomimetic Robotic Fish Based on Unreal Engine. Biomimetics 2023, 8, 236. https://doi.org/10.3390/biomimetics8020236
Wang M, Wang K, Zhao Q, Zheng X, Gao H, Yu J. LQR Control and Optimization for Trajectory Tracking of Biomimetic Robotic Fish Based on Unreal Engine. Biomimetics. 2023; 8(2):236. https://doi.org/10.3390/biomimetics8020236
Chicago/Turabian StyleWang, Ming, Kunlun Wang, Qianchuan Zhao, Xuehan Zheng, He Gao, and Junzhi Yu. 2023. "LQR Control and Optimization for Trajectory Tracking of Biomimetic Robotic Fish Based on Unreal Engine" Biomimetics 8, no. 2: 236. https://doi.org/10.3390/biomimetics8020236
APA StyleWang, M., Wang, K., Zhao, Q., Zheng, X., Gao, H., & Yu, J. (2023). LQR Control and Optimization for Trajectory Tracking of Biomimetic Robotic Fish Based on Unreal Engine. Biomimetics, 8(2), 236. https://doi.org/10.3390/biomimetics8020236