Control Systems
What is proportional control?
A proportional controller sets its output in proportion to the error, the gap between where a system is and where it should be. Big error, big push; small error, gentle push; no error, no push beyond what holds it still. For a drone holding a height, that's thrust = hover + Kp × error. It's the P in PID, and the simplest controller that eases into its target instead of slamming into it.
The rule
The error is target minus measurement. The bias is the output that holds the system still with no error at all: for the drone, 9.8, which exactly cancels gravity. Kp, the gain, is how much extra push each unit of error is worth.
Take Kp 0.5 and a target of 10 m:
- On the ground, 10 m to go: 9.8 + 0.5 × 10 = 14.8
- 2 m to go: 9.8 + 0.5 × 2 = 10.8
- On target: 9.8, just hover
- 2 m too high: 9.8 + 0.5 × (−2) = 8.8, less than hover, so it sinks back
The sign of the error does the steering both ways. In code it's one line:
float error = target - h;
thrust = 9.8 + 0.5 * error;
Why it eases in
As the drone climbs, the error shrinks, so the push shrinks with it. By the time it arrives there's hardly any push left, and air drag has taken most of its speed, so it settles with barely any overshoot. Plot height against time and you get a fast rise that flattens out as it closes in: the step response, and every tuning decision is about its shape.
Live experiment
Fly it at four gains
The drone climbs to 10 m with thrust = 9.8 + Kp × error, and the line at the top works out the push as it goes. Kp 0.1 crawls to about 7 m in twelve seconds; 0.25 creeps to about 9.8 m; 0.5 eases in, passing 9.5 m at about 4 s; 1 is quicker but swings past to about 11.6 m.
“Push in proportion” is lesson 2 of 6 in Feedback Falls, Control Systems World 1. Free with an account. Lessons unlock in order, so you’ll do the one before it first.
Choosing Kp
The gain is the one dial. On this drone, Kp 0.1 is a timid push that's still crawling after twelve seconds. Kp 0.5 passes 9.5 m in about four seconds and goes only 0.4 m past. Kp 1 gets there sooner but swings up to about 11.6 m: too much gain trades a slow arrival for overshoot. Tuning by hand means raising Kp until the overshoot just appears, then backing off a little.
What P can't do
P needs the bias to be right. Load the drone with a parcel and it settles a little short: a steady-state error, which an integral term removes. And P can't see speed, so a bold gain overshoots; a derivative term adds the brakes. You'll find P on its own in lifts slowing as they near a floor, 3D printer heads easing into position and line-following robots steering by how far off the line they are.
Free lesson
Now build it yourself
Each lesson comes in three short parts: see the idea, try it on a live board, then build it yourself, with quick checks as you go.
“Push in proportion” is lesson 2 of 6 in Feedback Falls, Control Systems World 1. Free with an account. Lessons unlock in order, so you’ll do the one before it first.
Or start from the very first lesson, no account neededPractice questions
Three quick questions from the lessons. Pick an answer to check it.
Show the answer
Answer: Hover thrust: the error is zero, so the push is zero. Zero error means zero push, and the hover thrust alone holds it where it is. That's what the 9.8 in the line is for.
- Why not “Half”? Nothing in the rule halves the thrust. It's the hover thrust plus the gain times an error of zero.
- Why not “Zero”? Zero thrust would let gravity win and the drone would fall. The hover thrust stays on; only the proportional part goes to zero.
- Why not “Full”? Full thrust is for a big error. On target the error is zero, so the proportional push is zero too.
Show the answer
Answer: Shrinks, so it eases in. The push is the gain times the error, and the error shrinks as it arrives.
- Why not “Grows”? The push is the gain times the error, and the error gets smaller as the drone closes in, so the push does too.
- Why not “Stays the same”? A fixed push is on-off control. Proportional control changes the push with every change in the error.
- Why not “Reverses”? The push only reverses once the drone is above the target and the error turns negative. On the way in it just shrinks.
Show the answer
Answer: It's the hover thrust: with zero error it holds the drone still. Gravity pulls at 9.8, so 9.8 of thrust exactly cancels it. The gain times error is added on top to steer. Leave it out and the drone sags below the target, needing error just to stay up.
- Why not “It's the gain”? The gain is the 0.5 that multiplies the error. The 9.8 is added on its own, whatever the error.
- Why not “Nothing, it could be 0”? Without it the drone needs a standing error just to make enough thrust to hang there, so it sags below the target or never lifts off.
- Why not “It's the target height”? The target is 10 m and lives inside the error, target minus height. The 9.8 is thrust, not a height.
“Push in proportion” is lesson 2 of 6 in Feedback Falls, Control Systems World 1. Free with an account. Lessons unlock in order, so you’ll do the one before it first.
Questions people ask
What is the difference between proportional control and on-off control?
On-off control has two outputs, full or nothing, so it always overshoots a little and bounces around the target. Proportional control has as many outputs as there are errors: a big push far away, a small one close in, none on target, so it can ease in and settle.
What does Kp mean in a P controller?
Kp is the proportional gain: how much extra output per unit of error. For a drone holding height, Kp 0.5 means half a unit of thrust for every metre it is below the target. A bigger Kp reacts harder and arrives sooner, until it starts to overshoot.
Why does a P controller need a bias term?
Many systems need some output just to stay where they are, like a drone's hover thrust or a heater's steady warmth. The bias supplies that. Without it the controller needs a standing error to make that output, so it settles short of the target.
Does a P controller always reach its target exactly?
Only if the bias is exactly right. If the load changes, say the drone picks up a parcel, P settles a little short, a gap called steady-state error or droop. An integral term removes it.
Related topics
- PID control explainedWhat the P, I and D terms each do, shown on a drone climbing to 10 m.
- Open-loop vs closed-loop controlSet and hope, or measure and correct: the idea behind every controller.
- Bang-bang (on-off) control vs PIDFully on or fully off: the thermostat's controller, its band, and its limits.
- How a line follower robot worksTwo eyes, a threshold and three rules, then smoother steering in proportion.