But controlling amplitude controls period at least to some extent. That’s how Mumford tamed a Eureka clock, so using the processor’s clock to control amplitude contravenes my self imposed rules. Others might have different rules.
https://www.bmumford.com/clocks/eureka/
Mmmm, what do others think? I’ll carry on for the moment. Done in software so easily switched off if the jury find me guilty.
The goal is minimising the difference between beats, requiring two steps:
- Finding the optimum amplitude (not done yet – I guessed)
- Writing a governor that maintains amplitude near optimum by tweaking impulse power. The governor works. Here’s the flowchart:

The governor samples 20 amplitudes and then compares the rolling average is within the target range (60000 ±1000uS). If the rolling average is below the lower limit (amplitude falling), the clock is ordered to increase impulse by 0.08mS. If above the upper limit (amplitude rising), the clock is ordered to decrease amplitude, also in 0.08mS steps.
The log shows a 2.2mS impulse keeps amplitude within range for 240 beats, but it’s not strong enough. So the governor increases impulse over 120 beats up to 2.68mS. It finds that to be too strong after 280 beats, and then reduces impulse in 6 steps over 120 beats down to 2.36mS. Changes highlighted in green and red. Considerable hysteresis.

At present all the parameters are arbitrary. Target range, impulse increment, and sample size, all guesses. I don’t know how to set them logically. Inappropriate settings cause the governor to hunt or fail to get a lock, or to respond too violently, or too slowly. Needs more thought.
As implemented, gut feel is it’s too slow.
It’s behaviour is analogous to a mechanical governor, where the balls are replaced by the bob mass, gravity by a magnetic field, the drive shaft by a rolling average, the operating point adjuster by a target range, and the throttle valve by impulses.

Does anyone understand how to design governors? I’ve exceeded my understanding and have no experience. More swotting, and I’d rather watch telly. Doesn’t help that James Watt was much smarter than me!!!
Dave