LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Servo Servo Close One Channel doesn't close

Hi,

I'm trying to manage a peristaltic pump, that can be controlled by servo control signal, with an Arduino Uno board. It should start when the water level sensor reads a value that is smaller than a reference one. This operation must continue until stop button is pressed. The problem is that it works well for 3 times (open servo channel, compare (only if it's needed), close servo channel) and then it continues to go without stopping, even if i press the stop button.

Do you have any idea to solve it?

Thanks.

 

0 Kudos
Message 1 of 3
(1,842 Views)

You're probably getting stuck in the innermost while loop which is going to run as long as the analog read is less than the reference level.

 

You should only need one while loop with one case structure inside of it.  And perhaps a shift register that should keep track of whether the pump should be on or off.

0 Kudos
Message 2 of 3
(1,790 Views)

Hi,

thanks for your answer, but it is not blocking in the innermost loop, since looking with the highlight mode (bulb on) the signal goes out form the loop (when the condition is satisfied) and it interacts with the "servo close" block but after 3/4 times it stops to execute in the right way and it doesn't close the channel. 

0 Kudos
Message 3 of 3
(1,767 Views)