RotationalEMF
An ideal electromechanical transducer coupling electrical voltage and current to rotational mechanical torque and angular velocity.
This component models an ideal rotational electromotive force (EMF) device, acting as a bidirectional energy converter between the electrical and rotational mechanical domains. It establishes a relationship where the induced voltage (v
) across its electrical terminals is directly proportional to the angular velocity (w
) of its rotor, and conversely, the torque (\tau
) generated on the rotor is directly proportional to the current (i
) flowing through its electrical terminals. The constant of proportionality for these relationships is the electrical torque constant, k
. The mechanical rotation and torque are defined relative to a housing or support structure. The defining equations for its behavior are:
and
The negative sign in the torque equation is a convention related to motor action and the defined positive directions of current and torque.
Usage
RotationalEMF(k)
Parameters:
Name | Description | Units | Default value |
---|---|---|---|
k | Electrical torque constant / back-EMF constant | N.m/A |
Connectors
Variables
Name | Description | Units |
---|---|---|
v | Voltage drop between the two pins | V |
i | Current flowing from positive to negative pin | A |
phi | Angle of shaft flange with respect to housing spline | rad |
w | Angular velocity of flange relative to housing spline | rad/s |
tau | Torque of flange | N.m |
Behavior
Source
# An ideal electromechanical transducer coupling electrical voltage and current to rotational mechanical torque and angular velocity.
#
# This component models an ideal rotational electromotive force (EMF) device, acting as a bidirectional
# energy converter between the electrical and rotational mechanical domains. It establishes a relationship
# where the induced voltage (`v`) across its electrical terminals is directly proportional to the angular velocity
# (`w`) of its rotor, and conversely, the torque (`\tau`) generated on the rotor is directly proportional to the current
# (`i`) flowing through its electrical terminals. The constant of proportionality for these relationships is the
# electrical torque constant, `k`. The mechanical rotation and torque are defined relative to a
# housing or support structure.
# The defining equations for its behavior are:
#
# ```math
# v = k \cdot w
# ```
#
# and
#
# ```math
# \tau = -k \cdot i
# ```
#
# The negative sign in the torque equation is a convention related to motor action and the defined positive
# directions of current and torque.
component RotationalEMF
# Positive electrical pin
p = Pin() [{
"Dyad": {
"placement": {"icon": {"iconName": "pos", "x1": 450, "y1": -50, "x2": 550, "y2": 50}}
}
}]
# Negative electrical pin
n = Pin() [{
"Dyad": {
"placement": {"icon": {"iconName": "neg", "x1": 450, "y1": 950, "x2": 550, "y2": 1050}}
}
}]
# Rotor spline
rotor = Spline() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
# Housing (support) of the emf shaft
housing = Spline() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
# Electrical torque constant / back-EMF constant
parameter k::ElectricalTorqueConstant
# Voltage drop between the two pins
variable v::Voltage
# Current flowing from positive to negative pin
variable i::Current
# Angle of shaft flange with respect to housing spline
variable phi::Angle
# Angular velocity of flange relative to housing spline
variable w::AngularVelocity
# Torque of flange
variable tau::Torque
relations
v = p.v-n.v
0 = p.i+n.i
i = p.i
phi = rotor.phi-housing.phi
w = der(phi)
k*w = v
tau = -k*i
tau = rotor.tau
end
Flattened Source
# An ideal electromechanical transducer coupling electrical voltage and current to rotational mechanical torque and angular velocity.
#
# This component models an ideal rotational electromotive force (EMF) device, acting as a bidirectional
# energy converter between the electrical and rotational mechanical domains. It establishes a relationship
# where the induced voltage (`v`) across its electrical terminals is directly proportional to the angular velocity
# (`w`) of its rotor, and conversely, the torque (`\tau`) generated on the rotor is directly proportional to the current
# (`i`) flowing through its electrical terminals. The constant of proportionality for these relationships is the
# electrical torque constant, `k`. The mechanical rotation and torque are defined relative to a
# housing or support structure.
# The defining equations for its behavior are:
#
# ```math
# v = k \cdot w
# ```
#
# and
#
# ```math
# \tau = -k \cdot i
# ```
#
# The negative sign in the torque equation is a convention related to motor action and the defined positive
# directions of current and torque.
component RotationalEMF
# Positive electrical pin
p = Pin() [{
"Dyad": {
"placement": {"icon": {"iconName": "pos", "x1": 450, "y1": -50, "x2": 550, "y2": 50}}
}
}]
# Negative electrical pin
n = Pin() [{
"Dyad": {
"placement": {"icon": {"iconName": "neg", "x1": 450, "y1": 950, "x2": 550, "y2": 1050}}
}
}]
# Rotor spline
rotor = Spline() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
# Housing (support) of the emf shaft
housing = Spline() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
# Electrical torque constant / back-EMF constant
parameter k::ElectricalTorqueConstant
# Voltage drop between the two pins
variable v::Voltage
# Current flowing from positive to negative pin
variable i::Current
# Angle of shaft flange with respect to housing spline
variable phi::Angle
# Angular velocity of flange relative to housing spline
variable w::AngularVelocity
# Torque of flange
variable tau::Torque
relations
v = p.v-n.v
0 = p.i+n.i
i = p.i
phi = rotor.phi-housing.phi
w = der(phi)
k*w = v
tau = -k*i
tau = rotor.tau
metadata {}
end
Test Cases
This is setup code, that must be run before each test case.
using ElectricalComponents
using ModelingToolkit, OrdinaryDiffEqDefault
using Plots
using CSV, DataFrames
snapshotsdir = joinpath(dirname(dirname(pathof(ElectricalComponents))), "test", "snapshots")
"/home/actions-runner-10/.julia/packages/ElectricalComponents/bmmPM/test/snapshots"
Related
Examples
Experiments
Analyses
Tests