Eric Nelson
Lifetime Supporting Member + Moderator
I'm working on a quickie program for a camera inspection system. Product traveling down a conveyor is inspected with a vision system. If the product fails inspection, it is pushed off the conveyor by a cylinder. Let's see how well I can 'draw' the layout.
Hey, that turned out pretty good!...
The camera gives either a "PASS' or "FAIL" signal, which gets placed in a FIFO stack (1=PASS, 0=FAIL) each time I receive a signal from the camera. The sensor at the reject position unloads the FIFO stack, and if the value is "0", the reject cylinder fires. Simple enough.
Everything works as planned, except one thing that bugs me. The 'unload location' from the FIFO stack retains the final value when the stack position reaches zero (nothing in the stack). I realize this is how it's supposed to work, but it's not how I want it to work. IOW, if the last part through the system is a failure, sucessive triggering of the reject position sensor fires the reject cylinder. The LOUSY part is, if the last part through the system was ACCEPTED, sucessive triggering of the reject position sensor DOESN'T fire the reject pusher... banghead
My concern is that I'm relying on the "PASS" and "FAIL" signals to load the FIFO stack. If I get NEITHER, and the FIFO stack empties with an accepted part as the final 'inspected' part, failed parts have the ability to get through. I would rather reject everything if the camera fails to give a result.
Keep in mind this is a VERY low-end system, so I don't have options like 'stop the conveyor', 'sound an alarm', etc...
I have tried using the inspection position sensor to advance the FIFO, then sticking the PASS/FAIL results in the correct location within the stack (the camera results come AFTER the trigger signal), but had weird results.
I also tried forcing the reject to fire every time whenever the stack position = zero, but that caused it to reject the last part through the system, even when it was flagged as good. This happened even when I placed the FIFO Unload (FFU) instruction AFTER the reject sequence...
One other 'odd' thing...
The FIFO Load (FFL) instruction is supposed to execute only on a false-to-true transition. Any idea why I had to use one-shots? Without them, it fires every scan. Something to do with using inputs rather than internal bits?...
Attached is the (tiny) program, including a PDF version for Casey!...
[attachment]
beerchug
-Eric
+---+ +-+
| | VISION | | REJECT
| | SYSTEM | | PUSHER
+---+ +-+
/_\ __|__
----------------------------------------------------------------------
+---+ +---+ +---+ +---+ +---+
| | | | | | | | | |
+---+ +---+ +---+ +---+ +---+
----------------------------------------------------------------------
FLOW -----> ^ ^
INSPECTION REJECT
POSITION POSITION
Hey, that turned out pretty good!...
The camera gives either a "PASS' or "FAIL" signal, which gets placed in a FIFO stack (1=PASS, 0=FAIL) each time I receive a signal from the camera. The sensor at the reject position unloads the FIFO stack, and if the value is "0", the reject cylinder fires. Simple enough.
Everything works as planned, except one thing that bugs me. The 'unload location' from the FIFO stack retains the final value when the stack position reaches zero (nothing in the stack). I realize this is how it's supposed to work, but it's not how I want it to work. IOW, if the last part through the system is a failure, sucessive triggering of the reject position sensor fires the reject cylinder. The LOUSY part is, if the last part through the system was ACCEPTED, sucessive triggering of the reject position sensor DOESN'T fire the reject pusher... banghead
My concern is that I'm relying on the "PASS" and "FAIL" signals to load the FIFO stack. If I get NEITHER, and the FIFO stack empties with an accepted part as the final 'inspected' part, failed parts have the ability to get through. I would rather reject everything if the camera fails to give a result.
Keep in mind this is a VERY low-end system, so I don't have options like 'stop the conveyor', 'sound an alarm', etc...
I have tried using the inspection position sensor to advance the FIFO, then sticking the PASS/FAIL results in the correct location within the stack (the camera results come AFTER the trigger signal), but had weird results.
I also tried forcing the reject to fire every time whenever the stack position = zero, but that caused it to reject the last part through the system, even when it was flagged as good. This happened even when I placed the FIFO Unload (FFU) instruction AFTER the reject sequence...
One other 'odd' thing...
The FIFO Load (FFL) instruction is supposed to execute only on a false-to-true transition. Any idea why I had to use one-shots? Without them, it fires every scan. Something to do with using inputs rather than internal bits?...
Attached is the (tiny) program, including a PDF version for Casey!...
[attachment]
beerchug
-Eric