Adding a PID controller to an espresso machine

Adding a PID controller to an espresso machine, by "simonp"

A PID Controller - what is it?

A PID controller is a device that allows accurate and stable temperature control of a system. It does this by using a mathematical algorithm, which attempts to predict the response of the system based on parameters that you program into it. It does this using 3 different calculations: Proportional, Integral & Differential. We won't go into detailed descriptions here of how each of these work (there is plenty of very technical information available on the internet), but the most commonly used analogy is that of trying to stop a car by driving up to a line, but only hitting the brakes when you reach that line. You will overshoot. A sensible driver will predict when he needs to start braking to stop at the line, and then he will regulate his braking along the way to ensure he stops at the line smoothly. The sensible driver is basically how a PID works.

Why Use One?

Espresso machines (leaving aside HX machines which work differently) normally use a thermostat fitted to the boiler to control the heating element and thus the temperature of the water. These devices have built in hysteresis to stop them from constantly switching i.e. it will switch off at, say, 110°C and turn back on at say 100°C. As a result of this hysteresis the temperature of the boiler (and therefore the brew temperature) can vary by quite a lot. The common method of getting over this is by "temperature surfing", which is running water through the group until the thermostat turns on and then waiting for a set amount to roughly achieve the desired brew temp. This method is wasteful of water, time consuming, and not that consistent.

The PID controller, as described above, takes this hassle out of the equation by ensuring that the boiler is held at a particular temperature whenever you wish to pull a shot (leaving recovery time aside for the moment). The second advantage of this control method is that you are able to easily change the boiler temperature and, consequently, the brew temperature so you can fine tune your brew temperature, and change it for different bean blend requirements if required. The third advantage is that it looks cool!

How much does it cost?

This very much depends on where you get your parts from. Buying all new parts will cost you in the region of £200. The most costly bit is the PID controller, which would cost around £150 new. However, they are regularly on available on ebay either used or often old but unused. I picked up one, which I suspect has never been used, for £7.50!

Is it difficult?

This probably depends on the machine, but certainly on the Rancilio Silvia it is very simple, and took me less than an hour to complete. A small amount of electrical knowledge and some common sense is all you need.

The best type of PID to use for this application is a mains powered one, however I didn't check carefully enough, and mine is a 24V one, not a big problem as £3 got me a small transformer to run it that is small enough to fit inside the box I had to mount the PID controller in.

The PID in its box with transformer

Simon's PID in its box with the transformer

Installation

The rest of this article does relate specifically to installation of a PID controller on to a Rancilio Silvia, however the same basics will apply to any single boiler espresso machine.

The first thing to do is to locate the boiler temperature thermostat for the brew temperature control. There will be 2 thermostats, the other one being for the steam temperature. You have a choice at this point whether to use the PID to control the steam temperature as well as the brew temperature. I decided to keep the steam thermostat in circuit as the PID controller I bought only has 1 setpoint (some have 2 which allows you to easily switch between brew temp and steam temp, usually by the press of a button), and I couldn't be bothered to keep changing the setpoint every time I wanted to steam. There is one advantage to controlling the steam temp with the PID, and that is you don't have to guess the point at which the thermostat will turn off, and so keeping the boiler at maximum steaming capacity, as the boiler will always be at a steady temperature. I found that with the digital temperature readout I was easily able to determine the stat switch off point anyway, so don't find it a big issue.

Siting the thermocouple

Siting the thermocouple

To get back to the point, once you have located the brew thermostat, you must disconnect it from the circuit. It is this point in the circuit where you must wire in your solid-state relay (SSR), which replaces the switching function of the thermostat.

Now you need to find a suitable place to mount the thermocouple. Most of the people who have PIDed Silvias have used thermocouples that are fixed inside an eyelet that they then mount under one of the screws holding the old thermostat in place. I couldn't find one of these readily available so I used a normal bead K-type thermocouple, and bought some special thermocouple adhesive pads to stick it on the top of the boiler. I later moved the thermocouple but more on that later.

The Solid State Relay (attached to the machine frame)

The Solid State Relay (attached to the machine frame)

Next you need to find somewhere to mount the solid-state relay, this will need to be mounted on a largish area of metal, to act as a heatsink. I used the same place as everyone else seems to have used on the Silvia as there is conveniently a stud to fix it to. You will need to use wire capable of coping with the heat inside the machine around the boiler to wire the SSR to the wiring you took off of the thermostat.

