УДК 004.942
M.S. Kuprin1, kms0207@ya.ru,
I.A. Osipov1, igoros7755@gmail.com,
A.V. Klyuchikov2, Candidate of Engineering Sciences, junior researcher, krok9407@mail.ru,
N.E. Samokhin1, nikitasamokhin123@yandex.ru,
1Yuri Gagarin State Technical University of Saratov, Saratov, 410054, Politekhnicheskaya St. 77, Russian Federation
2Saratov State University of Genetics, Biotechnology and Engineering named after N.I. Vavilov, Saratov, 410012, Theatre Sq. 1, Russian Federation
Simulation modeling of mobile robotic complexes tool analysis according to physical laws
This article is about the technologies of simulation modeling of mobile robotic complexes. The basic demands for a simulation environment are defined such as realistic results, open source code, extensibility, performance of system, possibility of usage of low-level code for simulation. Moreover, the most significant characteristics for physics engines are described in the article, specifically solid state physics, torque setup, stability of “axle” connection, stability of the simulated many-body system. The frequently used physics engines such as PhysX, ODE, MuJoCo, Bullet, Havok are analyzed and the search of modeling services is made in order to make the comparative table. The platform Unity is in focus of this work to show its abilities in modeling of mechanical and electronic parts of mobile robots. The aim of this work is minimizing mobile robots development outgoings. Programming product is given as result of simulation modeling of robotic complexes. The Unity platform is used as the engine for development of simulation tools for mechanical and electronic parts of robotic complex. The set of tools based on Unity engine is developed in order to create virtual models of mobile robots. The architecture of the project was developed in order to determine aspects of creating mobile robots in a simulation modeling environment. The logic of scripts for modeling the solid state physics, kinematic chains and joints with different degrees of freedom is presented as a result of developing architecture of the project. The package was tested, a model of a mobile four-wheeled robotic platform was built as a result of the test.
Key words: simulation modeling, computer modeling, mobile robots, physics engine, Unity.
Introduction
The number of mobile robots in the world is rapidly increasing. The number of mobile robots sold will increase by 31% annually from 2020 to 2023 according to IFR (International Federation of Robotics) predictions [1]. With the increase in the number of mobile robots, there is a need for means of testing new solutions, modeling the behavior of the prototype, checking performance and evaluating the most important parameters such as maneuverability and the ability to overcome obstacles [2]. Approbation is a resource-intensive process because of the wear of the mechanical parts of the robot, possibility of failure of electronic components and the need to purchase consumables.
Computer calculations are carried out during the development of 3D models of the housing, prototyping of electronic circuits, mathematical modeling of individual links of the robotic system (RTK) [3-4], as well as the creation and testing of algorithms for the software [5-6].
Simulation modeling combines all these aspects. Simulation modeling is the process of creating a virtual model, when using which the system under study is replaced by a simplified version of the object. A simulation model is a computer program that accurately describes the structure of the system. The simulation model is capable of reproducing the behavior of the system in real time [7].
Defining requirements for the simulation environment
The process of modeling mobile robots is labor-intensive as a result of the complexity of the orientation of the robot in area, navigation and overcoming obstacles. The main problems in developing simulation environments are:
1. Calculation stability [8]. Many physics engines are used in computer games for animations where accurate results are not the primary concern so accuracy is neglected in favor of performance. The PhysX physics engine shows good results in calculating collisions but optimization “send to sleep” the object;
2. Ability to use as a predictive engine in real control systems, which requires a high speed of calculations from the engine;
3. Rigid body physics and soft body physics. Inaccurate calculations lead to incorrect results;
4. Ability to simulate various types of sensors as well as adding and customizing your own [9];
The most important factors when choosing a modeling tool are:
● realism of results, closeness of simulation to reality;
● open-source code;
● the ability to use the same code for both simulation and robot control;
● extensibility of projects
● possibility of modification and development of own simulation modules;
● performance of the system [10].
Analysis and choice of physics engine
Factors affecting the realism of the simulation of the movement of a mobile robot are:
1. Rigid body physics;
2. Stability of “axis” type joint;
3. Possibility to adjust the torque;
4. Stability of the multibody simulated system [11].
The most advanced physics engines are: ODE, MuJoCo, PhysX, Havok, Bullet [12-15]. Most robotic simulators use these engines (Table 1).
PhysX and Havok were developed for games, while they can be used with optimization adjusted and are available for use in the game development system (Unity) [8, 9, 14-16] or as the additional library. The technical characteristics analysis of the simulation environments was made. Data was presented in the comparative table (Table 2).
Using the Unity game engine for modeling mobile robots
Unity is a development environment for 2D and 3D games and applications. Unity Editor is a multifunctional tool for working with graphics, physics, data, sounds, animations, user interfaces and program code [17]. A component-oriented approach is used for development, which means that the properties of an object on the Unity sсene are determined by the components that are attached to the object [18]. The standard component library allows you to create a variety of events and objects, but restricts user actions. Unity allows the user to develop unique components-scripts using the C# and JavaScript programming languages [19]. Unity supports additional libraries and plugins that extend the functionality of the development environment [20].
The use of Unity as a tool for modeling the functioning of robots is considered.
The main reasons to use Unity are:
● PhysX physics engine;
● possibility to use Havok physics engine;
● Windows and Linux support;
● C# and JavaScript support;
● clear documentation;
● wide range of file formats support;
● intuitive GUI with flexible settings;
● plugins support and API;
● environmental modeling tools.
Setting the goal and objectives of the study
The goal of study is to analyze simulation modeling tools for robotic systems that correspond to the identified parameters. This will allow developing a software package for designing a simulation model of a mobile robot, taking into account the physical, software and hardware features of the product.
Simulation modeling makes it possible to predict with high accuracy the behavior of a real robotic system using a virtual model.
The process of designing a virtual model takes less time and does not require the cost of physical resources (fasteners, wiring, parts). It is also easy to edit, requires less production and research into new configurations, algorithms, and increases the information content during designing and testing [21, 22] .
Objectives:
● define the most important parameters for modeling mobile robots;
● determine the degree of compliance of Unity with the identified parameters;
● implement close to realistic behavior of mechanics and electronics by using Unity;
● evaluate the possibilities of using the package;
● develop a mobile robot model.
Proposed solution
To reach the goals of study a package tools (Asset) was chosen for data presentation. Development in the Asset format will allow adding 3D models, scripts, materials and images to the database and use it to develop your own application software.
It is necessary to develop the behavior of mechanical joints, develop a basic set of mechanical joints and implement the behavior of electronics and microcontrollers in order to simulate the behavior of a mechatronic platform.
Component-oriented programming was used in order to develop a package of simulation modeling tools. Special script components allow to simulate the behavior of individual elements of a robotic system with the use of the Unity tools [23]. The developed components allow to simulate:
● electronic part of robot:
○ microcontrollers (make microcontrollers programmable, simulate GPIO interface, implement I²C protocol);
○ motor drivers (motor control for generating a control signal);
○ electric motor (creation of torque in the presence of a control signal);
○ encoders (detection of changes in the rotation angle of an object);
○ rangefinders (distance measurement);
○ LEDs (switching on/off in the presence/absence of a control signal);
○ text displays (displaying text received from I²C protocol).
● mechanical part of robot [24-27]:
○ rigid body physics (robot body elements);
○ fixed joint (fixed connection of robot structural elements);
○ axis (a movable connection of the robot’s structural elements that provides rotation around the axis).
All components have been designed with the possibility of flexible configuration and extension, so the user of the package has the opportunity to develop his own modules for the robot. The architecture of the resulting simulation system is shown in Figure 1.
The package allows you to simulate mobile robots and test programs for microcontrollers at current state. The mobile robot consisting of the four-wheeled platform, the microcontroller, the display, the rangefinder and the servo drive and four drivers was developed to test the software package (fig.2).
Simulation of mechanical connections and physics of solids
There are special components for working with physics in Unity:
● Rigidbody - Rigid body physics [28];
● Collider - a physical model of an object for collision calculations [29];
● Joins - connections with different number of degrees of freedom [30];
● Articulations - set of articulation bodies [31].
To simplify the configuration of components and automatic attachment to the object, the scripts “ModuleBaseScript” and “HingeBaseScript” were developed, which create and configure a fixed joint and a hinge joint, respectively. When starting the scene, the connected elements are checked for the presence of Rigidbody component, if there is no component, it is automatically attached with the RequireComponent attribute [32].
Conclusion
A search was made for tools for mathematical modeling of the robot behavior in the course of the study. Tools with extensions for working with physics were identified among them. Software solutions with the ability to visualize the results are also defined.
Taking into account these aspects, Unity development environment was chosen for the simulation of mobile robots. The software allows you to develop your own package with a set of tools for a specific task.
The goal was set to reduce production costs using simulation modeling of mobile robots as a part of the study. The task was set to form the Asset library in Unity development environment with the possibility of developing their own solutions and modeling the designs of mobile robots. Ten modules were developed with the use of Unity to simulate the electronic and mechanical components of a robotic system. The package has been tested. Problems were identified in the process of testing and ways to solve these problems were proposed
References
1. International Federation of Robotics. "Mobile Robots Revolutionize Industry." ifr.org. https://ifr.org/ifr-press-releases/news/mobile-robots-revolutionize-industry (date of access: 23 August 2022).
2. González Rodríguez, Á.G., González Rodríguez, A. (2011). Mobile Robots. In: Nava Rodríguez, N. (eds) Advanced Mechanics in Robotic Systems. Springer, London. https://doi.org/10.1007/978-0-85729-588-0_3
3. Aarnio P, Koskinen K, Salmi S. (2000) Simulation of the hybtor robot. International conference climbinng walking robots. Professional Engineering Publishing, pp 267–274
4. Röse, A.(2009). Kinematic Design. In: Kern, T. (eds) Engineering Haptic Devices. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-88248-0_8
5. Germann D, Hiller M, Schramm D(2005) Design and control of the quadruped walking robot ALDURO. Int Symp Autom Robot Constr ISARC
6. Berkaev A. R. Development of localisation system and positioning of a mobile robot / A.R Berkaev, A.A. Nenashev, A.V. Klyuchikov // Mathematical methods in engineering and technology - MMTT. - 2020 - T. 12-3. pp 152-157.
7. Swamidass S. (2000) SIMULATION MODELS . In: Swamidass, P.M. (eds) Encyclopedia of Production and Manufacturing Management. Springer, Boston, MA . https://doi.org/10.1007/1-4020-0612-8_884
8. Drumwright E., Shell D. An evaluation of methods for modeling contact in multibody simulation, IEEE Int. Conf. on Robotics and Automation, 2011, P. 1695–1701.
9. Hummel J.An Evaluation of Open Source Physics Engines for Use in Virtual Reality Assembly Simulations
10. Leonova N.L. Simulation modeling: lecture synopsis, Higher School of Technology and Energetics, St. Petersburg, 2015, 94 p. (in Russian)
11. Seugling A. Evaluation of physics engines and implementation of a physics module in a 3d-authoring tool
12. Manyuxina A. N. Game engine usage for robotic devices modeling systems development, conference «Integraciya mirovyh nauchnyh protsessov kak osnova obshetvennogo progressa», 2015, pp. 131–137. (in Russian)
13. Todorov E.Convex and analytically-invertible dynamics with contacts and constraints: Theory and implementation in MuJoCo, IEEE Conference on Robotics and Automation (ICRA), 2014.
14. Boeing, A., Brunl T. Evaluation of real-time physics simulation systems, ACM Press, 2007, P. 281.
15. Erez, T. Simulation Tools for Model-based Robotics: Comparison of Bullet, Havok, MuJoCo, ODE and PhysX
16. Tassa Y., Todorov E. IEEE International Conference on Robotics and Automation (ICRA), Seattle, WA, USA, 2015.
17. Unity - Unity User Manual 2021.3 (LTS) // Unity User Manual 2021.3 (LTS) URL: https://docs.unity3d.com/Manual/index.html (date of access: 07 September 2022)
18. Unity - Introduction to components // Unity User Manual 2021.3 (LTS) URL: https://docs.unity3d.com/Manual/Components.html (date of access: 07 September 2022)
19. Unity - Scripting // Unity User Manual 2021.3 (LTS) URL: https://docs.unity3d.com/Manual/ScriptingSection.html (date of access: 07 September 2022)
20. Unity - Plug-ins// Unity User Manual 2021.3 (LTS) URL: https://docs.unity3d.com/Manual/Plugins.html (date of access: 07 September 2022)
21. Unity - Scripting API: RequireComponent [Online] // Unity Scripting API 2021.3 (LTS) URL: https://docs.unity3d.com/ScriptReference/RequireComponent.html (date of access: 07 September 2022)
22. Hummel J., Wolff R.,Stein T.et al. Advances in Visual Computing, Lecture Notes in Computer Science, Vol. 7432, 2012, P. 346– 357.
23. Ivaldi, S, Padois V., Nori F. Tools for dynamics simulation of robots: a survey based on user feedback, 14th IEEE-RAS International Conference on Robotics and Automation, 2014, P. 842–849.
24. Izyumov A. A., Vinnik A. E., Habibulina N. Y. Mobile robot movement simulation, TUSUR conferation digest, 2020, no 1-1, pp. 83-86. (in Russian)
25. Mokaeva A.A., Hamukov Y.H., Shautsukova L.Z.Kinematic scheme development of cable control system of “trunk” manipulator device, Izvestiya Kabardino-Balkarsky Scientific Center Russian Academy of Sciences, 2015, № 6. (in Russian)
26. Design of all-wheel drive wheeled vehicles, Vol. 1. М., Publ. MSTU, 2008. pp. 25-56, 144-182, 435-485. (in Russian)
27. Design of all-wheel drive wheeled vehicles, Vol. 2. М., Publ. MSTU, 2008. pp. 152-490. (in Russian)
28. Unity - Manual: Rigidbody // Unity User Manual 2021.3 (LTS). URL: https://docs.unity3d.com/Manual/class-Rigidbody.html (date of access: 06 September 2022)
29. Unity - Manual: Introduction to collision// Unity User Manual 2021.3 (LTS) URL: https://docs.unity3d.com/Manual/CollidersOverview.html (date of access: 06 September 2022)
30. Unity - Manual: Introduction to joints // Unity User Manual 2021.3 (LTS) URL: https://docs.unity3d.com/Manual/Joints.html (date of access: 06 September 2022)
31. Unity - Manual: Introduction to physics articulations // Unity User Manual 2021.3 (LTS) URL: https://docs.unity3d.com/Manual/physics-articulations.html (date of access: 06 September 2022)
Unity - Scripting API: RequireComponent // Unity Scripting API 2021.3 (LTS) URL: https://docs.unity3d.com/ScriptReference/RequireComponent.html (date of access: 07 September 2022)