PID Control Design
Why doesn't a P controller work in a drone?
To hover, the drone needs a propeller speed that is enough to counter gravity. In a P controller system, the control action is proportional to the error. As the drone gets closer to the target height, the error decreases, which causes the actual propeller speed to drop below what's needed to stay airborne, so the drone begins to fall.
The Drone Hovering Dilemma: Numerical Breakdown
1. The Parameters
-
Target Altitude (
): -
Hovering Requirement (
): (The speed needed just to balance gravity). -
Proportional Gain (
): -
Control Equation:
2. The Flight Path
| Actual Height (Hactual​) | Error (50−Hactual​) | Controller Output (5×Error) | Result |
|---|---|---|---|
| Rising: |
|||
| Rising: |
|||
| Rising: |
|||
| STUCK: Output ( |
3. Why it never reaches 50 meters
If the drone somehow reached
-
-
-
Result:
is not enough to fight gravity ( ). The drone falls back toward .
If the drone reached the target of
-
-
-
Result: The motors shut off. The drone falls like a rock.
4. Key Takeaway: The "Equilibrium"
The drone settles at
-
In the Walking Example: There is no "gravity" pulling you back to the start line. If you stop walking (0 speed), you just stay where you are.
-
In the Drone Example: If you "stop" (0 RPM), you fall. You must have a non-zero output to stay still.
The Integral (I) Solution:
The Integral term says: "Hey, we've been stuck at 30m for a while. There is still a
The controller never manages to reduce the error below the error that gives the drone the speed enough for staying in the air. If the drone goes up a little bit, the error decreases, the propeller speed decreases, and the drone goes down. This is why you always get stuck with that offset error below the target.
Key takeaway: if the system needs action at steady state, P controller will not be enough because there should be no error at steady state so the P controller will produce no action. You need an I controller then, and might need a D controller to cure oscillations, just like adding a damper.
In your DC motor scenario, friction and the external load act exactly like gravity did for the drone. They are "parasitic" forces that the controller must constantly fight just to keep the system moving at a steady state.
The Physics of the Stall
For a DC motor, the voltage you apply (
-
The Drag: Friction (
) is always pushing against you. To maintain any constant speed, you must apply a specific non-zero voltage ( ) to overcome that friction. -
The P-Controller Trap: If the motor actually reached
, the error would be zero, making the voltage . Without voltage, there is no torque to fight the friction, and the motor immediately slows down. -
The Equilibrium: The motor settles at a speed where the error is just large enough that the P-controller outputs exactly
. You are stuck below your target speed forever. This is your Steady-State Error.
Why the PI Controller is the "Fix"
The PI controller solves this by changing how that "friction-fighting voltage" is generated.
-
The P-term: Still handles the initial "kick" to get the motor spinning quickly.
-
The I-term: It sees that the motor is stuck at 90% speed. It starts "collecting" that 10% error over time.
-
The Result: The I-term keeps growing until it provides the
required to fight friction. Because the I-term "remembers" this value, the error can finally go to zero. At the target speed, the P-term is , but the I-term is providing of the effort needed to keep the motor spinning against the load.
Pro-Tip for your notes: In Control Theory terms, adding the Integral term increases the System Type. A Type 0 system (like a motor with only a P-controller) cannot eliminate steady-state error for a step input if there is a disturbance like friction. By adding the "I", you turn it into a Type 1 system, which handles constant disturbances perfectly.
Extra note: this is confirmed by the transfer function of the dc motor. For velocity control, there are no integrators (it is type zero), so using a P controller will introduce a steady state error.