Posted by: Andre | November 13, 2009

Custom PID Controller

PID (Proportional, Integral, Derivative) is something that people into coffee equipment talk about a lot. But really, what is it? As a controls engineer I use this control algorithm all the time, but in basic terms, it is a complex equation for keeping something at a stable place, in this case water temperature for coffee brewing. If you think of a car, a PID would serve the same function as a cruise control keeping you comfortably at a steady speed. Why not just use a thermostat for coffee brewing? Well it would be similar to flooring the car until you reached your speed and then letting all the way off the gas once you’re there to let it coast back to the speed you want and then floor it again…uncomfortable right? Well for coffee a stable predictable temperature means very similar extractions every time.

As for the controller itself, I decided to use an Arduino board. This is a small project board that has some of the overhead for using a microcontroller built into it. This means crystal and USB/serial programming and communication interface is already done for me, much less headache and lets me get right to programming what I need. Here is a picture with the Arduino on the left and on the right is a LCD daughter board I built custom for this project.

Arduino and LCD

The LCD board is a simple circuit providing constant current from an LM317 regulator to the PT1000 temperature probe, and a couple momentary push buttons to adjust the temperature set point. Here are a couple more pictures of the project:

Communication through the USB is possible to the computer as well. This allows for graphing to the computer to tune PID settings. I’m using a heavily modified version of the Bare Bones Coffee PID project on the Arduino Playground here: http://www.arduino.cc/playground/Main/BarebonesPIDForEspresso My version basically also allows for communication to the LCD, functions for the push buttons and temperature function for a PT1000 probe instead of a thermocouple.

Overall I’m pleased with the results, not only does the PID work beautifully and give me great extractions on the Caravel, but my major project goal was to get comfortable with the Arduino in an effort to possibly use it later for the main controller to a temperature and pressure profiling espresso test bench machine. I believe with a dedicated laptop for controls the Arduino could be programmed as the interface to the devices in a pass-through system.

Advertisements

Responses

  1. Hi, this is a very interesting project. Would you share the code for the arduino? I really would like to make a PID for my machine. Would be happy to hear from you about that. Cheers

  2. Hi, thanks for the interest. This link gives you a place to start: http://www.arduino.cc/playground/Main/BarebonesPIDForEspresso but it will depend on exactly what equipment you have and how you have it plugged into the board. I would post my code, but I’ve switched laptops a few times, and will have to find it on one of my backup hard drives. I’ll post when I find it!

    Since this post I’ve made a project box for the board and put everything inside, but everything is working stable enough that I haven’t changed anything else.

  3. Thanks, i have a PT100 with a nice Analog Devices 6B13 converter module (from Ebay) which has a RS485 and RS232 output, so i should have temperature in plain ascii at the serial input of my arduino. Adapting shouldn’t be a problem, right?
    Kind regards


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: