Tuning should not be required for repeat applications as the parameters are now built into the controller software. However, I will describe the process as it was interesting how additional performance could be obtained from the same hardware by tuning the software.
I noticed during debugging that the sensor readings were very unstable and jittery. Consecutive values were often far apart – something I would not expect given that temperature changes slowly – and this was causing the PID algorithm to behave poorly.
One solution to this was to dampen the analog values read using filtering software. A search led me to the ResponsiveAnalogRead library (and the explanatory blog) which was designed exactly for this purpose, and allows the amount of dampening to be tuned to the application.
In order to obtain tuning parameters as a CSV formatted dump of the control output (CO), current value (CV) and setpoint (SP) against time, I implemented the PID_PROFILE #define in the debug header file to allow the functionality to be turned on and off.
As a baseline, the first run was for a minimally damped CV reading. With the setpoint unchanging, the CV shows a high degree of variation and causes the CO to be very active.
It took a few runs to get to a much more stable CV. However even with this level of dampening there is still considerable fluctuation in the CO. I noticed that the spikes in CV roughly corresponded to the spikes in CO. This was potentially the frequency in the heating wires affecting the sensor wires, as they were running side by side.
Once the separation was increased, performance improved yet again. Note that, for comparison purposes, the time scale in the chart above is double that in the previous chart.
Finally, a test with the SP changing verified that the performance was good enough for my purposes.