Please enable JavaScript to view this site.

DAQFactory User's Guide

Navigation: 10 PID Loops

10.3 Autotuning

Scroll Prev Top Next More

PID support includes autotuning, which helps determine the best P, I, and D parameters for your particular process.  To use, you must have your system in a stable state, with the process variable sitting close to the set point.  Once there, select a relay height, which is the amount the output will be adjusted depending on whether the process variable is above or below the set point.  Unlike PID control, the output just alternates between these two values.  Press the Start button to start the autotune.  The system will need to go through at least two cycles, at which point it can calculate P, I, and D parameters.  Ideally you should wait until the period and height of the process variable stabilizes.  At this point (or any other point) you can use the Use Results button to copy the results of the autotune into the P, I and D fields.  You will then need to apply the changes to keep the new parameters.

In general, you want to keep the oscillation somewhat slow, at least 20x the acquisition rate of the process variable and PID loop interval, but for really slow moving systems, make sure you get enough movement that it is well above any noise.  You will also likely want it to run through 3 or 4 oscillations if you can to ensure that it is settled into its pattern.

Note: the big advantage of relay autotuning over other methods is that your system does not need to be taken far out of range to autotune.  You can and should specify a very small relay height to keep your system within acceptable parameters.  It is best to start with a very small and relay height and work up to ensure that you do not accidentally drive your system into an unacceptable range.

Example: If you want to see autotuning in action, though perhaps not showing its true power, create the simulation system example described in the Creating a PID loop section.  Then:

1.  Make sure both the sequence and the PID loop are running.  Go to the PID view for the PID loop and select the AutoTune page.

2.  The Autotune page also shows a graph.  If you recently changed the setpoint, wait until the process variable stabilizes close to the setpoint.

3.  Enter a relay height of 2, then click Start to start the autotune procedure.

What you will see at this point is the output red trace alternating between +2 and -2 relative to your setpoint as the process variable in green itself alternates above and below the setpoint.  After two such oscillations, the Calced P, I and D values will be displayed.  With every cycle, these numbers will change slightly as the autotuning zones in on the best number.  When you are satisfied with the values, you can stop the autotuning and click Use Results to copy the values into the loop parameters.  You will also have to click Apply to save these new values into the loop.  Because the simulation is so basic, the autotune probably will not improve the loop much and may even make it worse.  In a real system however, autotune can really help get you close to the ideal parameters.