IdealGear
An ideal mechanical gear unit with a fixed housing, connecting two rotational shafts.
This component models a lossless gearbox with a user-defined gear ratio, connecting two mechanical rotational splines, spline_a
and spline_b
. The housing of the gear is assumed to be rigidly connected to a support. The kinematic relationship between the relative angle of shaft 'a' and shaft 'b' with respect to the support is given by:
The corresponding torque relationship, assuming an ideal (lossless) transmission, is:
where spline_a
and spline_b
respectively. The relative angles are defined as:
This component extends from PartialElementaryTwoSplinesAndSupport
Usage
IdealGear(ratio)
Parameters:
Name | Description | Units | Default value |
---|---|---|---|
ratio | The fixed transmission ratio between shaft 'a' and shaft 'b' (phi_a / phi_b) | – |
Connectors
Variables
Name | Description | Units |
---|---|---|
phi_support | Variable for the absolute angle of the support spline | rad |
phi_a | Relative angle of shaft 'a' with respect to the support | rad |
phi_b | Relative angle of shaft 'b' with respect to the support | rad |
Behavior
Source
# An ideal mechanical gear unit with a fixed housing, connecting two rotational shafts.
#
# This component models a lossless gearbox with a user-defined gear ratio,
# connecting two mechanical rotational splines, `spline_a` and `spline_b`.
# The housing of the gear is assumed to be rigidly connected to a support.
# The kinematic relationship between the relative angle of shaft 'a' and shaft 'b'
# with respect to the support is given by:
# ```math
# \\phi_a = ratio \\cdot \\phi_b
# ```
# The corresponding torque relationship, assuming an ideal (lossless) transmission, is:
# ```math
# \text{ratio} \\cdot \\tau_a + \\tau_b = 0
# ```
# where \$\tau_a\$ and \$\tau_b\$ are the torques at `spline_a` and `spline_b` respectively.
# The relative angles are defined as:
# ```math
# \\phi_a = \text{spline\\_a}.\\phi - \\phi\\_\text{support}
# ```
# ```math
# \\phi_b = \text{spline}\\_b.\\phi - \\phi\\_\text{support}
# ```
component IdealGear
extends PartialElementaryTwoSplinesAndSupport
# The fixed transmission ratio between shaft 'a' and shaft 'b' (phi_a / phi_b)
parameter ratio::Real
# Relative angle of shaft 'a' with respect to the support
variable phi_a::Angle
# Relative angle of shaft 'b' with respect to the support
variable phi_b::Angle
relations
phi_a = spline_a.phi-phi_support
phi_b = spline_b.phi-phi_support
phi_a = ratio*phi_b
0 = ratio*spline_a.tau+spline_b.tau
metadata {"Dyad": {"icons": {"default": "dyad://RotationalComponents/IdealGear.svg"}}}
end
Flattened Source
# An ideal mechanical gear unit with a fixed housing, connecting two rotational shafts.
#
# This component models a lossless gearbox with a user-defined gear ratio,
# connecting two mechanical rotational splines, `spline_a` and `spline_b`.
# The housing of the gear is assumed to be rigidly connected to a support.
# The kinematic relationship between the relative angle of shaft 'a' and shaft 'b'
# with respect to the support is given by:
# ```math
# \\phi_a = ratio \\cdot \\phi_b
# ```
# The corresponding torque relationship, assuming an ideal (lossless) transmission, is:
# ```math
# \text{ratio} \\cdot \\tau_a + \\tau_b = 0
# ```
# where \$\tau_a\$ and \$\tau_b\$ are the torques at `spline_a` and `spline_b` respectively.
# The relative angles are defined as:
# ```math
# \\phi_a = \text{spline\\_a}.\\phi - \\phi\\_\text{support}
# ```
# ```math
# \\phi_b = \text{spline}\\_b.\\phi - \\phi\\_\text{support}
# ```
component IdealGear
# First rotational 1-dimensional shaft spline connector (flange_a)
spline_a = Spline() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
# Second rotational 1-dimensional shaft spline connector (flange_b)
spline_b = Spline() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
# Support spline connector, typically for housing or reaction torques
support = Spline() [{
"Dyad": {
"placement": {"icon": {"iconName": "support", "x1": 450, "y1": 950, "x2": 550, "y2": 1050}}
}
}]
# Variable for the absolute angle of the support spline
variable phi_support::Angle
# The fixed transmission ratio between shaft 'a' and shaft 'b' (phi_a / phi_b)
parameter ratio::Real
# Relative angle of shaft 'a' with respect to the support
variable phi_a::Angle
# Relative angle of shaft 'b' with respect to the support
variable phi_b::Angle
relations
support.phi = phi_support
support.tau = -spline_a.tau-spline_b.tau
phi_a = spline_a.phi-phi_support
phi_b = spline_b.phi-phi_support
phi_a = ratio*phi_b
0 = ratio*spline_a.tau+spline_b.tau
metadata {"Dyad": {"icons": {"default": "dyad://RotationalComponents/IdealGear.svg"}}}
end
Test Cases
This is setup code, that must be run before each test case.
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