I run your code.
However, it seems that the provided several parameter pairs from the autotune do not work ....
I mean those parameters make convergence eventually, however they are not good parameters...
and I think the brew type works only well as a good parameter tuning.
I assume that brew is assigned by yourself, right?
I have one more question, there are divisor variables in each method, and I don't think they do not quite follow the table in this website: https://en.wikipedia.org/wiki/Ziegler%E2%80%93Nichols_method
How did you come up those divisors?