>
section 2 of 1211 min read

2. Mathematical Models of Physical Systems

Before we can design a controller, we need an equation that describes how the plant behaves. The crucial insight is that vastly different physical systems have nearly identical mathematical descriptions. A car's velocity dynamics, an RC charging circuit, and a thermal mass cooling toward room temperature are all governed by the same first-order linear differential equation. This is why control theory generalizes so well.

We will model four kinds of systems (mechanical, electrical, electromechanical, thermal, hydraulic), then derive their transfer functions, then build up to block diagrams and signal flow graphs.

2.1 Mechanical systems: Newton tells you the equation

Mechanical systems obey Newton's second law: F=maF = ma. Three primitive elements show up:

  • Mass stores kinetic energy. Force-velocity relation: F=mv˙=mx¨F = m \dot v = m \ddot x.
  • Damper (also called "dashpot") dissipates energy to friction. F=bx˙F = b \dot x where bb is the damping coefficient.
  • Spring stores elastic potential energy. F=kxF = k x where kk is the spring constant.

The canonical example is the mass-spring-damper, which appears literally everywhere mechanical things move:

plaintext
    F(t) →   ┌────┐    ┌─/\/\/\─┐   ┌──┐
             │    │    │  k     │   │ b│
             │  m │ ───┤        ├───┤  │
             │    │    └────────┘   └──┘
             └────┘
                  ── x(t) →

Newton's law for the mass: sum of forces equals mx¨m \ddot x.

F(t)bx˙kx=mx¨F(t) - b \dot x - k x = m \ddot x

Rearrange:

mx¨+bx˙+kx=F(t)m \ddot x + b \dot x + k x = F(t)

This is a second-order linear ordinary differential equation. It describes a car's suspension, a cell-phone speaker's diaphragm, a vibration-isolated optical table, a humanoid robot's arm joint with elasticity. Even your steering wheel, when you let go, oscillates back to center (mass: the wheel; spring: the rack-and-pinion centering force; damper: friction). Same equation.

Take the Laplace transform with zero initial conditions:

(ms2+bs+k)X(s)=F(s)(m s^2 + b s + k) X(s) = F(s)

So the transfer function from force (input) to position (output) is:

G(s)=X(s)F(s)=1ms2+bs+kG(s) = \frac{X(s)}{F(s)} = \frac{1}{m s^2 + b s + k}

This is the "mother" of all transfer functions in this chapter. Every textbook example traces back to a system that looks like this.

Car suspension intuition. When your car hits a pothole, the wheel mass + tire spring + shock absorber make a mass-spring-damper. The shock absorber's damper bb is exactly tuned so that after a pothole, the car settles back to level in a few damped oscillations and not too many. Too little damping (worn-out shocks) and the car bounces all the way down the highway. Too much damping (overly stiff shocks) and the ride is brutally rough. The "feel" of a luxury car is largely about ζ\zeta, the damping ratio, which we will define in Section 3.

2.2 Electrical systems: KVL, KCL, and the same math

For electrical circuits we already know the elements (Chapter 2). Resistor, inductor, capacitor:

  • vR=Riv_R = R i
  • vL=Li˙v_L = L \dot i
  • iC=Cv˙i_C = C \dot v

Apply KVL to a series RLC circuit driven by a voltage source v(t)v(t):

Lq¨+Rq˙+qC=v(t)L \ddot q + R \dot q + \frac{q}{C} = v(t)

Where qq is the charge on the capacitor, and current is i=q˙i = \dot q.

Compare to the mechanical equation:

mx¨+bx˙+kx=F(t)m \ddot x + b \dot x + k x = F(t)

Same equation. Mass plays the role of inductance, damper plays the role of resistance, spring plays the role of inverse capacitance, force plays the role of voltage, position plays the role of charge.

2.3 The force-voltage and force-current analogies

Two complementary analogies between mechanical and electrical systems exist. The force-voltage analogy maps:

MechanicalElectrical (force-voltage)
Force FFVoltage vv
Velocity x˙\dot xCurrent ii
Mass mmInductance LL
Damper bbResistance RR
Spring kkInverse capacitance 1/C1/C
Position xxCharge qq

The force-current analogy swaps voltage and current:

MechanicalElectrical (force-current)
Force FFCurrent ii
Velocity x˙\dot xVoltage vv
Mass mmCapacitance CC
Damper bbConductance 1/R1/R
Spring kkInverse inductance 1/L1/L
Position xxMagnetic flux linkage

