Sei sulla pagina 1di 7

PID Tune Control Panel

Open the PID Tune Control Pannel by using one of the following methods:
• Select the Tools >PID Tune Control Panel menu command.

• Click the PID Tune Control Panel button on the Navigation Bar.
• Open the Tools Folder in the Instruction Tree , then open the PID Tune Control Panel.

PID Tuning Compatibility


• PID loop auto-tuning will not be available for PID instructions on controllers with firmware before Release 2.00
• PID instructions created by the PID Wizard or generated by hand in releases prior to STEP 7-Micro/WIN Release 4.0 will
be tunable with manually entered corrections to the tuning parameters. Auto tuning is not available for these PID
instructions.
• Loop tables for PID instructions created by the PID Wizard in releases prior to STEP 7-Micro/WIN Release 4.0 do not
conform to the auto tuning format. However, if you modify a loop table to conform to the auto-tuning format, the PID
instruction may then have the auto-tuning algorithm executed on it.

Understanding Auto-Tune
Expanded Loop Table
Prerequisites
Auto–Hysteresis and Auto–Deviation
Auto–Tune Sequence
Exception Conditions
Notes Concerning PV Out–of–Range (Result Code 3)
PID Tuning Control Panel

Understanding Auto-Tune
PID Auto–Tune capability has been incorporated into the S7–200 PLCs and STEP 7–Micro/WIN has added a PID Tuning
Control Panel. Together, these two features greatly enhance the utility and ease of use of the PID function provided in the
S7–200 Micro PLC line.

Auto–tune can be initiated by the user program from an operator panel or by the PID Tuning Control Panel. PID loops can be
auto–tuned one at a time or all eight loops can be auto–tuned at the same time if necessary. The PID Auto–Tune computes
suggested (near optimum) values for the gain, integral time (reset) and derivative time (rate) tuning values. It also allows you to
select tuning for fast, medium, slow or very slow response of your loop.

With the PID Tuning Control Panel you can initiate the auto–tuning process, abort the auto–tuning process and monitor the
results in a graphical form. The control panel displays any error conditions or warnings that might be generated. It also allows
you to apply the gain, reset and rate values computed by auto–tune

The auto–tuning algorithm used in the S7–200 is based upon a technique called relay feedback suggested by K. J. Åström and
T. Hägglund in 1984. Over the past twenty years relay feedback has been used across a wide variety of industries.

The concept of relay feedback is to produce a small, but sustained oscillation in an otherwise stable process. Based upon the
period of the oscillations and the amplitude changes observed in the process variable, the ultimate frequency and the ultimate
gain of the process are determined. Then, using the ultimate gain and ultimate frequency values, the PID Auto–tuner suggests
a value for the gain, reset and rate tuning values.

The values suggested depend upon your selection for speed of response of the loop for your process. You can select fast,
medium, slow or very slow response. Depending upon your process a fast response may have overshoot and would
correspond to an underdamped tuning condition. A medium speed response may be on the verge of having overshoot and
would correspond to a critically damped tuning condition. A slow response may not have any overshoot and would correspond
to an overdamped tuning condition. A very slow response may not have overshoot and would correspond to a heavily
overdamped tuning condition.

In addition to suggesting tuning values the PID Auto–tuner can automatically determine the values for hysteresis and peak PV
deviation. These parameters are used to reduce the effect of the process noise while limiting the amplitude of the sustained
oscillations set up by the PID Auto–Tuner.
The PID Auto–Tuner is capable of determining suggested tuning values for both direct–acting and reverse–acting P, PI, PD,
and PID loops.

The purpose of the PID Auto–Tuner is to determine a set of tuning parameters that provide a reasonable approximation to the
optimum values for your loop. Starting with the suggested tuning values will allow you to make fine tuning adjustments and
truly optimize your process.

Prerequisites
The loop that you want to auto–tune must be in automatic mode. The loop output must be controlled by the execution of the
PID instruction. Auto–tune will fail if the loop is in manual mode.

