Skip to content
LIBRARY
AbsoluteSensor.md

AbsoluteSensor

Combined, toggleable absolute-motion sensor.

Each boolean parameter independently enables one output group. r/v/w/ angles are produced by composing the dedicated AbsolutePosition/ AbsoluteVelocity/AbsoluteAngularVelocity/AbsoluteAngles sensors as conditional sub-components. a/z have no dedicated public sensor of their own (Modelica has none either): they are computed by double-differentiating the world-resolved position/angular velocity and rotating World -> resolve_in_frame via an internal TransformAbsoluteVector.

Usage

MultibodyComponents.AbsoluteSensor()

Parameters:

NameDescriptionUnitsDefault value
resolve_in_frameResolveInFrame.FrameA()
sequenceAxis sequence used for angles (only meaningful when get_angles = true)[1, 2, 3]
get_rOutput the absolute position rfalse
get_vOutput the absolute velocity vfalse
get_aOutput the absolute acceleration afalse
get_wOutput the absolute angular velocity wfalse
get_zOutput the absolute angular acceleration zfalse
get_anglesOutput the absolute Euler/Cardan anglesfalse

Connectors

  • frame_a - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several Frame

connectors that can be connected together (Frame3D)

  • frame_resolve - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several Frame

connectors that can be connected together (Frame3D)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Variables

NameDescriptionUnits
v0World-resolved velocity (intermediate for a)m/s
a0World-resolved accelerationm/s2
w0World-resolved angular velocity (intermediate for z)rad/s
z0World-resolved angular accelerationrad/s2

Behavior

Source

dyad
"""
Combined, toggleable absolute-motion sensor.

Each boolean parameter independently enables one output group. `r`/`v`/`w`/
`angles` are produced by composing the dedicated `AbsolutePosition`/
`AbsoluteVelocity`/`AbsoluteAngularVelocity`/`AbsoluteAngles` sensors as
conditional sub-components. `a`/`z` have no dedicated public sensor of their
own (Modelica has none either): they are computed by double-differentiating
the world-resolved position/angular velocity and rotating World ->
`resolve_in_frame` via an internal `TransformAbsoluteVector`.
"""
component AbsoluteSensor
  frame_a = Frame3D() {
    "Dyad": {"placement": {"diagram": {"x1": 460, "y1": 960, "x2": 540, "y2": 1040}}}
  }
  frame_resolve = Frame3D() if case(resolve_in_frame, ResolveInFrame.FrameResolve) {
    "Dyad": {"placement": {"diagram": {"x1": 460, "y1": -50, "x2": 540, "y2": 30}}}
  }
  r_x = RealOutput() if get_r {"Dyad": {"placement": {"diagram": {"x1": 960, "y1": 0, "x2": 1040, "y2": 80}}}}
  r_y = RealOutput() if get_r {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 100, "x2": 1040, "y2": 180}}}
  }
  r_z = RealOutput() if get_r {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 200, "x2": 1040, "y2": 280}}}
  }
  v_x = RealOutput() if get_v {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 300, "x2": 1040, "y2": 380}}}
  }
  v_y = RealOutput() if get_v {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 400, "x2": 1040, "y2": 480}}}
  }
  v_z = RealOutput() if get_v {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 500, "x2": 1040, "y2": 580}}}
  }
  a_x = RealOutput() if get_a {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 600, "x2": 1040, "y2": 680}}}
  }
  a_y = RealOutput() if get_a {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 700, "x2": 1040, "y2": 780}}}
  }
  a_z = RealOutput() if get_a {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 800, "x2": 1040, "y2": 880}}}
  }
  w_x = RealOutput() if get_w {
    "Dyad": {"placement": {"diagram": {"x1": -50, "y1": 0, "x2": 30, "y2": 80, "rot": 180}}}
  }
  w_y = RealOutput() if get_w {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 100, "x2": 30, "y2": 180, "rot": 180}}
    }
  }
  w_z = RealOutput() if get_w {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 200, "x2": 30, "y2": 280, "rot": 180}}
    }
  }
  z_x = RealOutput() if get_z {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 300, "x2": 30, "y2": 380, "rot": 180}}
    }
  }
  z_y = RealOutput() if get_z {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 400, "x2": 30, "y2": 480, "rot": 180}}
    }
  }
  z_z = RealOutput() if get_z {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 500, "x2": 30, "y2": 580, "rot": 180}}
    }
  }
  angle_1 = RealOutput() if get_angles {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 600, "x2": 30, "y2": 680, "rot": 180}}
    }
  }
  angle_2 = RealOutput() if get_angles {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 700, "x2": 30, "y2": 780, "rot": 180}}
    }
  }
  angle_3 = RealOutput() if get_angles {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 800, "x2": 30, "y2": 880, "rot": 180}}
    }
  }
  pos = AbsolutePosition(resolve_in_frame = resolve_in_frame) if get_r {
    "Dyad": {"placement": {"diagram": {"x1": 450, "x2": 550, "y1": 300, "y2": 400}}}
  }
  vel = AbsoluteVelocity(resolve_in_frame = resolve_in_frame) if get_v {
    "Dyad": {"placement": {"diagram": {"x1": 250, "x2": 350, "y1": 330, "y2": 430}}}
  }
  angvel = AbsoluteAngularVelocity(resolve_in_frame = resolve_in_frame) if get_w {
    "Dyad": {"placement": {"diagram": {"x1": 480, "x2": 580, "y1": 100, "y2": 200}}}
  }
  ang = AbsoluteAngles(sequence = sequence) if get_angles {
    "Dyad": {"placement": {"diagram": {"x1": 450, "x2": 550, "y1": 500, "y2": 600}}}
  }
  acc_transform = TransformAbsoluteVector(frame_r_in = ResolveInFrame.World(), frame_r_out = resolve_in_frame) if get_a {
    "Dyad": {"placement": {"diagram": {"x1": 650, "x2": 750, "y1": 300, "y2": 400}}}
  }
  angacc_transform = TransformAbsoluteVector(frame_r_in = ResolveInFrame.World(), frame_r_out = resolve_in_frame) if get_z {
    "Dyad": {"placement": {"diagram": {"x1": 250, "x2": 350, "y1": 130, "y2": 230}}}
  }
  structural parameter resolve_in_frame::ResolveInFrame = ResolveInFrame.FrameA()
  "Axis sequence used for `angles` (only meaningful when get_angles = true)"
  structural parameter sequence::Integer[3] = [1, 2, 3]
  "Output the absolute position r"
  structural parameter get_r::Boolean = false
  "Output the absolute velocity v"
  structural parameter get_v::Boolean = false
  "Output the absolute acceleration a"
  structural parameter get_a::Boolean = false
  "Output the absolute angular velocity w"
  structural parameter get_w::Boolean = false
  "Output the absolute angular acceleration z"
  structural parameter get_z::Boolean = false
  "Output the absolute Euler/Cardan angles"
  structural parameter get_angles::Boolean = false
  "World-resolved velocity (intermediate for a)"
  variable v0::Velocity[3] if get_a
  "World-resolved acceleration"
  variable a0::Acceleration[3] if get_a
  "World-resolved angular velocity (intermediate for z)"
  variable w0::AngularVelocity[3] if get_z
  "World-resolved angular acceleration"
  variable z0::AngularAcceleration[3] if get_z
