Your privacy choices

KiwiBee uses optional Google Analytics, Google Ads, and Meta Pixel cookies to understand adult visitors, measure completed sign-ups, and improve campaigns. Essential cookies always stay on. OpenAI’s ChatGPT Ads Pixel also measures page views and completed enquiries after advertising consent, and may use hashed contact details for matching. Privacy policy

Skip to main content

PID Controller Balance Lab

About this simulation

PID Controller Balance Lab lets students experience closed-loop feedback control first-hand. A metallic ball rolls along a tilting beam driven by twin end thrusters while a real-time scrolling chart plots the target setpoint r(t) (green) against the actual ball position x(t) (gold). The controller continuously measures position error e(t) = r − x(t) and computes thruster command u(t) = Kp·e + Ki∫e dt + Kd(de/dt). By dragging the setpoint ring along the beam or kicking the ball, learners discover why pure Proportional control oscillates endlessly, how Derivative gain Kd acts as a predictive brake to damp overshoot, and how Integral gain Ki eliminates steady-state trim offset.

What students can explore

  • Set Ki = 0 and Kd = 0 while keeping Kp = 6, then drag the green setpoint ring and watch the ball oscillate back and forth without damping.
  • Raise Derivative gain Kd to 4.0 and observe how the controller brakes the beam tilt before the ball crosses the setpoint, eliminating overshoot.
  • Set Ki = 0 with Kp = 4 and Kd = 3.5 and notice the small Steady-State Offset readout caused by gravity trim bias, then raise Ki to 1.0 to pull the error to 0.00 m.
  • Click the ball or press Disturbance kick to apply a sudden velocity impulse and test how quickly your tuned PID loop recovers.
  • Drag the green target ring rapidly between the left and right ends of the beam to test step-response rise time and peak overshoot.

Learning objectives

  1. 1Define position error e(t) = r(t) − x(t) in a closed-loop feedback control system.
  2. 2Explain the physical role of each PID term: Proportional stiffness (Kp), Integral bias elimination (Ki), and Derivative damping (Kd).
  3. 3Analyze step-response metrics including rise time, peak overshoot percentage, settling time, and steady-state error.
  4. 4Tune a three-term PID controller to achieve fast, critically damped stabilization after an external disturbance.

Questions teachers ask

What does PID stand for in control engineering?

PID stands for Proportional–Integral–Derivative control. It is the most widely used feedback control algorithm in robotics, drones, cruise control, and industrial automation, combining present error (P), accumulated past error (I), and rate of change of error (D).

Why does the ball oscillate wildly when Kp is high and Kd is zero?

Proportional gain Kp acts like a spring pulling the ball toward the setpoint. Without damping (Kd = 0), the ball builds up speed as it approaches the target and shoots right past it, repeating the cycle back and forth.

How does the Derivative term Kd stop overshoot?

The Derivative term measures how fast the ball is approaching the target (de/dt). Even while the ball is still short of the setpoint, Kd senses its high closing speed and tilts the beam the opposite way early to brake the ball smoothly.

When do you need the Integral gain Ki?

If there is a constant disturbance such as a slight sensor tilt or wind bias, a PD controller settles slightly off-target where the small proportional push balances the bias. The Integral term accumulates that lingering error over time until the offset is driven to zero.

Embed this simulation

Drop it into your LMS, blog, or class site — free.

<iframe src="https://kiwibee.io/en/simulations/pid-controller-drone-balance-3d-simulation/embed" title="PID Controller Balance Lab | KiwiBee" loading="lazy" allowfullscreen style="width:100%;height:min(70vh,620px);min-height:420px;border:0;border-radius:16px"></iframe>

Continue exploring

Bring interactive science into your classroom

KiwiBee's free teacher workspace brings lesson planning, worksheets, classroom tools, and gradebook together in one place.

Start free and create your first class

or explore the teacher workspace →