TactivergeLite

Lite / Textbooks / Feedback and Control / Chapter 3

3. Proportional control

Version 1 · Technically checked (automated checks only) · 3 source lessons · Full interactive version

Introduction

Instead of on or off, push in proportion to the error: far away, push hard; close, push gently. The gain sets how hard. Proportional control is smooth and simple, but it has a built-in flaw: to keep pushing against a load it needs some error left over, so it settles a little short of the setpoint. Raise the gain and the shortfall shrinks, but the actuator saturates and, in real systems, overshoot creeps in.

Figure 3.1. P control always falls a little short (described in words)

Three bars showing where proportional control settles: with loop gain K·G = 4 it stops 20% short, with K·G = 9 it stops 10% short, and with K·G = 99 it stops 1% short. The error is 1 / (1 + K·G).

Explanation

Built from 3 School lessons. Each part is the lesson's own explanation.

3.1 Correct in proportion

When you park a bike next to a friend, you slow down as you get close. What rule is your brain using?

Push in proportion to the gap

A proportional controller makes its correction a fixed fraction of the gap:

correction = k × gap

Far away, big gap, big push. Close by, small gap, gentle push. The number k is called the gain.

Too little, just right, too much

With k below 1, each step closes part of the gap: a smooth glide in. k = 1 jumps straight there (in a perfect world). k between 1 and 2 overshoots and wobbles, then settles. k = 2 bounces for ever. k above 2 wobbles bigger and bigger: unstable.

Settling a little short

A proportional heater only heats when the room is too cold. Near the target the gap is small, so the heat is small, and it can only balance the heat leaking out if the room stays a little below target. Higher gain shrinks this offset; later levels add a trick (integral action) to remove it.

Common mix-ups

Open the Lite lesson: Correct in proportion

3.2 Proportional control: push harder when further away

On/off heaters are either flat out or off. What if the heater could push gently when you are nearly there?

The proportional rule

effort = Kp × error. Big error, big effort; small error, small effort; no error, no effort. With PWM, 'effort' can be a duty cycle. Two practical limits: a heater cannot cool, so negative effort is clipped to 0, and it cannot exceed full power, so large efforts are clipped to 100%. When clipped, the controller is saturated and behaves like on/off.

The leftover error

On a cold night the heater must keep supplying heat. A proportional controller only supplies heat when there is an error, so it settles where the error is just big enough: the steady-state error. More gain means less error is needed, so it settles closer. Removing the error completely needs another idea, integral action, which you meet in Level 3.

Too much gain

Real systems have delays: the heater warms up, air takes time to mix, the sensor responds slowly, and firmware samples at intervals. With a very high gain, the controller overreacts to each change and can overshoot or oscillate. Engineers raise the gain until the error is small enough and stop well before the response turns twitchy.

Derivation: Where a proportional heater settles
  1. Controller: heater power P = Kp × (r − T), limited to 0–3,000 W. (r = setpoint, T = temperature, Kp in W per °C.)

  2. Greenhouse: heat leaks out at UA × (T − T_out) watts, with UA = 100 W per °C in the model.

  3. Steady means heat in = heat out: Kp × (r − T) = UA × (T − T_out).

  4. Expand and collect the T terms: Kp·r + UA·T_out = (UA + Kp) × T.

  5. So T = (UA·T_out + Kp·r) ÷ (UA + Kp). With UA = 100, T_out = 5 °C, Kp = 400, r = 18 °C: T = (500 + 7,200) ÷ 500 = 15.4 °C, 2.6 °C short.

  6. Kp = 1,500 gives (500 + 27,000) ÷ 1,600 ≈ 17.2 °C: closer. The error shrinks as Kp grows but only reaches zero if Kp were infinite.

Common mix-ups

Open the Lite lesson: Proportional control: push harder when further away

3.3 Why P control always falls short

Turn the proportional gain up from 1 to 9 and the error shrinks from half the setpoint to a tenth. Why does it never reach zero?

The error is doing a job

A P controller's output is proportional to the error. To hold a motor at speed, the motor needs a steady push; the only way P can provide one is to keep some error. That leftover is the steady-state error, e = r/(1 + K·Kp).

Designing to a spec

If the error must be within 2 % of r, set r/(1 + K·Kp) ≤ 0.02·r, so K·Kp ≥ 49. For a unit plant, Kp ≥ 49. That is a large gain, which leads to the next problem.

Why not just crank Kp?

High gain amplifies sensor noise into the motor command, can push the actuator into saturation, and on plants with more dynamics (a springy joint, a delay) causes overshoot and oscillation or even instability. Integral action removes steady-state error without needing enormous gain.

Derivation: Steady-state error of P control
  1. Controller: u = Kp·e, where e = r − y (setpoint minus output).

  2. Plant at steady state: once nothing is changing, the output is just its static gain times its input, y = K·u.

  3. Combine: y = K·Kp·e. Substitute into e = r − y to get e = r − K·Kp·e.

  4. Collect the e terms: e·(1 + K·Kp) = r.

  5. So e = r / (1 + K·Kp). For a unit plant (K = 1) and unit setpoint, e = 1/(1 + Kp).

  6. e is zero only if Kp is infinite. Any finite gain leaves an error, because the controller needs a non-zero error to produce the non-zero push that holds the output up.

Common mix-ups

Open the Lite lesson: Why P control always falls short

