Judging by your name, I would have though you hit the problem right on the head ;-)
Sniping with a shotgun!
Sorry, but your post made me laugh.
Good thing you figured it out in the end. It's like that most of the time. Had a similar problem with the spindle encoder on my lathe. Tried everything until I found out the board that was controlling the spindle didn't get enough power. Took me weeks to figure that one out as the problem I was having was random.