If you move the tool to a certain position using the MDI commands, are the results always accurate? The first thing to do is make sure your machine is set up correctly, so that you know it's always going where it's told to. If that's all good, the next thing to figure out is if you're losing steps. Sending the tool back and forth multiple times, one axis at a time, is a good way to check that. If at the end of a long series of moves in all directions it returns to 0,0,0, then its time to look at the G-code, and see if it's sending the tool to the correct location.