relations
  if get_r
    connect(frame_a, pos.frame_a)
    if case(resolve_in_frame, ResolveInFrame.FrameResolve)
      connect(frame_resolve, pos.frame_resolve)
    end
    [r_x, r_y, r_z] = pos.r
  end
  if get_v
    connect(frame_a, vel.frame_a)
    if case(resolve_in_frame, ResolveInFrame.FrameResolve)
      connect(frame_resolve, vel.frame_resolve)
    end
    [v_x, v_y, v_z] = vel.v
  end
  if get_w
    connect(frame_a, angvel.frame_a)
    if case(resolve_in_frame, ResolveInFrame.FrameResolve)
      connect(frame_resolve, angvel.frame_resolve)
    end
    [w_x, w_y, w_z] = angvel.w
  end
  if get_angles
    connect(frame_a, ang.frame_a)
    angle_1 = ang.angles[1]
    angle_2 = ang.angles[2]
    angle_3 = ang.angles[3]
  end
  if get_a
    v0 = der(frame_a.r_0)
    a0 = der(v0)
    connect(frame_a, acc_transform.frame_a)
    if case(resolve_in_frame, ResolveInFrame.FrameResolve)
      connect(frame_resolve, acc_transform.frame_resolve)
    end
    acc_transform.r_in_x = a0[1]
    acc_transform.r_in_y = a0[2]
    acc_transform.r_in_z = a0[3]
    a_x = acc_transform.r_out_x
    a_y = acc_transform.r_out_y
    a_z = acc_transform.r_out_z
  end
  if get_z
    w0 = angular_velocity1(frame_a.R)
    z0 = der(w0)
    connect(frame_a, angacc_transform.frame_a)
    if case(resolve_in_frame, ResolveInFrame.FrameResolve)
      connect(frame_resolve, angacc_transform.frame_resolve)
    end
    angacc_transform.r_in_x = z0[1]
    angacc_transform.r_in_y = z0[2]
    angacc_transform.r_in_z = z0[3]
    z_x = angacc_transform.r_out_x
    z_y = angacc_transform.r_out_y
    z_z = angacc_transform.r_out_z
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/OneFrameSensor.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "140"}
      },
      {"label": "abs sensor", "x": 500, "y": 680, "rot": 0}
    ]
  }
}
end
Flattened Source
dyad
"""
Combined, toggleable absolute-motion sensor.

Each boolean parameter independently enables one output group. `r`/`v`/`w`/
`angles` are produced by composing the dedicated `AbsolutePosition`/
`AbsoluteVelocity`/`AbsoluteAngularVelocity`/`AbsoluteAngles` sensors as
conditional sub-components. `a`/`z` have no dedicated public sensor of their
own (Modelica has none either): they are computed by double-differentiating
the world-resolved position/angular velocity and rotating World ->
`resolve_in_frame` via an internal `TransformAbsoluteVector`.
"""
component AbsoluteSensor
  frame_a = Frame3D() {
    "Dyad": {"placement": {"diagram": {"x1": 460, "y1": 960, "x2": 540, "y2": 1040}}}
  }
  frame_resolve = Frame3D() if case(resolve_in_frame, ResolveInFrame.FrameResolve) {
    "Dyad": {"placement": {"diagram": {"x1": 460, "y1": -50, "x2": 540, "y2": 30}}}
  }
  r_x = RealOutput() if get_r {"Dyad": {"placement": {"diagram": {"x1": 960, "y1": 0, "x2": 1040, "y2": 80}}}}
  r_y = RealOutput() if get_r {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 100, "x2": 1040, "y2": 180}}}
  }
  r_z = RealOutput() if get_r {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 200, "x2": 1040, "y2": 280}}}
  }
  v_x = RealOutput() if get_v {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 300, "x2": 1040, "y2": 380}}}
  }
  v_y = RealOutput() if get_v {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 400, "x2": 1040, "y2": 480}}}
  }
  v_z = RealOutput() if get_v {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 500, "x2": 1040, "y2": 580}}}
  }
  a_x = RealOutput() if get_a {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 600, "x2": 1040, "y2": 680}}}
  }
  a_y = RealOutput() if get_a {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 700, "x2": 1040, "y2": 780}}}
  }
  a_z = RealOutput() if get_a {
    "Dyad": {"placement": {"diagram": {"x1": 960, "y1": 800, "x2": 1040, "y2": 880}}}
  }
  w_x = RealOutput() if get_w {
    "Dyad": {"placement": {"diagram": {"x1": -50, "y1": 0, "x2": 30, "y2": 80, "rot": 180}}}
  }
  w_y = RealOutput() if get_w {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 100, "x2": 30, "y2": 180, "rot": 180}}
    }
  }
  w_z = RealOutput() if get_w {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 200, "x2": 30, "y2": 280, "rot": 180}}
    }
  }
  z_x = RealOutput() if get_z {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 300, "x2": 30, "y2": 380, "rot": 180}}
    }
  }
  z_y = RealOutput() if get_z {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 400, "x2": 30, "y2": 480, "rot": 180}}
    }
  }
  z_z = RealOutput() if get_z {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 500, "x2": 30, "y2": 580, "rot": 180}}
    }
  }
  angle_1 = RealOutput() if get_angles {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 600, "x2": 30, "y2": 680, "rot": 180}}
    }
  }
  angle_2 = RealOutput() if get_angles {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 700, "x2": 30, "y2": 780, "rot": 180}}
    }
  }
  angle_3 = RealOutput() if get_angles {
    "Dyad": {
      "placement": {"diagram": {"x1": -50, "y1": 800, "x2": 30, "y2": 880, "rot": 180}}
    }
  }
  pos = AbsolutePosition(resolve_in_frame = resolve_in_frame) if get_r {
    "Dyad": {"placement": {"diagram": {"x1": 450, "x2": 550, "y1": 300, "y2": 400}}}
  }
  vel = AbsoluteVelocity(resolve_in_frame = resolve_in_frame) if get_v {
    "Dyad": {"placement": {"diagram": {"x1": 250, "x2": 350, "y1": 330, "y2": 430}}}
  }
  angvel = AbsoluteAngularVelocity(resolve_in_frame = resolve_in_frame) if get_w {
    "Dyad": {"placement": {"diagram": {"x1": 480, "x2": 580, "y1": 100, "y2": 200}}}
  }
  ang = AbsoluteAngles(sequence = sequence) if get_angles {
    "Dyad": {"placement": {"diagram": {"x1": 450, "x2": 550, "y1": 500, "y2": 600}}}
  }
  acc_transform = TransformAbsoluteVector(frame_r_in = ResolveInFrame.World(), frame_r_out = resolve_in_frame) if get_a {
    "Dyad": {"placement": {"diagram": {"x1": 650, "x2": 750, "y1": 300, "y2": 400}}}
  }
  angacc_transform = TransformAbsoluteVector(frame_r_in = ResolveInFrame.World(), frame_r_out = resolve_in_frame) if get_z {
    "Dyad": {"placement": {"diagram": {"x1": 250, "x2": 350, "y1": 130, "y2": 230}}}
  }
  structural parameter resolve_in_frame::ResolveInFrame = ResolveInFrame.FrameA()
  "Axis sequence used for `angles` (only meaningful when get_angles = true)"
  structural parameter sequence::Integer[3] = [1, 2, 3]
  "Output the absolute position r"
  structural parameter get_r::Boolean = false
  "Output the absolute velocity v"
  structural parameter get_v::Boolean = false
  "Output the absolute acceleration a"
  structural parameter get_a::Boolean = false
  "Output the absolute angular velocity w"
  structural parameter get_w::Boolean = false
  "Output the absolute angular acceleration z"
  structural parameter get_z::Boolean = false
  "Output the absolute Euler/Cardan angles"
  structural parameter get_angles::Boolean = false
  "World-resolved velocity (intermediate for a)"
  variable v0::Velocity[3] if get_a
  "World-resolved acceleration"
  variable a0::Acceleration[3] if get_a
  "World-resolved angular velocity (intermediate for z)"
  variable w0::AngularVelocity[3] if get_z
  "World-resolved angular acceleration"
  variable z0::AngularAcceleration[3] if get_z
