Mind the toves. They can be a bit slithy. Don't even get me started on the borogoves.

Friday, March 7, 2008

Some background on the PID project

When I first got my Silvia espresso machine about three years ago, I was really interested in all the mods people were doing. I did the pressure modification because it was relatively easy, cheap, and it seemed to me that it would improve my espresso. I really wanted to install a PID too, but I stopped short because using a commercial PID controller seemed overly expensive to me. So I learned to "reverse time surf" and made do with that for a long time. The problem with that is that it takes a long time between shots, and without a temperature readout, its still guesswork.

PID stands for proportional, integral, derivative, which are the elements of a formula for controlling a closed process (one input, one output) within a very tight range. The cruise control on your car is a PID controller. Basically the formula looks at the current error (distance from desired temperature) and adjusts the power to the heating element based on the sum of: the current error (P), the sum of errors over time (I) and the current rate of change of the error (D). For more details check out the wikipedia page on PID controllers.

The reason for using a PID to control the boiler on an espresso machine is that "perfect" espresso requires (among other things) a very specific temperature (depending on the coffee used) and the temperature must be kept as close as possible to that temp throughout the brewing process. The Silvia is a good candidate for a PID, since the temperature is already pretty stable for a relatively inexpensive home machine. (To get a more stable temp, you'd have to spend at least twice as much as Silvia.) In actuality, the PID has nothing to do with keeping the temp stable during the pour, it only helps the machine recover quickly without overshoot. Temp stability is a result of the thermal mass of the brass in the machine, which the Silvia has quite a lot of. The PID also makes it possible to precisely control the starting temp, which to me is the biggest advantage. Here's a blog that has some temperature plots so you can see the difference between PID and non-PID temperature ranges.

So, why am I doing this now? Hmmmm.... Well it started with the Make magazine video podcasts. I got addicted to them, and several of their projects used this thing called an "Arduino". I was like, "what the heck it that." I looked it up and found out it was an open source microcontroller. I had built a robot with a Basic Stamp several years ago, so my interest was piqued. Then, I ran across Tim Hirzel's and Nash Lincoln's blogs where they talked about using the Arduino for PID. Now all my lights were lit up.

As I've gotten into this, I think that if someone just wanted a simple PID, it would be easier to go the traditional route, using a dedicated PID controller. (Murph's PID page is the canonical reference.) There are several people selling "PID kits" that make it really simple. But the cool thing about using a full-blown microprocessor like the Arduino is that I can add as many features as I want. I plan to add a brewhead light that will light up during shots, using the PID to control steaming, and a custom LCD display. Tim and Nash have are taking it way further than that, doing things like using a nintendo controllers for remote control and more!

No comments: