www.chriscoffee.com: quality & service, second to none

Optimizing PID Parameters in a Modified Heat Exchanger

Want to talk espresso but not sure which forum? If so, this is the right one.

Link to "Optimizing PID Parameters in a Modified Heat Exchanger"by Ken Fox on Mon Jan 23, 2006 3:38 am

Greg Scace made a seminal post a few weeks ago on alt.coffee, dealing with programming a PID Controller for use in an Espresso Machine. The link to that post and thread is below:

http://groups.google.com/group/al...1#92c194b7df31b499

Greg did not design these instructions around Heat Exchanger espresso machines, rather they were more general. In my own judgement these instructions are more pertinent to single and double boiler machines and only somewhat useful for heat exchangers, based both on actual experience trying to impliment them and on practical considerations. I will illustrate this both with descriptions of my own experiences and with actual shot temperature data obtained in trying to impliment Greg's suggestions.

First, and most importantly, Greg made a suggestion that I think is EXTREMELY IMPORTANT, regardless of the type of machine you are attempting to control: this is to narrow the temperature band over which the controller will operate, and thereby improving the accuracy of the temperatures you will actually try to control. On the Fuji PXR3 controller, this is done with the "P-SL" and "P-SU" parameters in block 2 and the "SV-H" and "SV-L" parameters in block 3. I refer the interested reader to Greg's original post for descriptions on how to do this, or one can find this information in a bit harder to decipher form in the instructions sheet that ships with the Fuji PXR3. Presumably other PID controllers have similar adjustments that can be made but I am not familiar with them so I refer interested parties to the literature that shipped with their particular controllers.

What we are doing here basically is giving the controller a range over which it can accept and act on temperature setting instructions. The default settings on my Fuji PXR3 controllers were a low of 32F and a high of 752F; in my particular case it was appropriate to limit the range to boiler temperatures of 52F to 252F, a range of 200 degrees F, or less than a third of the original factory specified range. This appears to have a huge impact on accuracy in the controller's function, as I hope to demonstrate below.

The rest of Greg's post deals with stragems for manually tuning the "P" the "I" and the "D" parameters of the controller. I refer the interested reader to Greg's post for clearly written explanations of these parameters. I have tried to use these instructions on one of my HEX machines (the other Junior, currenlty undergoing PID modification) and after 3 hours futzing around with it I came to the conclusion that these instructions really are not tailored to a Heat Exchanger. The reasons for this are that HEX machines that are PID'd only indirectly have the output parameter of interest (e.g. the brew temp) controlled by the controller. What the controller is really controlling on a Heat Exchanger is the boiler temperature. The brew temperature, once again THE THING that is of interest here, is "damped," in that the boiler temperature has a lag time associated with how it effects the temperature of the water in the heat exchanger and hence the brew temperature.

What I found from my testing was that fiddling around with the P and the I and the D was basically a waste of time with my HEX machines. Also, the "tuning" that Greg proposes is quite subjective when one is tuning the boiler but is really interested in brew temperature from a HEX design.

Instead, I decided to try the autotuning functions on the Fuji. Those who know their PXR3 manuals know that there are TWO autotuning methods, "A1," and "A2." "A1" is the standard autotuning that most people use; it takes several minutes and it is done. "A2" is a more complicated algorithm that attempts to reduce overshoot; on my rotary Junior it takes about half an hour or more to complete. This is what I ended up using for the graphs that accompany this post. An alternative approach would be to use the standard ("A1") autotuning process but to pull shots while this is ongoing. I tried that but my impression is that it won't yield better results than the "A2" autotune at idle that I ended up using.

Let's cut to the chase: reducing the range over which the controller operates increases precision and tightens the variance in shot temperatures obtained from my HEX machine. The improvement is MOST NOTABLE in the temperature variations observed on random shot pulling after random idle intervals. When looking at sequential shot series ("repeated shots") one sees an overall tightening of the curves over the duration of the shot, not just the most temperature stable ("flattest") portion of the shot temperature curve.

