Skip to content
LIBRARY
PlanarMechanics.PrescribedPosition.md

PlanarMechanics.PrescribedPosition

Prescribed position of frame_b via input connectors.

The position of frame_b is driven by the two real inputs r_x, r_y, resolved in the planar world frame.

When fixed_orientation is true, the rotation angle is locked to zero. When false, no orientation constraint is imposed and no torque is applied — the orientation must be determined by connected components.

When apply_force is false, no translational force is applied either (frame_b.fx = frame_b.fy = 0): the position equations then act as pure motion constraints that must be realized by actuation elsewhere in the model. This is the inverse-model mode: prescribing the tool position of a mechanism whose joints are actuated by unknown torques makes those torques solve the inverse kinematics and inverse dynamics simultaneously.

Usage

MultibodyComponents.PlanarMechanics.PrescribedPosition()

Parameters:

NameDescriptionUnitsDefault value
fixed_orientationtrue
apply_forceWhen false, the position is imposed without applying force (inverse-model mode)true

Connectors

  • frame_b - Coordinate system (2-dim.) fixed to the component with one cut-force and cut-torque.

All variables are resolved in the planar world frame. (Frame2D)

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

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

Variables

NameDescriptionUnits
rPosition vector from world frame to frame_b, resolved in world framem
vAbsolute velocity of frame_b, resolved in world framem/s
aAbsolute acceleration of frame_b, resolved in world framem/s2

Behavior

Dict{MIME{Symbol("text/plain")}, String} with 1 entry: MIME type text/plain => "Error displaying result"

Source

dyad
"""
Prescribed position of `frame_b` via input connectors.

The position of `frame_b` is driven by the two real inputs `r_x`, `r_y`,
resolved in the planar world frame.

When `fixed_orientation` is true, the rotation angle is locked to zero.
When false, no orientation constraint is imposed and no torque is applied —
the orientation must be determined by connected components.

When `apply_force` is false, no translational force is applied either
(`frame_b.fx = frame_b.fy = 0`): the position equations then act as pure motion
constraints that must be realized by actuation elsewhere in the model. This is
the inverse-model mode: prescribing the tool position of a mechanism whose
joints are actuated by unknown torques makes those torques solve the inverse
kinematics and inverse dynamics simultaneously.
"""
component PrescribedPosition
  frame_b = Frame2D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 900, "y1": 450, "x2": 1000, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  r_x = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 250, "x2": 50, "y2": 350, "rot": 0}
      },
      "tags": []
    }
  }
  r_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 650, "x2": 50, "y2": 750, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter fixed_orientation::Boolean = true
  "When false, the position is imposed without applying force (inverse-model mode)"
  structural parameter apply_force::Boolean = true
  "Position vector from world frame to frame_b, resolved in world frame"
  variable r::Position[2]
  "Absolute velocity of frame_b, resolved in world frame"
  variable v::Velocity[2]
  "Absolute acceleration of frame_b, resolved in world frame"
  variable a::Acceleration[2]
relations
  r = [r_x, r_y]
  frame_b.x = r_x
  frame_b.y = r_y
  v = der(r)
  a = der(v)
  if fixed_orientation
    frame_b.phi = 0
  else
    frame_b.tau = 0
  end
  if !apply_force
    frame_b.fx = 0
    frame_b.fy = 0
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/PrescribedPosition.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end
Flattened Source
dyad
"""
Prescribed position of `frame_b` via input connectors.

The position of `frame_b` is driven by the two real inputs `r_x`, `r_y`,
resolved in the planar world frame.

When `fixed_orientation` is true, the rotation angle is locked to zero.
When false, no orientation constraint is imposed and no torque is applied —
the orientation must be determined by connected components.

When `apply_force` is false, no translational force is applied either
(`frame_b.fx = frame_b.fy = 0`): the position equations then act as pure motion
constraints that must be realized by actuation elsewhere in the model. This is
the inverse-model mode: prescribing the tool position of a mechanism whose
joints are actuated by unknown torques makes those torques solve the inverse
kinematics and inverse dynamics simultaneously.
"""
component PrescribedPosition
  frame_b = Frame2D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 900, "y1": 450, "x2": 1000, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  r_x = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 250, "x2": 50, "y2": 350, "rot": 0}
      },
      "tags": []
    }
  }
  r_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 650, "x2": 50, "y2": 750, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter fixed_orientation::Boolean = true
  "When false, the position is imposed without applying force (inverse-model mode)"
  structural parameter apply_force::Boolean = true
  "Position vector from world frame to frame_b, resolved in world frame"
  variable r::Position[2]
  "Absolute velocity of frame_b, resolved in world frame"
  variable v::Velocity[2]
  "Absolute acceleration of frame_b, resolved in world frame"
  variable a::Acceleration[2]
relations
  r = [r_x, r_y]
  frame_b.x = r_x
  frame_b.y = r_y
  v = der(r)
  a = der(v)
  if fixed_orientation
    frame_b.phi = 0
  else
    frame_b.tau = 0
  end
  if !apply_force
    frame_b.fx = 0
    frame_b.fy = 0
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/PrescribedPosition.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end


Test Cases

No test cases defined.