I’m making progress with tuning the PID that controls the pump speed to deliver the required pressure.
This plot shows the result of a 9 bar shot, using the results of an auto tune. The thick black line is the pressure set point, and the thin black line is the real-time measured pressure. You can see that it fluctuates a fair bit, by about +/- 0.4 bar. I’ve also plotted the P (blue line) and I (light purple line) terms. You can see that the I plot is pretty stable, but the P line is fluctuating wildly, so this is the one that needs adjusting.
The auto tune gave a value of 25° (this is the pump phase), so I dropped it to 8° and tried again. This looks much better, with very little noise, just a bit of a spike at the start.
The third go I went up to 12.5°, and this is looking even better.
The idea is that you keep increasing the value until the P term starts oscillating, and then go back a bit from there.
Hopefully these graphs show some of the insights and control you can get. For example you can see the flow rate (the light blue line that is at the bottom for most of the shot). This shows a high fill rate (around 525 ml/min) until the headspace is filled and the puck is saturated, at which point it drops to around 40 ml/min. You can then see that this increases throughout the shot as the puck erodes. This is why a lever type profile is good, because you flatten the flow rate.
The absolute flow rate numbers are not that accurate, as they’re based on a flow meter on the incoming cold water. This essentially spins as the water goes through and makes little pulses that the controller counts. It shows reliable trends though, as long as the opv is closed (otherwise it also counts the water returned to the tank via the opv).
I’m going to keep tweaking, but rather than waste coffee I decided to just tweak each time a make a coffee, and if it takes a few days that’s fine.