1 PID Tuning

download 1 PID Tuning

of 3

Transcript of 1 PID Tuning

  • 8/3/2019 1 PID Tuning

    1/3

    1 PID Tuning1.1 PID Controller

    A proportional-integral-derivative controller (PID controller) is a common feedback loopcomponent in industrial control systems.1

    The Controller compares a measured value from a process (typically an industrial process)with a reference set point value. The difference (or "error" signal) is then used to calculate anew value for a manipulable input to the process that brings the process measured value backto its desired set point.

    Unlike simpler control algorithms, the PID controller can adjust process outputs based on thehistory and rate of change of the error signal, which gives more accurate and stable control.(It can be shown mathematically that a PID loop will produce accurate, stable control in caseswhere a simple proportional control would either have a steady-state error or would cause the

    process to oscillate).

    1.1.1 Control loop basics

    Intuitively, the PID loop tries to automate what an intelligent operator with a gauge and acontrol knob would do. The operator would read a gauge showing the output measurement ofa process, and use the knob to adjust the input of the process (the "action") until the process'soutput measurement stabilizes at the desired value on the gauge.

    In older control literature this adjustment process is called a "reset" action. The position ofthe needle on the gauge is a "measurement", "process value" or "process variable". Thedesired value on the gauge is called a "set point" (also called "set value"). The difference

    between the gauge's needle and the set point is the "error".

    A control loop consists of three parts:1. Measurement by a sensor connected to the process (e.g. encoder),

    2. Decision in a controller element,

    3. Action through an output device such as an motor.

    As the controller reads a sensor, it subtracts this measurement from the "set point" todetermine the "error". It then uses the error to calculate a correction to the process's inputvariable (the "action") so that this correction will remove the error from the process's outputmeasurement.

    In a PID loop, correction is calculated from the error in three ways: cancel out the currenterror directly (Proportional), the amount of time the error has continued uncorrected(Integral), and anticipate the future error from the rate of change of the error over time(Derivative).

    A PID controller can be used to control any measurable variable which can be affected bymanipulating some other process variable. For example, it can be used to control temperature,

    pressure, flow rate, chemical composition, speed, or other variables. Automobile cruisecontrol is an example of a process outside of industry which utilizes crude PID control.

    Some control systems arrange PID controllers in cascades or networks. That is, a "master"control produces signals used by "slave" controllers. One common situation is motorcontrols: one often wants the motor to have a controlled speed, with the "slave" controller(often built into a variable frequency drive) directly managing the speed based on a

    proportional input. This "slave" input is fed by the "master" controller's output, which iscontrolling based upon a related variable.

    http://linuxcnc.org/docs/html/motion_pid_theory.htmlhttp://linuxcnc.org/docs/html/motion_pid_theory.html
  • 8/3/2019 1 PID Tuning

    2/3

    1.1.2 Theory

    "PID" is named after its three correcting calculations, which all add to and adjust thecontrolled quantity. These additions are actually "subtractions" of error, because the

    proportions are usually negative:

    Proportional

    To handle the present, the error is multiplied by a (negative) constant P (for "proportional"),and added to (subtracting error from) the controlled quantity. P is only valid in the band overwhich a controller's output is proportional to the error of the system. Note that when the erroris zero, a proportional controller's output is zero.

    Integral

    To learn from the past, the error is integrated (added up) over a period of time, and thenmultiplied by a (negative) constant I (making an average), and added to (subtracting errorfrom) the controlled quantity. I averages the measured error to find the process output'saverage error from the set point. A simple proportional system either oscillates, moving back

    and forth around the set point because there's nothing to remove the error when it overshoots,or oscillates and/or stabilizes at a too low or too high value. By adding a negative proportionof (i.e. subtracting part of) the average error from the process input, the average difference

    between the process output and the set point is always being reduced. Therefore, eventually, awell-tuned PID loop's process output will settle down at the set point.

    Derivative

    To handle the future, the first derivative (the slope of the error) over time is calculated, andmultiplied by another (negative) constant D, and also added to (subtracting error from) thecontrolled quantity. The derivative term controls the response to a change in the system. Thelarger the derivative term, the more rapidly the controller responds to changes in the process'soutput.

    More technically, a PID loop can be characterized as a filter applied to a complex frequency-domain system. This is useful in order to calculate whether it will actually reach a stablevalue. If the values are chosen incorrectly, the controlled process input can oscillate, and the

    process output may never stay at the set point.

    1.1.3 Loop Tuning

    "Tuning" a control loop is the adjustment of its control parameters (gain/proportional band,integral gain/reset, derivative gain/rate) to the optimum values for the desired controlresponse. The optimum behavior on a process change or set point change varies depending onthe application. Some processes must not allow an overshoot of the process variable from theset point. Other processes must minimize the energy expended in reaching a new set point.Generally stability of response is required and the process must not oscillate for anycombination of process conditions and set points.

    Tuning of loops is made more complicated by the response time of the process; it may takeminutes or hours for a set point change to produce a stable effect. Some processes have adegree of non-linearity and so parameters that work well at full-load conditions don't workwhen the process is starting up from no-load. This section describes some traditional manualmethods for loop tuning.

    There are several methods for tuning a PID loop. The choice of method will depend largelyon whether or not the loop can be taken "offline" for tuning, and the response speed of thesystem. If the system can be taken offline, the best tuning method often involves subjecting

    the system to a step change in input, measuring the output as a function of time, and usingthis response to determine the control parameters.

  • 8/3/2019 1 PID Tuning

    3/3

    Simple method

    If the system must remain on line, one tuning method is to first set the I and D values to zero.Increase the P until the output of the loop oscillates. Then increase I until oscillation stops.Finally, increase D until the loop is acceptably quick to reach its reference. A fast PID looptuning usually overshoots slightly to reach the set point more quickly; however, some

    systems cannot accept overshoot.

    Parameter Rise Time OvershootSettling Time S.S. Error

    P Decrease Increase Small Change Decrease

    I Decrease Increase Increase Eliminate

    D Small Change Decrease Decrease Small Change

    Effects of increasing parameters

    Ziegler-Nichols method

    Another tuning method is formally known as the "Ziegler-Nichols method", introduced byJohn G. Ziegler and Nathaniel B. Nichols. It starts in the same way as the method described

    before: first set the I and D gains to zero and then increase the P gain and expose the loop toexternal interference for example knocking the motor axis to cause it to move out ofequilibrium in order to determine critical gain and period of oscillation until the output of the

    loop starts to oscillate. Write down the critical gain ( ) and the oscillation period of the

    output ( ). Then adjust the P, I and D controls as the table shows:

    Control type P I D

    P

    PI

    PID

    Final Steps

    After tuning the axis check the following error with Hal Scope to make sure it is within yourmachine requirements. More information on Hal Scope is in the HAL User manual.