Thermostats: Bang-Bang Control

Why is your house either 'Too Hot' or 'Too Cold'? Thermostats use Bang-Bang control. It's simple, but inefficient compared to PID.

Thermostats: Bang-Bang Control

You set the AC to 72°F. The house warms up to 73°. The AC kicks on full blast. The house cools to 71°. The AC turns off. The temperature moves in a sine wave: 71… 73… 71… 73. This is Bang-Bang Control (On-Off Control).

Simple but Jerky

Bang-Bang is the simplest code in the world: if (Current > Target) { TurnOn(); } else { TurnOff(); }

  • Pros: Easy to code.
  • Cons: Overshoot. The system is always oscillating. It’s rough on the machinery (turning a compressor on/off rapidly wears it out).

Hysteresis (The Buffer)

To prevent the AC from flickering on/off every second, we add Hysteresis.

  • “Turn ON at 74.”
  • “Turn OFF at 70.” This 4-degree gap prevents “Short Cycling.”

Robotics: The Claw

We use Bang-Bang for pneumatics or simple motors.

  • “If button pressed, Close Claw.”
  • “If button released, Open Claw.” We don’t need a PID loop to close a claw. It’s either Grip or No Grip. But for an Arm? Bang-Bang would cause it to smash up and down violently. For that, we need PID. Knowing when to be simple is part of being a good engineer.

Explore FIRST® Robotics

FIRST® (For Inspiration and Recognition of Science and Technology) is a global robotics community preparing young people for the future. Discover the ultimate sport for the mind and see how you can get involved in STEM and robotics!

Learn More at firstinspires.org