Search

Search papers and lessons

PD Control

Level 2 · 11 min read

PD control adds a term that reacts to how fast the output is changing, which damps the overshoot a proportional controller produces.

On this page

  • Colour = topic mix
  • Probability
  • Linear algebra
  • Discrete math
  • Calculus
  • Control systems
  • ReadReady to readNot yet

TL;DR

A proportional controller pushes the system toward its target in proportion to the error. That works, but the system often overshoots the target and rings back and forth. A PD controller adds a second term that pushes against the rate at which the output is changing, which is like a brake that grows with speed. The result is much less overshoot and a response that settles. The name comes from its two parts: proportional and derivative.

Builds on: Feedback Control, Ordinary Differential Equation · Leads to: Transfer Function, Lyapunov Stability

This lesson explains a mathematical idea from engineering. It is not advice for building or operating any equipment.

Where it's used

Robot joints and servo motors. A motor that turns a robot's elbow must reach an angle quickly and stop there without swinging past it. Engineers commonly use a PD loop, with the angle error feeding a proportional term and the measured angular speed feeding a derivative term, so the arm arrives smoothly.

Multirotor drones. The attitude, meaning the tilt of the body, is held by fast feedback loops on each axis. Those loops are often PD-type, because the gyroscope measures the rate of rotation directly, and that rate is exactly the derivative term needed to damp the motion.

Positioning stages. Machines that move a tool or a read head to a precise position use feedback with damping so the head lands on target without ringing. The derivative term is what keeps the settling time short.

How it works

We take the smallest useful case: a unit mass that a controller pushes along a line. Let the position be yy, the target be r=1r = 1 metre, and the force be uu. Start at rest at y=0y = 0.

  1. Set up the plant. With a unit mass, Newton's second law says the acceleration equals the force, so y′′=uy'' = u. Check: a force of 22 newtons gives an acceleration of 22 metres per second squared.
  2. Use proportional control only. Choose u=Kp(r−y)u = K_p(r - y) with Kp=4K_p = 4. The push is four times the error. Check: at the start the error is 1−0=11 - 0 = 1, so the force is 44 newtons.
  3. Watch the mass move. The mass accelerates toward the target. At the start the force is 44, so the acceleration is 44, and the mass speeds up. Check: the speed starts at zero and grows, so the motion starts gently.
  4. Pass the target. The force becomes zero when y=1y = 1, but the mass has built up speed by then. Check: the mass keeps moving past the target, so the error becomes negative and the force pushes back.
  5. Keep oscillating. Without any damping the mass swings back and forth between y=0y = 0 and y=2y = 2, forever. Check: the midpoint of the swing is 11, the target, and the amplitude is 11.
  6. Add the derivative term. Now choose u=Kp(r−y)−Kd y′u = K_p(r - y) - K_d\,y', with Kd=2K_d = 2. The new term uses the speed y′y', the derivative of position, not the error. Check: when the mass moves fast toward the target, y′y' is large and the push back is strong, so the mass slows before it overshoots far.
flowchart LR
  R["Target r"] --> E["Error r minus y"]
  E --> P["Proportional term Kp times error"]
  Y["Position y"] --> D["Derivative term minus Kd times speed"]
  P --> S["Sum is the force u"]
  D --> S
  S --> M["Unit mass: y'' = u"]
  M --> Y

The math

Definition: PD control law

For a plant whose output yy should follow a setpoint rr, the PD law is

u=Kp (r−y)−Kd dydt,u = K_p\,(r - y) - K_d\, \frac{dy}{dt},

where Kp>0K_p > 0 is the proportional gain and Kd≥0K_d \ge 0 is the derivative gain. The derivative term uses the rate of change of the output, written y′=dydty' = \frac{dy}{dt}.

Step 1 in symbols: the plant

A unit mass obeys y′′=uy'' = u, where y′′y'' is the second derivative of position, the acceleration. This is a double integrator. A mass with drag or a spring would add terms, but the unit mass keeps the algebra short.

Step 2 in symbols: the closed loop

Substituting the PD law into the plant gives

y′′+Kd y′+Kp y=Kp r.y'' + K_d\, y' + K_p\, y = K_p\, r.

This is a second-order linear differential equation with constant coefficients, the kind studied in ordinary differential equations. The term Kdy′K_d y' acts like friction, and KpyK_p y acts like a spring pulling the output toward rr.

Step 3 in symbols: where it settles

At steady state the output stops changing, so y′=0y' = 0 and y′′=0y'' = 0. The equation gives Kpy=KprK_p y = K_p r, so y=ry = r exactly. With no constant load, a proportional controller on this plant also settles at rr. So the derivative term does not change the final value. It changes only the path to it.

Step 4 in symbols: the characteristic equation

Write the solutions as exponentials este^{st} (exponential functions). This gives the characteristic equation

s2+Kd s+Kp=0.s^2 + K_d\, s + K_p = 0.