Before initiating an auto–tune operation your process must be brought to a stable state which means that the PV has reached
setpoint (or for a P type loop, a constant difference between PV and setpoint) and the output is not changing erratically.

Ideally, the loop output value needs to be near the center of the control range when auto–tuning is started. The auto–tune
procedure sets up an oscillation in the process by making small step changes in the loop output. If the loop output is close to
either extreme of its control range, the step changes introduced in the auto–tune procedure may cause the output value to
attempt to exceed the minimum or the maximum range limit.

If this were to happen, it may result in the generation of an auto–tune error condition, and it will certainly result in the
determination of less than near optimal suggested values.

Auto–Hysteresis and Auto–Deviation


The hysteresis parameter specifies the excursion (plus or minus) from setpoint that the PV (process variable) is allowed to
make without causing the relay controller to change the output. This value is used to minimize the effect of noise in the PV
signal to more accurately determine the natural oscillation frequency of the process.

If you select to automatically determine the hysteresis value, the PID Auto–Tuner will enter a hysteresis determination
sequence. This sequence involves sampling the process variable for a period of time and then performing a standard deviation
calculation on the sample results.

In order to have a statistically meaningful sample, a set of at least 100 samples must be acquired. For a loop with a sample
time of 200 msec, acquiring 100 samples takes 20 seconds. For loops with a longer sample time it will take longer. Even
though 100 samples can be acquired in less than 20 seconds for loops with sample times less than 200 msec, the hysteresis
determination sequence always acquires samples for at least 20 seconds.

Once all the samples have been acquired, the standard deviation for the sample set is calculated. The hysteresis value is
defined to be two times the standard deviation. The calculated hysteresis value is written into the actual hysteresis field (AHYS)
of the loop table.

Tip:
While the auto–hysteresis sequence is in progress, the normal PID calculation is not
performed. Therefore, it is imperative that the process be in a stable state prior to
initiating an auto–tune sequence. This will yield a better result for the hysteresis value
and it will ensure that the process does not go out of control during the auto–hysteresis
determination sequence.

The deviation parameter specifies the desired peak–to–peak swing of the PV around the setpoint. If you select to automatically
determine this value, the desired deviation of the PV is computed by multiplying the hysteresis value by 4.5. The output will be
driven proportionally to induce this magnitude of oscillation in the process during auto–tuning.

Auto–Tune Sequence
The auto–tuning sequence begins after the hysteresis and deviation values have been determined. The tuning process begins
when the initial output step is applied to the loop output.

This change in output value should cause a corresponding change in the value of the process variable. When the output
change drives the PV away from setpoint far enough to exceed the hysteresis boundary a zero–crossing event is detected by
the auto–tuner. Upon each zero crossing event the auto–tuner drives the output in the opposite direction.

The tuner continues to sample the PV and waits for the next zero crossing event. A total of twelve zero–crossings are required
to complete the sequence. The magnitude of the observed peak–to–peak PV values (peak error) and the rate at which
zero–crossings occur are directly related to the dynamics of the process.
Early in the auto–tuning process, the output step value is proportionally adjusted once to induce subsequent peak–to–peak
swings of the PV to more closely match the desired deviation amount. Once the adjustment is made, the new output step
amount is written into the Actual Step Size field (ASTEP) of the loop table

The auto–tuning sequence will be terminated with an error, if the time between zero crossings exceeds the zero crossing
watchdog interval time. The default value for the zero crossing watchdog interval time is two hours.

The screen image above shows the output and process variable behaviors during an auto–tuning sequence on a direct acting
loop. The PID Tuning Control Panel was used to initiate and monitor the tuning sequence.

Notice how the auto–tuner switches the output to cause the process (as evidenced by the PV value) to undergo small
oscillations. The frequency and the amplitude of the PV oscillations are indicative of the process gain and natural frequency

Based upon the information collected about the frequency and gain of the process during the auto–tune process, the ultimate
gain and ultimate frequency values are calculated. From these values the suggested values for gain (loop gain), reset (integral
time) and rate (derivative time) are calculated.

