Skip to content
LIBRARY
PlanarMechanics.CentrifugalTest.md

PlanarMechanics.CentrifugalTest

Centrifugal acceleration test: a body on a rotating arm with an AbsoluteVelocity sensor.

Translates the "AbsoluteAccCentrifugal" test from test_PlanarMechanics.jl. A body of mass 1 is attached via a 10m arm to a revolute joint spinning at w=10 rad/s with no gravity. The sensor measures absolute velocity in the world frame.

Usage

MultibodyComponents.PlanarMechanics.CentrifugalTest()

Behavior

[connect(world+frameb,revolute+framea)connect(revolute+frameb,rod+framea)connect(rod+frameb,body+framea)connect(body+framea,absv_sensor+frame_a)world.frameb.x(t)=0world.frameb.y(t)=0world.frameb.phi(t)=0connect(frameb,framevis+frame_a)world.framevis.phi(t)=world.framevis.frame_a.phi(t)world.framevis.x_shape.r(t)=arrayliteral([3],world.framevis.frame_a.x(t),world.framevis.frame_a.y(t),world.framevis.z_position)world.framevis.x_shape.R(t)=arrayliteral([33],cos(world.framevis.phi(t)),sin(world.framevis.phi(t)),0,sin(world.framevis.phi(t)),cos(world.framevis.phi(t)),0,0,0,1)world.framevis.x_shape.r_shape(t)=[000]world.framevis.x_shape.length_direction(t)=[100]world.framevis.x_shape.width_direction(t)=[001]world.framevis.x_shape.length(t)=world.framevis.axis_lengthworld.framevis.x_shape.width(t)=2world.framevis.axis_radiusworld.framevis.x_shape.height(t)=2world.framevis.axis_radiusworld.framevis.y_shape.r(t)=arrayliteral([3],world.framevis.frame_a.x(t),world.framevis.frame_a.y(t),world.framevis.z_position)world.framevis.y_shape.R(t)=arrayliteral([33],cos(world.framevis.phi(t)),sin(world.framevis.phi(t)),0,sin(world.framevis.phi(t)),cos(world.framevis.phi(t)),0,0,0,1)world.framevis.y_shape.r_shape(t)=[000]world.framevis.y_shape.length_direction(t)=[010]world.framevis.y_shape.width_direction(t)=[001]world.framevis.y_shape.length(t)=world.framevis.axis_lengthworld.framevis.y_shape.width(t)=2world.framevis.axis_radiusworld.framevis.y_shape.height(t)=2world.framevis.axis_radiusworld.framevis.z_shape.r(t)=arrayliteral([3],world.framevis.frame_a.x(t),world.framevis.frame_a.y(t),world.framevis.z_position)world.framevis.z_shape.R(t)=arrayliteral([33],cos(world.framevis.phi(t)),sin(world.framevis.phi(t)),0,sin(world.framevis.phi(t)),cos(world.framevis.phi(t)),0,0,0,1)world.framevis.z_shape.r_shape(t)=[000]world.framevis.z_shape.length_direction(t)=[001]world.framevis.z_shape.width_direction(t)=[100]world.framevis.z_shape.length(t)=world.framevis.axis_lengthworld.framevis.z_shape.width(t)=2world.framevis.axis_radiusworld.framevis.z_shape.height(t)=2world.framevis.axis_radiusrevolute.w(t)=drevolute.phi(t)dtrevolute.alpha(t)=drevolute.w(t)dtrevolute.framea.x(t)=revolute.frameb.x(t)revolute.framea.y(t)=revolute.frameb.y(t)revolute.framea.phi(t)+revolute.phi(t)=revolute.frameb.phi(t)revolute.frameb.fx(t)+revolute.framea.fx(t)=0revolute.framea.fy(t)+revolute.frameb.fy(t)=0revolute.frameb.tau(t)+revolute.framea.tau(t)=0revolute.framea.tau(t)=revolute.tau(t)revolute.flangea.phi(t)=revolute.phi(t)revolute.flangea.tau(t)=revolute.tau(t)revolute.shape.r(t)=arrayliteral([3],revolute.framea.x(t),revolute.framea.y(t),revolute.zposition)revolute.shape.R(t)=arrayliteral([33],cos(revolute.framea.phi(t)),sin(revolute.framea.phi(t)),0,sin(revolute.framea.phi(t)),cos(revolute.framea.phi(t)),0,0,0,1)revolute.shape.rshape(t)=arrayliteral([3],0,0,12revolute.cylinderlength)revolute.shape.lengthdirection(t)=[001]revolute.shape.widthdirection(t)=[100]revolute.shape.length(t)=revolute.cylinderlengthrevolute.shape.width(t)=2revolute.radiusrevolute.shape.height(t)=2revolute.radiusrod.phi(t)=rod.framea.phi(t)rod.w(t)=drod.phi(t)dtrod.r0(t)=arrayliteral([22],cos(rod.phi(t)),sin(rod.phi(t)),sin(rod.phi(t)),cos(rod.phi(t)))rod.rrod.r0(t)=arrayliteral([2],rod.framea.x(t)+rod.frameb.x(t),rod.frameb.y(t)rod.framea.y(t))rod.framea.phi(t)=rod.frameb.phi(t)rod.framea.fx(t)+rod.frameb.fx(t)=0rod.frameb.fy(t)+rod.framea.fy(t)=0rod.framea.tau(t)+rod.frameb.tau(t)+rod.r01(t)rod.frameb.fy(t)rod.r02(t)rod.frameb.fx(t)=0rod.shape.r(t)=arrayliteral([3],rod.framea.x(t),rod.framea.y(t),rod.zposition)rod.shape.R(t)=arrayliteral([33],1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0)rod.shape.rshape(t)=[000]rod.shape.lengthdirection(t)=arrayliteral([3],rod.r01(t)rod.l,rod.r02(t)rod.l,0)rod.shape.widthdirection(t)=[001]rod.shape.length(t)=rod.lrod.shape.width(t)=2rod.radiusrod.shape.height(t)=2rod.radiusbody.r(t)=arrayliteral([2],body.framea.x(t),body.framea.y(t))body.v(t)=dbody.r(t)dtbody.phi(t)=body.framea.phi(t)body.w(t)=dbody.phi(t)dtbody.a(t)=dbody.v(t)dtbody.alpha(t)=dbody.w(t)dtbody.f(t)=arrayliteral([2],body.framea.fx(t),body.framea.fy(t))body.f(t)+arrayliteral([2],body.mgn2d1,body.mgn2d2)=body.mbody.a(t)body.Ibody.alpha(t)=body.framea.tau(t)body.shape.r(t)=arrayliteral([3],body.framea.x(t),body.framea.y(t),body.zposition)body.shape.R(t)=arrayliteral([33],cos(body.phi(t)),sin(body.phi(t)),0,sin(body.phi(t)),cos(body.phi(t)),0,0,0,1)body.shape.rshape(t)=[000]body.shape.lengthdirection(t)=[001]body.shape.widthdirection(t)=[100]body.shape.length(t)=2body.radiusbody.shape.width(t)=2body.radiusbody.shape.height(t)=2body.radiusabsv_sensor.px(t)=absv_sensor.pos.x(t)absv_sensor.py(t)=absv_sensor.pos.y(t)absv_sensor.pphi(t)=absv_sensor.pos.phi(t)absv_sensor.transform.x_in(t)=dabsv_sensor.px(t)dtabsv_sensor.transform.y_in(t)=dabsv_sensor.py(t)dtabsv_sensor.transform.phi_in(t)=dabsv_sensor.pphi(t)dtabsv_sensor.v_x(t)=absv_sensor.transform.x_out(t)absv_sensor.v_y(t)=absv_sensor.transform.y_out(t)absv_sensor.w(t)=absv_sensor.transform.phi_out(t)connect(framea,pos+framea)connect(framea,transform+framea)absv_sensor.pos.frame_a.fx(t)=0absv_sensor.pos.frame_a.fy(t)=0absv_sensor.pos.frame_a.tau(t)=0arrayliteral([3],absv_sensor.pos.x(t),absv_sensor.pos.y(t),absv_sensor.pos.phi(t))=absv_sensor.pos.r(t)absv_sensor.pos.r(t)=arrayliteral([3],absv_sensor.pos.frame_a.x(t),absv_sensor.pos.frame_a.y(t),absv_sensor.pos.frame_a.phi(t))absv_sensor.transform.frame_a.fx(t)=0absv_sensor.transform.frame_a.fy(t)=0absv_sensor.transform.frame_a.tau(t)=0absv_sensor.transform.x_out(t)=absv_sensor.transform.x_in(t)absv_sensor.transform.y_out(t)=absv_sensor.transform.y_in(t)absv_sensor.transform.phi_out(t)=absv_sensor.transform.phi_in(t)]

