Sounds like a math error somewhere. First check the G code to see if that Z move is being commanded at the failure point. If not, then I'm guessing a math/calculation error in your controller firmware. Some kind of computer hardware failure is unlikely.