Tips:
The current loop parameters determine which tuning values are calculated by the
auto-tuner. For a PI loop with only values for the Gain and Integral Time, the auto-tuner
will calculate new gain and integral time values, but leave the suggested derivative time at
0.0 (no derivative action).

The Derivative Time parameter will not work well if there is noise in the Process Variable
value.

Exception Conditions
Three warning conditions can be generated during tuning execution. These warnings are reported in three bits of the ASTAT
field of the loop table and, once set, these bits remain set until the next auto–tune sequence is initiated.
• Warning 0 is generated if the deviation value is not at least 4X greater than the hysteresis value. This check is performed
when the hysteresis value is actually known, which depends upon the auto–hysteresis setting.
• Warning 1 is generated if there is more than an 8X difference between the two peak error values gathered during the first
2.5 cycles of the auto–tune procedure.
• Warning 2 is generated if the measured average peak error is not at least 4X greater than the hysteresis value.

In addition to the warning conditions several error conditions are possible. The table below lists the error conditions along with
a description of the cause of each error.

Error Conditions during Tuning Execution


Result Code (in ARES) Condition
01 aborted by user EN bit cleared while tuning is in progress
02 aborted due to a zero–crossing watchdog Half–cycle elapsed time exceeds zero–crossing
timeout watchdog interval
03 aborted due to the process out–of–range PV goes out–of–range:
-during the auto–hysteresis sequence, or
-twice before the fourth zero–crossing, or
-after the fourth zero crossing
04 aborted due to hysteresis value exceeding User–specified hysteresis value, or
maximum automatically determined hysteresis value > maximum
05 aborted due to illegal configuration value The following range checking errors:
-Initial loop output value is < 0.0 or > 1.0
-User–specified deviation value is <= hysteresis
value , or is > maximum deviation
-Initial output step is <= 0.0 or is > maximum
-Zero–crossing watchdog interval time is < minimum
-Sample time value in loop table is negative
06 aborted due to a numeric error Illegal floating point number or divide by zero
encountered
07 PID instruction was executed with no PID instruction executed with no power flow while
power flow (manual mode) auto–tuning is in progress or is requested
08 auto–tuning allowed only for P, PI, PD, or Loop type is not P, PI, PD, or PID
PID loops

Notes Concerning PV Out–of–Range (Result Code 3)


The process variable is considered to be in–range by the auto–tuner if its value is greater than 0.0 and less than 1.0.

If the PV is detected to be out–of–range during the auto–hysteresis sequence, then the tuning is immediately aborted with a
process out–of–range error result.

If the PV is detected to be out–of–range between the starting point of the tuning sequence and the fourth zero–crossing, then
the output step value is cut in half and the tuning sequence is restarted from the beginning. If a second PV out–of–range event
is detected after the first zero–crossing following the restart, then the tuning is aborted with a process out–of–range error result.

Any PV out–of–range event occurring after the fourth zero–crossing results in an immediate abort of the tuning and a
generation of a process out–of–range error result.

PID Tuning Control Panel


STEP 7-Micro/WIN includes a PID Tuning Control Panel that allows you to graphically monitor the behavior of your PID loops.
In addition, the control panel allows you to initiate the auto–tune sequence, abort the sequence, and apply the suggested
tuning values or your own tuning values.
To use the control panel, you must be communicating with an S7–200 PLC and a wizard–generated configuration for a PID
loop must exist in the PLC. The PLC must be in RUN mode for the control panel to display the operation of a PID loop. The
screen image above shows the default screen for the control panel.

The control panel displays the station address (Remote Address) of the target PLC at the top left–hand side of the screen. At
the top right–hand side of the screen, the PLC type and version number are displayed. Underneath the Remote Address field
is a bar chart representation of the process variable value along with both it’s scaled and unscaled values. Just to the right of
the PV bar chart is a Current Values region

In the Current Values region, the values of the Setpoint, Sample Time, Gain, Integral time, and Derivative time are displayed.
The value of the Output is displayed in a horizontal bar chart along with its numerical value. To the right of the Current Values
region is a graphical display.

