Temperature stability is key to making consistently good espresso. The diyPresso One is designed for this. The large 600 ml boiler and heavy E61 brew group provide lots of thermal mass which helps to keep the brewing temperature constant.
Most home barista machines are limited to simple PID controllers or even an old-fashioned bimetal thermostat control. The Arduino-based controller of the diyPresso One enables more advanced temperature control methods and increased temperature stability. Our 1.8.0 firmware update implements a method we call Dynamic Feed Forward which reduces temperature variation with 60-80%.
The Limitations of Standard PID Controllers
From the initial release, the open-source software on the diyPresso One controller featured a PID temperature controller with a static Feed Forward feature. PID controllers are widely used in premium espresso machines. They estimate the required heating power based on three factors:
- Proportional: The current difference between the actual temperature and the setpoint.
- Integral: The historical difference.
- Derivative: The rate of change, attempting to predict future errors
The main disadvantage of a classical PID controller setup in espresso machines is that the system is often slow to react. When cold water flows into the boiler it takes a while for the water to mix, for the temperature change to be picked up by the temperature sensor, for the controller to adjust the heating level and for the water to heat and mix within the boiler. All these steps add to a control delay and with that reduced temperature stability.

Static Feed Forward
Originally, the diyPresso One addressed this by having a simple feed forward mechanism. When the water pump is activated the diyPresso One would increase the power of the heater with a configurable static amount. So, for example, it would increase the power with 40% when a brew is started. The PID terms then handle the further control of the temperature.
Power output = PID terms + static feed forward

This helps to reduce the temperature drop when pulling shots, but is far from perfect. The system does not take into account any variations in the amount of cold water flowing into the boiler. It can’t distinguish between a slow single shot, a fast double shot, or when just pulling water to pre-heat up a cup.
Dynamic Feed Forward
A differentiating feature of the diyPresso One is the load cell -essentially a precision scale- below the water reservoir. This sensor measures exactly how much water flows out of the reservoir and into the boiler. Using basic physics the controller calculates how much energy is needed to heat the water flowing into the boiler to the desired setpoint temperature.This approach allows for faster control of the heater and therefore a more stable boiler temperature.
The energy needed in Joules (ΔE) is the weight of the inflowing water (Δw) times the specific heat capacity of water (c ≈ 4.2 J/g°C) times the temperature difference between the setpoint and the inflowing water.
ΔE = Δw ⸱ c ⸱ (Tset – Tinflow)
The power of the heater is then increased accordingly.
As an example, when extracting an espresso at 2.0 grams per second with a setpoint of 95 ºC and an estimated inflow temperature of 27 ºC, the required energy is 2.0 * 4.2 * (95 – 27) = 571 J per second or 571 W. That requires an increase in power of about 46% (571 / 1250 W) for the diyPresso One to heat the inflowing water to the setpoint. This “Dynamic Feed Forward” term is added to the calculation of the PID controller instead of the static Feed Forward term.
Power output = PID terms + energy need based on boiler inflow

High flow situations
The maximum capacity of the pump in the diyPresso One is about 10 grams per second. That is roughly the flow when pulling just water to, e.g, pre-heat your espresso cup. 10 grams per second would require a heating power of 2856 W or about 2.3 times the maximum capacity of the heater in the diyPresso one.
To handle this, the controller tracks the excess power required in the “Dynamic Feed Forward Energy Stockpile” and increases the heater power in subsequent cycles. For example, when pulling 10 grams per second for 3 seconds, the heater will be at 100% for approximately 3 * 2.3 = 6.9 seconds.
Does it work?
In theory, yes. In practice it needed a bit of tuning. It turns out the Dynamic Feed Forward is too fast.
The temperature sensor of the boiler is located above the heater, this makes the system quick to pick up heating. While the cold water flowing into the boiler tends to drop to the bottom of the boiler and mixes slowly. The temperature sensor registers the heating from the heater sooner than the cooling from the inflowing water. This causes the PID to throttle down the heater to correct for the initial overshoot just when the bulk of cooler water starts hitting the sensor.

As shown in the graphs below, this resulted in performance of the Dynamic Feed Forward comparable to the (well-tuned) static feed forward, although with an almost inverted temperature curve.

We implemented a DFF factor as a setting in the new firmware, it allows tuning the DFF term and aligns the controller better with the actual physics. The controller uses this term to dampen the initial overshoot.
Power output = PID terms + DFF factor x energy need based on boiler inflow
Heuristically, we discovered that a DFF factor around 70% tends to perform quite well in the diyPresso One. With the tuned Dynamic Feed Forward the temperature error is about 60% less when pulling a typical double shot and roughly 80% less when pulling 50 grams of water.


Update your diyPresso
Dynamic Feed Forward is implemented in version 1.8.0 of the diyPresso One firmware. Follow the instructions on the dowloads page to upgrade your machine and enjoy your even tastier espresso.

