RackAndPinion
Models an ideal rack and pinion system, converting rotational motion to translational motion.
This component represents a one-dimensional, inertia-less rack and pinion mechanism. It establishes a kinematic relationship between the rotation of the pinion (circular gear) and the translation of the rack (linear gear). The core behavior is inherited from the IdealRollingWheel
component. This model assumes no slip between the rack and pinion and neglects any inertial effects.
This component extends from PartialElementaryRotationalToTranslational
Usage
RackAndPinion(radius)
Parameters:
Name | Description | Units | Default value |
---|---|---|---|
radius | Specifies the radius of the pinion gear, determining the kinematic relationship between rotational and translational motion. | m |
Connectors
Behavior
Source
dyad
# Models an ideal rack and pinion system, converting rotational motion to translational motion.
#
# This component represents a one-dimensional, inertia-less rack and pinion mechanism.
# It establishes a kinematic relationship between the rotation of the pinion
# (circular gear) and the translation of the rack (linear gear). The core behavior
# is inherited from the `IdealRollingWheel` component. This model assumes no slip
# between the rack and pinion and neglects any inertial effects.
component RackAndPinion
extends PartialElementaryRotationalToTranslational
# Specifies the radius of the pinion gear, determining the kinematic relationship between rotational and translational motion.
parameter radius::Length
relations
(spline.phi-support_r.phi)*radius = flange.s-support_t.s
0 = radius*flange.f+spline.tau
metadata {
"Dyad": {"icons": {"default": "dyad://RotationalComponents/IdealRollingWheel.svg"}}
}
end
Flattened Source
dyad
# Models an ideal rack and pinion system, converting rotational motion to translational motion.
#
# This component represents a one-dimensional, inertia-less rack and pinion mechanism.
# It establishes a kinematic relationship between the rotation of the pinion
# (circular gear) and the translation of the rack (linear gear). The core behavior
# is inherited from the `IdealRollingWheel` component. This model assumes no slip
# between the rack and pinion and neglects any inertial effects.
component RackAndPinion
# Primary rotational mechanical interface
spline = Spline() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
# Primary translational mechanical interface
flange = Flange() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
# Rotational mechanical support interface (e.g., for housing)
support_r = Spline() [{"Dyad": {"placement": {"icon": {"x1": 100, "y1": 950, "x2": 200, "y2": 1050}}}}]
# Translational mechanical support interface (e.g., for housing)
support_t = Flange() [{"Dyad": {"placement": {"icon": {"x1": 800, "y1": 950, "x2": 900, "y2": 1050}}}}]
# Specifies the radius of the pinion gear, determining the kinematic relationship between rotational and translational motion.
parameter radius::Length
relations
(spline.phi-support_r.phi)*radius = flange.s-support_t.s
0 = radius*flange.f+spline.tau
metadata {
"Dyad": {"icons": {"default": "dyad://RotationalComponents/IdealRollingWheel.svg"}}
}
end
Test Cases
This is setup code, that must be run before each test case.
julia
using RotationalComponents
using ModelingToolkit, OrdinaryDiffEqDefault
using Plots
using CSV, DataFrames
snapshotsdir = joinpath(dirname(dirname(pathof(RotationalComponents))), "test", "snapshots")
"/home/actions-runner-10/.julia/packages/RotationalComponents/0VPxm/test/snapshots"
Related
Examples
Experiments
Analyses