MV-7012: Functional Mockup Unit (FMU) in MotionView and MotionSolve

In this tutorial, you will learn about the use of FMU in MotionView and MotionSolve.

This exercise uses the Swingup_pendulum_FMU_start.mdl and sb_Controller.fmu files located in the mbd_modeling\motionsolve\fmu folder.

Functional Mock-up Interface (FMI) is a tool independent standard interface that facilitates exchange of models across diverse domains and applications. Based on this interface, a Functional Mock-up Unit (FMU) describing the model using a combination of xml-files, compiled C-code and other resource files can be shared and used in applications that supports such an interface.

FMUs can be one of two types:
Model Exchange
The FMU contains the necessary information about states. The parent application that uses this FMU “internalizes” and solves for these states.
The FMU either includes the solver or can connect to an external solver. In this case, the parent application co-simulates along with the FMU or the external solver.

Two versions of the FMI, FMI 1.0 and FMI 2.0, are used today. MotionView and MotionSolve support only FMI 2.0. For additional details on how to use FMU in MotionView, refer to the MotionView > MDL Reference Guide and the MotionSolve Reference Guide.

This tutorial will describe the steps required to:

  1. Open and review the swing-up pendulum model
  2. Add an FMU in MotionView
  3. Connect input and output to the FMU
  4. Run the model and view the results

In this tutorial, a pendulum is balanced on a cart, which can slide on a fixed platform. The bob of the pendulum faces down at the beginning of the simulation; the goal is to move the cart and swing the pendulum so that the bob faces upward. Once it achieves this position, it also needs to be maintained in the same position.

To achieve this objective, a controller unit in form of an FMU is used to determine the force necessary to balance the pendulum. The FMU is generated independently from a different control system modeling application.