LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determining optimum PID gain values?

I am writing a test application that attempts to control the pressure on the output side of a small pump by using PID to adjust the position of a valve that restricts flow through the pump. The valve is a ball valve controlled by a 0-10V servo.

I am using hardware-timed DAQ and have synchronized the analog input and output clocks using the RTSI bus as described in Optimized Hardware-Timed PID Loop.

My problem boils down to how does one go about determining the optimum values for the PID gains (Kc, Ti, and Td).

Of course the response of the system is quite non-linear in relation to changes in the valve postition. For example, if I begin to manually open the valve by changing the analog output connected to the servo (0V = closed) there is very little change in the output pressure until the control value gets up to around 4V. Then the response to the valve setting increases up to as much as about a 3.5 psi pressure drop for a 0.25V increase in the valve control and then decreases back to near zero response as the valve control gets close to around 9V or so (10V=fully open). As a result I assumed from the beginning that I would need to use a Gain Scheduled approach. In order to determine the proper PID gain values I first attempted to use the Autotune PID feature supplied in the PID Toolkit but I could never get this to work properly. I then turned to the PID Control Toolset User Manual and attempted to use the Open-Loop (Step Test) Tuning Procedure described on page 3-5 of this manual. I wrote a simple hardware-timed DAQ routine that would step the analog output value applied to the servo in increments of 0.25V and measure the output pressure at a typical frequency of 50Hz for several seconds at each level. This data was then used to compute the deadtime, time constant, and process gain as described in the manual. From these values I got results for Kc, Ti, and Td by following the recommendations. The values for Ti and Td did not show much variation at different settings of the valve (typical results Ti=0.008 min ~ 0.5 sec, Td = 0.002 min ~ 0.1 sec). But the values for Kc varied from near zero up to near 20 (actually -20 since an increase in the valve setting causes a decrease in pressure).

When I attempt to use these values I still cannot get the system to control properly. I have gotten the best results by using only one small gain value (Kc ~ -0.25, Ti = 0.008, Td = 0.002) and not using the gain scheduled approach. But, this value for Kc was obtained pretty much by trial and error and it is still not very ideal. I get some overshoot and a bit of oscillation, and sometimes the system ends up offset from the setpoint a bit.

In addition, I have a some additional types of pumps that have different characteristics that I can't seem to luck upon any reasonable gain values.

Any ideas as to what I could be doing wrong here.
0 Kudos
Message 1 of 2
(4,734 Views)
Doug Harper a �crit:

>My problem boils down to how does one go about determining the optimum
>values for the PID gains (Kc, Ti, and Td).
>
>Of course the response of the system is quite non-linear in relation
>to changes in the valve postition. For example, if I begin to
>manually open the valve by changing the analog output connected to the
>servo (0V = closed) there is very little change in the output pressure
>until the control value gets up to around 4V. Then the response to
>the valve setting increases up to as much as about a 3.5 psi pressure
>drop for a 0.25V increase in the valve control and then decreases back
>to near zero response as the valve control gets close to around 9V or
>so (10V=fully open).
>

I would consider non-linearities like (systematic) perturbations.
There must be somehow an "average", or "typical" response to the
controller's command. The aim is to get the regulation working based
upon that typical response, and make it robust enough to correct a given
perturbation set, including effects due to the command's transfer
function changes in certain parts of the functioning domain. Of course,
the amplitude of these effects come in addition to all other
perturbations you expect.

> As a result I assumed from the beginning that I
>would need to use a Gain Scheduled approach. In order to determine
>the proper PID gain values I first attempted to use the Autotune PID
>feature supplied in the PID Toolkit but I could never get this to work
>properly. I then turned to the PID Control Toolset User Manual and
>attempted to use the Open-Loop (Step Test) Tuning Procedure described
>on page 3-5 of this manual. I wrote a simple hardware-timed DAQ
>routine that would step the analog output value applied to the servo
>in increments of 0.25V and measure the output pressure at a typical
>frequency of 50Hz for several seconds at each level. This data was
>then used to compute the deadtime, time constant, and process gain as
>described in the manual. From these values I got results for Kc, Ti,
>and Td by following the recommendations. The values for Ti and Td did
>not show much variation at different settings of the valve (typical
>results Ti=0.008 min ~ 0.5 sec, Td = 0.002 min ~ 0.1 sec). But the
>values for Kc varied from near zero up to near 20 (actually -20 since
>an increase in the valve setting causes a decrease in pressure).
>When I attempt to use these values I still cannot get the system to
>control properly. I have gotten the best results by using only one
>small gain value (Kc ~ -0.25, Ti = 0.008, Td = 0.002) and not using
>the gain scheduled approach. But, this value for Kc was obtained
>pretty much by trial and error and it is still not very ideal. I get
>some overshoot and a bit of oscillation, and sometimes the system ends
>up offset from the setpoint a bit.
>In addition, I have a some additional types of pumps that have
>different characteristics that I can't seem to luck upon any
>reasonable gain values.
>Any ideas as to what I could be doing wrong here.
>
>

My approach is to start with the simplest possible system, trying to
regulate in a domain where the command is as constant as possible, with
the fewest possible perturbations.
I then choose the setpoint and command offset so that the error has an
amplitude similar to the biggest perturbation possible between two
iterations of the PID, and start the PID with all gains at 0 (so the
error remains constant at first, and is seen as the maximum error when
the PID starts correcting with non-null values). Then rise slowly Kc
till the command oscillates, and set it to a smaller value like 2/3rd.
Then do the same with Ki. Nevermind about Kd.

If the regulation still don't work well enough, well maybe this is not a
matter of tuning the gains, but rather making the system more stable or
buying a toughest controller...

If there is some reason why you did not try that method I would
certainly love to learn from it - oz
0 Kudos
Message 2 of 2
(4,734 Views)