Skip to content
LIBRARY
Examples.ACADOSGearedPendulum.md

Examples.ACADOSGearedPendulum ​

The pendulum driven through a gearbox: the motor torque is scaled by the gear ratio n before it reaches the link, whose own parameters — the mass among them — are therefore one component below the model that is handed to the controller. The plant of ACADOSMPCNestedParameterExample.

Usage ​

MPCComponents.Examples.ACADOSGearedPendulum(n=2.0, theta0=0.0)

Parameters: ​

NameDescriptionUnitsDefault value
nGear ratio from the motor torque to the link torque–2.0
theta0Initial angle–0.0

Connectors ​

  • tau - This connector represents a real signal as an input to a component (RealInput)

  • theta - This connector represents a real signal as an output from a component (RealOutput)

  • omega - This connector represents a real signal as an output from a component (RealOutput)

Behavior ​

Behavior of this component cannot be rendered because it includes path variables.

Source ​

dyad
"""
The pendulum driven through a gearbox: the motor torque is scaled by the gear ratio `n` before it
reaches the link, whose own parameters — the mass among them — are therefore one component below the
model that is handed to the controller. The plant of `ACADOSMPCNestedParameterExample`.
"""
component ACADOSGearedPendulum
  "Motor torque"
  tau = RealInput() {
    "Dyad": {
      "placement": {
        "icon": {"x1": -100, "y1": 450, "x2": 0, "y2": 550},
        "diagram": {"x1": 100, "y1": 300, "x2": 200, "y2": 400}
      }
    }
  }
  "Angle"
  theta = RealOutput() {
    "Dyad": {
      "placement": {
        "icon": {"x1": 1000, "y1": 300, "x2": 1100, "y2": 400},
        "diagram": {"x1": 900, "y1": 250, "x2": 1000, "y2": 350}
      }
    }
  }
  "Angular velocity"
  omega = RealOutput() {
    "Dyad": {
      "placement": {
        "icon": {"x1": 1000, "y1": 600, "x2": 1100, "y2": 700},
        "diagram": {"x1": 900, "y1": 450, "x2": 1000, "y2": 550}
      }
    }
  }
  "Gear ratio from the motor torque to the link torque"
  parameter n::Real = 2.0
  "Initial angle"
  parameter theta0::Real = 0.0
  gear = BlockComponents.Math.Gain(final k = n) {
    "Dyad": {"placement": {"diagram": {"x1": 300, "y1": 300, "x2": 400, "y2": 400}}}
  }
  link = MPCComponents.Examples.ACADOSPendulumPlant(m = 3.0, final theta0 = theta0) {
    "Dyad": {"placement": {"diagram": {"x1": 600, "y1": 300, "x2": 700, "y2": 400}}}
  }
relations
  connect(tau, gear.u) {}
  connect(gear.y, link.tau) {}
  connect(link.theta, theta) {}
  connect(link.omega, omega) {}
metadata {"Dyad": {"doc": {"behavior": false}}}
end
Flattened Source
dyad
"""
The pendulum driven through a gearbox: the motor torque is scaled by the gear ratio `n` before it
reaches the link, whose own parameters — the mass among them — are therefore one component below the
model that is handed to the controller. The plant of `ACADOSMPCNestedParameterExample`.
"""
component ACADOSGearedPendulum
  "Motor torque"
  tau = RealInput() {
    "Dyad": {
      "placement": {
        "icon": {"x1": -100, "y1": 450, "x2": 0, "y2": 550},
        "diagram": {"x1": 100, "y1": 300, "x2": 200, "y2": 400}
      }
    }
  }
  "Angle"
  theta = RealOutput() {
    "Dyad": {
      "placement": {
        "icon": {"x1": 1000, "y1": 300, "x2": 1100, "y2": 400},
        "diagram": {"x1": 900, "y1": 250, "x2": 1000, "y2": 350}
      }
    }
  }
  "Angular velocity"
  omega = RealOutput() {
    "Dyad": {
      "placement": {
        "icon": {"x1": 1000, "y1": 600, "x2": 1100, "y2": 700},
        "diagram": {"x1": 900, "y1": 450, "x2": 1000, "y2": 550}
      }
    }
  }
  "Gear ratio from the motor torque to the link torque"
  parameter n::Real = 2.0
  "Initial angle"
  parameter theta0::Real = 0.0
  gear = BlockComponents.Math.Gain(final k = n) {
    "Dyad": {"placement": {"diagram": {"x1": 300, "y1": 300, "x2": 400, "y2": 400}}}
  }
  link = MPCComponents.Examples.ACADOSPendulumPlant(m = 3.0, final theta0 = theta0) {
    "Dyad": {"placement": {"diagram": {"x1": 600, "y1": 300, "x2": 700, "y2": 400}}}
  }
relations
  connect(tau, gear.u) {}
  connect(gear.y, link.tau) {}
  connect(link.theta, theta) {}
  connect(link.omega, omega) {}
metadata {"Dyad": {"doc": {"behavior": false}}}
end


Test Cases ​

No test cases defined.

  • Examples

  • Experiments

  • Analyses