Keeping Things in Step: Clocks, Power Grids and Computers

A pendulum clock, a power grid and a cluster of servers all face the same problem: staying in step. Three new labs show how each one does it.
Some of the hardest problems in engineering are not about doing one thing well. They are about keeping many things in step. Three new labs look at the same idea from three very different angles.
A clock that keeps time
A pendulum clock is only as good as its pendulum. A full swing there and back of 2 seconds needs a pendulum just under a metre long: about 994 mm at standard gravity. Change the length and the clock drifts.
The Timekeeping lab shows how little it takes:
- A steel rod that warms by 10 °C stretches enough to lose about 5 seconds a day.
- A rod of invar, a nickel-iron alloy made for this job, cuts that about tenfold.
- Even a bigger swing slows the clock a little, because wide swings take slightly longer than small ones.
The same lab compares the clock with the sun. A sundial can run up to 16 minutes ahead of the clock in early November and about 14 minutes behind in February. That gap is the equation of time, and it comes from Earth's tilted axis and its oval orbit. Calendars drift too: the old Julian calendar slips a day from the seasons about every 128 years, while the Gregorian rule takes more than 3,000.
A grid that never runs out
Electricity has to be made at the moment it is used. Every hour, the power coming in must match the power going out. In the Energy grid lab you run a grid for a day:
- Sun and wind are used first, because they cost almost nothing to run.
- Surplus charges a battery, and the battery gives power back when demand is high.
- The power plants fill the rest in merit order, cheapest first.
The last plant needed sets the price for that hour. Add lots of solar on a summer day and you will see midday prices fall while the evening peak still needs gas.
Computers that agree
When a website keeps copies of your data on several servers, those servers must agree on what is true. The Distributed systems lab shows three tools engineers use:
- Quorums: with 3 copies, writing to 2 and reading from 2 means every read meets the latest write, even with one server down.
- Logical clocks: computers cannot trust their own clocks to the millisecond, so they count events instead. Vector clocks tell you whether one event happened before another or the two were concurrent.
- Consistent hashing: when a new server joins, only a small share of the data needs to move.
Try them
Start with the pendulum in the Timekeeping lab, run a cloudy winter day in the Energy grid lab, then make a random message run in the Distributed systems lab and find two events that are concurrent. The Sundial maker is a good next step if you want to build your own sun clock.