Source

dyad
"""
Centrifugal acceleration test: a body on a rotating arm with an AbsoluteVelocity sensor.

Translates the "AbsoluteAccCentrifugal" test from test_PlanarMechanics.jl.
A body of mass 1 is attached via a 10m arm to a revolute joint spinning at w=10 rad/s
with no gravity. The sensor measures absolute velocity in the world frame.
"""
test component CentrifugalTest
  world = World(g = 0) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 90, "y1": 450, "x2": 190, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  revolute = Revolute() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 230, "y1": 450, "x2": 330, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  rod = FixedTranslation(r = [10.0, 0.0]) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 390, "y1": 450, "x2": 490, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  body = Body(m = 1.0, I = 0.1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 530, "y1": 450, "x2": 630, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  abs_v_sensor = AbsoluteVelocity(resolve_in_frame = ResolveInFrame.World()) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 790, "y1": 450, "x2": 890, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
relations
  initial revolute.phi = 0.0
  initial revolute.w = 10.0
  connect(world.frame_b, revolute.frame_a) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(revolute.frame_b, rod.frame_a) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(rod.frame_b, body.frame_a)
  connect(body.frame_a, abs_v_sensor.frame_a)
metadata {"Dyad": {"tests": {"case1": {"stop": 3}}}}
end
Flattened Source
dyad
"""
Centrifugal acceleration test: a body on a rotating arm with an AbsoluteVelocity sensor.

Translates the "AbsoluteAccCentrifugal" test from test_PlanarMechanics.jl.
A body of mass 1 is attached via a 10m arm to a revolute joint spinning at w=10 rad/s
with no gravity. The sensor measures absolute velocity in the world frame.
"""
test component CentrifugalTest
  world = World(g = 0) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 90, "y1": 450, "x2": 190, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  revolute = Revolute() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 230, "y1": 450, "x2": 330, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  rod = FixedTranslation(r = [10.0, 0.0]) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 390, "y1": 450, "x2": 490, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  body = Body(m = 1.0, I = 0.1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 530, "y1": 450, "x2": 630, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  abs_v_sensor = AbsoluteVelocity(resolve_in_frame = ResolveInFrame.World()) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 790, "y1": 450, "x2": 890, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
relations
  initial revolute.phi = 0.0
  initial revolute.w = 10.0
  connect(world.frame_b, revolute.frame_a) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(revolute.frame_b, rod.frame_a) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(rod.frame_b, body.frame_a)
  connect(body.frame_a, abs_v_sensor.frame_a)
metadata {"Dyad": {"tests": {"case1": {"stop": 3}}}}
end


Test Cases

Test Case case1