Define the natural frequency ωn=Kp\omega_n = \sqrt{K_p} and the damping ratio ζ=Kd2Kp\zeta = \dfrac{K_d}{2\sqrt{K_p}}. Then the equation becomes s2+2ζωns+ωn2=0s^2 + 2\zeta\omega_n s + \omega_n^2 = 0. When ζ<1\zeta < 1 the roots are complex, and the response oscillates while it decays. When ζ≥1\zeta \ge 1 there is no overshoot.

Step 5 in symbols: the step response and overshoot

For ζ<1\zeta < 1, with r=1r = 1 and y(0)=y′(0)=0y(0) = y'(0) = 0, the response is

y(t)=1−e−ζωnt(cos⁡ωdt+ζωnωdsin⁡ωdt),ωd=ωn1−ζ2.y(t) = 1 - e^{-\zeta\omega_n t}\left(\cos\omega_d t + \frac{\zeta\omega_n}{\omega_d}\sin\omega_d t\right), \qquad \omega_d = \omega_n\sqrt{1 - \zeta^2}.

The peak occurs at t=π/ωdt = \pi/\omega_d and its size is 1+exp⁡ ⁣(−πζ1−ζ2)1 + \exp\!\left(-\dfrac{\pi\zeta}{\sqrt{1-\zeta^2}}\right) times the target, so the overshoot fraction depends only on ζ\zeta.

Worked examples

Example
1. Tiny: proportional control only

Take a unit mass, r=1r = 1, Kp=4K_p = 4, Kd=0K_d = 0, and start at y(0)=0y(0) = 0 at rest.

  1. The equation is y′′+4y=4y'' + 4y = 4, so ωn=2\omega_n = 2 and ζ=0\zeta = 0.
  2. The solution that starts at rest is y(t)=1−cos⁡2ty(t) = 1 - \cos 2t.
  3. Check the start: y(0)=1−1=0y(0) = 1 - 1 = 0.
  4. At t=π/4≈0.785t = \pi/4 \approx 0.785 s, cos⁡(π/2)=0\cos(\pi/2) = 0, so y=1y = 1. The target is reached.
  5. At t=π/2≈1.571t = \pi/2 \approx 1.571 s, cos⁡π=−1\cos\pi = -1, so y=2y = 2. The overshoot is 100100 percent.
  6. The motion continues between 00 and 22 forever, because nothing removes energy.

Interpretation: proportional control reaches the target but overshoots it by the same amount it started below it, and it never settles. The derivative term is the fix.

Example
2. Standard: adding the derivative term

Take the same unit mass with Kp=4K_p = 4 and Kd=2K_d = 2, so r=1r = 1.

  1. Natural frequency: ωn=4=2\omega_n = \sqrt{4} = 2.
  2. Damping ratio: ζ=22×2=0.5\zeta = \dfrac{2}{2 \times 2} = 0.5.
  3. Damped frequency: ωd=21−0.25=20.75≈1.732\omega_d = 2\sqrt{1 - 0.25} = 2\sqrt{0.75} \approx 1.732.
  4. Peak time: t=π/ωd=3.1416/1.732≈1.814t = \pi/\omega_d = 3.1416/1.732 \approx 1.814 s.
  5. The overshoot exponent is πζ/1−ζ2=π(0.5)/0.75≈1.814\pi\zeta/\sqrt{1-\zeta^2} = \pi(0.5)/\sqrt{0.75} \approx 1.814, so the overshoot factor is e−1.814≈0.163e^{-1.814} \approx 0.163.
  6. Peak value: 1+0.163=1.1631 + 0.163 = 1.163, so the overshoot is 16.316.3 percent instead of 100100 percent.
  7. Steady value: y=r=1y = r = 1, with no error.

Interpretation: adding the derivative term cut the overshoot from 100100 percent to about 1616 percent, while keeping the zero steady error. The damping ratio ζ=0.5\zeta = 0.5 is the number that controls this.

Example
3. Realistic: a 2 kg cart that must not overshoot

A cart of mass m=2m = 2 kg is pushed by a motor with force u=Kp(r−y)−Kd y′u = K_p(r - y) - K_d\, y'. Let Kp=8K_p = 8 N/m and Kd=2K_d = 2 N s/m, and let the target be r=0.5r = 0.5 m.

  1. Newton's law: my′′=um y'' = u, so 2y′′=8(r−y)−2y′2y'' = 8(r - y) - 2y'.
  2. Divide by 2: y′′+y′+4y=4ry'' + y' + 4y = 4r. In the standard form y′′+2ζωny′+ωn2y=ωn2ry'' + 2\zeta\omega_n y' + \omega_n^2 y = \omega_n^2 r, the coefficient of y′y' is 11.
  3. Natural frequency: ωn=4=2\omega_n = \sqrt{4} = 2 rad/s.
  4. Damping ratio: ζ=12×2=0.25\zeta = \dfrac{1}{2 \times 2} = 0.25.
  5. Overshoot factor: exp⁡ ⁣(−π×0.250.9375)=exp⁡(−0.811)≈0.444\exp\!\left(-\dfrac{\pi \times 0.25}{\sqrt{0.9375}}\right) = \exp(-0.811) \approx 0.444.
  6. Peak position: 0.5×(1+0.444)≈0.7220.5 \times (1 + 0.444) \approx 0.722 m, which is 0.2220.222 m past the target.

