MPG

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.

mpg01.png
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.

mpg02.png
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.

mpg03.png
Figure 3: The Scale Selector Switch path
mpg04.png
Figure 4: Setting the scale for how far to move per pulse.
mpg05.png
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.

mpg06.png
Figure 6: Smoothing the jog with ilowpass.