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 | current | inductor | capacitor | resistor |
| translational | force | velocity | mass | spring | damper |
| rotational | torque | angular velocity | inertia | torsion spring | rotary damper |
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
Mass-spring-damper. Newton's law for the mass, with the spring and damper pulling back:
Series RLC, written for the charge on the capacitor (), with Kirchhoff's voltage law:
The equations are identical under the force-voltage analogy: , , , , , . Both are the standard second-order system
(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: . A gear pair with ratio reflects a load inertia to the motor shaft as (and a load damping as ), which is how the DC motor lesson handles a gearbox.
Worked example: a positioning stage
Given: a stage of mass on a spring of with viscous damping , pushed by a step force of .
Find: , , the final displacement, the peak displacement and its time; the RLC analogue.
Solve:
- (); .
- Final displacement .
- Overshoot , so the peak is at .
- Analogue: , , , driven by a step: the capacitor charge follows with , i.e. the capacitor voltage settles at with the same overshoot.
Check: the program integrates the mechanical ODE with solve_ivp and steps the RLC transfer function with python-control.
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 , and the RLC lab's step view shows , overshoot and a peak time of : the stage's response, times faster ( instead of ). Raise to (the lab's "R for ") for the critically damped stage, the stiffest one that does not overshoot.
Guided lab: identify a spring-mass system
Hand calculation. A mass on a light spring of hanging from a stand has , a period of . If successive peaks of the free oscillation shrink by a ratio of , the log decrement gives and .
Simulation. Put , , and with an initial displacement of 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 . Expect the period within about of (the spring's own mass adds roughly a third of its mass to ) 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 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 but its analogue is : 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
- A rotor with on a torsion spring of and damping . Find and .
- Give the force-voltage analogue of a mass, , .
- A load inertia of is driven through a 20:1 gearbox. What inertia does the motor see?
Answer
- ; .
- , , .
- .
Test yourself
In the force-voltage analogy a spring of stiffness corresponds to
- an inductor
- a capacitor
- a resistor
- a capacitor
The damping ratio of is
How many independent energy stores, and so what order, does a mass on a spring with a damper have?
- one, first order
- two, second order
- three, third order
- it depends on the force
A 10:1 gearbox reflects a load inertia to the motor as