I will second SORCHEROR's encoder diagnosis, and motor swap recommendation.
If it were a problem with the servo drive, the control would continue to count position accurately as it ran away (and it would stop sooner, with a "position error" stall message).
If the problem is fairly persistent (you can reproduce it reliably in five or ten minutes of jogging around or making short moves) then swapping motor connections at the back of the console will work. For example, if you exchange the X power and encoder connections with the Z power and encoder connections, then whenever you press an X axis jog button, Z will move (and vice versa). If you do this, and the Z motor still runs away (even though the control thinks it is X) then the problem is in the motor or the motor cable. If, after you swap, the X motor runs away (which the control thinks is Z) then the problem is inside the console box.
Be very careful doing this, as the Z limit switches won't stop a runaway on the X axis output.
If the problem is too intermittent to positively identify this way, then I would physically swap motors. I.e. disconnect the cables at the X and Z motors; dismount them; swap pulleys if necessary; and trade places. Then you can run indefinitely with X moving X and Z moving Z, but with a different motor in each place.
When all is said and done, you will probably find you have a faulty encoder on the Z axis motor. I can sell you a replacement for $160 plus shipping, but will need to know the back shaft diameter where it is mounted (probably 3/8", but not guaranteed).
Do you know the model year of your control? |