QUOTE (paulengr @ Nov 11 2009, 04:32 AM)

Good autotuners are rare and difficult to program.
It depends on the language used.
QUOTE
This makes them very valuable assets to the vendor. This means that they are usually considered very proprietary information. Even if you identify which autotuner you want to know the algorithm for, it is very, very unlikely that you will be able to find that information because it is a secret.
I have posted Scilab code that does auto tuning on the PLC.net forum. It did FOPDT and SOPDT auto tuning.
QUOTE
From a practical point of view, I have never seen an autotuner that works reliably, not even an adaptive loop type. I realize that this disappoints the DCS folks but it's the truth.
That is because you haven't used a good one or the models the auto tuner used did not match the model of the thing being tuned. For instance a FOPDT or SOPDT auto tuner will not tune a motion system.
Here is how a temperature system is auto tuned. Dig into this.
http://www.deltamotion.com/peter/PDF/Mathc...sid%20SOPDT.pdf1. On page 1/10 I define the ideal SOPDT system. I chose different
value to to see how the well the system identification works under
different conditions Notice that there is dead time and I don't assume
all the poles are at the same location like others on this newsgroup.
2. At the bottom of page 2/10 I generate the test data that is later
to be used for system identification. I add noise the to ideal data
just to simulate reality a bit. The CO(t) function is a few steps.
The function can be arbitrary but I have found that the excitation is
critical to the identification. Dead times and time constants are
determined more accurately if the are step or rapid changes. The gain
and ambient coefficients are determined more accurate if the are steps
at different levels.
3. One page 3/10 I plot and save the generated test data. I can post
it on my FTP site for you to practice with. Notice that this data has
dead time and two poles that aren't at the same location. I could
have added more noise but the quasi-Newton method seems to filter it
out well.
4. One page 4/10 the system identification is done. Mathcad's Minerr
function can be like either Scilab's optim() function or lsqrsolve
function depending on the option chosen. I chose the quasi-Newton
optimization which is similar to the optim() function. Runge-Kutta is
used to integrate the differential equation. The differential equation
doesn't need to be linear. I could easily put a none linear term in
there like one that changes the gain as a function of temperature.
This happens with heat exchangers because of the LMTD. Fluid systems
are often of the form
v'=g/m-K*v^2. It is easy to ID non linear system IF you know the
general form of the equation and just need to ID the constants.
Notice that the ID'd poles are closer together than the real poles. I
have notice that system identification tends to ID the poles closer
together than what they really are. Notice that I all ID a dead time
and an ambient temperature. This is something that JCH does not do.
At the bottom of the MSE(), mean squared error function, is where I
calculate the mean squared error between the estimated temperature and
the actual or test data temperature. The Minerr function adjusts
Kp,t1,t2,thetap, and C till the MSE is minimized. You can see the
results are not perfect but that is reality.
5. On page 5/10 the actual or perfect response is compare to the
estimated response. The response looks close, almost identical, even
though the system identification puts the estimated poles closer
together. Also notice that a good system identification routine can
ID systems that are excited by more than just a step change. In fact
they must must be able to do system identification with arbitrary
excitation. Above I said the excitation is the key to doing system
identification. One key is the make multiple steps at different
levels. This is very important in computing the gain and computing
the gain when it isn't linear. Heat exchanger's gain changes because
of LMTD. ( log mean temperature difference ).
6. On page 6/10 PID gains are calculated using the estimated plant
parameters found by system identification. My formula is a little
more complex that the IMC formulas but the response is faster/better
for the same closed loop time constant. I doubt the extra complexity
in the formula is worth the effort for most applications.
7 Page 7/10 simulates the PID control of the original system using the
gains calculated from the system identification. Notice that feed
back noise is simulated as well as the dead time.
8. Page 8/10. The simulation show the response. The response isn't
perfect because there was noise in the original data used to do the
system identification. The system identification is not perfect
because the poles are closer together than they should be and I
simulated noise on the feedback but this is closer to reality.
9 Page 9/10 uses the internal model gain formulas that I got from the
www.controguru.com site. They work well too and are much simpler they
don't work quite as mine. I should have provided a IAE value for my
gains and the IMC gains for comparison.
10 page 10/10 shows the IMC response is a little slower but most would
be please with it.
I would like to know if anybody understands this.