Close

Random failure of claw machine

A project log for Toy Claw Machine

Full size Claw machine made from misc. parts.

willbadenwillbaden 03/08/2014 at 00:280 Comments

Since day one the claw machine has had random lockups that I thought a watchdog timer would fix.

The three lockups that were seen were:

Button for claw drop would not activate claw drop routine.  This was resolved by using the watchdog timer and to reset if the condition of "IF the joystick has control of the machine AND the claw drop routine interrupt was inactive, THEN do not reset watchdog"  This seemed to clear up the random lockup.

The second was what would be what appeared to be the steppers getting noise on the step pin.  Either the X or Y axis would start to move slowly and then accelerate.  The code does not support different speeds of the motors, so I figured it had to be a noise issue caused by either the power supplies or the stepper drivers.  Putting a scope to the 5V supply showed noise but none that could be associated to the random movement.  Same for the 24V supply.  I knew that the problem did not show up until the room was warmer.  So I started to heat the circuit up with a little heater.  The claw machine then started to show the signs of failure.  I started poking around the step pins on the drivers and found that they were getting solid 0v 5v transitions.  No noise.  Also the MCLR circuit was very touchy.  If I would touch the circuit, the steppers would then try to step very fast.  I took the MCLR directly to 5V and still touching the pin would cause fast stepping.  Questioning the design of the MCLR and the oscillator circuit, I took a closer look at both.  Following Microchips design criteria for the MCLR did not fix the problem.  Looking at the crystal, I mistakenly thought that it was a 4 MHz crystal as that is what I normally used for random projects.  I had changed over to 20 MHz for some project in the past (not sure which) and failed to remember this.  Checking the code, found the oscillator setting set to XT.  Once I changed it to HS the problem went away.  So it was a matter of the oscillators inability to keep time with low power.  

The third problem was a random lockup when the claw was raised all the way up.  The claw would pull up and when it got into the spring loaded seat, it would stop and still try to step.  This would make audible missed step noise and a gentle push up of the claw would allow the upper limit switch to be activated and it would finish the home routine.  I thought it was due to the plastic on aluminum contact that was causing a binding action.  I replaced the plastic bushing with a sintered bronze but it still had the problem.  So I bumped the current up to the stepper and the problem hasn't showed up again.

Discussions