A note to my future self
What I am doing here is quite against my policy of doing the least necessary amount of quality work, but I am doing it as a partial fulfillment of my Master's degree secondary goal: to be proficient in model, simulation, and control using Julia. Otherwise, I would just use the ABCD matrix of the model and would call it a day.
To follow a TDD approach, I need a verified model of an inverted pendulum to compare the newly created model against it. To do so I need to:
[x] #12
The WSM model is a Modelica model, which means I need to
[x] #13
OMJulia relies on Open Modelica, so I have to figure out a way to
[ ] #14
Here is a quick summary of the components used in the model
Modelica.Icons.Library - This is a built-in icon library.
PlanarMechanics.Parts.Body - Represents the mass of the pendulum and the cart in planar mechanics.
PlanarMechanics.Parts.Fixed - Represents a fixed point in planar mechanics.
PlanarMechanics.Parts.FixedTranslation - Represents the length of the pendulum in planar mechanics.
PlanarMechanics.PlanarWorld - Represents the planar world in planar mechanics.
PlanarMechanics.Joints.Revolute - Represents a revolute joint in planar mechanics.
PlanarMechanics.Joints.Prismatic - Represents a prismatic joint in planar mechanics.
Modelica.Mechanics.Rotational.Sensors.AngleSensor - Represents an angle sensor in rotational mechanics.
Modelica.Blocks.Math.MatrixGain - Represents a matrix gain block for control.
Modelica.Mechanics.Translational.Sensors.PositionSensor - Represents a position sensor in translational mechanics.
Modelica.Mechanics.Rotational.Sensors.SpeedSensor - Represents a speed sensor in rotational mechanics.
Modelica.Mechanics.Translational.Sensors.SpeedSensor - Represents a speed sensor in translational mechanics.
PlanarMechanics.Sources.WorldForce - Represents a world force source in planar mechanics.
Other auxiliary components
Modelica.Blocks.Interfaces.RealOutput - Represents real output signals for various components.
Real - Represents real numbers for storing values.
Modelica.SIunits.Mass - Represents mass values in SI units.
Modelica.SIunits.Inertia - Represents inertia values in SI units.
Modelica.SIunits.Angle - Represents angle values in SI units.
Modelica.SIunits.Length - Represents length values in SI units.
Modelica.SIunits.Position - Represents position values in SI units.
Modelica.SIunits.Acceleration - Represents acceleration values in SI units.
Modelica.SIunits.AngularAcceleration - Represents angular acceleration values in SI units.
The PlanarMechanics.* components are provided via https://github.com/dzimmer/PlanarMechanics which is missing for ModelingToolkitStandardLibarary. So I have to add the following to MTKStdLib
[x] #16
[x] #15
[x] #17
[x] #18
[x] #19
[ ] #20
[ ] #27 (as a validation for the component implementation, it isn't related to the pendulum model directly.)
To follow a TDD approach, I need a verified model of an inverted pendulum to compare the newly created model against it. To do so I need to:
The WSM model is a Modelica model, which means I need to
OMJulia relies on Open Modelica, so I have to figure out a way to
Here is a quick summary of the components used in the model
Modelica.Icons.Library
- This is a built-in icon library.PlanarMechanics.Parts.Body
- Represents the mass of the pendulum and the cart in planar mechanics.PlanarMechanics.Parts.Fixed
- Represents a fixed point in planar mechanics.PlanarMechanics.Parts.FixedTranslation
- Represents the length of the pendulum in planar mechanics.PlanarMechanics.PlanarWorld
- Represents the planar world in planar mechanics.PlanarMechanics.Joints.Revolute
- Represents a revolute joint in planar mechanics.PlanarMechanics.Joints.Prismatic
- Represents a prismatic joint in planar mechanics.Modelica.Mechanics.Rotational.Sensors.AngleSensor
- Represents an angle sensor in rotational mechanics.Modelica.Blocks.Math.MatrixGain
- Represents a matrix gain block for control.Modelica.Mechanics.Translational.Sensors.PositionSensor
- Represents a position sensor in translational mechanics.Modelica.Mechanics.Rotational.Sensors.SpeedSensor
- Represents a speed sensor in rotational mechanics.Modelica.Mechanics.Translational.Sensors.SpeedSensor
- Represents a speed sensor in translational mechanics.PlanarMechanics.Sources.WorldForce
- Represents a world force source in planar mechanics.Other auxiliary components
Modelica.Blocks.Interfaces.RealOutput - Represents real output signals for various components.
Real - Represents real numbers for storing values.
Modelica.SIunits.Mass - Represents mass values in SI units.
Modelica.SIunits.Inertia - Represents inertia values in SI units.
Modelica.SIunits.Angle - Represents angle values in SI units.
Modelica.SIunits.Length - Represents length values in SI units.
Modelica.SIunits.Position - Represents position values in SI units.
Modelica.SIunits.Acceleration - Represents acceleration values in SI units.
Modelica.SIunits.AngularAcceleration - Represents angular acceleration values in SI units.
The
PlanarMechanics.*
components are provided via https://github.com/dzimmer/PlanarMechanics which is missing forModelingToolkitStandardLibarary
. So I have to add the following to MTKStdLibHere is a PR that added the
Mechnaical.Transitional
module for inspiration and pitfalls https://github.com/SciML/ModelingToolkitStandardLibrary.jl/pull/85only then I can start building the model using ModelingToolkit. oouf :tired_face: