Z changes direction during print!! OMG!!

I am printing at 0.15 mm layer height, at approximately 3 mm height, the printer starts digging into the print. I aborted the print, I clicked on the button (in Pronterface) to lower the bed (go away from the nozzle), and instead it digs into the print even more! The Z direction got switched!!! When I click to get closer to the bed, then it goes away! Even If I give command “G1 Z400 F1000” the printer pushes against the nozzle instead of going further! (My printer is 400mm cube)
If I reset the printer (power off, then back on), the Z direction is OK.

I am using the RE-ARM, and I am getting really frustrated with it! I still have the other problem where it’s adding steps (shifting) for every layer. See my other thread.
But anyways, this NEW problem (did not happen until today), this is much worse and damaging my printer. I printed a thing 50mm height a few days ago and it was fine! now it just decides to switch direction mid-print!!

Imported from wikidot

Sounds like you think you are in absolute mode but are in relative mode ( or vice versa, see G90/G91 gcodes documentation ). Either that, or you have a weird position problem ( maybe use M114 to debug that )

Forgot to mention that the direction is not reversing at exactly the same position, it seems to be random. First time it reversed after 5 mm of print, second time after 3 mm in the print. And it does not happen to any gcode file. When I print the 2 cm test cube, it prints successfully.

Also, using M114, the position shows correct. So for example if currently I am at Z = 20, and I give command G1 Z30, the printer moves to Z = 10, but M114 reports Z = 30.
It’s as if the pin is reversed. But note that it’s not like the pin is disconnected, because it actually moves in both directions (except reversed).
When I reset the printer, everything is OK, the direction is good again.

I just replaced the RE-ARM board a few days ago with a Smoothieboard 5xC, and I executed the SAME gcode that I had on the micro sd, and it prints perfectly!