03-17-2014 11:54 AM
Hello. Trying to build a two tank level control in LabView. if someone could help me with this i would be forever thankful. attaching a principial drawing of how it should work like. between the two tanks is a pump, so the water can go both ways in this pipe.
03-17-2014 03:41 PM
The chances of getting someone to write the whole thing for you are minimal. If you make a stab at it and get stuck, people will be much more likely to help with specific questions.
03-17-2014 03:53 PM
@ToeCutter wrote:
The chances of getting someone to write the whole thing for you are minimal. If you make a stab at it and get stuck, people will be much more likely to help with specific questions.
True. Also, WHAT do you want??? Are you actually needing a CONTROL? Usually a tank would be an indicator. A pump control makes more sense. Or do you need a VI that runs a simulation with a pump and two tanks? If so, what are the parameters for the simulation? What happens when a tank is full? How do you control the pump? Etc...
03-18-2014 05:20 AM - edited 03-18-2014 05:32 AM
Ok. sorry for not beeing specific. the two tanks is supposed to represent two water reservoirs and the water supply for each reservoir is rain water + water from the upper reservoir to the lower reservoir. this simulation is a part of a bigger project that we are doing, and the truth is, we have no experience with LabView. so my intention was really to ask if someone had a model lying around that is similar to the one I am after, where I could just change the parameters. do you need some special toolkit for this model? I have installed LabView 2012
Upper tank:
Water outlet: 3 [m3/s] (adjustable 0-100%)
Area: 1 000 000 [m2]
Rain water: 0,75 [m3/s] (adjustable 0-100%)
Max regulation height: 8 [m] (alarm goes of at max)
Lower tank:
Water outlet: 6 [m3/s] (adjustable 0-100%)
Area: 11250 [m2]
Rain water: 1 [m3/s] (adjustable 0-100%)
Water supply for upper tank: 3 [m3/s] (adjustable 0-100%)
Max regulation height: 4 [m] (alarm goes of at max)
the pump should then of course be able to pump 6 [m3/s] (on/off switch)
03-18-2014 06:10 AM
Forget LabVIEW for a moment. Start by writing some equations relating the flow rates in your pipes and the liquid levels in your tanks. Then post it back here. Meanwhile start reading up and doing some basic tutorials on LabVIEW so you will understand the next steps.
03-18-2014 06:38 AM
Upper tank:
dV1/dt = Qrain1-Qout1
dh1/dt = 1/A1(Qrain1-Qout1)
Lower tank:
dV2/dt = Qrain2+Qout1-Qout2
dh2/dt = 1/A2(Qrain2+Qout1-Qout2)
03-18-2014 08:25 AM
Am I on the right path?
03-18-2014 09:02 AM
I would say you're doing great for a new LabVIEW user. Using shift registers is the simplest way to store the values you want to monitor. If you look at the shipping examples Help > Find Examples... and then search for "tank" you'll find some good examples although they use the more advanced PID VIs. Especially look at Process Control Explorer.vi.
03-18-2014 09:13 AM - edited 03-18-2014 09:22 AM
Well I have to admit I suspected you were too lazy to achieve anything- and you proved me totally wrong. Good work.
Your code is working nicely. I lowered the loop delay to make it a bit more responsive and I could play with the controls and see the water levels responding.
If you haven't seen one, I would read up on shift registers and use one of those instead of a feedback node. It's no better really, but most people seem to prefer them as being a little more 'readable'.
Also, I would define a timestep variable 'dt' and multiply all your flow rates by this each step. This allows you to vary the length of the timestep you are modelling.
As I said, you will find people much more willing to help with further queries on this now you have put some effort of your own in.
[EDIT]Somehow missed Niquist's post, hence the repitition.
03-19-2014 04:54 AM
Thanks for the advice, I'll look into that! I have another question. I want to be able to switch my two "turbine flow" sliders over to pumping mode. what I mean is that I want to be able to use them to not only drain water down to the lower tank, but also be able to pump water up. Anyone got any advice how to do this? Thank you for beeing so helpful.