For navigation it`s better to write a function that saves the frame machine position into a file, rather than building a gps tower everything so often. I did something like that for turtles and posted on the CC forums as "GPS-less movement", you can adapt it for a frame machine.
For collision, just put a turtle next to the machine, and before every movement by the machine, tell the turtle to move to the same direction. The turtle can detect if it has moved or not, since it returns true or false after each movement. After both the turtle and the machine have moved, calculate the distance between turtle and machine. If the turtle moved and the distance between turtle and machine is the same as before, both the machine and turtle have moved. If the turtle moved, but the distance between machine and turtle has increased, the machine is stuck. If the turtle has not moved, but the distance has increased, the machine moved and the turtle is stuck.
For collision, just put a turtle next to the machine, and before every movement by the machine, tell the turtle to move to the same direction. The turtle can detect if it has moved or not, since it returns true or false after each movement. After both the turtle and the machine have moved, calculate the distance between turtle and machine. If the turtle moved and the distance between turtle and machine is the same as before, both the machine and turtle have moved. If the turtle moved, but the distance between machine and turtle has increased, the machine is stuck. If the turtle has not moved, but the distance has increased, the machine moved and the turtle is stuck.