The graphical display shows color coded plots of the PV, SP, and Output as a function of time. The PV and SP share the same
vertical scale which is located at the left hand side of the graph while the vertical scale for the output is located on the right
hand side of the graph.

At the bottom left hand side of the screen is the Tuning Parameters (Minutes) region. Inside this region, the Gain, Integral Time
and Derivative Time values are displayed. Radio buttons indicate whether the Current, Suggested or Manual values for Gain,
Integral Time and Derivative Time are being displayed. You may click on the radio button to display any one of the three
sources for these values. To modify the tuning parameters, click the manual radio button.

You can use the Update PLC button to transfer the displayed Gain, Integral Time and Derivative Time values to the PLC for the
PID loop that is being monitored. You can use the Start Auto Tune button to initiate an auto–tuning sequence. Once an
auto–tuning sequence has started, the Start Auto Tune button becomes a Stop Auto Tune button.

Directly underneath the graphical display is a Current PID selection region with a pull down menu that allows you to select the
PID loop that you wish to monitor with the control panel.

In the Sampling Rate region you can select the graphical display sampling rate from 1 to 480 seconds per sample. You can
edit the sampling rate, then use the Set Time to apply the change. The time scale of the graph is automatically adjusted to best
display the data at the new rate.

You can freeze the graph by pressing the Pause button. Press the Resume button to resume sampling data at the selected
rate. To clear the graph, select Clear from the right mouse button within the graph.

To the right of the Chart Options region is a Legend that identifies the colors used to plot the PV, SP, and Output values.

Directly beneath the Current PID selection region is an area that is used to display information pertinent to the operation being
performed.
The Advanced ... button in the Tuning Parameters region allows you to further configure parameters for the auto–tuning
process. The advanced screen image is shown above.

From the advanced screen you can check the box that will cause the auto–tuner to automatically determine the values for the
Hysteresis and Deviation (default setting) or you can enter the values for these fields that minimizes the disturbance to your
process during the auto–tune procedure.

In the Other Options region you can specify the initial output step size and enter the zero crossing watchdog timeout period.

In the Dynamic Response Options region click the radio button that corresponds to the type of loop response that you wish to
have for your process. The Dynamic Response refers to how fast the loop will respond to a process change and not to how fast
the process is. Depending upon your process a fast response may have overshoot and would correspond to an underdamped
tuning condition. A medium speed response may be on the verge of having overshoot and would correspond to a critically
damped tuning condition. A slow response may not have any overshoot and would correspond to an overdamped tuning
condition. A very slow response may not have overshoot and would correspond to a heavily overdamped tuning condition.

Once you have made the desired selections, click OK to return to the main screen of the PID Tuning Control Panel.
Once you have completed the auto–tune sequence and have transferred the suggested tuning parameters to the PLC, you can
use the control panel to monitor your loop’s response to a step change in the setpoint. The screen image above shows the loop
’s response to a setpoint change (12000 to 14000) with the original tuning parameters (before running auto–tune).

Notice the overshoot and the long, damped ringing behavior of the process using the original tuning parameters.

The screen image above shows the loop’s response to the same setpoint change (12000 to 14000) after applying the values
determined by the auto–tune process using the selection for a fast response. Notice that for this process there is no overshoot,
but there is just a little bit of ringing. If you wish to eliminate the ringing at the expense of the speed of response, you need to
select a medium or a slow response and re–run the auto–tuning process.

Once you have a good starting point for the tuning parameters for your loop, you can use the control panel to tweak the
parameters. Then you can monitor the loop’s response to a setpoint change. In this way you can fine tune your process for an
optimum response in your application.

See Also:
PID Algorithm
PID Loop Table

PID Wizard
PIDx_INIT (PID Wizard Subroutine)

Note:
The Standard PID instruction is not used directly by projects with PID wizard configurations. If you use a PID wizard
configuration, then your program must use CALL PIDxINIT, to activate the PID wizard subroutine.
PID (Standard PID Instruction)

Potrebbero piacerti anche