Worked examples

Correct in proportion: example 1

A robot is at 20 cm, target 100 cm, k = 0.25. Where is it after one step? After two?

Solution

Step 1: gap = 80, move 0.25 × 80 = 20, now at 40 cm. Step 2: gap = 60, move 15, now at 55 cm. Each move is a quarter of what's left.

Proportional control: push harder when further away: example 1

Kp = 25% per °C, setpoint 20 °C. Efforts at 19 °C, 16 °C and 21 °C?

Solution

19 °C: 25 × 1 = 25%. 16 °C: 25 × 4 = 100%, the limit: 100% (saturated). 21 °C: 25 × (−1) = −25% → clipped to 0%.

Why P control always falls short: example 1

K = 2, Kp = 4, r = 10. Find the steady-state error and final output.

Solution

e = 10/(1 + 2×4) = 10/9 ≈ 1.11. Output y = 10 − 1.11 ≈ 8.89.

Why P control always falls short: example 2

A unit plant must settle within 5 % of its setpoint. What Kp is needed?

Solution

Kp = (1/0.05 − 1)/1 = 19.

Interactive figures, in words

Figure 3.2 from Correct in proportion

Step through with k = 0.5. Then try k = 1, k = 1.5, k = 2 and k = 2.2. Describe what each one does in a few words.

The gap-closer can be replaced by this table, starting at 0 cm with target 60 cm. k = 0.5: 30, 45, 52.5, 56.3 cm (glides in). k = 1: 60 (straight there). k = 1.5: 90, 45, 67.5, 56.3 (overshoots, settles). k = 2: 120, 0, 120, 0 (bounces for ever). k = 2.2: 132, −26.4, 163.7 (grows: unstable).

Figure 3.3 from Proportional control: push harder when further away

Choose Proportional. With the setpoint at 18 °C and outside at 5 °C, try a gain of 400 W per °C and read where it settles. Raise the gain to 1,500 and 3,000. Then switch to On/off and compare the energy and switching.

The thermostat diagram plots 300 minutes of greenhouse temperature from a 12 °C start, with the setpoint, a ±1 °C band and the heater power underneath. In proportional mode the power is gain × error, limited to 0–3,000 W; the temperature settles below the setpoint at (100 × outside + gain × setpoint) ÷ (100 + gain), and the readout states that value. In on/off mode the heater is full on below the band and off above it, and the readout counts switchings.

The interactive versions are in the full chapter.

Laboratory

These run in a browser on the full site (they need a faster connection). Simulations are simplified educational models.

Practice

Each question links to its Lite lesson, where your answer is checked on our server and a wrong answer gets a hint. Answers are never sent to your device.

  1. A robot is at 0 cm and wants to stop at 80 cm. Each step it moves 0.5 of the remaining gap. Where is it after one step, in cm?
    Answer it in “Correct in proportion”
  2. Which value of k makes the robot overshoot the target and then settle?
    Answer it in “Correct in proportion”
  3. A proportional heater targets 18 °C but the room settles at 16.6 °C. Why?
    Answer it in “Correct in proportion”
  4. A proportional heater controller uses effort = gain × error, where error = setpoint − temperature. The gain is 40% per °C and the effort is limited to the range 0 to 100%. The setpoint is 18 °C and the temperature is 16 °C. What heater effort does it command, in %?
    Answer it in “Proportional control: push harder when further away”
  5. At dusk the greenhouse is 8 °C below the setpoint and Kp × error is 300% of full power. What does the heater actually do?
    Answer it in “Proportional control: push harder when further away”
  6. A plant with static gain K = 1 is under proportional control with Kp = 5. The setpoint steps to r = 5. What is the steady-state error e = r − y once it settles?
    Answer it in “Why P control always falls short”
  7. A plant with static gain K = 2 must settle within 5 % of a setpoint r = 2 using proportional control only. What is the smallest Kp that achieves this?
    Answer it in “Why P control always falls short”
  8. Why can a P controller never remove the steady-state error completely?
    Answer it in “Why P control always falls short”

Engineering applications

Steering

A line-following robot that steers in proportion to how far it is off the line runs smoothly where an on/off steerer would zigzag. Too much gain and it weaves; too little and it drifts wide on curves.

Droop

In power grids, generators deliberately use proportional control of frequency, called droop, so many machines share a change in load. The small steady error is accepted by design.

Watch (optional)

Streaming video uses a lot of data. Everything you need is in the text.

Summary

Glossary

Proportional control
A proportional controller sets the command to a gain times the error: u = Kp × e. Bigger errors get bigger corrections. Field Guide
Steady-state error
Steady-state error is the error that remains after the response has settled and stopped changing. Field Guide
Setpoint and error
The setpoint (or reference) is the value you want; the error is the setpoint minus the measured value. Controllers act on the error. Field Guide
Overshoot
Overshoot is how far a response goes past its final value, usually given as a percentage of the step size. Field Guide

Project: How much gain?

A heater with steady-state gain 2 °C per unit of effort warms a tank that must stay within 0.5 °C of 40 °C. Find the minimum proportional gain that meets the spec at steady state, check the effort needed against an actuator limit of 30 units, and say what you would do if they conflict.

Deliverables

Write it up on paper or in your own notes. Lite never stores what you write.

References

← 2. On/off control and hysteresis4. Systems with memory: first-order response →