WOLFRAM SYSTEM MODELER

ModelInversionControl

Placeholder for the ModelInversionControl example model, available on the Wolfram SystemModeler website.

Wolfram Language

In[1]:=
SystemModel["EducationExamples.MechanicalEngineering.ModelInversionControl"]
Out[1]:=

Information

 
 

Library Dependency

This is a placeholder model. It requires the PlanarMechanics library.

  • The free PlanarMechanics library was created especially for modeling multibody systems with two-dimensional mechanical components. Compared to the MultiBody library, currently available in the Modelica Standard Library, it is simpler to use and it is more optimized to planar modeling. Planar models of mechanical systems are useful in many different applications, for example, in contact problems that are more easily modeled in 2D than in 3D.

The following documentation is taken from the main example of the downloadable model. Once you have downloaded all the model dependencies, the model can be downloaded here.

Model Inversion Control

 

Introduction

This model shows an inversion-based controller that is used to control a hoist crane.

The crane in this example is based on the CraneCrab example in the PlanarMechanics library.

In order to get the full experience of this example, you need the following:

 

These pages show an overview of the example. For the full example, open the accompanying notebook ModelInversionControl.nb.

 

Dynamics

The hoist crane is modeled using the PlanarMechanics Modelica library. Force is applied to a prismatic joint that pushes a crab along a one-dimensional beam. Attached to the crab is a dampened revolute joint that connects to the load through a stiff rod.

In the controller, a filtered pulse is used as a reference signal to control the position of the load. Using a constrained inverse block, the force that should be applied to the crab can be calculated from the reference signal.

 

Simulation

To simulate the model, perform this step:

  • Click the Simulate button in the top toolbar simulate.

Plot the Results

Explore how the crane is positioned relative to its reference position by examining the plot that is automatically displayed after simulating the model. The first variable describes the actual position of the crane, while the second describes the reference position that is input into the controller.

modelinversiondefaultplot

Automatic 3D Animation

PlanarMechanics and Multibody systems have visualizers to show what a real-world system would look like.

sim

To show a 3D animation of the model, follow the steps below:

  • Click the Simulate button simulate in the top-right corner.
  • When the build has finished and simulation has completed, click the Animation button animate in the toolbar.
  • Use your mouse or trackpad to drag the animation to a good angle and zoom in with your scroll wheel or by using the trackpad. Then click the Play button play to play the animation.

Change Parameters

Changing parameters for the simulation can be done rapidly in Simulation Center. The crane_I parameter determines the "real" inertia of the load. The model used inside the controller also has an inertia parameter that determines what the controller expects the load inertia to be. When the real and the expected inertia differ from each other, the controller will not be able to accurately predict what force to apply to the crane.

Try changing the inertia for the load and see how this affects the controller:

  • Switch to the Parameter tab on the left in the Experiment Browser.
  • Cange the value next to the body_I parameter to 1000.
  • Simulate again by following the steps in the Simulation section to see the effects of your changes.

You should now see the graph below:

defaultplotwithchangedparameters