Skip to content
RotationalEMF.md

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:

v=kw

and

τ=ki

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:

NameDescriptionUnitsDefault value
kElectrical torque constant / back-EMF constantN.m/A

Connectors

Variables

NameDescriptionUnits
vVoltage drop between the two pinsV
iCurrent flowing from positive to negative pinA
phiAngle of shaft flange with respect to housing splinerad
wAngular velocity of flange relative to housing splinerad/s
tauTorque of flangeN.m

Behavior

v(t)=p.v(t)n.v(t)0=n.i(t)+p.i(t)i(t)=p.i(t)phi(t)=rotor.phi(t)housing.phi(t)w(t)=dphi(t)dtkw(t)=v(t)tau(t)=ki(t)tau(t)=rotor.tau(t)

Source

dyad
# 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
dyad
# 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.

julia
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"