Full text
Thunder Dynamics: an Application to Elastic Systems Giorgio Simonini1,2, Marco Baracca1, Yuri De Santis1, Paolo Rosa Brusin1, Simone Tolomei1, Paolo Salaris1 Abstract—Thunder Dynamics provides automated tools for generating dynamic models and parameter identification regressors through both high-level and low-level interfaces. The library enables users to create standalone C++ libraries with Python bindings and supports symbolic parameter manipulation for adaptive control implementation. We demonstrate potential applications to variable stiffness actuators characterized by nonlinear elastic couplings modeled as polynomials with odd exponents. The framework addresses the critical need for standardized tools in robotics research and development, offering both computational efficiency and extensibility for handling complex robotic systems, including elastic joint mechanisms. Index Terms—Software library, Elastic systems, Adaptive control I. INTRODUCTION Modern robotics applications increasingly demand sophisticated tools for analyzing and controlling complex mechanical systems. The need for libraries and computational frameworks that can efficiently compute robot information has become essential in contemporary robotics research and industrial applications. Traditional rigid-body dynamics libraries, while providing excellent computational efficiency for classical robotic systems, often present limitations in terms of extensibility and specialized applications [1]. Moreover, the computational complexity of deriving analytical expressions for robot dynamics increases exponentially with the number of degrees of freedom, making automated tools essential for practical implementation [2]. Furthermore, the derivation of regressor matrices for parameter identification, a crucial component in adaptive control and system identification, requires careful handling of symbolic mathematics and computational efficiency [3]. Recent advances in robotics have highlighted the importance of compliance and elasticity in robotic systems [4]. Elastic systems could offer significant advantages in terms of safety, energy efficiency, and dynamic performance. These systems enable robots to interact safely with humans and unknown This work was supported in part by the European Union’s Horizon 2020 Research and Innovation Programme, (DARKO) under Grant 101017274; in part by the European Union by the Next Generation EU, Ecosistema dell’Innovazione Tuscany Health Ecosystem (THE, PNRR, Spoke 9: Robotics and Automation for Health) under Project ECS00000017; and in part by the Italian Ministry of Education and Research (MIUR) in the Framework of the CrossLab and ForeLab Project (Departments of Excellence). 1Dipartimento di Ingegneria dell’Informazione e Centro di Ricerca “Enrico Piaggio”, Universit` a di Pisa, Largo Lucio Lazzarino 1, 56126 Pisa, Italy 2Italian Doctorate in Robotics and Intelligent Machines [email protected] environments while maintaining the ability to modulate their mechanical impedance according to task requirements [5]. The complexity of modeling and controlling elastic systems necessitates specialized computational tools that can handle nonlinear elastic characteristics, multiple actuation schemes, and dynamic parameter variations. In this extended abstract, we presents an extension of Thunder Dynamics tailored to model systems with elastic joint actuation. II. THUNDER DYNAMICS DESCRIPTION Thunder Dynamics is a software package based on C++ and CasADi for the implementation of adaptive control and advanced robotics applications on serial manipulators [6]. The framework is built from the ground up to be easily expandable and to generate fine-tuned C++ or Python libraries for any serial manipulator application. It supports two distinct use cases, providing flexibility for different user requirements and expertise levels. The dual-interface design enables both rapid prototyping and advanced customization. A. High-Level Use Case The high-level interface offers a command-line utility to create customized C++ libraries tailored to specific robotic platforms. This implementation is the easiest and fastest to use, thanks to the efficiency of compiled C++ code. The generated libraries provide access to all classical terms for serial manipulators: forward kinematics, Jacobians, dynamical matrices, and dynamic regressors. Additionally, Thunder Dynamics can create Python bindings of the generated C++ library, allowing versatility and efficiency simultaneously. Finally, all parameters describing the robot can be expressed either symbolically or numerically. This enables the construction of robot models while allowing users to choose which parameters should be treated as inputs, facilitating symbolic parameter manipulation essential for creating custom applications. B. Low-Level Use Case The Low-level interface allows experienced users to define custom functions not directly included in the standard Robot class. This feature represents a key differentiator from other robotics libraries, where available functions are typically fixed and cannot be expanded. The robot’s model in Thunder Dynamics is fully analytic, meaning all expressions are symbolic and can be accessed and modified to create new functionalities. To define a new function, users extract desired expressions from the model and construct new quantities. Once added, new 2025 I-RIM Conference October 17-19, Rome, Italy ISBN: 9788894580570 10.5281/zenodo.17629872 233
functions become part of the class’s internal functions and can be used directly in high-level applications. III. APPLICATION ON ELASTIC SYSTEMS Thunder Dynamics provides a foundation for implementing elastic joint systems and offers potential for applications to variable stiffness actuators with nonlinear characteristics. The complete dynamic model of the variable stiffness actuator system incorporates both the rigid body dynamics of the robot links and the nonlinear elastic coupling τe(ϕ)[7], without inertia coupling as in the Spong assumption [8], i.e., Ml0n 0nMm¨q ¨ θ+C˙q+G 0+−τe(ϕ) τe(ϕ)=0 τ,(1) where q, θ ∈Rnare link and motor coordinates, ϕ=θ−q is the elastic deformation, τ∈Rnis the torque applied to the motors, Ml, Mm∈Rn×nare the mass link matrix and the motor inertia, respectively, C∈Rn×nis the Coriolis matrix, and G∈Rnis the gravity term. Since the elastic coupling is an odd function, in Thunder Dynamics it is represented as a polynomial function with odd exponents in the deformation, i.e., τe(ϕ) = nk X i=1 kiϕ2i+1,(2) with nk∈Nthe order of the elastic coupling. This formulation would capture asymmetric and nonlinear characteristics while maintaining mathematical tractability. The choice of odd exponents in polynomial representation is motivated by practical considerations: many physical elastic systems exhibit asymmetric force-displacement characteristics, and odd polynomial terms ensure that elastic forces change sign with deformation direction, a fundamental requirement for stable elastic behavior. As an example, here is reported the characteristic of the qbmove Variable Stiffness Actuator (VSA) [9] τe(ϕ)=2βcosh(αp) sinh(αϕ),(3) where α= 6.7322,β= 0.0222 are fixed parameters, and p= 20π/180 is the stiffness preset. From Fig. 1, it is clear that the linear approximation is fine with small angles, but not enough when the deformation increases, justifying a more complex modeling. In this case, the torque error using the odd polynomial approximation at the limit (0.6rad) is 0.11N, which is small w.r.t. the maximum torque of the actuator (5N). The Thunder Dynamics framework together with the elastic extension is open source and available online1. IV. CONCLUSIONS This extended abstract has presented an extension to Thunder Dynamics for elastic joint systems. The framework’s dual-interface architecture, efficient algorithms, and extensible design make it a valuable tool for robotics researchers and practitioners working with complex mechanical systems. 1https://github.com/CentroEPiaggio/thunder dynamics 0.75 0.50 0.25 0.00 0.25 0.50 0.75 deformation [rad] 10 5 0 5 10 torque [Nm] VSA Odd polynomial Linear (a) Torque 0.75 0.50 0.25 0.00 0.25 0.50 0.75 deformation [rad] 0.0 2.5 5.0 7.5 10.0 absolute torque error [Nm] Odd polynomial VSA (b) Torque error Fig. 1. Comparison between VSA models. The strength of this tool lies in its comprehensive support for user-defined extensions and adaptive control applications. By providing automated tools for generating dynamic models, regressor matrices, and symbolic computation capabilities, Thunder Dynamics significantly reduces the complexity of implementing advanced control algorithms. In this extended abstract, we present an application to variable stiffness actuators with polynomial elastic couplings to illustrate the library’s utility in addressing emerging robotics challenges. The ability to handle complex symbolic expressions while maintaining computational efficiency makes the framework suitable for both research applications and practical implementations. Future developments will focus on expanding the library’s capabilities and demonstrating practical implementations of elastic system modeling within the Thunder Dynamics framework, contributing to the advancement of adaptive and compliant robotics technologies. REFERENCES [1] B. Siciliano and O. Khatib, Springer Handbook of Robotics. Berlin, Germany: Springer, 2009. [2] R. Featherstone, Rigid Body Dynamics Algorithms. New York, NY: Springer, 2008. [3] M. Gabiccini, A. Bracci, D. De Carli, M. Fredianelli, and A. Bicchi, “Explicit Lagrangian formulation of the dynamic regressors for serial manipulators”, in Proceedings of XIX AIMETA Congress, 2009, pp. 14– 17. [4] B. Vanderborght, A. Albu-Sch¨ affer, A. Bicchi, E. Burdet, D. G. Caldwell, R. Carloni, M. Catalano, O. Eiberger, W. Friedl, G. Ganesh, M. Garabini, M. Grebenstein, G. Grioli, S. Haddadin, H. Hoppner, A. Jafari, M. Laffranchi, D. Lefeber, F. Petit, S. Stramigioli, N. Tsagarakis, M. Van Damme, R. Van Ham, L. C. Visser, and S. Wolf, “Variable impedance actuators: A review”, in Robotics and Autonomous Systems, vol. 61, no. 12, pp. 1601–1614, 2013. [5] A. Bicchi and G. Tonietti, “Fast and ’soft-arm’ tactics”, in IEEE Robotics & Automation Magazine, vol. 11, no. 2, pp. 22–33, 2004. [6] M. Baracca, G. Simonini, S. Tolomei, Y. De Santis, P. R. Brusin, S. Angeli, M. Gabiccini, A. Bicchi, and P. Salaris, “Thunder Dynamics: a C++ Tool for Adaptive Control of Serial Manipulators”, in Robotics, vol. 14, no. 9, p. 126, 2025. [7] A. De Luca, B. Siciliano and K. P. Valavanis, “Control of flexible-joint robots”, in Control Problems in Robotics and Automation, Eds. Berlin, Germany: Springer, 1998, pp. 49–67. [8] M. W. Spong, “Modeling and control of elastic joint robots,” in Journal of Dynamic Systems, Measurement, and Control, vol. 109, no. 4, pp. 310–319, 1987. [9] R. Mengacci, M. Garabini, G. Grioli, M. G. Catalano and A. Bicchi, “Overcoming the Torque/Stiffness Range Tradeoff in Antagonistic Variable Stiffness Actuators”, in IEEE/ASME Transactions on Mechatronics, vol. 26, no. 6, pp. 3186-3197, Dec. 2021. 234