Hi,
there are two jogging modes, Step and Continuous.
What you have described is the behavior of Mach when jogging in Step mode.
Each click of the MPG causes a move instruction to be appended to the motion buffer. Each click will move the current
axis one 'jog increment' whatever the current jog increment is at the current time. If the succession of move instructions
exceeds the jog rate the instructions stack up in the buffer. Even when the MPG is stopped movement will continue until
the buffer is empty. This is normal behavior.
The only way you can stop the motion controller from completing its task is to EStop.
There may be another alternative, I haven't tried it, this API is really meant for probing routines but may none the less offer
you away to 'cheat' Mach4:
LUA Syntax:
rc = mc.mcMotionClearPlanner(
number mInst)
Description:
Clears the motion planner of all previously planned moves.
What I am suggesting is that if you had some timer arrangement that detected that the MPG had ceased producing pulses
for say half a second then you could issue a mc.mcMotionClearPlanner instruction.
That may offer a way to prevent overrun in Step jog mode but perhaps you should experiment more with Continuous jog
mode.
This is from "Mill Operations Guide" in your Docs folder, page 23:
There are 2 basic jog modes which are selectable by pressing the “Jog Mode” button. The current selection will be indicated by an LED. Figure 3-5 shows the continuous mode selected. In continuous mode the machine will move at the specified jog rate as long as a jog button is held down. The jog rate can be changed by moving the slider at the bottom of the jogging tab or by directly typing the desired rate into the DRO in the bottom right corner. The number shown in the DRO is a percentage of the max velocity, or rapid rate, of the machine. Continuous mode is useful for moving the machine relatively large distances and rough positioning. When finding the edge of a work piece, locating a hole, or other precision position is required, step jog is much more accurate. In step jog, the machine moves only by the specified increment amount, regardless of how long the jog button is held down. The jog increment can be changed by pressing the “Cycle Jog Inc” button. This button will change the DRO to the right of it to show the current increment amount. The increment values can be changed on the General tab in the Mach configuration.
Thus in Continuous mode if you release the jog button the axis stops immediately. What happens when supplied by an MPG signal
however? My pendant (VistaCNC P1A) when in Velocity mode (same as Continuous mode) if you turn the MPG wheel fast enough
the axis moves at the current jog rate. If you slow down or stop the axis also stops. I recall when I set it up there was a setting
somewhere that allowed me to program how fast that threshold was.....can't remember where just at the moment.
I believe the same thing happens with an ordinary MPG attached to your motion controller.
Try it out.
Craig