I would hope this is true of other HEX machine designs as well but since I don't own any of them I'll have to leave that to others to test. The results from my own machine follow. I should note that the reduction in temperature range has shifted up the measured brew temperatures from what I observed previously, for a given boiler temperature. At the same time the variance has been reduced.

For a boiler temperature of 231F, here is what I got today for a shot series of 7 consecutive double shots, with a brew temperature averaging around 202.5F. This can be contrasted to what I got before I reprogrammed the controller:

Image


Given the temperature shift with reprogramming, I'll compare also to a similar brew temperature plot from a lower controller setting from before reprogramming, this one at a boiler temp of 232F, but with a similar brew temp in the 202F+ range:

Image


If we look at some other temperatures we have for example a boiler temperature of 231.5F, which is only 0.5F higher than the preceding series:

Image


The graph appears to my eyes to reflect the extra 0.5 degrees F requested over the previously shown 231F "reprogrammed" curves above. The average brew temp appears to be around 203F vs. 202.5F in the former.

On to 229F boiler temperature curves, reflecting about a 199F brew temperature:

Image


What does this change in controller programming do to random first shots obtained after random idle intervals, which anyone familiar with shot temperature measurements will admit are the most difficult shots to "get right?" I alluded to this issue in a post last week, which appears to have received a collective yawn :P here given the very few views and responses it garnered. But this is the crux of the problem for a low volume setting (e.g. like your house, you home baristas!) when you walk up to your machine, see some reassuring LED indicating boiler or brew temp, and assume that you are getting what you see! You aren't, regardless of your machine, and of that I'm about 99.8% certain, at least until the laws of thermodynamics are repealed :roll:

Here's what I got in my own measurements tonight after reprogramming: Because there was an issue before in my observations, shown on my graphs, with first shots after a longer idle period (due to espresso head overheating on my Cimbali Junior(s)), I have labelled the shots that were obtained after idle periods equal to or exceeding an hour:

at 231.5F boiler temp, equalling around 202-203F brew temperature:

Image


at 231.0F boiler temp, a little lower:

Image


at 229F boiler temp, equalling around 199-200F brew temp:

Image


For comparison, here is a "random first shot series" from before, with the original programming:

Image


One can see that the range of actually obtained shot temperatures on random shots obtained after variable idle periods has been about cut in half, and this has been demonstrated at three different boiler temperature settings after reprogramming. These are the only 3 temps I've tested, and I'm sure I can produce many other similar curves at other relevant shot temperatures.

