Searching Algorithm for Tuning PID

R

Thread Starter

Roberto Carabajal

Hello:

I want to write a piece of code to find optimal set of values (Ki, Kp, Kd) of a generic PID controller, taking into account any of the classical tuning rules. The idea is to generate successive gain values, put them as PID inputs, calculate output, change gains accordingly and so on. But I found it very difficult conceiving the proper algorithm, especially dealing with convergence. Can anybody help me showing the way? I like to use MatLab/Visual Basic, but a general approach could be sufficient.

Thanks very much.
Roberto
 
I did a similar thing, however I opted for the old faithful Microsoft Excel. I initially considered using MATLAB. However, for ease of use, portability and the fact that almost every PC I'm going to come across will have Excel, I chose this option.

I created it all using VBA, it was a real pain (never used this type of programming before), but worth it in the end as you can visualize everything on automatically updated trends.

As for the equations, etc., just Google FOPDT equations, etc. Cascade them to create Higher Order functions, etc. for modeling.

Like you I also implemented a heap of different tuning methods (ZN, CC, IMC, etc). Really helped to see the limitations of each, also how much the tuning paramaters can change due to manipulation of certain terms.
 
Top