monkeyhead
Member
Attatched is the logic for a dumb little project i'm working on.
I tested it today and it woks fine other than needing the photo eyes debounced and a some logic to compensate for the clock rolling around to zero. It just seems like there should be an easier way.
Anyway basic setup:
products take 9 secs to travel through the tunnel.2 photo eyes, one before the heat tunnel and one after. packages arrive at completely random intervals.
1. first eye copies the absolute value of the free running clock + 10 secs to a fifo stack.
2. second eye unloads the fifo stack.
3. the absolute value of the free running clock is compared to the first value on the fifo stack continuosly. if it exceeds the value the package is assumed to be lost in the tunnel and an alarm is set.
Just curious to know how other people would have handled this.
I tested it today and it woks fine other than needing the photo eyes debounced and a some logic to compensate for the clock rolling around to zero. It just seems like there should be an easier way.
Anyway basic setup:
products take 9 secs to travel through the tunnel.2 photo eyes, one before the heat tunnel and one after. packages arrive at completely random intervals.
1. first eye copies the absolute value of the free running clock + 10 secs to a fifo stack.
2. second eye unloads the fifo stack.
3. the absolute value of the free running clock is compared to the first value on the fifo stack continuosly. if it exceeds the value the package is assumed to be lost in the tunnel and an alarm is set.
Just curious to know how other people would have handled this.