PlanarMechanics.Prismatic
Prismatic (sliding) joint allowing translation along a fixed direction.
The sliding direction is given by parameter r, rotated by frame_a's orientation. Without axisflange support, the joint slides freely (f = 0).
This component extends from PartialTwoFrames This component extends from MultibodyComponents.Renderable
Usage
MultibodyComponents.PlanarMechanics.Prismatic(render=true, color=[0, 0.8, 1, 1], specular_coefficient=0.7, r=[1, 0], box_width=0.08, box_height=0.08, z_position=0)
Parameters:
| Name | Description | Units | Default value |
|---|---|---|---|
render | – | true | |
color | – | [0, 0.8, 1, 1] | |
specular_coefficient | – | 0.7 | |
r | Direction of the rod wrt. body system at phi=0 | m | [1, 0] |
box_width | Half-width of the box in animations | – | 0.08 |
box_height | Half-height of the box in animations | – | 0.08 |
z_position | z-position of the box in animations | – | 0 |
Connectors
frame_a- 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)
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)
Variables
| Name | Description | Units |
|---|---|---|
s | Joint coordinate | m |
v | m/s | |
a | m/s2 | |
f | N | |
e0 | – | |
r0 | Translation vector of the prismatic rod resolved w.r.t. inertial frame | m |
Behavior
Dict{MIME{Symbol("text/plain")}, String} with 1 entry: MIME type text/plain => "Error displaying result"
Source
"""
Prismatic (sliding) joint allowing translation along a fixed direction.
The sliding direction is given by parameter `r`, rotated by frame_a's orientation.
Without axisflange support, the joint slides freely (`f = 0`).
"""
component Prismatic
extends PartialTwoFrames
extends MultibodyComponents.Renderable(color = [0, 0.8, 1, 1])
"Visualization shape for the prismatic rod"
shape = MultibodyComponents.BoxShape(render = render, color = color)
"Direction of the rod wrt. body system at phi=0"
parameter r::Length[2] = [1, 0]
"Half-width of the box in animations"
parameter box_width::Real = 0.08
"Half-height of the box in animations"
parameter box_height::Real = 0.08
"z-position of the box in animations"
parameter z_position::Real = 0
"Joint coordinate"
variable s::Length(statePriority = 2)
variable v::Velocity(statePriority = 2)
variable a::Acceleration
variable f::Dyad.Force
variable e0::Real[2]
"Translation vector of the prismatic rod resolved w.r.t. inertial frame"
variable r0::Length[2]
relations
# Rotate the unit direction by frame_a angle
e0 = [[cos(frame_a.phi), -sin(frame_a.phi)], [sin(frame_a.phi), cos(frame_a.phi)]] * (r / norm(r))
r0 = e0 * s
v = der(s)
a = der(v)
# position constraint
frame_a.x + r0[1] = frame_b.x
frame_a.y + r0[2] = frame_b.y
# orientation rigidly transferred
frame_a.phi = frame_b.phi
# force balance
frame_a.fx + frame_b.fx = 0
frame_a.fy + frame_b.fy = 0
# torque balance with lever arm
frame_a.tau + frame_b.tau + r0[1] * frame_b.fy - r0[2] * frame_b.fx = 0
# joint force along sliding direction
e0[1] * frame_a.fx + e0[2] * frame_a.fy = f
# free sliding (no axisflange)
f = 0
# set shape position and orientation (2D lifted to 3D)
shape.r = [0, 0, 0]
shape.R = MultibodyComponents.RR(MultibodyComponents.nullrotation())
shape.r_shape = [frame_a.x, frame_a.y, z_position]
shape.length_direction = [e0[1], e0[2], 0]
shape.width_direction = [0, 0, 1]
shape.length = s
shape.width = box_width
shape.height = box_height
metadata {"Dyad": {"icons": {"default": "dyad://MultibodyComponents/Prismatic.svg"}}}
endFlattened Source
"""
Prismatic (sliding) joint allowing translation along a fixed direction.
The sliding direction is given by parameter `r`, rotated by frame_a's orientation.
Without axisflange support, the joint slides freely (`f = 0`).
"""
component Prismatic
frame_a = Frame2D() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 50, "y1": 450, "x2": 150, "y2": 550, "rot": 0}
},
"tags": []
}
}
frame_b = Frame2D() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 850, "y1": 450, "x2": 950, "y2": 550, "rot": 0}
},
"tags": []
}
}
parameter render::Boolean = true
parameter color::Real[4] = [0.5, 0.5, 0.5, 1.0]
parameter specular_coefficient::Real = 0.7
"Visualization shape for the prismatic rod"
shape = MultibodyComponents.BoxShape(render = render, color = color)
"Direction of the rod wrt. body system at phi=0"
parameter r::Length[2] = [1, 0]
"Half-width of the box in animations"
parameter box_width::Real = 0.08
"Half-height of the box in animations"
parameter box_height::Real = 0.08
"z-position of the box in animations"
parameter z_position::Real = 0
"Joint coordinate"
variable s::Length(statePriority = 2)
variable v::Velocity(statePriority = 2)
variable a::Acceleration
variable f::Dyad.Force
variable e0::Real[2]
"Translation vector of the prismatic rod resolved w.r.t. inertial frame"
variable r0::Length[2]
relations
# Rotate the unit direction by frame_a angle
e0 = [[cos(frame_a.phi), -sin(frame_a.phi)], [sin(frame_a.phi), cos(frame_a.phi)]] * (r / norm(r))
r0 = e0 * s
v = der(s)
a = der(v)
# position constraint
frame_a.x + r0[1] = frame_b.x
frame_a.y + r0[2] = frame_b.y
# orientation rigidly transferred
frame_a.phi = frame_b.phi
# force balance
frame_a.fx + frame_b.fx = 0
frame_a.fy + frame_b.fy = 0
# torque balance with lever arm
frame_a.tau + frame_b.tau + r0[1] * frame_b.fy - r0[2] * frame_b.fx = 0
# joint force along sliding direction
e0[1] * frame_a.fx + e0[2] * frame_a.fy = f
# free sliding (no axisflange)
f = 0
# set shape position and orientation (2D lifted to 3D)
shape.r = [0, 0, 0]
shape.R = MultibodyComponents.RR(MultibodyComponents.nullrotation())
shape.r_shape = [frame_a.x, frame_a.y, z_position]
shape.length_direction = [e0[1], e0[2], 0]
shape.width_direction = [0, 0, 1]
shape.length = s
shape.width = box_width
shape.height = box_height
metadata {"Dyad": {"icons": {"default": "dyad://MultibodyComponents/Prismatic.svg"}}}
endTest Cases
No test cases defined.
Related
Examples
Experiments
Analyses