The figure below shows an open loop step response of the flow, and the model fit to it. We then went on to the PID Tuning section. However, we could stop right there because the simulation with the 'old' PID parameters predicted instability while that did not occur in practice!
Figure 1: open loop step response
Figure 2 Simulated and measured response of the PID controller.
Figure 3: Measured flow in two ways. Yellow: raw flow signal entering the PLC. Bluelin: flow signal as it entered in the PID block.
Figure 4: Open loop response with the 'repaired' PLC code. Clearly, now the flow signal is much more accurate.
Figure 5: Measured and simulated response with the PID controller tuned by the PID Tuner.
Figure 6: Old versus new response.