PID tuning (PD/PDF and PD2I) tutorial

Closed loop control algorithms are used to adjust valve responsiveness within Alicat flow or pressure controllers. Modifying the variables within these algorithms allows the user to control how fast a controller reaches a setpoint as well as control stability.

In this article, we will explain some of the theory behind valve tuning and give tips on tuning your own Alicat device.

When to tune your controller

Before shipping, each controller is tuned for optimal valve performance at the indicated process conditions. For example, if a controller is ordered to flow air at 25 SCCM, then it will be tuned with that in mind. That means if you use your controller for exactly what you configured it for, the valve tuning and therefore control stability should be solid.

However, if process conditions change, for example, if you decide to flow hydrogen instead of air or if you modify the inlet/outlet pressure, you may need to retune your device.

Valve tuning using PD/PDF and PD2I control algorithms

There are two control algorithms used to tune Alicat controllers:

  1. PD/PDF tuning typically for single valve controllers
  2. PD2I tuning typically for dual valve controllers (MCDs and PCDs)

Note: You can view your selected control loop by going to MENU > CONTROL > CONTROL LOOP > LOOP TYPE on the front panel of your Alicat controller.

The PID control algorithm is composed of three terms each playing their part to minimize the error between the setpoint and the measured process variable. They are defined as follows:

  • Proportional (P): The proportional term decreases the error between the setpoint and reading.
  • Derivative (D): The derivative variable dampens the rate of change of the valve position.
  • Integral (I): The integral variable takes into account the sum of previous errors.

Note: You can view the current settings for your P, D, and I variables by going to MENU > CONTROL > CONTROL LOOP on the front panel of your Alicat controller.

The PD/PDF Algorithm

The PD/PDF algorithm provides a simplified user interface. It only requires the user to work with two variables: P and D. This substantially cuts the user’s level of difficulty.

There are a couple of telltale problems indicating a device is in need of valve tuning:

  • You notice oscillation around the setpoint or the control response is unstable.
  • Your controller takes too long to get to the setpoint or never achieves the setpoint, but settles to a flow rate or pressure below the setpoint value.

Below are instructions on tuning your device to solve these problems.

Step-by-step instructions

Serial commands and FlowVision
  1. Ensure that your controller is connected serially.
    1. These instructions assume a Unit ID of A. If your controller’s Unit ID is not A, substitute the correct letter of your Unit ID. If your controller is in streaming mode, do not type the leading ‘a’ in the instructions below.
    2. In this tutorial, we will be using the [Unit ID]S# command to give the controller setpoints. In addition, we will assume a 2 SLPM full scale mass flow controller (MC-2SLPM-D). Therefore, our command for a full scale setpoint will be AS2. Likewise, the commands for 1 SLPM or 0.4 SLPM would be AS1 and AS0.4, respectively. Replace the setpoint value with what your setup requires.
  2. Set PID loop type to PD/PDF.
    1. There are multiple ways to perform this action. The simplest is from the front panel of your Alicat device.
      1. From the front panel of your device, go to: MENU > CONTROL > ADV CONTROL > LOOP SETUP > LOOP TYPE. This is the menu map for Alicat’s latest firmware. If you find your menu is different, please consult your manual or one of our application engineers.
      2. Select PD/PDF Control and press SET.
    2. To perform this serially use the Loop Control Algorithm command. To query which algorithm is being used, use ALCA. A value of 1 will return for PD/PDF, and a value of 2 will return for PD²I.
      1. To set the algorithm to PD/PDF use the command ALCA 1. The device will respond with A 1.
      2. To set the algorithm to PD²I use the command ALCA 2. The device will respond with A 2.
  3. Set all PID variables.
    1. Record your controller’s existing PID settings.
      1. Read the current P value: type ar21.
      2. Read the current D value: type ar22.
    2. Set the P variable in register 21 to 100: type aw21=100.
    3. Set the D variable in register 22 to 5000: type aw22=5000.
  4. Determine the best P value.
    1. Ensure that your controller is connected to a gas source of the appropriate pressure and flow capacity. Start with a 0 setpoint: type AS0.
    2. Command a 5%, 25%, 50%, and 100% setpoint (AS0.1, AS0.5, AS1, AS2), and observe the flow readings.
    3. If there is no overshoot, add 100 to the P variable in register 21: type AW21=[old value+100]. Start again at step a. Once you observe a small amount of overshoot, continue to step d.