Why two? Because mechanical systems have two natural ways to describe the topology: by which masses share a common point (which suggests the force-current view, because nodes share a common voltage, like masses share a common position), or by the chain of force transmissions (which suggests force-voltage, because elements in series share a common current, like a force passing through a chain of mechanical elements).

In practice, when you encounter a mechanical system, you write down the equations of motion using Newton's laws directly and turn them into a transfer function. The analogies are useful mostly for two reasons. First, they let you build mechanical analogs of electrical filters (and vice versa). Second, they let you use the well-developed circuit-analysis machinery (mesh, nodal) on mechanical problems. If you have software that does circuit analysis, you can analyze a mechanical system by drawing its electrical analog.

2.4 Electromechanical: the DC motor

Most real plants are electromechanical: an electrical actuator drives a mechanical load. The DC motor is the canonical example, and showing up in every robot, every drone, every electric car, every disk drive.

The motor has both a mechanical equation (torque accelerates the rotor) and an electrical equation (voltage drives current through the armature):

Jθ¨+bθ˙=KtiJ \ddot \theta + b \dot \theta = K_t i Li˙+Ri=vKbθ˙L \dot i + R i = v - K_b \dot \theta

Where JJ is rotor inertia, bb is mechanical damping, KtK_t is the torque constant (τ=Kti\tau = K_t i, current produces torque), KbK_b is the back-EMF constant (a spinning motor generates a voltage opposing the input). After Laplace and some algebra, the transfer function from voltage input to angular velocity output is:

Ω(s)V(s)=Kt(Js+b)(Ls+R)+KbKt\frac{\Omega(s)}{V(s)} = \frac{K_t}{(Js+b)(Ls+R) + K_b K_t}

This is a second-order system. Many DC motors have LL small enough to ignore, in which case the system simplifies to first order. Either way, it is one of the most-encountered plants in robotic and embedded systems.

2.5 Thermal systems

A heated body cooling toward ambient is a first-order system:

CθT˙+TTambientRθ=q(t)C_\theta \dot T + \frac{T - T_\text{ambient}}{R_\theta} = q(t)

Where CθC_\theta is thermal capacitance (joules per kelvin), RθR_\theta is thermal resistance (kelvin per watt), and q(t)q(t) is the heat input. Same form as an RC circuit. The time constant is τ=RθCθ\tau = R_\theta C_\theta, which can be milliseconds (a small transistor junction) up to hours (a large oven) up to centuries (a planet).

Thermal control is everywhere. Your 3D printer hotend, your laptop CPU's thermal-throttling logic, your cryogenic dilution refrigerator, your refrigerator at home, all run thermal control loops.

2.6 Hydraulic and pneumatic systems

Fluid systems with compressible (pneumatic) or incompressible (hydraulic) fluids are governed by analogous equations. Pressure plays the role of voltage; flow rate plays the role of current; tank capacity plays the role of capacitance; flow restrictions (valves, orifices) play the role of resistance; long pipes have inertance (analogous to inductance, important at high frequencies and for water-hammer effects).

Hydraulic actuators dominate large-force applications: aircraft control surfaces, construction equipment, presses. Pneumatic actuators dominate factory automation in dusty, wet, or explosive environments where electrical sparks are unsafe.

2.7 Block diagrams and reduction rules

Real systems, with all their loops and signals, are messy. Block diagrams are the tool we use to keep track of the structure. A block is a transfer function. An arrow is a signal. Summing junctions add or subtract signals.

plaintext
         ┌───┐      ┌───┐
   ──→[+]┤ G1├──→[+]┤ G2├──→
       ↑ └───┘   ↑ └───┘
       │         │
       └─────────┴── feedback signals

The three reduction rules let you collapse any block diagram to a single transfer function.

Series (cascade): two blocks in series multiply.

plaintext
  X ──[G1]──[G2]── Y    ⇔    X ──[G1·G2]── Y

Parallel: two blocks fed the same input, outputs summed, add.

plaintext
       ┌──[G1]──┐
  X ───┤        ├[+]── Y    ⇔    X ──[G1+G2]── Y
       └──[G2]──┘

Negative feedback (the most important rule). Block GG in the forward path, block HH in the feedback path. The closed-loop transfer function is:

plaintext
              ┌───┐
  X ──→[+]───┤ G ├───→ Y
        ↑ -  └───┘   │
        │            │
        └───[H]──────┘

