In the interest of general tinkering, engineering fun, and micro-controller experience, I've been thinking a lot about espresso machine PIDs. I read through everything I could find on PIDs, but I still have some questions.
To me, the general concept is really pretty simple, and I've got a fun new Arduino micro-controller, an attractive LCD screen, and some temperature sensors. I thought I could probably write my own PID code and mod my Le'Lit. The goal is not necessarily to make the most effective, useful, or cheap PID - I just want to have fun and learn something.
Astute readers will realize that two PID codes for the Arduino already exist. I can follow some of the code pretty well, and there is even a built-in Auto Tuning function that is nice, but I want the satisfaction of writing the code completely myself (I'm willing to sacrifice end user ease of control and even performance).
My goal is to build the simplest PID controller possible, both mathematically and in terms of components.
I want to use my Arduino, my screen, a SSR, and a sensor. I will tune the the set point and gain parameters "by hand" - that is, I will just go back and change the values by rewriting the code. Tedious, but super simple.
I'd really appreciate some suggestions from those of you with control theory / PID / thermal experience to get started. I guess understanding the mathematics and performing the calculations are different things. Here's the basic outline (right?):
- 1. take temperature measurements
2. calculate the proportional, integral, and differential components with measurements (and gains)
3. translate that into heating element on and off
What I'm lacking is all the practical know-how. Here are my current questions:
- 1. How fast is it advisable to switch a heating element on and off?
2. Disregarding some PWM technique or power changing device, one must define a small temperature range around the set point within which the temperature oscillates, correct?
3. Are temperature measurements of the external boiler better than internal measurements, or are they just easier?
And my big question is about temperature sampling and sampling frequency. I can't find any informations about PIDs on this basic level. I think I should take a sliding window of temperature measurements for the calculations. For example, take 10 measurements with 1 measurement every half second replacing the first. I would think this would help with some of the noise in the system, and keep start-up integral errors from overwhelming the function. Is this an effective way? What would be a good sampling time? A good window size? Help?
Thank you very much.