Front panel and oscilloscope
  1. Set PID loop type to PD/PDF.
    1. From the front panel of your device, go to: MENU > CONTROL > CONTROL LOOP > LOOP TYPE. This is the menu map for Alicat’s latest firmware. If you find your menu is different, please consult your manual or one of our application engineers.
    2. Select PD/PDF Control and press SET.
  2. Set your PID variables to P=100 and D=5000.
    1. Go to: MENU > CONTROL > CONTROL LOOP. Before you make any changes to your P and D values, be sure to record your controller’s existing settings.
    2. Select P Gain, change your P gain to 100, and press SET
    3. Select D Gain, change your D gain to 5000, and press SET
  3. Determine the best P value.
    1. Ensure that your controller is connected to a gas source of the appropriate pressure and flow capacity. Start with a 0 setpoint.
    2. Command a 5%, 25%, 50%, and 100% setpoint, and observe the flow readings.
    3. If there is no overshoot, add 100 to the P variable. Start again at step a. Once you observe a small amount of overshoot, continue to step d.
    4. If there is un-damped oscillation, subtract 10 from the P variable. Repeat this until the oscillations die away after a change in setpoint.  If it does not improve after 5 iterations, jump to section 4 and start increasing the D variable.
  4. Determine the best D value.
    1. Ensure that your controller is still connected as in step 4 and start from a 0 setpoint.
    2. Command a 5%, 25%, 50%, and 100% setpoint, and observe the flow readings.
    3. If you are experiencing overshoot and oscillations, increase D 1000 at a time. Start again at step a.
    4. If the flow reading matches your setpoint and readings are stable, continue to the next step.
  5. Validate the final tuning.
    1. To properly balance off the speed of response and stability, it may be necessary to repeat steps 3 and 4 above several times.
    2. If you cannot dampen out oscillations through tuning, there may be mechanical interference from other parts of your system.

The PD2I Algorithm

The PD2I algorithm was developed at Alicat Scientific for the express purpose of obtaining the highest possible performance in pressure control applications. It is also applicable to many flow control applications. As it utilizes proprietary predictive functions, this algorithm does not behave like a standard PID routine. Fortunately, PD2I tuning is simple if you follow a few simple guidelines:

Step-by-step instructions

 

Serial commands and FlowVision
  1. Ensure that your controller is connected serially.
    1. These instructions assume a Unit ID of A. If your controller’s Unit ID is not A, substitute the correct letter of your Unit ID. If your controller is in streaming mode, do not type the leading ‘a’ in the instructions below.
    2. In this tutorial, we will be using the [Unit ID]S# command to give the controller setpoints. In addition, we will assume a 2 SLPM full scale mass flow controller (MC-2SLPM-D). Therefore, our command for a full scale setpoint will be AS2. Likewise, the commands for 1 SLPM or 0.4 SLPM would be AS1 and AS0.4, respectively. Replace the setpoint value with what your setup requires.
  2. Set PID loop type to PD2I.
    1. There are multiple ways to perform this action. The simplest is from the front panel of your Alicat device.
      1. From the front panel of your device, go to: MENU > CONTROL > ADV CONTROL > LOOP SETUP > LOOP TYPE. This is the menu map for Alicat’s latest firmware. If you find your menu is different, please consult your manual or one of our application engineers.
      2. Select PD2I Control and press SET.
    2. To perform this serially use the Loop Control Algorithm command. To query which algorithm is being used, use ALCA. A value of 1 will return for PD/PDF, and a value of 2 will return for PD²I.
      1. To set the algorithm to PD/PDF use the command ALCA 1. The device will respond with A 1.
      2. To set the algorithm to PD²I use the command ALCA 2. The device will respond with A 2.
  3. Set all PID variables to P=200, D=10, I=100.
    1. Record your controller’s existing PID settings.
      1. Read the current P value: type ar21.
      2. Read the current D value: type ar22.
      3. Read the current I value: type ar23.
    2. Set the P variable in register 21 to 200: type aw21=200.
    3. Set the D variable in register 22 to 10: type aw22=10.
    4. Set the I variable in register 23 to 100: type aw23=100.
  4. Determine the best P value.
    1. Ensure that your controller is connected to a gas source of the appropriate pressure and flow capacity. Start with a 0 setpoint: type AS0.
    2. Command a 25%, 75%, and 100% setpoint (AS0.5, AS1.5, AS2), and observe the flow readings.
    3. If you observe any oscillations, increase P by 100: type AW21=[old value+100]. Start again at step a. If you find that increasing P increases the oscillations, skip this step and move on to step d.
    4. If there is un-damped oscillation, subtract 10 from the P variable in register 21: type AW21=[old value-10]. Repeat this step until the flow rate approaches the setpoint with no overshoot or oscillations. Do not worry about the speed of convergence.  At this point, the tuning might look like this.
  5. Determine the best I value.
    1. Ensure that your controller is still connected as in step 4 and start from a 0 setpoint: type AS0.
    2. Command a 25%, 75%, and 100% setpoint (AS0.5, AS1.5, AS2), and observe the flow readings.
    3. To increase the speed of convergence, add 50 to the I variable in register 23: type AW23=[old value+50]. Start again at step a.
    4. If, after increasing I, you observe overshooting and oscillations, return I to the previous value.
    5. If the flow reading matches your setpoint and converges at a speed you as happy with, continue to the next step.
  6. Determine the best D value.
    1. For nearly every tuning scenario, the optimal D value is 10 and does not require any change. If your current tuning is sufficient, move on to step 7.
    2. Ensure that your controller is still connected as in step 4 and start from a 0 setpoint: type AS0.
    3. Command a 25%, 75%, and 100% setpoint (AS0.5, AS1.5, AS2), and observe the flow readings.
    4. If you observe oscillation around the setpoint, add 10 to the D variable in register 22: type AW22=[old value+10]. Start again at step b. If flow readings are stable, continue to step 7. Do not exceed a value of 50 in the D register.  If it looks like you would need to, return to step 4, and start again.
  7. Validate the final tuning.
    1. To properly balance off the speed of response and stability, it may be necessary to repeat steps 4, 5, and 6 above several times.
    2. If you cannot dampen out oscillations through tuning, there may be mechanical interference from other parts of your system.
    3. Your final tuning should look something like this.

