Abstract
The real-time simulation of multibody models on embedded systems is of particular interest for controllers and observers such as model predictive controllers and state observers, which rely on a dynamic model of the process and are customarily executed in electronic control units. This work first identifies the software techniques and tools required to easily write efficient code for multibody models to be simulated on ARM-based embedded systems. Automatic Programming and Source Code Translation are the two techniques that were chosen to generate source code for multibody models in different programming languages. Automatic Programming is used to generate procedural code in an intermediate representation from an object-oriented library and Source Code Translation is used to translate the intermediate representation automatically to an interpreted language or to a compiled language for efficiency purposes. An implementation of these techniques is proposed. It is based on a Python template engine and AST tree walkers for Source Code Generation and on a model-driven translator for the Source Code Translation. The code is translated from a metalanguage to any of the following four programming languages: Python-Numpy, Matlab, C++-Armadillo, C++-Eigen. Two examples of multibody models were simulated: a four-bar linkage with multiple loops and a 3D vehicle steering system. The code for these examples has been generated and executed on two ARM-based single-board computers. Using compiled languages, both models could be simulated faster than real-time despite the low resources and performance of these embedded systems. Finally, the real-time performance of both models was evaluated when executed in hard real-time on Xenomai for both embedded systems. This work shows through measurements that Automatic Programming and Source Code Translation are valuable techniques to develop real-time multibody models to be used in embedded observers and controllers.
Similar content being viewed by others
Abbreviations
- AP:
-
Automatic Programming
- AST:
-
Abstract Syntax Tree
- BBB:
-
BeagleBone Black
- CISC:
-
Complex Instruction Set Computing
- DSL:
-
Domain Specific Language
- ECU:
-
Electronic Control Unit
- HIL:
-
Hardware-In-the-Loop
- MB:
-
Multibody
- MMU:
-
Memory Management Unit
- OOP:
-
Object-Oriented Programming
- OS:
-
Operating System
- PC:
-
Personal Computer
- PP:
-
Procedural Programming
- RISC:
-
Reduced Instruction Set Computing
- RPI:
-
Raspberry Pi Model B
- RTOS:
-
Real-Time Operating System
- SBC:
-
Single Board Computer
- SCG:
-
Source Code Generation
- SCT:
-
Source Code Translation
- SLOC:
-
Source Lines Of Code
References
Altenberg, J.: Using the realtime preemption patch on ARM CPUs. In: Eleventh Real-Time Linux Workshop, Dresden, Germany (2009)
Barrett, S.F., Kridner, J.: Bad to the Bone: Crafting Electronic Systems with BeagleBone and BeagleBone Black. Synthesis Lectures on Digital Circuits and Systems. Morgan Claypool Publishers, San Rafael (2013)
Behnel, S., Bradshaw, R., Citro, C., Dalcin, L., Seljebotn, D.S., Smith, K.: Cython: The best of both worlds. Comput. Sci. Eng. 13(2), 31–39 (2011). http://doi.ieeecomputersociety.org/10.1109/MCSE.2010.118
Bélanger, J., Venne, P., Paquin, J.: The what, where and why of real-time simulation. Tech. rep., OPAL-RT (2010)
Brown, J.H., Martin, B.: How fast is fast enough? Choosing between Xenomai and Linux for real-time applications. In: Twelfth Real-Time Linux Workshop, Nairobi, Kenya, p. 16 (2010)
Cetinkunt, S., Si, N., Nelson, B., Haggag, S.: Embedded-model-based control. J. Control Sci. Eng. 2013(237897), 2 (2013). doi:10.1155/2013/237897
Chatzigeorgiou, A.: Performance and power evaluation of C++ object-oriented programming in embedded processors. Inf. Softw. Technol. 45(4), 195–201 (2003)
Chon, S., Valenzuela, A.: Getting started on TI ARM embedded processor development—the basics. Tech. rep. (2013)
Cuadrado, J., Dopico, D., Pérez, J.A., Pastorino, R.: Automotive observers based on multibody models and the extended Kalman filter. Multibody Syst. Dyn. 27(1), 3–19 (2011). doi:10.1007/s11044-011-9251-1
Eichberger, A.: Generating multibody real-time models for hardware-in-the-loop applications (2002)
Fijalkowski, B.: Model-based design with production code generation for SBW AWS conversion mechatronic control system development. In: Automotive Mechatronics: Operational and Practical Issues. Intelligent Systems, Control and Automation: Science and Engineering, vol. 52, pp. 153–160. Springer, Berlin (2011). doi:10.1007/978-94-007-1183-9_7
García de Jalón, J., Bayo, E.: Kinematic and Dynamic Simulation of Multibody Systems: The Real-Time challenge. Springer, New York (1994)
Garcia, C.E., Prett, D.M., Morari, M.: Model predictive control: Theory and practice—a survey. Automatica 25(3), 335–348 (1989). http://www.sciencedirect.com/science/article/pii/0005109889900022. doi:10.1016/0005-1098(89)90002-2
González, M., González, F., Dopico, D., Luaces, A.: On the effect of linear algebra implementations in real-time multibody system dynamics. Comput. Mech. 41(4), 607–615 (2008). doi:10.1007/s00466-007-0218-2
Halfacree, G., Upton, E.: Raspberry Pi User Guide, 1st edn. Wiley, New York (2012)
Hirschberg, W., Rill, G., Weinfurter, H.: Tire model TMeasy. Veh. Syst. Dyn. 45, 101–119 (2007)
Kecskemethy, A., Hiller, M.: An object-oriented approach for an effective formulation of multibody dynamics. Comput. Methods Appl. Mech. Eng. 115(3–4), 287–314 (1994). http://www.sciencedirect.com/science/article/pii/0045782594900647. doi:10.1016/0045-7825(94)90064-7
Kim, S.S., Jung, H.K., Shim, J.S., Kim, C.W.: Development of vehicle dynamics model for real-time electronic control unit evaluation system using kinematic and compliance test data. Int. J. Automot. Technol. 6(6), 599–605 (2005)
Kingman, H.: The History of Embedded Linux & Best Practices for Getting Started. Linux Foundation Training Publication, San Francisco (2013)
Langtangen, H.P.: A Primer on Scientific Programming with Python, vol. 6. Springer, Berlin/Heidelberg (2011). doi:10.1007/978-3-642-18366-9
Laplante, P.A., Ovaska, S.J.: Real-Time Systems Design and Analysis. Wiley, New York (2012)
Wehrmeister, M.A., de Freitas, E.P., Binotto, A.P.D., Pereira, C.E.: Combining aspects and object-orientation in model-driven engineering for distributed industrial mechatronics systems. Mechatronics 24(7), 844–865 (2014). http://www.sciencedirect.com/science/article/pii/S0957415813002420, 10.1016/j.mechatronics.2013.12.008
McKenney, P.: ‘Real time’ vs. ‘Real fast’: how to choose? In: Proceedings of the Ottawa Linux Symposium (2008)
Parr, T.: Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages, 1st edn. Pragmatic Bookshelf, Frisco (2010)
Pastorino, R., Richiedei, D., Cuadrado, J., Trevisani, A.: State estimation using multibody models and non-linear Kalman filters. Int. J. Non-Linear Mech. 53, 83–90 (2013). doi:10.1016/j.ijnonlinmec.2013.01.016
Rulka, W., Pankiewicz, E.: MBS approach to generate equations of motions for HiL-simulations in vehicle system dynamics. Multibody Syst. Dyn. 14(3–4), 367–386 (2005)
Sanderson, C.: Armadillo: An open source C++ linear algebra library for fast prototyping and computationally intensive experiments. Tech. rep., NICTA (2010)
Simon, D.: Optimal State Estimation: Kalman, \(\mathrm{H}_{\infty}\), and Nonlinear Approaches, 1st edn. Wiley-Interscience, New York (2006)
The IFToMM benchmark website (2014). http://iftomm-multibody.org/benchmark/, online; accessed March 2014
The MathWorks website (2014). http://www.mathworks.com, online; accessed March 2014
Vun, N., Hor, H.F., Chao, J.W.: Real-time enhancements for embedded Linux. In: 14th IEEE International Conference on Parallel and Distributed Systems, pp. 737–740 (2008)
Whalen, M., Heimdahl, M.: An approach to automatic code generation for safety-critical systems. In: 14th IEEE International Conference on Automated Software Engineering, pp. 315–318 (1999). doi:10.1109/ASE.1999.802346
Whalen, M., Heimdahl, M.: On the requirements of high-integrity code generation. In: 4th IEEE International Symposium on High-Assurance Systems Engineering, Proceedings, pp. 217–224 (1999). doi:10.1109/HASE.1999.809497
Acknowledgements
The authors gratefully acknowledge the support of the European Commission through the Marie Curie IAPP project “Interactive” (Innovative Concept Modelling Techniques for Multi-Attribute Optimization of Active Vehicles), with contract number 285808 (http://www.fp7interactive.eu), the IWT Flanders and ITEA2 through the MODRIO project, the Research Fund KU Leuven. This work benefits also from the Belgian Programme on Interuniversity Attraction Poles, initiated by the Belgian Federal Science Policy Office (DYSCO). The research of Roland Pastorino is also funded by grant GCP2013/056 of the Galician Government. The research of Frank Naets is funded by a postdoctoral fellowship of the Fund for Scientific Research, Flanders (F.W.O).
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflicts of interest
The authors declare that they have no conflicts of interest.
Rights and permissions
About this article
Cite this article
Pastorino, R., Cosco, F., Naets, F. et al. Hard real-time multibody simulations using ARM-based embedded systems. Multibody Syst Dyn 37, 127–143 (2016). https://doi.org/10.1007/s11044-016-9504-0
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11044-016-9504-0