I think one of the defining engineering diseases I have is the persistent urge to overcomplicate all my hobbies. Every once in a while I get the bug to eek more granularity and precision out of tools and appliances that should be left well enough alone. The subject of my most recent bout of fixation was our chunky Nuova Simonelli Appia II espresso machine. The Appia II is a small single-boiler heat exchanger machine, meant for small cafes and restaurants. It is chonky. The unit that takes up most of my counter space was rescued from the basement of a restaurant in Brooklyn and lovingly restored to near-new condition by yours truly.
The one and only thing that ever bothered me about the Appia II was its pressurestat controller. A boiler pressurestat is a simple and elegant mechanical temperature controller. My issues with it are that it is fiddly to adjust, has no external monitoring or feedback, and is grossly imprecise. It needed to go.
Its replacement was to be a PID algorithm running on whatever microcontroller I had in the project bin. In my current mode of existence, the underlying goal for my projects is to buy as few parts as possible so I also wanted to use a long probe RTD I found in the trash as the main sensor. Throw in a cheap relay from Amazon and that was it for the electronics.
In poking around online I came across 1024kilobyte's open-source CoffeePID project developed for the ESP32 with a nice web server, so that became the starting point for my code.
In an unusual turn of events, Nuova Simonelli published a manual with detailed electric and hydraulic schematics. I gave the hydraulic schematic the engineering drawing treatment just for fun.
The original plan was to install a temperature probe in-line with the thermo-siphon, so as to directly measure the brew water temperature. After pulling the housing off the machine for the first time in a while it became clear doing so would be a far more complex project.
The best option appeared to be the top of the heat exchanger. The diagram shows a blanking plug installed where the heat exchanger makes a 90˚ turn to feed the thermo-siphon. Sadly upon pulling the plug I learned two things. One, espresso machines use a new-to-me flare-fitting standard consisting of a buttonish ferrule that is braised onto the tube. This replaces the need to flare tube ends, and I think more importantly allows manufacturers to use less expensive BSPP fittings.
The second and more sad thing I learned upon removing the blanking plug from the heat exchanger was that the diameter of the tube was far more narrow than expected. I planned to install the ~5mm diameter probe-style RTD, and my fear was that it would have created a flow constriction in the heat exchanger. A sensor that has minimal protrusion would be fine, but that will have to wait for the next time I get the urge to take the espresso machine apart. (Now I also want to add pressure sensors on the pump outlet and boiler...)
Ultimately the best solution had been in front of my face the whole time: just stick the temperature sensor in the port where the pressurestat used to live. I drilled and tapped an M8x1.25 hole in the top of a 1/4" BSPP cap and installed the RTD. The apparatus also got a nifty combination gasket-washer to make up for the poor surface finishes on the cap and RTD.
At the last minute, I decided to throw a tee fitting in the mix to accommodate the future installation of a pressure transducer. Sadly that last-minute change of plans meant the RTD probe was no longer able to protrude into the water. Two steps forward, one step back... This means the probe will read the steam temperature instead of the water temperature.
All that was left was several hours of PID tuning. Process engineers have the theory for analytically determining PID values for heat exchangers pretty well worked out, but the final tuning of the system still needs to be conducted manually.
Once tuned the controller worked perfectly. I get an ultimate accuracy of ± 0.25˚. The downside with the setup is that the boiler no longer automatically ramps up the heating element when you use the steam wand... However, now that I can quickly change the boiler temperature from my phone it's trivial to set the ideal steam temperature (and pressure by extension) for the perfect milk foam.