Skip to main content
Log in

Hard real-time multibody simulations using ARM-based embedded systems

  • Published:
Multibody System Dynamics Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10

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

  1. Altenberg, J.: Using the realtime preemption patch on ARM CPUs. In: Eleventh Real-Time Linux Workshop, Dresden, Germany (2009)

    Google Scholar 

  2. 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)

    Google Scholar 

  3. 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

    Article  Google Scholar 

  4. Bélanger, J., Venne, P., Paquin, J.: The what, where and why of real-time simulation. Tech. rep., OPAL-RT (2010)

  5. 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)

    Google Scholar 

  6. 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

    MATH  Google Scholar 

  7. Chatzigeorgiou, A.: Performance and power evaluation of C++ object-oriented programming in embedded processors. Inf. Softw. Technol. 45(4), 195–201 (2003)

    Article  Google Scholar 

  8. Chon, S., Valenzuela, A.: Getting started on TI ARM embedded processor development—the basics. Tech. rep. (2013)

  9. 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

    Article  MathSciNet  MATH  Google Scholar 

  10. Eichberger, A.: Generating multibody real-time models for hardware-in-the-loop applications (2002)

  11. 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

    Chapter  Google Scholar 

  12. García de Jalón, J., Bayo, E.: Kinematic and Dynamic Simulation of Multibody Systems: The Real-Time challenge. Springer, New York (1994)

    Book  Google Scholar 

  13. 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

    Article  MATH  Google Scholar 

  14. 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

    Article  MATH  Google Scholar 

  15. Halfacree, G., Upton, E.: Raspberry Pi User Guide, 1st edn. Wiley, New York (2012)

    Google Scholar 

  16. Hirschberg, W., Rill, G., Weinfurter, H.: Tire model TMeasy. Veh. Syst. Dyn. 45, 101–119 (2007)

    Article  Google Scholar 

  17. 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

    Article  Google Scholar 

  18. 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)

    Google Scholar 

  19. Kingman, H.: The History of Embedded Linux & Best Practices for Getting Started. Linux Foundation Training Publication, San Francisco (2013)

    Google Scholar 

  20. Langtangen, H.P.: A Primer on Scientific Programming with Python, vol. 6. Springer, Berlin/Heidelberg (2011). doi:10.1007/978-3-642-18366-9

    MATH  Google Scholar 

  21. Laplante, P.A., Ovaska, S.J.: Real-Time Systems Design and Analysis. Wiley, New York (2012)

    Google Scholar 

  22. 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

    Article  Google Scholar 

  23. McKenney, P.: ‘Real time’ vs. ‘Real fast’: how to choose? In: Proceedings of the Ottawa Linux Symposium (2008)

    Google Scholar 

  24. Parr, T.: Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages, 1st edn. Pragmatic Bookshelf, Frisco (2010)

    Google Scholar 

  25. 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

    Article  Google Scholar 

  26. 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)

    Article  MATH  Google Scholar 

  27. Sanderson, C.: Armadillo: An open source C++ linear algebra library for fast prototyping and computationally intensive experiments. Tech. rep., NICTA (2010)

  28. Simon, D.: Optimal State Estimation: Kalman, \(\mathrm{H}_{\infty}\), and Nonlinear Approaches, 1st edn. Wiley-Interscience, New York (2006)

    Book  Google Scholar 

  29. The IFToMM benchmark website (2014). http://iftomm-multibody.org/benchmark/, online; accessed March 2014

  30. The MathWorks website (2014). http://www.mathworks.com, online; accessed March 2014

  31. 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)

    Google Scholar 

  32. 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

    Chapter  Google Scholar 

  33. 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

    Chapter  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Roland Pastorino.

Ethics declarations

Conflicts of interest

The authors declare that they have no conflicts of interest.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11044-016-9504-0

Keywords

Navigation