MoDeS3 Lego Robot - Modelling and simulation of the robot arm
Simulation is an important means in complex cyber-physical and IoT applications as it can provide:
analysis at design time of the development
prediction at runtime
We have developed the physican model of the robot arm (crane) in the open-source OpenModelica framework.
It defines itself with the following goal: "The goal with the OpenModelica effort is to create a comprehensive Open Source Modelica modeling, compilation and simulation environment based on free software distributed in binary and source code form for research, teaching, and industrial usage.“
OpenModelica is complex, there are many built-in functions and libraries, and it is also able to compute the complex behaviours of hybrid systems. Our robot arm is inherently hybrid as the controller has discrete modes while the physical system is continuous.
We have built the model of the robot arm.
By decomposing the physical model into smaller pieces, we can get the hugh level modelica model, depicted in the following figure.
This hierarchical model can be further refined according to the parts of the physical component.
We have used many different components of the library, we have parameterized them according to the measurements, and what we got is quite close to reality. We have done measurements and the model could predict the real physics with only 2-3% of error. This is a quite good result :)
The simulaton is provided to the controller as a service running on a separate linux virtual machine. A virtual controller is developed which compiles the uploaded modelica files with the given parameters and computes the simulation. The results can be showed by the web server of this virtual machine or the results can be sent back to the controller.
the overview of the architecture is depicted on the next figure.
This way the simulation at design and also at runtime is available through a simple interface!
And now let’s show a simple simulation scenario! The model of the next picture is being simulated.
The angle of the three motors in the function of time is depicted on the next picture.
As it can be seen, the three motors can work independently with different speed! Note that this is just a simple example where only some parameters are examined. However, the tool is able to evaluate more complex parameters and movements of the system.
Simulation is a useful feature both at design and also at runtime, various questions regarding the path of the robot arm then can be answered!
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
Continious-Time Simulation on Eclipse with ModelicaML/MDT Plugin
In previous blog post, First Experience on Modelica and ModelicaML, I tried to show how to simulate a discrete time model on OMEdit (Open Modelica Connection editor) and on Eclipse with ModelicaML plugin.
In this post you'll find simulation of a continious-time model. For this purpose we'll us a Permanent Magnet DC Machine with a load. Model includes only standart Modelica Blocks. We assume that you have OpenModelica and Eclipse with ModelicaML/MDT plugin installations, and you are familiar with creating Modelica models on OMEdit and ModelicaML model Eclipse/Papyrus.
So, for now, we can skip the steps regarding creations model, then just download the models previously created from the links below. However, please feel free to contact us for furher information.
On OpenModelica OMedit
Download the model from here.
Open the model on OMEdit
Just click simulate
Then you'll get the results
Click checkbox the graph you want to see like that below
On Eclipse/Papyrus with ModelicaML/MDT Plugin
Download the model from here.
Import project from the archive
Switct perspective to ModelicaML Modeling
Open the model file
Find SimulationModel item in tree on Model Explorer View
Right click and select simulation from pop-up menu
Then you'll get the results
Click checkbox the graph you want to see like that below
What is Modelica?
Modelica is an object-oriented, declarative, multi-domain modeling language for component-oriented modeling of complex systems, e.g., systems containing mechanical, electrical, electronic, hydraulic, thermal, control, electric power or process-oriented subcomponents. The free Modelica language is developed by the non-profit Modelica Association. The Modelica Association also develops the free Modelica Standard Library that contains about 1360 generic model components and 1280 functions in various domains, as of version 3.2.1.
What is ModelicaML?
Modelica Modeling Language (ModelicaML) is a graphical modeling language for the description of time-continuous and time-discrete/event-based system dynamics. ModelicaML is defined as an extended subset of the OMG Unified Modeling Language (UML). This subset enables the generation of executable Modelica code.
ModelicaML extends the graphical modeling capabilities of Modelica by providing more diagrams (UML diagrams for presenting the composition, connection, inheritance or behavior of classes) for graphical model definition or documentation. Moreover, ModelicaML supports a method for formalizing and evaluating system requirements using simulations.
What is UML?
The Unified Modeling Language (UML) is a general-purpose modeling language in the field of software engineering, which is designed to provide a standard way to visualize the design of a system.It was created and developed by Grady Booch, Ivar Jacobson and James Rumbaugh at Rational Software during 1994–95 with further development led by them through 1996. In 1997 it was adopted as a standard by the Object Management Group (OMG), and has been managed by this organization ever since. In 2000 the Unified Modeling Language was also accepted by the International Organization for Standardization (ISO) as an approved ISO standard. Since then it has been periodically revised to cover the latest revision of UML.
Simulation on Eclipse
When I look for an Eclipse based tools for my sgJavaSci Code Generation project, I tried many basic tools for Modeling like that EMF, GMF, Graphiti, Spray and so on… However Eclipse has more powerful tools based UML on top of basic tools, Papyrus, Sirius for System Engineer. It also has tools for code generation Acceleo and Xtext.
Regarding UML, it can be extended for using on various domain. For example one of them is SysML for system engineering and developing Embedde systems. However, this modeling languages are not for simulation.
Regarding ModelicaML, it can be used for code generation and simulation. A Modelica open source project, OpenModelica already has tools for development graphical and textual, Connection Editor (OMEdit) and NoteBook (OMNoteBook) applications. But output of this tools can not be used for code generation because they are not XML based. That is why ModelicaML was selected for code generation with GeneAuto. Also all of the tools to be used are open source.
You’ll find an example model on OpenModelica Connection editor, and an equivalent model on ModelicaML on Eclipse Kepler below. Also you can download source code of example below.
Example is a discrete model of simple up-counter
Modelica Model on OpenModelica Connection Editor
You should have OpenModelica installation to try this model
ModelicaML Model on Eclipse Kepler
You should have OpenModelica installation and Eclipse Kepler with ModelicaML plugin to try this model