In summary, I have shown (what I regard to be) exceptional shot temperature stability both on repeated shot series and random shots taken after variable idle intervals, on a PID-modified Heat Exchanger machine. The greatest improvement on reprogramming (reducing temperature range ala Greg's recommendations) has been in random first shots after idle.

I have yet to see similar curves posted from any other machine that seem to be demonstrably more consistent. The fact that this can be done with "ancient" heat exchanger technology after a modest modification (installation of PID temperature control) should be of interest to those looking for shot temperature stability, shot to shot, but who would prefer to hold onto and modify their present equipment rather than spend a lot of money chasing the "newer technologies." A heat exchanger so modified can easily have it's boiler temperature increased to accommodate a large volume of milk drinks and then the temperature can be reduced to make temperature stable straight shots at predictable shot temperatures.

Also, I believe I have shown that a couple of the tweaks in PID controller programming that were originally recommended by Greg Scace are applicable the HEX design machines, and are well worth doing for the benefits they provide.


ken
Ken Fox
 
Posts: 1065
Joined: Oct 28, 2005
Location: Idaho

Link to "Optimizing PID Parameters in a Modified Heat Exchanger"by Balthazar_B on Mon Jan 23, 2006 7:43 am

Excellent post, Ken. Maybe I'll try the PID mod on my Vetrano -- after the warranty has expired :wink: .
- John
Balthazar_B
 
Posts: 58
Joined: Nov 22, 2005
Location: California
www.klatchroasting.com: USBC champion, voted 2007 WBC 'best espresso'
www.klatchroasting.com: USBC champion, voted 2007 WBC 'best espresso'

Post Withdrawn

Link to "Optimizing PID Parameters in a Modified Heat Exchanger"by Ken Fox on Tue Jan 24, 2006 11:21 am

Reluctantly I have to withdraw this post. The first three temperatures I tested were rock hard stable before I posted this and I felt confident that other boiler temperatures would test out similarly. Unfortunately, two or three other temperatures (both within and outside the range I posted about initially) varied considerably with each testing round. I have NO idea why this would be the case. One possibility is that the P-I-D factors are at fault. Another, machine related factor could be the fact that my autofill has been coming on way more often than normally, which I'm now thinking may be related to the fact that I cleaned the autofill probe recently and it might be set too high. This can be easily corrected but I don't have the time to repeat this testing for the time being.

As you can imagine, this has been very frustrating and a huge time sink. My original posting about temperature stability in a heat exchanger still stands; I tested all those boiler temperatures repeatedly and got consistent results, both by temperature and when relating one temperature to another (e.g. 230F was hotter than 229 and consistently so).

I have reset the P-I-D parameters back towards what Jim S. set up when he originally set up this controller a couple of years ago. I'll futz around with the stuff more when I have the time, but for now it is only honest to withdraw this post and to suggest that one not use this as the basis for tuning their own PID in a HEX machine.

Sorry.

ken
Ken Fox
 
Posts: 1065
Joined: Oct 28, 2005
Location: Idaho

Re: Post Withdrawn

Link to "Optimizing PID Parameters in a Modified Heat Exchanger"by coffee_monkey on Tue Jan 24, 2006 2:41 pm

Keep up the great work Ken! Even though I have nothing (technical) to add, I would still like you to know that someone out there appreciate what you are doing!.
coffee_monkey
 
Posts: 36
Joined: Aug 05, 2005
Location: Boston

Re: Post Withdrawn

Link to "Optimizing PID Parameters in a Modified Heat Exchanger"by Ken Fox on Tue Jan 24, 2006 5:04 pm

coffee_monkey wrote:Keep up the great work Ken! Even though I have nothing (technical) to add, I would still like you to know that someone out there appreciate what you are doing!.


Thanks, I appreciate it.

I believe that what happened were two things: (1) autofill probe level was set incorrectly (by me) a little more than a week ago, after I cleaned the probe. The result is that the probe was not keeping the water to the right level, rather the boiler had too little water in it, and the level was such that just opening the steam wand was enough to cause the autofill to kick in, although often with a delay of minutes to an hour. I was of course letting off steam a lot in order to quickly change the boiler temperature so I could move on to the next test temperature. I was hearing the autofill kick in 6 or 8 times a day when usually I'd hear it a few times a week. I tried to ignore whether or not the autofill came on during the testing (to be fair) but this clearly screwed up the results;

(2) yesterday I typed in the data from a full datalogger (like 500 numbers) and did it hours after the testing. I must have confused what the boiler setting was when I did the actual testing because the charts looked good, just they were 2 or 3 degrees different from when I tested the same boiler temperature earlier. But I can't be sure.

I think you either use all your data or you throw it all out; I could have picked and chosen some nice graphs obtained after the original graphs I posted on this thread, but that would have meant ignoring ones that were screwed up either due to my transcription error or to the autofill problems. I have readjusted the autofill and seem to have corrected the original error.

So, it is my fault and maybe I just need to buy one of those PC connected dataloggers and forget about typing all this sh*t in.

ken
Ken Fox
 
Posts: 1065
Joined: Oct 28, 2005
Location: Idaho


Return to Knockbox