LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling Solenoid Valves for a water level application with LabVIEW:

Awesome! I would think maybe a 2-3% room for error, the second valve (draining valve) would mainly be for going to a lower percentage of water in the desired bucket. Example - If the desired bucket has a 70% water in it, and we enter in 50%, we will need to drain out 20% of the water. Also, due to possible ripples when the water is being transferred, the sensor might pick up a value that is lower than desired, let's say we went 50% of water in the desired bucket, and there is currently 20%, so the top valve (valve that lets water in) turns on - and the sensor measures 40-45% of water due to ripples and once the ripples settles down the actual value is 55%, we may want to drain out some of that excess water to get it to 50%, does that make sense? Or am I over-complicating this? That would just be a simple if-else statement, right?

 

Right, will be adding some hysteresis type algorithm that will account for maybe 2-3% of error, and yes, only 1 valve will be on at any given time.

 

Yes, we will have to do some testing and playing around with the numbers to get it exact! We're using 1/2 inch pipe, so we will probably have to shut off the filling valve 2-3% before the desired value.

 

You have been very helpful, nathand! Thank you!

 

Programming the logic should be pretty simple, (I think). Any other foreseen issues? Programming in LabVIEW is our weak point, but the logic statements shouldn't be too bad, I was worried because I thought the easiest would be using a PID - But if you're saying scrap the PID, I think it will won't be too painful! :]

0 Kudos
Message 21 of 23
(680 Views)

Sounds like you're at the point where you should start coding and see how it works; it's rarely possible to fully design an algorithm in advance.

 

I'd try filtering the level measurement and see if you can eliminate the effects of ripples that way first, instead of anticipating overshoot and planning to drain to compensate.  It also sounds like this is a simple enough system that you could generate an accurate mathematical model, which makes the control much simpler (your code can calculate how long to open the valve based on how much liquid needs to move).  If you can make the model work, then you can use the sensor reading only for fine tuning.

 

You should be able to get a good start with the information you have.  If you're uncomfortable, build it up in stages - for example start with a simple VI that just reads the liquid level, and has on/off buttons for each valve.  See if you can can control the liquid level manually, that will give you a sense of what the code needs to do.  Feel free to post your code if you have questions about it or get stuck, but make sure your code demonstrates that you've made an effort to do it yourself.

Message 22 of 23
(677 Views)
Thanks! I actually have the done the vi to measure the level and calculate the volume (its attached in the beginning of this thread) and we got the measuring the level part working...we just need the algorithm for the logic!

We'll start coding this soon! Ill let you guys know if we run into any issues! Thanks again!
0 Kudos
Message 23 of 23
(673 Views)