Skip to content

This repository contains models for Hardware In Loop simulation in OpenModelica using Arduino.

Notifications You must be signed in to change notification settings

souradipp76/OpenModelica-HIL

Repository files navigation

OpenModelica-HIL-Simulation

Free library for Hardware-in-Loop simulation with Arduino using Modelica and Modelica_DeviceDrivers models in Linux.

Library description

The OpenModelica-HIL-Simulation library is an open source Modelica package for Hardware-in-Loop simulations involving Arduino platforms using Interprocess Communication.

Main features:

  • Support for Linux.
  • (Soft) real-time synchronization of a simulation.

Please note that the library is known to work with

  • OpenModelica (partial support starting with OpenModelica v1.11.0, e.g.serial port).

Prerequisites

Running Test Simulation

Test the package using HIL_Arduino.mo test provided.

  • Load the Arduino platform with the controller1.ino code.
  • Compile the SerialSHM.c file in HIL_IPC/HIL_ArduinoIPC/Resources/Include using the following command
$ gcc Serial_SHM.c -o Serial_SHM -lrt
  • Execute the SerialSHM file using the following command
$ sudo ./Serial_SHM
  • Load the HIL_Arduino.mo test model present in package.
  • Set simulation flag '-rt=1' in OMEdit. Simulate the model. If no error occurs, the package is good to go.

For further information: Visit https://build.openmodelica.org/Documentation/Modelica.html , https://build.openmodelica.org/Documentation/Servomechanisms.html

Development and contribution

Main developers:

Contributions in shape of [Pull Requests] are always welcome.

The following people have directly contributed to the implementation of the library (many more have contributed by providing feedback and suggestions):

  • Manas Ranjan Das (project mentor), contribution in bug fixes,error removal etc.

About

This repository contains models for Hardware In Loop simulation in OpenModelica using Arduino.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published