Interpretation: the cart overshoots by about 44 percent, because the derivative gain is too small for this mass and stiffness. Doubling KdK_d to 44 gives ζ=0.5\zeta = 0.5 and an overshoot of 1616 percent, so the same cart stops much closer to the target.

Try it: With Kd=4K_d = 4 and the same Kp=8K_p = 8, m=2m = 2 and r=0.5r = 0.5 m, what is the peak position? Answer: ζ=4/(216)=0.5\zeta = 4/(2\sqrt{16}) = 0.5, so the overshoot factor is 0.1630.163 and the peak is 0.5×1.163≈0.580.5 \times 1.163 \approx 0.58 m.

Common mistakes and tradeoffs

It is tempting to think that the derivative term acts on the error. In fact the standard PD law differentiates the output, not the error. When the setpoint jumps, an error-based derivative would produce a large sudden push, which is why many designs use −Kd y′-K_d\,y' instead of Kd d(r−y)dtK_d\,\frac{d(r - y)}{dt}.

It is tempting to think that more derivative gain is always better. In fact the derivative term amplifies noise, because differentiating a noisy measurement gives large spikes. Real designs filter the derivative signal and keep KdK_d modest.

It is tempting to think that a PD controller removes steady error from a constant load. In fact the steady state in the examples has y=ry = r only because the plant has no constant disturbance. A constant force such as gravity on a lifted arm leaves a steady error with PD control, and an integral term is needed to remove it.

When to use it. Use PD control when the plant has inertia and the output must reach its target quickly without much overshoot, and when a measurement of the output's rate is available or can be estimated.

When not to use it. When the plant has delays or sensor noise is high, a large derivative term can destabilise the loop or amplify noise. In those cases a lower derivative gain, a filter, or a different design is needed.

ControllerSteady error from a constant loadOvershoot for the unit mass example
Proportional, Kd=0K_d = 0yes100100 percent, and it never settles
PD, Kd=2K_d = 2, Kp=4K_p = 4depends on the load; zero in the example16.316.3 percent
PIDnonedepends on the tuning

History

In 1922 Nicolas Minorsky, working on automatic ship steering for the US Navy, described a control law that combined a proportional term with a term based on the rate of change of the error. His paper is one of the first clear statements of the idea that later became the PID controller.

Engineers used such laws in process plants and servo systems through the 1930s and 1940s. The tuning methods that engineers used in those decades were largely empirical, based on watching the response to a step input.

Control theory later gave a precise account of why the derivative term works. The damping ratio ζ\zeta of the closed loop, which the examples use, comes from this analysis, and it became the standard tool for choosing gains.

Recap

  • A proportional controller u=Kp(r−y)u = K_p(r - y) reaches the target but overshoots and can oscillate forever when the plant has inertia.
  • The PD law u=Kp(r−y)−Kd y′u = K_p(r - y) - K_d\, y' adds a force that opposes the speed of the output.
  • For a unit mass the closed loop is y′′+Kdy′+Kpy=Kpry'' + K_d y' + K_p y = K_p r, with steady state y=ry = r.
  • The damping ratio ζ=Kd/(2Kpm)\zeta = K_d/(2\sqrt{K_p m}) controls the overshoot; ζ=0.5\zeta = 0.5 gives about 1616 percent.
  • Adding an integral term removes steady errors from constant loads, which is the step to full PID control, and transfer functions describe the same loop in the frequency domain.

Next, read Lyapunov Stability for a general test of whether a loop like this one settles, and Feedback Control if the basic loop is not yet clear.

Check yourself

QuestionRecall: what does the [[derivative|derivative term]] in a PD controller act on, and why does that damp the motion?Show answer

It acts on the rate of change of the output, y′y'. When the output moves quickly, the term pushes against that motion, which slows the approach to the target and reduces overshoot. It adds damping without changing the final value.

QuestionComputation: for a unit mass with Kp=9K_p = 9 and Kd=6K_d = 6, what are the natural frequency ωn\omega_n and the damping ratio ζ\zeta?Show answer

ωn=9=3\omega_n = \sqrt{9} = 3. The damping ratio is ζ=62×3=1\zeta = \dfrac{6}{2 \times 3} = 1. This is the critically damped case, so there is no overshoot.

QuestionWhy: suppose a constant force FF from gravity acts on the mass in the opposite direction to the controller. Why does a PD controller then leave a steady error, and how big is it?Show answer

At steady state the velocity is zero, so the derivative term contributes nothing. The force balance becomes Kp(r−y)=FK_p(r - y) = F, so the error is r−y=F/Kpr - y = F/K_p. The derivative term cannot remove this, because it is zero at steady state. Only an integral term, which keeps adding up the error, can push the error to zero.

QuestionApplied: an engineer says a higher derivative gain always makes the loop safer. Is this right?Show answer

No. A higher derivative gain adds damping, which reduces overshoot in the ideal model. But it also amplifies noise in the measured rate and can destabilise a loop with delays. The gain has to be chosen to balance speed, overshoot and noise.

Sources