relations
  if get_r
    connect(frame_a, pos.frame_a)
    if case(resolve_in_frame, ResolveInFrame.FrameResolve)
      connect(frame_resolve, pos.frame_resolve)
    end
    [r_x, r_y, r_z] = pos.r
  end
  if get_v
    connect(frame_a, vel.frame_a)
    if case(resolve_in_frame, ResolveInFrame.FrameResolve)
      connect(frame_resolve, vel.frame_resolve)
    end
    [v_x, v_y, v_z] = vel.v
  end
  if get_w
    connect(frame_a, angvel.frame_a)
    if case(resolve_in_frame, ResolveInFrame.FrameResolve)
      connect(frame_resolve, angvel.frame_resolve)
    end
    [w_x, w_y, w_z] = angvel.w
  end
  if get_angles
    connect(frame_a, ang.frame_a)
    angle_1 = ang.angles[1]
    angle_2 = ang.angles[2]
    angle_3 = ang.angles[3]
  end
  if get_a
    v0 = der(frame_a.r_0)
    a0 = der(v0)
    connect(frame_a, acc_transform.frame_a)
    if case(resolve_in_frame, ResolveInFrame.FrameResolve)
      connect(frame_resolve, acc_transform.frame_resolve)
    end
    acc_transform.r_in_x = a0[1]
    acc_transform.r_in_y = a0[2]
    acc_transform.r_in_z = a0[3]
    a_x = acc_transform.r_out_x
    a_y = acc_transform.r_out_y
    a_z = acc_transform.r_out_z
  end
  if get_z
    w0 = angular_velocity1(frame_a.R)
    z0 = der(w0)
    connect(frame_a, angacc_transform.frame_a)
    if case(resolve_in_frame, ResolveInFrame.FrameResolve)
      connect(frame_resolve, angacc_transform.frame_resolve)
    end
    angacc_transform.r_in_x = z0[1]
    angacc_transform.r_in_y = z0[2]
    angacc_transform.r_in_z = z0[3]
    z_x = angacc_transform.r_out_x
    z_y = angacc_transform.r_out_y
    z_z = angacc_transform.r_out_z
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/OneFrameSensor.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "140"}
      },
      {"label": "abs sensor", "x": 500, "y": 680, "rot": 0}
    ]
  }
}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses