Category: HAL
A very basic bit of hal code for a 7I76E MPG would be:
net mpg-counts hm2_7i76e.0.7i76.0.0.enc0.count
net mpg-counts axis.x.jog-counts
net mpg-counts axis.y.jog-counts
net mpg-counts axis.z.jog-counts
net x-jog-enable hm2_7i76e.0.7i76.0.0.input-07 axis.x.jog-enable
net y-jog-enable hm2_7i76e.0.7i76.0.0.input-08 axis.y.jog-enable
net z-jog-enable hm2_7i76e.0.7i76.0.0.input-09 axis.z.jog-enable
loadrt mux4
addf mux4.0 servo thread
net jog-inc0 hm2_7i76e.0.7i76.0.0.input-10 mux4.0.sel0
net jog-inc1 hm2_7i76e.0.7i76.0.0.input-11 mux4.0.sel1
setp mux4.0.in0 0.0001
setp mux4.0.in1 0.0010
setp mux4.0.in2 0.0100
setp mux4.0.in3 0.1000
net jog-scale mux4.0.out
net jog-scale axis.x.jog-scale
net jog-scale axis.y.jog-scale
net jog-scale axis.z.jog-scale
Notes:
This is for axis rather than for joints so will only work after homing
(a minor change is needed to jog before and after homing)
The I/O pins and jog increments are arbitrary
The mux4 select bits are a binary code 00,01,10,11 to select the jog increment.
This can usually be arranged with a wafer switch but can be redone for linear select
or button press to select the increments.