01-30-2018 04:30 PM - edited 01-30-2018 04:40 PM
Hi, I'm a beginner in LabVIEW and I am doing a project where I have a water pump that need to be activated when the water level sensor gets 0,244V and be deactivated when the sensor gets 4,88V, when the water level gets 4,88V, the water pump gets deactivated an waits the level gets 0,244V again to re-activate, my problem is, after the water pump gets deactivated in the higher level and the water level starts to get down, the water pump re-activates, but it needs to stay deactivated until the water level gets 0,244V.
I also put some LEDs to indicate the water level, they work normally
Here is the Block Diagram:
(The Pin8 is the water pump)
I hope you understand my problem, thanks for helping me.
Solved! Go to Solution.
01-30-2018 04:38 PM
Read the description of the behavior you're seeking, and then look at your code again.
If the output is less than 0,244, turn ON.
Stay on until output is greater than 4,88. Then turn OFF.
Stay off until output is less than 0,244.
So there's a powered on state, and a waiting state.
The current VI only has one state.
Maybe you'd be interested in a state machine?
01-30-2018 05:47 PM
What you are looking for is something called hysteresis. I created a subVI that does this and have posted on the forum, but I don't have the time to look for it now. You might learn more by coding it yourself anyway.
You need a shift register with a boolean value that maintains the status of what the pump is doing now. If you are above 4.88 V, you turn that shift register false, otherwise do nothing to it. If you are below 2.44 V, turn the boolean true otherwise do nothing. Send that boolean value to the pump. So in that in between zone of 2.44 to 4.88, the boolean value and thus the pump will be in whatever value/state comes out of the shift register.
01-30-2018 07:27 PM
I found the thread. Actually I called it Deadband.vi
https://forums.ni.com/t5/LabVIEW/refrigerator-temperature-control/m-p/1095955
01-31-2018 06:01 AM
@RavensFan wrote:
What you are looking for is something called hysteresis.
Or actually anti-hysteresis .
01-31-2018 04:08 PM - edited 01-31-2018 04:31 PM
RavensFan escreveu:
I found the thread. Actually I called it Deadband.vi
https://forums.ni.com/t5/LabVIEW/refrigerator-temperature-control/m-p/1095955
Thank you! It's working fine, but the pump is being activated when the tank is full, and deactivated when empty. It's possible to change the "off below" to "on below", and the "on above" to "on below"?
01-31-2018 04:22 PM - edited 01-31-2018 04:23 PM
Yes. Study the code and understand how it works. You just need to flip some constants to the opposite value.
And edit the labels in the cluster control so they mean the new definition.
PS: "Below"
01-31-2018 04:43 PM
Thank you very much guys for helping me with this project, It's working perfectly now.