Wolfram Computation Meets Knowledge


Expand the curriculum with exciting experiments in dynamics and gain insight into how modeling and simulation can enhance and strengthen understanding of physics and math concepts.

Arduino Robot Arm

The Wolfram Model Plug library allows you to connect your simulation models to the real world using Arduino boards, thereby further increasing the capability for fast prototyping in System Modeler. Here, we will show how Model Plug can be used to interactively control a robot arm from a control panel.

Combining Simulation Models and Real Hardware

The models used in this example were created with the Model Plug library and basic blocks from the Modelica Standard Library. A very useful feature in connecting hardware to System Modeler is that no manual coding is required, only graphic drag-and-drop modeling, which makes fast prototyping simpler and more time efficient.

The simulation model as seen in the diagram view in Model Center, with the control panel and robot arm models expanded. Continuous filters from Modelica.Blocks are used to filter the signals from the control panel and thereby achieve softer transitions when the robot arm moves from one position to another.

The simulation model contains, besides blocks from the Modelica Standard Library, a control panel model and a robot arm model that are both based on components from the Model Plug library, among others. The control panel model is linked to a physical control panel through a USB port on the computer. The port number is set as a parameter in the model (see below). The physical robot arm prototype is connected to the robot arm model in the same manner.

The physical control panel is connected to the control panel model by specifying the Port parameter, which in this case is "COM3".

Real-Time Interactivity

With the simulation model and hardware set up, we can now simulate the model and use the knobs on the physical control panel to control the movements of the robot arm, all in real time.

The experimental setup with hardware (control panel, robot arm) and software (simulation model in System Modeler).

Check out the video below to see how the control panel is used to steer the robot arm using System Modeler and the simulation model as an interface between them.

Three different knobs on the control panel are used to control the three different servo motors, each with an angular range of 0-180 degrees. Each plot visible on the laptop screen corresponds to the signal from one of the servos.

Connect your simulation models to the real world

Using the Model Plug library, you can connect hardware such as input devices, sensors, and actuators to your simulation models, thereby making it possible to interact with your simulations directly and in real time.