.Modelica_LinearSystems2.WorkInProgress.StateSpace.Examples.designInversePendulumController

Information

This example demonstrates how to design pole placement controller to balance an inverted pendulum. For controller design a linearized model of a (simple) physical system model is used. The controller is applied to the physical model in Moldelica_Controller library.

It is also shown how to linearize a modelica model. The linear model is used as a base for control design

Interface

function designInversePendulumController
  import Modelica.Utilities.Streams;
  import Modelica_LinearSystems2;
  import Modelica_LinearSystems2.Math.Complex;
  import Modelica_LinearSystems2.Math.Matrices;
  input String modelName = "Modelica_Controller.Examples.Components.InversePendulum_small" "Name of the model to linearize";
  input Complex pa[4] = {-5 + 0*j, -5 + 0*j, -5.0 - 0.25*j, -5.0 + 0.25*j} "Assigned poles";
  input String fileName = DataDir + "inversePendulumController_small.mat" "File name for results";
  output Real K_pa[:, :] "feedback matrix pole assignment controller";
  output Real M_pa[:, :] "pre filter LQ controller";
end designInversePendulumController;

Generated at 2024-04-28T18:16:21Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos