Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Garyhlucas on October 22, 2016, 03:01:34 PM

Title: PID control of pulse positioned valve
Post by: Garyhlucas on October 22, 2016, 03:01:34 PM
We have an air control valve to control Dissolved Oxygen in an aeration tank. The valve has an open signal wire and a close signal wire and 4 second travel time opening or closing.  We simply pulse it for 10 milleseconds to position it part way, open or closed. We have a DO probe in the tank, but the valve itself is open loop, no feedback of actual position.

Is there some way to apply a PID loop to control this valve? The Do-More PID loops and their autotune has worked so incredibly well on this job for tank level control, pH control, air pressure control, and liquid flow control that I'd really like to use one for the DO.  I am working towards closing the loop by using an analog inductive prox sensor sensing an archimedy's spiral mounted to the valve actuator shaft.  However this is a product where I fight for every dollar of cost. The valve has a V-port to improve the range and linearity.

Thanks,
Title: Re: PID control of pulse positioned valve
Post by: BobO on October 23, 2016, 12:00:58 AM
The new hardware would give you some nice low cost options for that, but would think existing hardware would require a CTRIO2 to control an output with enough precision to maintain any accuracy in valve position. Closing the loop would make it easy, but obviously adds cost.

But surely somebody with actual app experience (unlike me) can offer some ideas...
Title: Re: PID control of pulse positioned valve
Post by: ATU on October 23, 2016, 09:36:23 AM
If you knew tank pressure and flow, could you calculate a material flow rate?
Title: Re: PID control of pulse positioned valve
Post by: Garyhlucas on October 23, 2016, 11:40:50 AM
If you knew tank pressure and flow, could you calculate a material flow rate?
The problem with this project is that we are building a low capacity, low cost Membrane Bio-Reactor (MBR) waste water treatment plant.  To make the process work in this 10,000 gpd plant we need virtually all the same instrumentation as a 1,000,000 gpd plant! So adding instruments or using better ones has a bad effect on cost.

Air flow meters are top dollar instruments, around $2000 each. Pitot tubes cost about $500 including a differential pressure transmitter, and orifice plates with transmitters are about $200.  The problem is that small plants like this are used for schools, campgrounds, parks, hurches, and other sites where they experience extreme turndown on a regular basis.  The pitot and  orifice don't have wide ranges. The current job was designed for 7500 gpd, with equipment that can actually do 14,000 gpd and we are seeing 550 gpd!

I've been tweaking things over the weekend, my V-port valve is working quite well, but I really need this to be bulletproof reliable and easy to adjust.
Title: Re: PID control of pulse positioned valve
Post by: ATU on October 24, 2016, 07:42:28 AM
If you are trying to sense the valve position on the cheap, then maybe look toward automotive components? Maybe you could use something like a throttle position sensor, if the movement on the valve was short and you could attach a linkage or cable? Most engine compartment sensors are engineered for extreme operating conditions. Just a thought.
Title: Re: PID control of pulse positioned valve
Post by: Controls Guy on October 24, 2016, 11:50:51 AM
Yep, I've used those.   Or Novotechnik and others have reasonable industrial pots.   Or just totalize your valve movements and remember where you think you are and adjust accordingly.   Sort of poor man's velocity mode PID.
Title: Re: PID control of pulse positioned valve
Post by: Garyhlucas on October 24, 2016, 06:32:25 PM
Yes automotive stuff would fit right in, as I already use some agriculture parts.  The issue is mounting, the spiral piece I am doing now clamps right on with a small hose clamp and no valve modification.  The bracket holding the sensor can also be used for a digital prox to get a full open or close position sensing just a hose clamp screw.  It bothers me when I make a part do only one job, I feel like that is a sub-optimal solution!
Title: Re: PID control of pulse positioned valve
Post by: ATU on October 24, 2016, 08:22:19 PM
All designs are a compromise.
Title: Re: PID control of pulse positioned valve
Post by: Garyhlucas on October 24, 2016, 10:58:52 PM
All designs are a compromise.
Oh yeah, but I fight really hard to keep the stuff that make the difference between a great product and one that is run of the mill!
Title: Re: PID control of pulse positioned valve
Post by: BobO on October 24, 2016, 11:57:27 PM
All designs are a compromise.

Well, maybe yours are. ::)

;)
Title: Re: PID control of pulse positioned valve
Post by: ATU on October 25, 2016, 11:29:41 AM
I've got this conversation bookmarked. It should be handy for future discussions. 8)
Title: Re: PID control of pulse positioned valve
Post by: plcnut on October 25, 2016, 12:21:47 PM
I have no idea how picky your application is, but here is a thought from this Hillbilly:

Set a scale for "EstimatedPosition" = 0 to 4000.
Set a scale for "CommandPosition" = 0 to 4000.
These numbers will equal milliseconds of time.

Now add in a homing routine for turning on "CloseValve" for 4000 mSec and set "EstimatedPosition" to 0.

Using a Task that is enabled to run every second (or whatever your sample time may be) where you can calculate the difference between your "CommandPosition" and "EstimatedPosition".
Use this absolute value (The difference) to set a timer. Now based on whether the value was positive or negative, then you can decide whether to turn on the "OpenValve" or the "CloseValve" for that amount of time, and then update your "EstimatedPosition" with the new value.

You could also add in a couple of compares that monitored if the "CommandPosition" was within 100 of being open, then run the valve all the way open and then bring it back for 100 mSec.

I'm just rambling now, but maybe this will give you an idea.
Title: Re: PID control of pulse positioned valve
Post by: Controls Guy on October 26, 2016, 12:39:55 PM
Apparently I'm a hillbilly as well, cause that was what I was thinking.  It doesn't really matter if your estimate of the current valve position is correct to 12 sig figs or not, because the trend in the PID output will move you the right amount in the right direction, and it will end up working pretty much like a "real" PID loop.  I'd still experiment with the valve to time movement in percent per second, dead time for new move commands, backlash on reversing, etc. Then your position estimate will be respectable, and it's not all that critical anyway.

[Checks neck with mirror.....yep, it's red]