LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two tank level control

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.

0 Kudos
Message 1 of 11
(4,745 Views)

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.

0 Kudos
Message 2 of 11
(4,705 Views)

@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...

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 3 of 11
(4,698 Views)

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)

 

 

0 Kudos
Message 4 of 11
(4,656 Views)

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.

0 Kudos
Message 5 of 11
(4,643 Views)

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)

Message 6 of 11
(4,636 Views)

Am I on the right path?

0 Kudos
Message 7 of 11
(4,619 Views)

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.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
Message 8 of 11
(4,607 Views)

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.

Message 9 of 11
(4,603 Views)

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.

Message 10 of 11
(4,568 Views)