I am relatively new to ladder logic so I am having a hard time wrapping my head around this project of mine.
I have a drink dispenser that dispenses the drink as long as the button is pressed. This forces the user to manually time the release of the button to stop dispensing the drink without over or under filling the cup. This doesn't happen so well without much practice. I want to make this gorilla proof.
I would like to use an AB Pico or similar smart relay to control this. There are only two sizes of cups, small and large. I want the user to be able to press and release the button once for a small (dispense for 6 seconds) or press and release a second time for a large (another 6 seconds or 12 seconds in all), then a third press and release will shut everything off immediately if there's a problem. I only have one button and can't add another one.
In a perfect world I'd also like to be able to press and hold the button to dispense until the button is released. I know this will get into logic that can see the difference between a press and release and a press and hold, but that is beyond my knowledge at the moment.
What I'm having trouble seeing is how to make sure the two fill levels are consistently met regardless of when the second press is done. I have logic turning on the pump on the first press but if I press again at say 4 seconds, the second timer starts so the last two seconds of the first timer don't do anything. My timers aren't cumulative and I'm struggling to see how to do this.
I've thought about an up down counter. The button counts up and the timers count down and as long as the counter is greater than zero, keep the pump running. I struggle to get that logic to work right with the third press and release if the first timer has reduced the counter from 2 to 1, it's never going to be 3. I just chase myself in a circle with ideas on what to do about it.
Can I get some help on how to handle this, please?
I have a drink dispenser that dispenses the drink as long as the button is pressed. This forces the user to manually time the release of the button to stop dispensing the drink without over or under filling the cup. This doesn't happen so well without much practice. I want to make this gorilla proof.
I would like to use an AB Pico or similar smart relay to control this. There are only two sizes of cups, small and large. I want the user to be able to press and release the button once for a small (dispense for 6 seconds) or press and release a second time for a large (another 6 seconds or 12 seconds in all), then a third press and release will shut everything off immediately if there's a problem. I only have one button and can't add another one.
In a perfect world I'd also like to be able to press and hold the button to dispense until the button is released. I know this will get into logic that can see the difference between a press and release and a press and hold, but that is beyond my knowledge at the moment.
What I'm having trouble seeing is how to make sure the two fill levels are consistently met regardless of when the second press is done. I have logic turning on the pump on the first press but if I press again at say 4 seconds, the second timer starts so the last two seconds of the first timer don't do anything. My timers aren't cumulative and I'm struggling to see how to do this.
I've thought about an up down counter. The button counts up and the timers count down and as long as the counter is greater than zero, keep the pump running. I struggle to get that logic to work right with the third press and release if the first timer has reduced the counter from 2 to 1, it's never going to be 3. I just chase myself in a circle with ideas on what to do about it.
Can I get some help on how to handle this, please?