The Unseen Intelligence: How a 100-Year-Old Algorithm Powers Your Thermostat and Shaver

Update on Oct. 19, 2025, 12:24 p.m.

You step into the shower and turn the knob. It’s ice-cold. You nudge it hotter. Too hot. You dial it back, but now it’s lukewarm. For a few frustrating moments, you are a human feedback controller, manually trying to guide a simple system—the water temperature—to a desired setpoint. This daily struggle is a perfect microcosm of one of the oldest and most fundamental challenges in engineering: how do you make a system automatically and reliably regulate itself? The answer, surprisingly, is not always a complex AI, but often a beautifully simple, century-old algorithm. It’s called a PID controller, and it’s the unseen intelligence quietly running the modern world, from cruise control in your car to the adaptive motor in a smart shaver like the Xiaomi S700.

First conceptualized in the early 20th century for ship steering, with pioneering work by engineers like Nicolas Minorsky, the Proportional-Integral-Derivative (PID) controller is the bedrock of control theory. Its genius lies in how it makes a decision by considering three things: the present, the past, and the predicted future. To demystify it, let’s go back to our shower. Imagine we replace our hand with a simple automated controller.
Xiaomi S700 Electric Shaver

P for Proportional: The Impulsive Actor

The most intuitive thing to do is to act in proportion to the problem. This is the ‘P’ in PID. Our controller measures the current water temperature (the “process variable”) and compares it to our desired temperature (the “setpoint”). The difference is the “error.” A proportional controller acts on this error: if the water is very cold (a large error), it opens the hot water valve a lot. If it’s just a little cold (a small error), it opens the valve just a little. It’s a simple, reactive strategy. But it has a flaw. As the temperature gets closer to the target, the error gets smaller, so the controller opens the valve less and less. It often ends up in a state where the small amount of heat it’s adding is perfectly balanced by the heat lost to the environment, leaving the water perpetually, stubbornly, just a little too cold. This is called a steady-state error. Our proportional controller is impulsive but lacks the persistence to finish the job.

I for Integral: The Stubborn Historian

To fix this, our controller needs a memory. It needs to look at the past. This is the ‘I’ for Integral. The integral component looks at the accumulated error over time. If that “a little too cold” error persists, the integral term grows larger and larger. Think of it as the controller’s growing impatience. This growing value is added to the output, forcing the valve to open a little more, and a little more, until the error is finally eliminated and the temperature reaches the exact setpoint. The integral term is a stubborn historian, remembering past failures and refusing to settle for “close enough.” It’s the component that ensures precision.

D for Derivative: The Calm Predictor

So now we have a controller that is both reactive and persistent. But this combination can be aggressive. The proportional part might overshoot the target, making the water too hot, and the integral part might compound this error. We need a voice of caution, a predictor of the future. This is the ‘D’ for Derivative. The derivative component looks at the rate of change of the error. If the temperature is rising very quickly, the derivative term calculates this rapid change and says, “Whoa, slow down! At this rate, we’re going to fly past our target.” It then creates an opposing force, slightly closing the hot valve to dampen the response and prevent overshooting. The derivative is the calm predictor, anticipating the future based on current trends and ensuring a smooth, stable arrival at the setpoint.

When these three components—the impulsive actor (P), the stubborn historian (I), and the calm predictor (D)—work together, you get the magic of a PID controller. It’s a perfect team, capable of guiding a system to its target quickly, accurately, and without wild oscillations.

Xiaomi S700 Electric Shaver

Once you understand this principle, you start seeing it everywhere. Your car’s cruise control uses a PID loop where the setpoint is your desired speed and the controller adjusts the throttle to counteract disturbances like hills. A PID controller is the brain of your home thermostat. It’s what allows a drone to hover motionless in the air, constantly correcting for gusts of wind. And it’s inside the Xiaomi S700 shaver. Its setpoint is a constant blade speed. When you move from a sparse area on your cheek to denser stubble on your chin, the motor experiences more resistance—a disturbance. The controller instantly detects the drop in speed (the error), and the PID algorithm commands the brushless motor to increase power, maintaining a consistent, smooth cut. When the resistance disappears, it eases off. This happens hundreds of time a second, an invisible, adaptive intelligence ensuring both efficiency and comfort.

In an age dominated by talk of neural networks and machine learning, the humble PID controller is a testament to the enduring power of classic algorithms. It’s a reminder that true “smartness” isn’t always about complex learning, but often about an elegant, mathematical understanding of a system’s behavior. While more advanced systems for things like autonomous driving will build upon these foundations with layers of AI and fuzzy logic, the core principles of feedback and control remain. The PID controller is the silent, invisible force that brings order to our mechanical world, a 100-year-old piece of logic still working tirelessly in the heart of our most modern gadgets.