ModelPlug is a library that allows you to connect your simulations with the real world. It uses an Arduino board (or compatible) to send analog and digital signals to physical devices and receive signals from them.
With ModelPlug, you can combine simulation models and real hardware. For example, you can get data from your hardware, design a control, and test it in real time.
You can build a real control panel and use it to control your simulation models.
ModelPlug provides the following components:
|Analog input||Reads analog values from the pins|
|Digital input||Reads digital values from the pins|
|Analog output||Writes analog values to the pins|
|Digital output||Writes digital values to the pins|
|Servo control||Writes the angle to servo motors|
|Arduino||Connects to Arduino boards like Arduino Uno, Arduino Mega 2560|
|Arduino Leonardo||Connects to Arduino Leonardo boards and boards using native USB|
|StandardFirmata||Connects to Arduino-compatible boards|
|CustomFirmata||Connects to any board supporting Firmata|
ModelPlug connects with the boards using USB serial communication. In order to configure, read, and write to the board, ModelPlug uses the Firmata protocol v2.3 (http://www.firmata.org). This protocol allows you to connect not only to Arduinos, but also to many boards compatible with Arduino. Examples of other boards supporting the Firmata protocol are:
ModelPlug wraps the functionality of Firmata by providing easy-to-use Modelica models that you can connect in your simulations.
ModelPlug requires a board with Firmata Version 2.3 or higher.
Currently ModelPlug does not support sensors that communicate through I2C or SPI with the board.
The minimum synchronization interval is 1 ms; therefore, ModelPlug cannot have a sampling interval smaller than that. The standard Firmata allows a minimum sampling interval of 10 ms.
ModelPlug uses a serial protocol; therefore, the transfer speed is constrained by the serial port speed. This can be problematic when reading or writing too many inputs/outputs with a small sampling interval.
Ask questions about SystemModeler and ModelPlug
Find out how to connect sensors and actuators to the Arduino
Get details about the Firmata protocol
The breadboard diagrams were created using Fritzing