PID Control of Non Linear Ball Valve

Hi all,

Thank you so much for the input on this. Lots of great stuff here.


I'm sorry I didn't provide enough information.
I am controlling air flow.
I have no position feedback.
The valve is motor driven.

The pressures we are dealing with are about 7 Bar.

@Mispeld. Would you mind sharing the math to perform this linearization?

Is temperature a large factor? Didn't consider it to be honest. I can install a temperature transmitter if required.
 
Is temperature a large factor? Didn't consider it to be honest. I can install a temperature transmitter if required.




Typically no.


If this is outside in, oh, say Potsdam, NY, USA, from -24degF in February to 90degF in July, that be a ballpark 10% swing in density, so it could make a small difference; then again the rest of the process is also in the same temperature range so it may cancel or be at least mitigated.
 
Now why are the basic metric units for a flow coefficient m^3.5/kg^0.5 ?


Code:
      peter_trolling          heh_it_worked
-----------] [----------------------( )-----
Well, it could be argued that it isn't if ΔP is in bar (net [g cm**-1 µs**-1]), in which case the flow coeff units are [g**3.5 kg**-0.5], but it is if ΔP is in Pa (net [kg m**-1 s**-1]). So you were close (only off by a factor of ~316), and correct if we bury the conversion factor from bar**0.5 to Pa**0.5, which is square root of an integral power of ten, in the coefficient.




OT: How many cubic inches in a gallon (US)? That's needed to get from [Bbl d**-1] to [m**3 h**-1]. What dimensions, in integral inches, of a rectangular parallelpiped gives a volume of one US gallon?
 
I have never seen direct control of airflow using only valve position work well, but I am usually working with pressures between 0.5 bar and 1 bar gauge. If you are going to try this PID may not be a good idea, since it works best with linear systems.

These articles will give you some math background:
https://www.blowervacuumbestpractic...owers/basics-aeration-control-valves-–-part-1
https://www.blowervacuumbestpractic...owers/basics-aeration-control-valves-–-part-2

The metric and US Customary equations are here:
https://www.engineeringtoolbox.com/flow-coefficients-d_277.html
 
I use Mathcad and do hydraulic simulations all the time.
A gal has
62dA62SE5IBzUbKUD8QaDSSCd1EyvgAaNOeZ3VkBXMAAAAASUVORK5CYII=

So there are no integer values for all sides but I know what you meant. 3*7*11
BTW, on the bottom of page 3/25
https://deltamotion.com/peter/Mathcad/Mathcad - Hydraulic Cylinder.pdf

you can see I calculate the flow coefficient. In this case the flow is cubic (inches/sec)/sqrt(psi) or
H54Lp1DWtiFFEK2RkfNWxZICTswfQ1pedUscgyQAddOaOOVw8jLMMUSCAknkHE5VY2mNd3UCMiUFbKTrV+6hNS8r8qmDqzAs8+Wjme+jy22IO2iNitGQlgAaWNSOh4Wj3gycFdASFiBWh9PKeR9992FAshG61n67H48REiAVajtlbzV77ENjuU5Apa+zx4lERKggGZdOaTd4S0ALAhCAiSDKSvA4fwA76WBYeR7T8MAAAAASUVORK5CYII=

This is cool. I didn't know I could paste Mathcad into posts.


In nuclear power school we called this an oolie contest.


I do hydraulic simulations all the time.


Now back on topic.


The OP can't do much without position feedback. My formula above requires the spool position. Then one can attempt to make use of the flow vs opening curve. The problem is that the formula Q(x)=kv(x)*sqrt(ΔP)
requires that the valve position x is known to calculate the flow coefficient. Therefore even if a differential pressure sensor was installed the valve position still isn't know to compute the flow.
I think the OP should either install a position sensor on the valve or just using a simple control where the motor is turned a little open or close to get the desired flow.

Now I will make an assumption about the motor. The motor only opens or closes at one speed. In which case you can bump the motor open or closed until the desired flow is meet. If the motor moves to quickly then sometime between bumps will be necessary to see the effect.


Forum member, Pandiani, introduced me to valves like this that they us in power plants only the valve opens and closes using pulses.
 
Hi all,
@Mispeld. Would you mind sharing the math to perform this linearization?

For the forward model, which is the PV vs CO data (eyeball estimate from post #5):

PV = CO * A * B^(CO - 1)

where:
PV is process variable flow in m3/min
CO is offset fractional controller output [i.e., (CO-10)/100]
A = 338.4 from Excel Solver
B = 7.7 from Excel Solver

Note: the zero response from 0 to 15% is addressed by shifting the CO by 10%, which can be accommodated by the min output setting of the PID instruction.

For the inversion function I used:

MOD-CO = CO * (X* Y^(CO) + Z)

where:
MOD-CO is modified controller output to the valve divided by 100
CO is offset output as above
X = 2.409 from Excel Solver
Y = 0.059 from Excel Solver
Z = 0.682 from Excel Solver

So, you would take PID output and subtract the 10 percent to account for no response and then convert to a fraction (i.e., 0 to 0.9). Plug this number into the CO in the above equation to get the modified fractional output that can be sent to the valve. Again, this is based on a presumed actual flow curve from a controller manual output sweep.

As mentioned in the previous post, this is not a perfect linearization, but comes close. There are other equations that can be effective to model the inverted equal-percentage shape.
 
I can see my Mathcad equations didn't post. Oh well.

Misspend. The problem is that the motor is integrating a open or close control signal and you don't know what the position is. You are calculating an output as if the valve will move to that position and stop like a servo valve.

Drbitboy, the number of cubic inches per gallon is just a small fraction over 231. 231 cu in per gal is close enough. When I am working with imperial units I use inches, seconds, pounds mass and pounds force. 1 lbf = 1lbm*1g.
 
Code:
      peter_trolling          heh_it_worked
-----------] [----------------------( )-----
Well, it could be argued that it isn't if ΔP is in bar (net [g cm**-1 µs**-1]), in which case the flow coeff units are [g**3.5 kg**-0.5], but it is if ΔP is in Pa (net [kg m**-1 s**-1]). So you were close (only off by a factor of ~316), and correct if we bury the conversion factor from bar**0.5 to Pa**0.5, which is square root of an integral power of ten, in the coefficient.
I am not off by a factor of 316. I am talking about the basic units. Mathcad simplifies the units to the most basic ones so it doesn't use bar or pascal unless you override it. Standard servo valves are rated at lpm/sqrt(35*bar) but units still simplifies to m^3.5 / kg ^ 0.5 Obviously the magnitude of the scaling changes. if I use cm^3.5 / kg ^0.5
 
Thanks a lot for all this great stuff. I'll try and get stuck in tomorrow and absorb what I can.

Any suggestions for a differential pressure transmitter?

I can leave the temperature transmitter out for now but factor it into the math to get some understanding of it all.

Absolutely will install the position feedback if you feel it will benefit. I can see it's an optional add on.
 
Drbitboy, the number of cubic inches per gallon is just a small fraction over 231. 231 cu in per gal is close enough. When I am working with imperial units I use inches, seconds, pounds mass and pounds force. 1 lbf = 1lbm*1g.


Yes, it used to be 231 exactly, it depends if we use international inches or the other one (US survey inch, I think).
 
Thanks a lot for all this great stuff. I'll try and get stuck in tomorrow and absorb what I can.

Any suggestions for a differential pressure transmitter?

I can leave the temperature transmitter out for now but factor it into the math to get some understanding of it all.

Absolutely will install the position feedback if you feel it will benefit. I can see it's an optional add on.

Drbitboy's suggest of using a differential pressure sensor is good but useless without knowing the valve opening.

You are lucky I am caged inside right now.
Here is another question. You graph shows flow vs percent open. Is percent open and position linear?

This better be worth it. Using the flow meter and bumping the valve open or closed to get the desired flow seems simple to me.
 
Btw, I forgot my training. The non-linearity of the flow wrt valve position is not the direct cause of a problem with a PID. It is the linearity (or lack thereof) of the response of the system* wrt valve position that will determine how well this valve will work (assuming you resolve any positioning issues); the valve can be non-linear but if the system is near-linear across the entire range of expected valve positions, then a PID will work well. The situation I mentioned, where the valve takes essentially all of the pressure drop at low flow rates, but at high flow rates the bulk of the pressure drop is taken up in the piping, is where this valve's characteristic would work well to make the system response linear over the range.



* pressure or flow, i.e. whatever is being measured and used for control.
 
what is the required accuracy? How about a strapping table to define the output and then an add/sub function to give fine control. You could feed that into the PID in man mode and keep the faceplates
 
Inches, mm, yards, metres, PSI, Bar, that's why the Hubble went so badly wrong. Some years ago I purchased a scientific calculator, as usual, a boy with a new toy. Had it for years no problem then one day I was working for an American company (in the UK) & the original system was made for the European market so I had to convert everything into old money. simple with a calculator that has these functions, yeah right. All went well I thought then on producing a batch we found that the mix was wrong. The product development explained that the water addition was short, after scratching my head I realised that the calculator being Japanese used a conversion for American gallons not imperial. This is a bit ironic as this is an American company but uses imperial gallons. The other confusing thing is the US Dry/liquid measure o_O
Here in the UK we are no better, 50 years after decimalisation the mechanical industry still use imperial especially in pipe sizes.
 

Similar Topics

Hello. I have an application where I'm controlling a spindle motor as a yarn package builds in diameter. As the diameter increases the motor...
Replies
25
Views
9,491
I am trying to build ladder logic in rsl5k to turn on a contactor with a digital output. I have a 1769-IT6 input card and a 1769-OA16 output card...
Replies
8
Views
1,952
I have S7 1512C controler for controlling 48 PID temperature loop, the output is PWM. Please I need the best, most efficient way to write the...
Replies
13
Views
600
Hi all, I'm having trouble solving a problem I've been working on for several months, and thought you might like a stab at it. The machine runs...
Replies
22
Views
947
How can I connect PID Output to a valve. In ladder logic program is there any logic do I want to add between valve and PID? PV=SP What will be the...
Replies
7
Views
413
Back
Top Bottom