# Gaggia PID Boiler temp during brewing



## ZappyAd (Jul 19, 2017)

Now that I have a @MrShades PID on my Gaggia classic I thought I would look at how the boiler temp changes over time. I'm interested to know if the behaviour I am seeing is 'normal' or if there is something else to optimize.

Here is a graph of the PID temp vs time during a 35s shot.









I have the initial temp (of the boiler) set at about 106. This is because when I tested the water temp at the brew head (with a styrofoam cup and thermometer) this was the temp reading on the PID that gave me about 93' in the head. This may be too hot (?) but the taste of the coffee seems better at this temp than at a lower temp.

I suppose the graph isn't revealing anything too interesting - as the extraction starts colder water is coming into the boiler which is then losing temp until the heating elements kick in. I guess there is a question about:

- is the heating starting soon enough or is the temp drop too great?

- does this cooler water get to the brew head and is that affecting the taste?

Does anyone else have any figures about how the temp changes on their PID so that we can compare to see if we are at least in the same ballpark? I'm trying to think of a way to measure the temp at the brewhead effciently (I have about 99 cups left to experiment with).

This is all part of a possibly never ending process of ticking off things that could potentially be sub optimal in my setup so any help is appreciated.


----------



## ajohn (Sep 23, 2017)

If the water is really at 106C it's boiling. It may pay to check the readings it gives against something else. There is a catch with that as nothing responds immediately to temperature - there is invariably a lag even in the part that senses the temperature.

I'd suspect that you need to tune the PID while a shot is running and then see what happens when it isn't and shortly after a shot has been pulled. Temperature will probably go over the setting. You may find that 30sec is too short to allow the unit to tune correctly.

For consistency on a machine in situations where several shots are pulled on the trot to make a number of drinks I find that a pre flush is needed to get the grouphead, internal bits and portafilter up to temperature. That's true for different reasons on both a BE and a Piccino. So that needs to be done even when only one shot is to be pulled otherwise taste will vary. What should interest you is the brew temperature after that has been done - ideally water temperature as it goes into the coffee.








I want to mod a Piccino at some point - the task is full of problems so much so that I'll try a more precise on off control before pid.

John

-


----------



## ZappyAd (Jul 19, 2017)

