TExcelTAD
Home › Control Systems & Automation › Electrical and Mechanical Models and Their Analogies

Electrical and Mechanical Models and Their Analogies

A control engineer is handed a machine before a controller: a print head on a belt, a camera gimbal, a loudspeaker cone, a filter circuit. Before any design, the machine has to become equations. The good news is that most of them are built from a handful of ideal elements, each with one law, joined by one kind of balance (Kirchhoff's laws for circuits, Newton's law for mechanics). Electrical and mechanical systems even share the same equations, so a mechanical engineer's mass-spring-damper and an electrical engineer's RLC circuit are the same problem in different units. This lesson builds both and shows the analogy that lets you test a mechanical idea on a breadboard.

The ideal elements

Domain Effort (across) Flow (through) Store of kinetic-like energy Store of potential-like energy Dissipator
electrical voltage vv current ii inductor v=Ldidtv = L\frac{di}{dt} capacitor i=Cdvdti = C\frac{dv}{dt} resistor v=Riv = Ri
translational force FF velocity x˙\dot x mass F=mx¨F = m\ddot x spring F=kxF = kx damper F=bx˙F = b\dot x
rotational torque τ\tau angular velocity ω\omega inertia τ=Jω˙\tau = J\dot\omega torsion spring τ=kθ\tau = k\theta rotary damper τ=bω\tau = b\omega

The circuit elements were covered in Circuit Theory, the mechanical ones in Mechanical Vibrations. Here the point is method: write one balance equation per independent energy store, and the order of the model equals the number of independent stores.

Two systems, one equation

k = 200 N/m b = 4 N s/m m = 0.5 kg F x mechanical + - v R = 4 Ohm L = 0.5 H C = 5 mF i electrical (force-voltage analogue)

Mass-spring-damper. Newton's law for the mass, with the spring and damper pulling back:

mx¨+bx˙+kx=F⟹X(s)F(s)=1ms2+bs+km\ddot x + b\dot x + kx = F \quad \Longrightarrow \quad \frac{X(s)}{F(s)} = \frac{1}{m s^2 + b s + k}

Series RLC, written for the charge qq on the capacitor (i=q˙i = \dot q), with Kirchhoff's voltage law:

Lq¨+Rq˙+1Cq=v⟹Q(s)V(s)=1Ls2+Rs+1/CL\ddot q + R\dot q + \frac{1}{C}q = v \quad \Longrightarrow \quad \frac{Q(s)}{V(s)} = \frac{1}{L s^2 + R s + 1/C}

The equations are identical under the force-voltage analogy: m↔Lm \leftrightarrow L, b↔Rb \leftrightarrow R, k↔1/Ck \leftrightarrow 1/C, F↔vF \leftrightarrow v, x↔qx \leftrightarrow q, x˙↔i\dot x \leftrightarrow i. Both are the standard second-order system

ωn=km=1LC,ζ=b2km=R2CL\omega_n = \sqrt{\frac{k}{m}} = \frac{1}{\sqrt{LC}}, \qquad \zeta = \frac{b}{2\sqrt{km}} = \frac{R}{2}\sqrt{\frac{C}{L}}