T(s)=Y(s)X(s)=G1+GHT(s) = \frac{Y(s)}{X(s)} = \frac{G}{1 + G H}

Memorize this. It is the single most important formula in control theory. It tells you that the closed-loop transfer function is the open-loop forward path divided by one plus the loop gain GHGH.

The denominator 1+G(s)H(s)1 + G(s) H(s) is the characteristic equation; setting it to zero gives the closed-loop poles. The roots of 1+GH=01 + GH = 0 govern stability.

Why the formula is what it is. Let EE be the error at the summing junction, YY the output. From the diagram, E=XHYE = X - HY and Y=GEY = GE. Substitute: Y=G(XHY)=GXGHYY = G(X - HY) = GX - GHY. Solve for YY: Y(1+GH)=GXY(1 + GH) = GX, so Y/X=G/(1+GH)Y/X = G/(1 + GH). That is the entire derivation.

If the feedback is positive (uncommon in control, common in oscillators) replace minus with plus and the formula becomes G/(1GH)G/(1 - GH). The 1GH=01 - GH = 0 in the denominator is the Barkhausen criterion that triggers oscillation in feedback amplifiers (Chapter 5).

With practice, you can collapse arbitrarily complex diagrams. Move pickup points, swap the order of summing junctions, and apply the three rules until one block remains.

2.8 Signal flow graphs and Mason's gain formula

A signal flow graph is an alternative representation. Variables are nodes; transfer functions are directed arrows ("branches") with gains as labels. Signal flow graphs are nicer for systems with many feedback loops because the algebra is mechanical.

rendering diagram...

Mason's gain formula computes any source-to-sink transfer function in one step:

T=1ΔkPkΔkT = \frac{1}{\Delta} \sum_k P_k \Delta_k

Where:

  • PkP_k is the gain of the kk-th forward path from source to sink.
  • Δ=1Li+LiLjLiLjLk+\Delta = 1 - \sum L_i + \sum L_i L_j - \sum L_i L_j L_k + \cdots is the graph determinant. The sums are over individual loops, pairs of non-touching loops, triples of non-touching loops, etc.
  • Δk\Delta_k is what Δ\Delta becomes when you remove all loops touching path PkP_k.

Two loops "touch" if they share a node or an edge. Two paths "touch" similarly. Mason's formula is just the algebra of the closed-loop calculation, generalized to many loops.

When to use Mason's. For simple single-loop systems, block-diagram reduction is faster. Mason's shines for multi-loop systems (cross-coupled aircraft control, multi-cavity laser locks, networked controllers). It also shines when you need to derive the transfer function symbolically rather than numerically.

Worked example: derive the closed-loop transfer function with one feedback loop.

A graph has source RR, sink CC, one forward path with gain GG, and one feedback loop with loop gain GH-GH.

  • Forward path P1=GP_1 = G.
  • Loops: L1=GHL_1 = -GH. So Δ=1L1=1+GH\Delta = 1 - L_1 = 1 + GH.
  • Loop L1L_1 touches path P1P_1, so Δ1=1\Delta_1 = 1.

Mason's gives T=P1Δ1/Δ=G/(1+GH)T = P_1 \Delta_1 / \Delta = G / (1 + GH), which is exactly the negative-feedback formula we already derived. Mason's just generalizes that derivation to systems with arbitrary loop structure.

2.9 The miracles of feedback

We saw most of these in Chapter 5 (feedback amplifiers). Here is the master list.

  • Reduces sensitivity to plant variations. Sensitivity of closed-loop gain to changes in GG is 1/(1+GH)1/(1+GH). So if loop gain is 100, a 10% change in GG produces only a 0.1% change in closed-loop behavior.
  • Improves disturbance rejection. Disturbances entering the plant are attenuated by the same factor 1/(1+GH)1/(1+GH).
  • Increases bandwidth. A first-order plant with bandwidth ω0\omega_0 has, when wrapped in feedback with loop gain KK, a closed-loop bandwidth approximately Kω0K \omega_0. (Gain-bandwidth product is preserved.)
  • Linearizes nonlinear plants. If the loop gain is large, the closed-loop behavior is dominated by the feedback path, not the plant's nonlinearity. This is why op-amp circuits work even though the op-amp itself has all kinds of nonlinearities.
  • Can cause instability if not designed carefully. The danger we will spend most of the chapter analyzing.

The first four are gifts. The fifth is the catch.