last 2 days I was at a customers machine searching for bugs without any success. CPU ist a Freescale 6808 and code written in assembly (by me about
5 years ago). The machine is now in production for about 1,5 years. In that time about 10 million pcs have been produced with.
The upper unit consists of a turn table with 2 opposite mounted grabbers. The lower unit consists of a shuttle for feeding material and another shuttle what takes away the waste. Only one of those 2 shuttles can be in the grabber position. One grabber is always in shuttle position and opposite grabber is in workpiece position. Every workpiece needs a grabber cycle to put material on. Thereby some waste is accumulated at the grabbers tools what has to be flushed after preselected number of workpieces.
The SW design is mainly made by 4 state machines. One state machine for both shuttles becouse only one of them can be in grabber position. One main machine cycle state machine for the turn table and 2 more for the both grabbers. The grabbers work simulatanously. Grabber at workpiece puts material to the workpiece while opposite graber picks up new material from feed shuttle. With a grabber in action, the turntable must not turn to avoid crash. In case of a cleaning cycle, the lower grabber first flushs the waste to the cleaning shuttle, then the shuttles change and the same grabber picks up new material and tilts up to workpiece.
The rules seem simple but they are not. Main state machine writes commands to the lower state machine. There is a material request command from the upper grabber to the shuttle state machine. That is a counter what contains
0,1 or 2 becouse up to 2 grabbers can be without material same time. There is also a cleaning request from the upper grabber to the shuttle to allow the shuttle to be in position until the wasted grabber tilted down by turn table for cleaning. This is only a flag becouse both grabbers must not clean in consecutive cycles. This would generate to much delay becouse a grabber sequence waste-material pickup is much longer than a single material release. In average the material shuttle is designed slightly faster than the external conveyor can exxchange the next workpiece. This makes a one cycle time window where one cleaning cycle can be inserted without too much delay to the workpiece transport conveyor.
The SW has now 2 diffrent bugs (maybe the reason is same). One bug is, that occasionally (about every hour) one grabber makes an accidently cleaning to the cleaning shuttle after (or before) cleaning the correct grabber. The other bug I found, is a dead lock situation. Material feed shuttle waits that grabber picks up the material, the grabber above waits for cleaning shuttle to release waist and cleaning shuttle cannot go into position where the feed shuttle waits.
I observed that machine now for 2 days without exact result what makes me crazy. The time for one workpiece is about 1-2 seconds and most time there are 2 or 3 concurrent moves. Unfortunately I have no Idea on how to go on. I made a Display what can show the state numbers in realtime. Probably a digital camera system would be ideal what records machine moves and state number display. A record time of one minute is much enough to replay and examine what happened before a bug. A frame rate of 20 photos per second seems also ok. Any ideas (or maybe experience) if that is possible with USB camera? I hardly see a chance to trace this with a logic analyzer