As I understand it the temperature sensor is effectively giving the temperature of the boiler casing quite close to the water held inside it. Whatever it reads the water inside will lose a bit of temp as it makes its way to the brew head (about 8 degrees but possibly in my case a little bit more). So to hit the coffee at 93 it pretty much has to be above boiling temp inside the boiler (although the pressure might mean that it isn't actually visibly boiling?)

These results are after a complete boiler empty from standstill (to remove overnight water), a full 30+ minute warm up with cooling flushes. So everything is at temp and steady state.

The PID tuning is automatic and done by the PID itself with the press of a button. I don't think it is possible to do it while water is running through the boiler and I don't think the Gaggia is powerful enough to heat water to temp on demand as it flows. I thought you are effectively relying on having enough hot water in the boiler at the right temperature to start with, and then heating up a new batch after the shot. The PID is really just keeping the water at a certain temperature more accurately than a simple on/off system.

I'm really only interested in the temperature of the water on the coffee but at the moment the boiler temp is the only proxy I have for that


----------



## JojoS (Oct 1, 2014)

Build yourself a thermofilter for a little more accuracy in actual brew temperature readings. You might find a more aggressive PID setting helpful or even a PID bypass to turn the boiler heaters on to full power to maintain/support a desired temperature profile for the duration of the shot.


----------



## haz_pro (Apr 4, 2013)

I find flicking the steam switch for a couple of seconds before hitting brew helps.


----------



## ZappyAd (Jul 19, 2017)

JojoS said:


> Build yourself a thermofilter for a little more accuracy in actual brew temperature readings. You might find a more aggressive PID setting helpful or even a PID bypass to turn the boiler heaters on to full power to maintain/support a desired temperature profile for the duration of the shot.


I will look into the thermofilter. I was thinking that at the very least the boiler should always come on when you press the brew switch because you know that the temp is always going to drop so you might as well get a head start switching on the heating element. I guess the PID is doing it pretty soon after the temp starts dropping but it might as well do it instantly.


----------



## martinierius (Sep 28, 2014)

If you know a little about electricity you can wire the brew switch so that the heating is on during the time the pump is active.

When I had my classic (actually a gaggia coffee) I also put a heavy duty rectifier diode between the brew switch and heating elements which gave a bit less than 50% power during the shot: much easier for the PID to stabilise after a shot.


----------



## JojoS (Oct 1, 2014)

I use the alarm function to bypass the PID during the shot for a few seconds at the start of first few drips. The steam switch trick only works before you turn on the pump. There is a tutorial on how to build a thermofilter over at Gaggia Users Group.


----------



## MrShades (Jul 29, 2009)

The drop in temp, and subsequent recovery, is caused by two main things - the laws of physics, and the PID algorithm!

The Gaggia boiler is designed in such a way that cold water enters the bottom of the boiler, but brew water exits via the top of a pipe that goes from the bottom of the boiler to about half way up the boiler (inside it). Cold water is more dense that hot water, hence cold water entering the bottom of the boiler SHOULD (in theory, at least) cause the hot water at the top to exit via the tube. Happy days! However, turbulence inside the boiler caused by the water entering upsets this slightly, and obviously causes the water to mix more than would be ideal. So - you're still getting cold water mixing with your nice hot water, and the temperature of the boiler will invariably drop.

Without additional modifications otherwise, the PID only has the temperature sensor to use as a system input. It has no idea that you've hit the brew switch (or steam switch) - so it needs the drop in temp to cause the PID algorithm to call for heat. It notices a sudden and large drop in temp, and reacts by (reasonably quickly) calling for heat - and quite a bit of it.

With a PID there's a fine balance between producing something that heats up quickly, from cold and between shots (or during a shot) - and is also temperature stable, and does take a million years to stabilise and/or constantly overshoot the set temperature significantly. You can't have an ideal of a PID that reacts instantly and aggressively, but is also highly temp stable - so it's a balance.

As has been mentioned, modifying your Classic further so that the heating elements are always on whenever the brew switch is hit wouldn't be difficult at all - and there are various ways of reducing that "full power" burst if you wanted something more gentle but still instant. Doing this would help the Classic (not the PID) react instantly and more aggressively. There's various ways of being clever about this, and using an Arduino or similar to control many elements of the Classic (inc PID control, heating elements in general, pump, etc. etc.) - and with time, effort and the right knowledge you could produce a temp controller that handled the nuances of espresso production very well.

The other area worth looking at is the reason for the drop in the first place - cold water entering the boiler. Having a preheat coil or preheat box fitted would (obviously) preheat the water entering the boiler. This would mean that the boiler temp wouldn't drop so dramatically or so quickly, and the PID would be better placed to handle the slower and more gradual drop in temp with its usual control.

On my Alex Duetto dual boiler, if I don't have the (preheating) steam boiler on - then I see a similar drop in (perceived) brew temp of the (much larger) Duetto brew boiler during a 30s shot. It'll start at 94c but drop to around 88c during a shot. I'm comforted by having 88c water pumped through a small hole in an E61 group head - which is 4kg of solid brass that's been at 94c for quite a while! You could almost pump cold water through it and still get 94c water out...

Anyway - what you're seeeing is perfectly normal. You can improve it with further modding... but it's still hugely different to how it was when standard!

Adrian


----------



## AndyZap (Dec 29, 2016)

Also: the brass shower screen holder is very useful for keeping the brew temperature stable. It is much heavier than the original (aluminium?) holder and accumulates the heat well.

Regarding the PID parameters: seems that the PID duty cycle (do not remember the correct name in the manual) is the one to check. I have tried to decipher the PID algorithm, even wrote a tool in c# which captures PID temperature/activity and tries to fit an algorithm into it - another tonne of coffee and I am sure I will get it. Anyway, as I can see it, for every duty cycle PID calculates the % of the "ON" time, this is how it controls the amount of heat to be injected into the system. E.g. PID might calculate the need for 25% power, so for 20 sec cycle this translates into 5 sec ON and 15 sec OFF.

IMHO, the PID duty cycle does not impact much the "aggressiveness" of the algorithm, but with the smaller values it reacts quicker to the condition changes, e.g. during the brew. 20 sec value seems too large to react to 30 sec brew time, so I have set mine at 5 sec. 2 sec might be even better, but I was worried that it would switch the heating on/off too frequently, and this might impact the life of the heater (not sure if this is true although - any opinions?)

Finally, I have a dimmer fitted, so can do the low-pressure pre-infusion. This makes the total shot time even longer, so the PID has plenty of time to recover. Judging from the coffee taste, I think the coffee is happy with the temperature


----------



## MrShades (Jul 29, 2009)

AndyZap said:


> Also: the brass shower screen holder is very useful for keeping the brew temperature stable. It is much heavier than the original (aluminium?) holder and accumulates the heat well.
> 
> Regarding the PID parameters: seems that the PID duty cycle (do not remember the correct name in the manual) is the one to check. I have tried to decipher the PID algorithm, even wrote a tool in c# which captures PID temperature/activity and tries to fit an algorithm into it - another tonne of coffee and I am sure I will get it. Anyway, as I can see it, for every duty cycle PID calculates the % of the "ON" time, this is how it controls the amount of heat to be injected into the system. E.g. PID might calculate the need for 25% power, so for 20 sec cycle this translates into 5 sec ON and 15 sec OFF.
> 
> ...


I'm pretty sure that the standard setting for the "duty cycle" is 2s, which is what I'd recommend. It's the "ot" (or Proportional Cycle) setting - which is in seconds (and not in minutes as it sort of mentions in my manual). All of P,I and D settings are essentially "seconds" where relevant (ie, I and D).


----------



## ZappyAd (Jul 19, 2017)

I would like to investigate this further with something like an Arduino to get control of more of the variables but I'm more of a software guy so am a bit cautious around wires!


----------



## MrShades (Jul 29, 2009)

ZappyAd said:


> I would like to investigate this further with something like an Arduino to get control of more of the variables but I'm more of a software guy so am a bit cautious around wires!


The "wires" part is easy... the software gets pretty complex!


----------



## ZappyAd (Jul 19, 2017)

MrShades said:


> The "wires" part is easy... the software gets pretty complex!


But it isn't ever going to kill you


----------



## MrShades (Jul 29, 2009)

ZappyAd said:


> But it isn't ever going to kill you


Have you not watched Robocop or The Matrix?


----------



## AndyZap (Dec 29, 2016)

MrShades said:


> I'm pretty sure that the standard setting for the "duty cycle" is 2s, which is what I'd recommend. It's the "ot" (or Proportional Cycle) setting - which is in seconds (and not in minutes as it sort of mentions in my manual). All of P,I and D settings are essentially "seconds" where relevant (ie, I and D).


Indeed, this is the one: "ot" (or Proportional Cycle) I talked about. The 1/32 PID has 2 sec but the 1/16 PID has 20 sec as default - too slow for the brew cycle


----------



## slipperydippery (Feb 19, 2017)

martinierius said:


> If you know a little about electricity you can wire the brew switch so that the heating is on during the time the pump is active.
> 
> When I had my classic (actually a gaggia coffee) I also put a heavy duty rectifier diode between the brew switch and heating elements which gave a bit less than 50% power during the shot: much easier for the PID to stabilise after a shot.


I hope you see this @martinierius; Could you give an instruction as to how you installed this? My bigger shots (60g yield) are dropping from 92 to 85 degrees during the shot (in the basket), and I'm trying to find a way to improve this.


----------



## martinierius (Sep 28, 2014)

Simply said: put a heavy duty rectifier, the heating elements and the Brew switch in series/serial? (English not my native language). Check everything double to be sure you don't create a short when closing the brew switch.

If you have a drawing of the wiring as it is now I can explain more.


----------



## slipperydippery (Feb 19, 2017)

martinierius said:


> Simply said: put a heavy duty rectifier, the heating elements and the Brew switch in series/serial? (English not my native language). Check everything double to be sure you don't create a short when closing the brew switch.
> 
> If you have a drawing of the wiring as it is now I can explain more.


Oh thanks, I'll get on that!


----------



## shodjoe1 (Apr 25, 2018)

If the water is at 106C is not boiling ...it is already STEAM!!!


----------

