.Modelica_LinearSystems2.WorkInProgress.StateSpace.Examples.designInverseDoublePendulumControllerWithObserver

Information

This example demonstrates how to design pole placement controller to balance an inverted double 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 designInverseDoublePendulumControllerWithObserver
  import Modelica.Utilities.Streams;
  import Modelica_LinearSystems2;
  import Modelica_LinearSystems2.Math.Complex;
  import Modelica_LinearSystems2.Math.Matrices;
  import Modelica_LinearSystems2.StateSpace;
  input String modelName = "Modelica_LinearSystems2.Controller.Examples.Components.InverseDoublePendulum" "name of the model to linearize";
  input Complex pa[6] = {Complex(-1, 0), Complex(-1, 0), Complex(-12, -0.2), Complex(-12, 0.2), Complex(-15, -0), Complex(-15, 0)} "assigned poles";
  input Complex pob[6] = cat(1, fill(-15 + 0*j, 4), fill(-20 + 0*j, 2)) "assigned observer poles";
  input String fileName = DataDir + "inverseDoublePendulumControllerO.mat" "file name for results";
  input Boolean makeAnalysis = false;
  output Real K_pa[:, :] "feedback matrix pole assignment controller";
  output Real M_pa[:, :] "pre filter LQ controller";
  output Real K_ob[:, :] "feedback matrix pole assignment controller";
end designInverseDoublePendulumControllerWithObserver;

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