The Solid State Relay (showing connections)

The Solid State Relay (showing connections)

For ease of fitting, I have my PID wired up to it's own mains plug, but some have wired it in to the machines mains switch for convenience, if you are going to do this you will need to make sure that you use wiring and connectors that are suitable for the high temperature environment inside the machine.

The installation was pretty simple, and took about an hour. I ran the auto tune function (this runs through some heating & cooling cycles on the boiler to try to determine the best settings for the system), which got it working OK, but I needed to alter the cycle time to speed the reaction up.

It is certainly easier now to use than with the 'temperature surfing' method to get brew temperature consistency. Also a lot less use of water as I don't have to run a mug of water through each time before I pull a shot.

The other big advantage being that I am now able to adjust the brew temperature for different blends and roasts. It is great just to be able to run some water to heat the cup and portafilter, and by the time I have dried, dosed, tamped, re-locked, dried the cup and got ready the temperature had pretty much re-stabilised so I can just run the shot.

I still had to tweak the PID as it did overshoot on temperature sometimes, but even so it is way less than the (so I am told) 40 degF hysteresis on the standard thermostat!

The PID keeps a steady temperature superbly. The machine comes on about an hour before I get up, when I go downstairs the temperature is within 0.5°F of my setpoint. It is also great for steaming, as the thermocouple readout lets you start steaming just before the steam thermostat cuts out so you can keep the boiler on during steaming.

The downside is that before pulling a shot I ran 60-90ml to heat up the cup(s) and the portafilter, and I found that when the temperature ramped back up, it overshot by 5 or 6 degrees, and took a few minutes to get back down to the setpoint. OK, in reality the extra temperature is small, and it's debateable how much difference this makes, bearing in mind the 30-40 hysteresis of the original temp stat.

I tried changing some of the control variables to eliminate this overshoot, but never got it that good. A lot of people use PID controller with "fuzzy logic". This basically means that the controller continues to self-learn the system it is attached to, and aims to make it function better, and increase accuracy/stability over time. The PID controller I have does not have this function.

Having looked around for info on the ‘interet, I came across an old alt.coffee posting by someone who had mounted the thermocouple on the side of the boiler, about half way down rather than on the top where the old thermostats are. This made more sense to me, as it is closer to the centre of the main mass of water, and would be less prone to the rapid temp fluctuations near the cold-water inlet, which don't indicate the real boiler temperature. I moved the thermocouple and re-ran the auto tune on the PID controller, as it was around 1.00am I then went to bed!

Placing the thermocouple

Placing the thermocouple

The next morning the temperature was, as usual, close to my setpoint, and I ran some water through the portafilter. I watched the temperature coming back up, and it settled within 1°C of my setpoint .

I'm sure this new sensor location more closely displays the water temp that will go to the grouphead, so this looks good.

Most Silvia PIDers seem to run the boiler temperature at 232°F but I run mine at 228F which gives me 92C running 2oz of fluid into a styrofoam cup which is plenty hot enough. I started off at 225F but found the espresso sweeter with the boiler at 228F.

Would I change back?

NO WAY!!! It is so easy now, I know every time I pull a shot what the temperature is, and that it is correct, so I can keep my attention on keeping the portafilter hot, and dosing and tamping correctly. I'm not saying I get a perfect shot every time, but I always get good crema, usually with mottling, and if a shot is bad, at least I know it is either the roast or bad dosing/tamping.



Print this | Hits: 170251

Comments

Display Order
by matts
on 26.09.04, 19:10

Nice work as usual!

Just a word of warning for bidding on PID's on e-bay, a lot that come up are 'relay' output rather than 'Solid State Relay' driver. As far as I understand most PID units are modular but the output driver is usually specified when ordering and to change that module which is a small internal circuit board is £££.

'Relay' to be clear is an on/off AC current switch, but usually with a low amp rating which isn't enough for your boiler heater.

'SSR' output is a low voltage DC current output which then drives the Solid State Relay itself which has the necessary oompf (techinical term) to control the heater.

Cheers

Matt


by simonp
on 28.09.04, 12:09

Just a foot note to add that with the side mounted thermocouple I am running at 218-220F as a setpoint as the water is cooler further down the boiler. This gives me a brew temp (measured with a thermocouple in the coffee puck) of 200F.


Only logged in users are allowed to comment. register/log in