This can be done through FlowVision SC by entering the new values into the respective boxes on the instrument panel.

Front panel and oscilloscope
  1. Set PID loop type to PD2I.
    1. From the front panel of your device, go to: MENU > CONTROL > CONTROL LOOP > LOOP TYPE. This is the menu map for Alicat’s latest firmware. If you find your menu is different, please consult your manual or one of our application engineers.
    2. Select PD2I Control and press SET.
  2. Set your PID variables to P=200, D=10, I=100.
    1. Go to: MENU > CONTROL > CONTROL LOOP. Before you make any changes to your P and D values, be sure to record your controller’s existing settings.
    2. Select P Gain, change your P gain to 200, and press SET.
    3. In a similar fashion, change your D gain to 10, and your I gain to 100.
  3. Determine the best P value.
    1. Ensure that your controller is connected to a gas source of the appropriate pressure and flow capacity. Start with a 0 setpoint.
    2. Command a 25%, 75%, and 100% setpoint and observe the flow readings.
    3. If you observe any oscillations, increase P by 100. Start again at step a. If you find that increasing P increases the oscillations, skip this step and move on to step d.
    4. If there is un-damped oscillation, subtract 10 from the P. Repeat this step until the flow rate approaches the setpoint with no overshoot or oscillations. Do not worry about the speed of convergence.  At this point, the tuning might look like this.
  4. Determine the best I value.
    1. Ensure that your is still connected as in step 3 and start from a 0 setpoint.
    2. Command a 25%, 75%, and 100% setpoint, and observe the flow readings.
    3. To increase the speed of convergence, add 50 to the I variable. Start again at step a.
    4. If, after increasing I, you observe overshooting and oscillations, return I to the previous value.
    5. If the flow reading matches your setpoint and converges at a speed you as happy with, continue to the next step.
  5. Determine the best D value.
    1. For nearly every tuning scenario, the optimal D value is 10 and does not require any change. If your current tuning is sufficient, move on to step 6.
    2. Ensure that your controller is still connected as in step 4 and start from a 0 setpoint.
    3. Command a 25%, 75%, and 100% setpoint, and observe the flow readings.
    4. If you observe oscillation around the setpoint, add 10 to the D variable. Start again at step b. If flow readings are stable, continue to step 6. Do not exceed a value of 50 in the D register.  If it looks like you would need to, return to step 3, and start again.
  6. Validate the final tuning.
    1. To properly balance off the speed of response and stability, it may be necessary to repeat steps 3, 4, and 5 above several times.
    2. If you cannot dampen out oscillations through tuning, there may be mechanical interference from other parts of your system.
    3. Your final tuning should look something like this.

FastTrack Ordering

M/MC mass flow meters and controllers that ship in just 3-5 business days.
CALIBRATION
Standard or High Accuracy
DISPLAY
Monochrome, Color, or None
PROTOCOL
Analog, RS-232, RS-485, or Modbus RTU
CONNECTOR
MD8, Locking Industrial, DB9M, DB15
FITTINGS
NPT

METER RANGES

2 SCCM - 500SLPM

CONTROLLER RANGES

2 SCCM - 100SLPM

Service and Support

Whether it is time for your instrument’s annual recalibration or your instrument needs a repair or upgrade,
you can fill out the Service Request Form below, email us, call us, or start a live chat session to get the service process started.

7641 N Business Park Dr. Tucson, AZ 85743

service@alicat.com

+1(888)290-6060