Electronic Control Unit and Digital Twin Based on Raspberry Pi 4 for Testing the Remote Nonlinear Trajectory Tracking of a P3-DX Robot
Abstract
1. Introduction
1.1. Related Works
1.2. Research Gaps and Contributions
2. Resources and Methodology
2.1. Hardware and Software Resources
2.2. Methodology for Obtaining the Robot Digital Twin
- Comprehension of system dynamics: Understand the principle of operation of the process to be modelled.
- Electronic interfacing: Setup the electronic interface that allows the excitation and recording of the real process response.
- Excitation design and data acquisition: Design the excitation signals (input vector) and perform the experiments to record the corresponding output vector.
- System response analysis: Analyze the response of the plant to identify region of nonlinear (saturation, dead zone) behaviour and linear characteristics (dynamic and static).
- Parametric modeling: Propose a parametric model for the linear zone and identify the corresponding parameters using the associated tools (e.g., Matlab Identification Toolbox).
- Model validation: Validate the proposed model using a different input test vector from the one used for identification.
- Model refinement or code generation: If the validation results are unsatisfactory, revisit and revise the proposed model (return to the modeling step). If the results are acceptable, generate code for implementation on the target digital platform (e.g., using Simulink Coder).
- DT validation: Evaluate the DT implemented on the electronic platform by comparing the real and virtual process (DT) with new test inputs applied via the same electronic interface.
2.2.1. Robot Modeling and Identification
2.2.2. Nonlinear Trajectory Tracking: Lyapunov-Based Controller
- (a)
- Consider the kinematics model of a unicycle mobile (Equation (1))
- (b)
- Define the pose error (Cartesian space): , respect to the desired values.
- (c)
- Obtain the time derivative of the pose error .
- (d)
- Propose the Lyapunov Function , in this case:
- (e)
- Evaluate the time derivative of the Lyapunov Function , where the control vector (, ) and the desired velocities () according to the trajectory reference are involved,
- (f)
- Propose a control law that guarantees stability of the control system, that means . In this case, the control law is:
- (g)
- Adjust the gains involved in the control law according to the desired trajectory tracking (see Appendix A.2).
3. Experimental Results
4. Discussion
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Abbreviations
DT | Digital Twin |
HIL | Hardware-in-the-Loop |
RBP | Raspberry Pi |
ECU | Electronic Control Unit |
LBC | Lyapunov-based Controller |
FPGA | Field Programmable Gate Array |
DSP | Digital Signal Processor |
CPU | Central Process Unit |
GPU | Graphic Processing Unit |
DC | Direct Current motor |
UDP | User Datagram Protocol |
Appendix A
Appendix A.1. Identification Parameters
Parameter | Value |
---|---|
Ts | 25 ms |
Delay q | 3 samples |
Input vector size | 2 |
Output vector size | 2 |
State vector size | 8 |
Linear velocity saturation | −0.7701 m/s, 0.7487 m/s |
Angular velocity saturation | −1.7700 rad/s, 1.7550 rad/s |
Linear velocity dead-zone | −0.0151 m/s, 0.0149 m/s |
Angular velocity dead-zone | −0.0300 rad/s, 0.0750 rad/s |
0.3984 | |
0.2287 | |
0.6014 | |
0.7706 | |
−57 × 10−6 | |
−36 × 10−6 |
Appendix A.2. Control Gains of the Global Solution
Parameter | Value |
---|---|
Servo: Gain regulator Kr | |
Servo: Integral Gain Ki | |
LBC gains | K1 = 1.21, K2 = 1.30, K3 = 1.53 |
References
- Tumasov, A.V.; Vashurin, A.S.; Trusov, Y.; Evgeny, T. The Application of Hardware-in-the-Loop (HIL) Simulation for Evaluation of Active Safety of Vehicles Equipped with Electronic Stability Control Systems. Procedia Comput. Sci. 2019, 150, 309–315. [Google Scholar] [CrossRef]
- Lin, J.S.; Wang, Y.C.; Lin, C.L.; Ma, L.S. Adaptive Cruise Control System Combined with AIoT. In Proceedings of the International Conference on Consumer Electronics—Taiwan (ICCE-Taiwan), Taichung, Taiwan, 9–11 July 2024. [Google Scholar] [CrossRef]
- Suh, M.W.; Chung, J.H.; Seok, C.S.; Kim, Y.J. Hardware-in-the-loop simulation for ABS based on PC. Int. J. Veh. Des. 2004, 24, 157–170. [Google Scholar] [CrossRef]
- Temeltas, H.; Gokasan, M.; Bogosyan, S. Hardware in the Loop Robot Simulators for On-site and Remote Education in Robotics. Int. J. Eng. Educ. 2006, 22, 815–828. [Google Scholar]
- Grega, W. Hardware-in-the-loop simulation and its application in control education. In Proceedings of the FIE’99 Frontiers in Education. 29th Annual Frontiers in Education Conference. Designing the Future of Science and Engineering Education, San Juan, PR, USA, 10–13 November 1999; ISBN 0-7803-5643-8. [Google Scholar]
- Ahmed, A.H.; Alsharif, A.O.; Aburas, O.E. Low Cost Hardware-in-the-Loop Control Systems Using Microcontrollers. J. Alasmarya Univ. Basic Appl. Sci. 2021, 6, 587–606. [Google Scholar] [CrossRef]
- Zheng, J.L.; Zeng, Y.B.; Xu, H.; Liu, W.C.; Mou, D.; Zhao, Z.M. An Event-Based Synchronization Framework for Controller Hardware-in-the-loop Simulation of Electric Railway Power Electronics Systems. arXiv 2023, arXiv:2311.07036. [Google Scholar]
- Sanz, M.; Santamargarita, D.; Huerta, F.; Ochoa, D.; Lázaro, A.; Barrado, A. Reduced-Order Model of Power Converters to Optimize Power Hardware-In-the-Loop Technology in Dc-Distributed Systems. In Proceedings of the 2020 IEEE Applied Power Electronics Conference and Exposition (APEC), New Orleans, LA, USA, 15–19 March 2020. [Google Scholar] [CrossRef]
- Flack, C.; Ucer, E.; Smith, C.P.; Kisacikoglu, M. Controller Hardware-in-the-Loop Testing of Decentralized EV-Grid Integration. In Proceedings of the 2022 IEEE Power & Energy Society General Meeting (PESGM), Denver, CO, USA, 17–21 July 2022. [Google Scholar] [CrossRef]
- Wagg, D.; Worden, K.; Barthorpe, R.; Gardner, P. Digital Twins: State-of-The-Art Future Directions for Modelling and Simulation in Engineering Dynamics Applications. ASCE-ASME J. Risk Uncertain. Eng. Syst. Part B Mech. Eng. 2020, 6, 030901. [Google Scholar] [CrossRef]
- Segovia, M.; Garcia-Alfaro, J. Design, Modeling and Implementation of Digital Twins. Sensors 2022, 22, 5396. [Google Scholar] [CrossRef]
- Magalhães-Lima, L.G.; Soares-Ferreira, J.M.; Nascimento-Coelho, D.; Regis De Melo, R.; Souza Da Silva, W. Development and Validation of a Digital Twin for a 5-Revolute Joint Robotic Manipulator. In Proceedings of the 2025 Brazilian Conference on Robotics (CROS), Belo Horizonte, Brazil, 28–30 April 2025. [Google Scholar]
- Birk, W.; Hostettler, R.; Razi, M.; Atta, K.; Tammia, R. Automatic generation and updating of process industrial digital twins for estimation and control—A review. Front. Control. Eng. 2022, 3, 954858. [Google Scholar] [CrossRef]
- Jørgensen, B.N.; Howard, D.A. Digital Twins: Benefits, Applications and Development Process. In Proceedings of the EPIA Conference on Artificial Intelligence, Faial Island, Portugal, 5–8 September 2023. [Google Scholar] [CrossRef]
- Thelen, A.; Zhang, X.; Fink, O.; Lu, Y.; Ghosh, S.; Youn, B.D.; Todd, M.D.; Mahadevan, S.; Hu, C.; Hu, Z. A comprehensive review of digital twin—Part 1: Modeling and twinning enabling technologies. Struct. Multidiscip. Optim. 2022, 65, 354. [Google Scholar] [CrossRef]
- Thelen, A.; Zhang, X.; Fink, O.; Lu, Y.; Ghosh, S.; Youn, B.D.; Todd, M.D.; Mahadevan, S.; Hu, C.; Hu, Z. A comprehensive review of digital twin—Part 2: Roles of uncertainty quantification and optimization, a battery digital twin, and perspectives. Struct. Multidiscip. Optim. 2023, 66, 1. [Google Scholar] [CrossRef]
- Li, R.; Shang, X.; Wang, Y.; Liu, C.; Song, L.; Zhang, Y.; Gu, L.; Zhang, X. Research on Parameter Compensation Method and Control Strategy of Mobile Robot Dynamics Model Based on Digital Twin. Sensors 2024, 24, 8101. [Google Scholar] [CrossRef]
- Zhao, L.; Nie, Z.; Xia, Y.; Li, H. Virtual–Physical Tracking Control for a Car-Like Mobile Robot Based on Digital Twin Technology. IEEE Trans. Ind. Electron. 2024, 71, 16348–16356. [Google Scholar] [CrossRef]
- Stączek, P.; Pizoń, J.; Danilczuk, W.; Gola, A. A digital twin approach for the improvement of an autonomous mobile robots (AMR’s) operating environment—A case study. Sensors 2021, 21, 7830. [Google Scholar] [CrossRef]
- Wang, Y.; Zhao, X. A digital twin dynamic migration method for industrial mobile robots. Robot. Comput.-Integr. Manuf. 2025, 92, 102864. [Google Scholar] [CrossRef]
- Mihalic, F.; Truntic, M.; Hren, A. Hardware-in-the-Loop Simulations: A Historical Overview of Engineering Challenges. Electronics 2022, 11, 2462. [Google Scholar] [CrossRef]
- Arif, S.; Khan, A.; Rehman, S. A Lightweight Received Signal Strength Indicator Estimation Model for Low-Power Internet of Things Devices in Constrained Indoor Networks. Appl. Sci. 2025, 15, 3535. [Google Scholar] [CrossRef]
- Bruno, S.; Trifan, I.D.; Vita, L.; Loprencipe, G. Development of Low-Cost Monitoring and Assessment System for Cycle Paths Based on Raspberry Pi Technology. Infrastructures 2025, 10, 50. [Google Scholar] [CrossRef]
- Bueno, G.; Sanchez-Vargas, L.; Diaz-Maroto, A.; Ruiz-Santaquiteria, J.; Blanco, M.; Salido, J.; Cristobal, G. Real-Time Edge Computing vs. GPU-Accelerated Pipelines for Low-Cost Microscopy Applications. Electronics 2025, 14, 930. [Google Scholar] [CrossRef]
- Nichols, K.M.; Roembke, R.A.; Adamczyk, P.G. Real-Time Motor Control Using a Raspberry Pi, ROS, and CANopen over EtherCAT, with Application to a Semi-Active Prosthetic Ankle. Actuators 2025, 14, 84. [Google Scholar] [CrossRef]
- Alvarez-Oviedo, A.; Mamani-Villanueva, J.F.; Echaiz-Espinoza, G.A.; Mauricio-Villanueva, J.M.; Ortiz-Salazar, A.; Llanos-Villarreal, E.R. Design of a System for Driver Drowsiness Detection and Seat Belt Monitoring Using Raspberry Pi 4 and Arduino Nano. Designs 2025, 9, 11. [Google Scholar] [CrossRef]
- Dimitrov, K.; Chivarov, N.; Chivarov, S.; Paunova-Krasteva, T.; Filipov, E.; Daskalova, A. Concept of a Cyber–Physical System for Control of a Self-Cleaning Aquaponic Unit. AgriEngineering 2024, 6, 3843–3874. [Google Scholar] [CrossRef]
- Fazylova, A.; Tultayev, B.; Iliev, T.; Stoyanov, I.; Kabasheva, M.; Kosunalp, S. Experimental Study of an Industrial Data Transmission Network in the Automatic Control System of a Wind Turbine. Machines 2024, 12, 746. [Google Scholar] [CrossRef]
- Turlykozhayeva, D.; Temesheva, S.; Ussipov, N.; Bolysbay, A.; Akhmetali, A.; Akhtanov, S.; Tang, X. Experimental Performance Comparison of Proactive Routing Protocols in Wireless Mesh Network Using Raspberry Pi 4. Telecom 2024, 5, 1008–1020. [Google Scholar] [CrossRef]
- Drăgoi, M.V.; Nisipeanu, I.; Frimu, A.; Tălîngă, A.M.; Hadăr, A.; Dobrescu, T.G.; Suciu, C.P.; Manea, A.R. Real-Time Home Automation System Using BCI Technology. Biomimetics 2024, 9, 594. [Google Scholar] [CrossRef]
- Rsapberry Pi 4. Available online: https://www.raspberrypi.com/products/raspberry-pi-4-model-b/ (accessed on 20 March 2025).
- Walter, J.; Fakih, M.; Grüttner, K. Hardware-Based Real-Time Simulation on the Raspberry Pi. In Proceedings of the 2nd Workshop on High-Performance and Real-Time Embedded Systems (HiRES 2014), Vienna, Australia, 20–22 January 2014. [Google Scholar]
- Landolfi, E.; Salvi, A.; Troiano, A.; Natale, C. Hardware-in-the-loop validation of an adaptive model predictive control on a connected and automated vehicle. Int. J. Adapt. Control. Signal Process. 2023, 37, 1459–1491. [Google Scholar] [CrossRef]
- Amoozar, M.H.; Zhang, Y.M. Trajectory tracking of Wheeled Mobile Robots: A kinematical approach. In Proceedings of the 2012 IEEE/ASME 8th IEEE/ASME International Conference on Mechatronic and Embedded Systems and Applications, Suzhou, China, 8–10 July 2012. [Google Scholar] [CrossRef]
- Zambelli, M.; Karayiannidis, Y.; Dimarogonas, D.V. Posture regulation for unicycle-like robots with prescribed performance guarantees. IET Control. Theory Appl. 2015, 9, 192–202. [Google Scholar] [CrossRef]
- Alcala, E.; Puig, V.; Quevedo, J.; Escobet, T.; Comasolivas, R. Autonomous vehicle control using a kinematic Lyapunov-based technique with LQR-LMI tuning. Control. Eng. Pract. 2018, 73, 1–12. [Google Scholar] [CrossRef]
- Vazquez, M.; Ardito-Proulx, M.; Wadoo, S. Lyapunov Based Trajectory Tracking Dynamic Control for a QBOT-2. In Proceedings of the 2020 IEEE Integrated STEM Education Conference (ISEC), Princeton, NJ, USA, 1 August 2020. [Google Scholar] [CrossRef]
- Liu, M.; Fang, S.; Dong, H.; Xu, C. Review of digital twin about concepts, technologies, and industrial applications. J. Manuf. Syst. 2021, 58, 346–361. [Google Scholar] [CrossRef]
- Vered, Y.; Elliott, S.J. The use of digital twins to remotely update feedback controllers for the motion control of nonlinear dynamic systems. Mech. Syst. Signal Process. 2023, 185, 109770. [Google Scholar] [CrossRef]
- Saad, A.; Faddel, S.; Mohammed, O. IoT-based digital twin for energy cyber-physical systems: Design and implementation. Energies 2020, 13, 4762. [Google Scholar] [CrossRef]
- P3-DX Robot. Available online: https://www.generationrobots.com/media/Pioneer3DX-P3DX-RevA.pdf?srsltid=AfmBOopigKPz8ste_THqrR6Gy0mbhTVBrQ8hLlfLf8HZTO2f8OTK4PxR (accessed on 20 March 2025).
- Simulink Coder. Available online: https://ch.mathworks.com/products/simulink-coder.html (accessed on 20 March 2025).
- Cristina Losada-Gutiérrez, C.; Espinosa, F.; Santos-Pérez, C.; Marrón-Romera, M.; Rodriguez-Ascariz, J.M. Remote control of a robotic unit: A case study for control engineering formation. IEEE Trans. Educ. 2020, 63, 246–256. [Google Scholar] [CrossRef]
Ref. | Focus Area | Research Objective | Sorting |
---|---|---|---|
[1,2,3,29] | Automotive | HIL for ESC systems | No |
[4,5] | Education | Robotic HIL | No |
[8,9] | Power Systems | HIL DC and Grid | No |
[13,14,15] | Control Modeling and Optimization | DT in control | No |
[30,31,32,33,34,35,36,37] | Robotics | Trajectory Tracking | No |
This research | Electronic Control | HIL, DT | Yes |
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. |
© 2025 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
Losada-Gutiérrez, C.; Espinosa, F.; Cruz, C.; Alvarado, B.P. Electronic Control Unit and Digital Twin Based on Raspberry Pi 4 for Testing the Remote Nonlinear Trajectory Tracking of a P3-DX Robot. Actuators 2025, 14, 376. https://doi.org/10.3390/act14080376
Losada-Gutiérrez C, Espinosa F, Cruz C, Alvarado BP. Electronic Control Unit and Digital Twin Based on Raspberry Pi 4 for Testing the Remote Nonlinear Trajectory Tracking of a P3-DX Robot. Actuators. 2025; 14(8):376. https://doi.org/10.3390/act14080376
Chicago/Turabian StyleLosada-Gutiérrez, Cristina, Felipe Espinosa, Carlos Cruz, and Biel P. Alvarado. 2025. "Electronic Control Unit and Digital Twin Based on Raspberry Pi 4 for Testing the Remote Nonlinear Trajectory Tracking of a P3-DX Robot" Actuators 14, no. 8: 376. https://doi.org/10.3390/act14080376
APA StyleLosada-Gutiérrez, C., Espinosa, F., Cruz, C., & Alvarado, B. P. (2025). Electronic Control Unit and Digital Twin Based on Raspberry Pi 4 for Testing the Remote Nonlinear Trajectory Tracking of a P3-DX Robot. Actuators, 14(8), 376. https://doi.org/10.3390/act14080376