This is an example of using a MPG (Manual Pulse Generator) to jog the axes on a CNC machine.

There are several HAL connections needed to jog with a MPG. Figure 1 illustrates the path from the MPG to the axis jog count inputs. Notice how you can connect to all three axes jog counts. If your using a software encoder component you will need to make HAL connections for it.

Figure 1: MPG to axis jog counts
Typical connections for a Mesa 7i77
net jog-count <= hm2_5i25.0.7i77.0.0.enc0.count
net jog-count => axis.0.jog-counts
net jog-count => axis.1.jog-counts
net jog-count => axis.2.jog-counts

In Figure 2 we set pin (setp) values in the mux4 component. We set in0 to zero so that will be off.

Figure 2: Setting the scales for mux4.0.

In Figure 3 we see the path from the jog scale selector switch to the mux4 component. If input 1 is on then or2.0 out is on and mux4.0.out is set to the value of mux4.0.in1. If input 2 is on then sel1 is on so the output of mux4 is equal to in2. If input 3 is on the both sel0 and sel1 is on so the output of mux4 is equal to in3.

Figure 3: The Scale Selector Switch path
Figure 4: Setting the scale for how far to move per pulse.
Figure 5: Enabling the Axis

Optionally you can also use the ilowpass component in between the encoder counts and the axis jog-counts to smooth out the jogging on machines with fast acceleration. You will need to set the ilowpass.n.gain and the ilowpass.n.scale.

Figure 6: Smoothing the jog with ilowpass.