PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry
ENRUESPTFRDE

Related simulators

Continue with similar topics in this category — or all 48 in Engineering.

View category →
NewUniversity / research

PID Controller (1D)

Launch Simulator

Cart on a track: Kp, Ki, Kd and random velocity impulses toward set-point x = 0.

NewUniversity / research

PID Tuning Sandbox

Launch Simulator

Second-order plant step response: overshoot, rise/settling time, Ziegler–Nichols Ku/Pu hints, actuator saturation, and disturbance rejection.

NewUniversity / research

Torsional Drivetrain Resonance

Launch Simulator

Two-inertia torsional drivetrain: shaft stiffness and damping, twist angle, first natural mode, resonance response, and optional backlash deadzone.

NewUniversity / research

Cart–Pole: LQR vs MPC vs PID

Launch Simulator

Nonlinear cart inverted pendulum: linearize about upright φ = θ, discrete-time LQR from DARE (Q, R → K), finite-horizon LQ MPC with DARE terminal cost, and hand-tuned PID — same force limit, kicks, and plant as the mechanics cart-pole.

NewUniversity / research

Heat Exchanger ε-NTU

Launch Simulator

Parallel and counter-flow heat exchanger calculator: NTU = UA/Cmin, capacity ratio Cr, effectiveness, heat transfer, and outlet temperatures.

NewSchool

Watt Governor (schematic)

Launch Simulator

Flyballs and sleeve vs RPM; steam throttle gap — speed feedback cartoon.

PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Engineering/Thermostat: on/off vs PID

Thermostat: on/off vs PID

First-order room: on/off hysteresis vs continuous PID heater power.

Plant & control

22 °C
18 °C
0.12 1/s
2.8 °C/s at u=1
0.35 °C

About this model

A thermostat implements temperature regulation with hysteresis or proportional control: heating or cooling runs until the measured temperature crosses a setpoint band, preventing rapid on-off chattering from sensor noise. Simple bang-bang control flips at high and low thresholds; more advanced digital thermostats approximate PID behavior or model predictive schedules. The simulator connects the *control law* to the *thermal inertia* of a room or vessel—capacity, losses to ambient, and actuator power limit how quickly temperature can change. Idealizations often use a first- or second-order thermal model without spatial gradients, assuming a single well-mixed temperature and instantaneous actuator response. Students see why overshoot appears when gain is too aggressive, why deadband saves wear on compressors, and why feed-forward (weather, occupancy) improves comfort in real products.

Who it's for: Introductory control or HVAC students linking household thermostats to feedback concepts taught with the PID and governor simulators.

Key terms

  • Setpoint
  • Hysteresis
  • Bang-bang control
  • Deadband
  • Thermal inertia
  • Heat loss
  • Feedback
  • Overshoot

How it works

First-order room model: dT/dt = −k(T−T_amb) + P·u with u ∈ [0,1] heater power. On/off control uses hysteresis around the setpoint to avoid chattering. PID smoothly modulates power and usually settles with less overshoot when gains are tuned.

Frequently asked questions

Why not heat exactly to the setpoint and stop?
Real sensors lag, and heat keeps flowing after the actuator turns off. Without hysteresis or a modulating valve, the system would chatter—rapidly cycling on and off—which is inefficient and hard on equipment.
Is this the same mathematics as the PID cart demo?
Same family of ideas—error-driven feedback—but thermal plants are slow, often dominated by long time constants, so proportional-only or PI loops are common and derivative action must be filtered against sensor noise.
What does thermal mass change in the plots?
Larger capacitance slows temperature swings, smoothing disturbances but delaying response. It is analogous to a larger time constant in an RC circuit.
Do smart thermostats violate these basics?
They add scheduling, occupancy sensing, and sometimes weather prediction, but the core still closes a loop between measured temperature and actuator commands.