Heat-o-matic: Making a Burger with Micropython

If you want to maintain a system in a particular state, you may well consider using a PID controller. PID stands for Proportional, Integral, Derivative. It sounds ominously mathsy but is actually pretty intuitive:

At every time-step, a calculation is made,

Proportional + Integral + Derivative

The Proportional term is a constant (Kp) multiplied by the distance between the current state and the target (the further away from the target, the stronger the adjustment)

The Integral term is a constant (Ki) multiplied by a running total of the distance from the target (compensates for any ‘drift’ in the system)

The Derivative term is a constant (Kd) multiplied by the speed at which the system is moving towards the target (helps prevent overshoot once you get to the target).

The sum of the three terms determines how extreme an adjustment is made until the next time-step, when the value is calculated again.

There are lots of excellent descriptions knocking about, so I won’t go on about it too much.

So what?

That’s what a PID is, but what is it used for? They pop up in lots of places where a process needs to produce a steady value. Things like pressure, speed, direction or temperature.

Water baths have been used in commercial kitchens forever, and have been creeping into domestic ones more and more. Armed with our PID controller code, a heating element, and a big pan of water, we made a tasty burger. Here’s a video:

Previous
Previous

Fob: Battery Life - forever

Next
Next

Grind Finer with a Rasperry Pi Pico