Test: PID Flight School (3D)
This is the same set of eight missions as the PID demonstration (you fly, on/off, spring, damper, memory, the real world, the rocket landing and the sandbox), with the same physics and the same predict-first questions, rebuilt in three.js as a game that you can work through on your own. It runs full screen and is laid out for a 1920 × 1080 display, so it opens in a new tab.
There are two versions with different visual styles. The missions, physics and controls are identical:
- Diorama: a daylight floating island, with a cel-shaded toy drone and rocket.
- Studio: a dusk sky and a mirror-gloss floor, with a camera drone and a booster rocket.
There is also a 3D version of the PID on a Microcontroller demonstration, which follows on from these missions. The drone’s roll loop runs on a simulated Cortex-M under Zephyr, through four missions (loop rate, fixed-point, resolution and threads) and a sandbox, with the generated Zephyr code:
- PID on a microcontroller (Diorama): the same floating island, with a tilt dial, a gust and the microcontroller beside the pad. Press K for the Zephyr code.
Controls: Space launches (hold it for thrust in the first mission), G sends a gust, P drops the parcel, N switches on sensor noise, F switches on the derivative filter, C changes the camera view and 1 to 8 select a mission (1 to 5 in the microcontroller version). Drag the scene to orbit the camera, scroll to zoom and double-click to return to the default view. Your predictions and objectives are saved in your browser.
What it needs: a recent desktop browser with WebGL and an internet connection (three.js and the fonts load from a CDN).
What it does not model: as in the 2D demonstrations, the PID flight school drone and rocket move only up and down, and the microcontroller drone only rolls. There is no sideways drift or battery sag, and a gust is a short push, not real turbulence. The camera never moves with the physics, so any motion you see on screen comes from the drone or the rocket.
The original 2D versions
Section titled “The original 2D versions”These are the demonstrations the 3D games are based on. They use the same physics and the same questions, and they fit on the page beside the text, so they are the better choice for reading alongside the book or on a smaller screen.
PID Control: Teaching a Drone to Hover
PID on a Microcontroller: From Maths to Zephyr
© 2026 Derek Molloy, Dublin City University. All rights reserved.