Z axis cable is probably backwards. Just flip it to the opposite where it plugs into the ramps board.
Well that is if I am understanding your problem correctly.