(The alternative force-current analogy maps mass to capacitance and keeps the circuit's topology the same as the mechanical drawing: masses become capacitors to ground. It is handy for networks of masses; the force-voltage one is easier to remember.)

The rotational version is the same again: Jθ¨+bθ˙+kθ=τJ\ddot\theta + b\dot\theta + k\theta = \tau. A gear pair with ratio N=θmotor/θloadN = \theta_\text{motor}/\theta_\text{load} reflects a load inertia to the motor shaft as Jload/N2J_\text{load}/N^2 (and a load damping as bload/N2b_\text{load}/N^2), which is how the DC motor lesson handles a gearbox.

Worked example: a positioning stage

Given: a stage of mass m=0.5 kgm = 0.5\ \text{kg} on a spring of k=200 N/mk = 200\ \text{N/m} with viscous damping b=4 N⋅s/mb = 4\ \text{N} \cdot \text{s/m}, pushed by a step force of 10 N10\ \text{N}.

Find: ωn\omega_n, ζ\zeta, the final displacement, the peak displacement and its time; the RLC analogue.

Solve:

  • ωn=200/0.5=20 rad/s\omega_n = \sqrt{200/0.5} = 20\ \text{rad/s} (3.18 Hz3.18\ \text{Hz}); ζ=4/(2200×0.5)=0.2\zeta = 4/(2\sqrt{200 \times 0.5}) = 0.2.
  • Final displacement F/k=10/200=0.050 mF/k = 10/200 = 0.050\ \text{m}.
  • Overshoot e−πζ/1−ζ2=52.7 %e^{-\pi\zeta/\sqrt{1 - \zeta^2}} = 52.7\,\%, so the peak is 0.050×1.527=0.0763 m0.050 \times 1.527 = 0.0763\ \text{m} at tp=π/(ωn1−ζ2)=0.160 st_p = \pi/(\omega_n\sqrt{1 - \zeta^2}) = 0.160\ \text{s}.
  • Analogue: L=0.5 HL = 0.5\ \text{H}, R=4 ΩR = 4\ \Omega, C=1/k=5 mFC = 1/k = 5\ \text{mF}, driven by a 10 V10\ \text{V} step: the capacitor charge follows x(t)x(t) with qfinal=Cv=0.050 Cq_\text{final} = Cv = 0.050\ \text{C}, i.e. the capacitor voltage q/Cq/C settles at 10 V10\ \text{V} with the same 52.7 %52.7\,\% overshoot.

Check: the program integrates the mechanical ODE with solve_ivp and steps the RLC transfer function with python-control.

python · try it yourself
import numpy as np
from scipy.integrate import solve_ivp
import control as ct

m, b, k, F = 0.5, 4.0, 200.0, 10.0
def stage(t, s):                         # s = [x, xdot]
    x, v = s
    return [v, (F - b * v - k * x) / m]
t = np.linspace(0, 2, 20001)
sol = solve_ivp(stage, (0, 2), [0, 0], t_eval=t, rtol=1e-9, atol=1e-12)
x = sol.y[0]
i = np.argmax(x)
print(f"mechanical: peak x = {x[i]:.4f} m at t = {t[i]:.4f} s, x(2 s) = {x[-1]:.4f} m")

L, R, C = m, b, 1 / k                    # force-voltage analogue
G = ct.tf([1 / C], [L, R, 1 / C])        # v_C(s) / v(s)
resp = ct.step_response(10 * G, T=t)
vc = resp.outputs
j = np.argmax(vc)
print(f"electrical: peak vC = {vc[j]:.3f} V at t = {t[j]:.4f} s -> q = C vC = {C * vc[j]:.4f} C")
wn, zeta = np.sqrt(k / m), b / (2 * np.sqrt(k * m))
print(f"wn = {wn:.2f} rad/s, zeta = {zeta:.3f}, overshoot {100 * np.exp(-np.pi * zeta / np.sqrt(1 - zeta**2)):.1f} %")
mechanical: peak x = 0.0763 m at t = 0.1603 s, x(2 s) = 0.0500 m
electrical: peak vC = 15.266 V at t = 0.1603 s -> q = C vC = 0.0763 C
wn = 20.00 rad/s, zeta = 0.200, overshoot 52.7 %

The charge on the capacitor and the position of the stage agree to the last printed digit: they are the same equation.

In the lab: the analogue on a breadboard scale

A real breadboard RLC uses millihenries and nanofarads, so its time scale is microseconds, but the damping ratio is what shapes the response. With L=10 mHL = 10\ \text{mH}, C=100 nFC = 100\ \text{nF} and R=126 ΩR = 126\ \Omega the RLC lab's step view shows ζ=0.1992\zeta = 0.1992, overshoot 52.80 %52.80\,\% and a peak time of 101.4 μs101.4\ \mu\text{s}: the stage's response, 15801580 times faster (ωd=30.99 krad/s\omega_d = 30.99\ \text{krad/s} instead of 19.6 rad/s19.6\ \text{rad/s}). Raise RR to 632.5 Ω632.5\ \Omega (the lab's "R for ζ=1\zeta = 1") for the critically damped stage, the stiffest one that does not overshoot.

0.000.501.001.500200 us400 us600 us800 ustvC (V)underdamped, zeta = 0.199peak +52.8 % at 101 usvC(t) after a step of V at t = 0envelopecritical R = 2 sqrt(L/C) = 632 Ohm

Guided lab: identify a spring-mass system

Hand calculation. A 200 g200\ \text{g} mass on a light spring of k=20 N/mk = 20\ \text{N/m} hanging from a stand has ωn=10 rad/s\omega_n = 10\ \text{rad/s}, a period of 0.628 s0.628\ \text{s}. If successive peaks of the free oscillation shrink by a ratio of 0.800.80, the log decrement δ=ln⁡(1/0.8)=0.223\delta = \ln(1/0.8) = 0.223 gives ζ=δ/4π2+δ2=0.0355\zeta = \delta/\sqrt{4\pi^2 + \delta^2} = 0.0355 and b=2ζkm=0.142 N⋅s/mb = 2\zeta\sqrt{km} = 0.142\ \text{N} \cdot \text{s/m}.

Simulation. Put m=0.2m = 0.2, k=20k = 20, b=0.142b = 0.142 and F=0F = 0 with an initial displacement of 0.05 m0.05\ \text{m} in the program and check the peak ratio.

What you would measure. Log the position with a phone's slow-motion video against a ruler, or an ultrasonic or time-of-flight distance sensor read by a USB microcontroller at 100 Hz100\ \text{Hz}. Expect the period within about 3 %3\,\% of 0.628 s0.628\ \text{s} (the spring's own mass adds roughly a third of its mass to mm) and a peak ratio that drifts at small amplitudes, because real friction is partly dry (Coulomb), not viscous.

Hazards and safe setup. A stretched spring stores energy: clamp the stand, use safety glasses when stretching, keep the mass small. No electrical hazard beyond the USB-powered sensor. For the electrical twin, a function generator at a few volts is enough; the inductor's flyback at a square-wave edge stays within the generator's output range with RR in series.

Pitfalls

  • Mixing analogies halfway (mass as inductance but spring as resistance): pick one mapping and use it for every element.
  • Forgetting that a spring is kk but its analogue is 1/C1/C: a stiffer spring is a smaller capacitor.
  • Counting energy stores that are not independent: two capacitors in parallel are one store, two springs in series are one spring.
  • Assuming friction is viscous because the model needs it to be: the nonlinearities lesson treats dry friction and backlash.

Practice

  1. A rotor with J=2×10−5 kg⋅m2J = 2 \times 10^{-5}\ \text{kg} \cdot \text{m}^2 on a torsion spring of 0.05 N⋅m/rad0.05\ \text{N} \cdot \text{m/rad} and damping 1×10−4 N⋅m⋅s1 \times 10^{-4}\ \text{N} \cdot \text{m} \cdot \text{s}. Find ωn\omega_n and ζ\zeta.
  2. Give the force-voltage analogue of a 2 kg2\ \text{kg} mass, b=10 N⋅s/mb = 10\ \text{N} \cdot \text{s/m}, k=500 N/mk = 500\ \text{N/m}.
  3. A load inertia of 1×10−3 kg⋅m21 \times 10^{-3}\ \text{kg} \cdot \text{m}^2 is driven through a 20:1 gearbox. What inertia does the motor see?
Answer
  1. ωn=0.05/2×10−5=50 rad/s\omega_n = \sqrt{0.05/2 \times 10^{-5}} = 50\ \text{rad/s}; ζ=10−4/(20.05×2×10−5)=0.05\zeta = 10^{-4}/(2\sqrt{0.05 \times 2 \times 10^{-5}}) = 0.05.
  2. L=2 HL = 2\ \text{H}, R=10 ΩR = 10\ \Omega, C=1/500=2 mFC = 1/500 = 2\ \text{mF}.
  3. 10−3/202=2.5×10−6 kg⋅m210^{-3}/20^2 = 2.5 \times 10^{-6}\ \text{kg} \cdot \text{m}^2.

Test yourself

In the force-voltage analogy a spring of stiffness kk corresponds to

  1. an inductor L=kL = k
  2. a capacitor C=1/kC = 1/k
  3. a resistor R=kR = k
  4. a capacitor C=kC = k

The damping ratio of mx¨+bx˙+kx=Fm\ddot x + b\dot x + kx = F is

  1. b2km\frac{b}{2\sqrt{km}}
  2. bkm\frac{b}{km}
  3. km\sqrt{\frac{k}{m}}
  4. 2bkm\frac{2b}{\sqrt{km}}

How many independent energy stores, and so what order, does a mass on a spring with a damper have?

  1. one, first order
  2. two, second order
  3. three, third order
  4. it depends on the force

A 10:1 gearbox reflects a load inertia JJ to the motor as

  1. 10J10J
  2. J/10J/10
  3. J/100J/100
  4. 100J100J