Just some info from an experience.About a month ago my z axis would not respond to the keyboard command,then a giggle here or ther and it would work.
Bit scarey as this could quit during a run and really mess things up.
I tightened every mar connector on the z motor and checked the z drive ,all was well and it would work for awhile .Finally it quit no z at all.
I suspected the DB25 soldering but it turned out its a bad wire or loose common at the z drive .
Its a short piece about 4 in and i am going to replace it shortly .
This problem hung around for some time and was difficult to pin down.