# components needed loadrt match8 count=6 loadrt mux4 count=1 loadrt mux2 count=2 loadrt encoder num_chan=1 loadrt threads name1=tt period1=100000 name2=tt2 period2=1000000000 loadrt hal_m5i20 loadFpga=1 # dummy connections # AXIS will not show spindle/coolant controls # unless they are connected to something newsig mist bit newsig flood bit linksp mist iocontrol.0.coolant-mist linksp flood iocontrol.0.coolant-flood newsig spindle-on bit linksp spindle-on motion.spindle-on # JOGWHEEL # jogwheel signals are connected to a software encoder component # the encoder count is connected to the motioncontroller (axis jogging) # and halui (feed override, spindle override) # signals for the jogwheel newsig counts s32 newsig joga bit newsig jogb bit # connect jog signals to hardware linksp joga m5i20.0.in-09 linksp jogb m5i20.0.in-10 # connect jog signals to encoder component linkps encoder.0.phase-A joga linkps encoder.0.phase-B jogb # connect encoder count to motioncontroller and halui linkps encoder.0.counts counts linksp counts axis.0.jog-counts linksp counts axis.1.jog-counts linksp counts axis.2.jog-counts linksp counts halui.feed-override.counts linksp counts halui.spindle-override.counts # JOG INCREMENT SELECTION # inc1 and inc2 are routed to a mux4 which selects the jog scale # connect inc-select signals to hardware newsig inc1 bit newsig inc2 bit linkps m5i20.0.in-03 inc1 linkps m5i20.0.in-04 inc2 # create 'constants' that are inputs to the mux4 newsig inc1val float sets inc1val 0.001 newsig inc2val float sets inc2val 0.01 newsig inc3val float sets inc3val 0.1 # link the constants to the mux4 # create and connect an output signal from the mux4 linkps mux4.0.in0 inc1val linkps mux4.0.in1 inc2val linkps mux4.0.in2 inc3val newsig joginc float linkps mux4.0.out joginc linkps mux4.0.sel0 inc1 linkps mux4.0.sel1 inc2 # connect jog increment to motioncontrol linksp joginc axis.0.jog-scale linksp joginc axis.1.jog-scale linksp joginc axis.2.jog-scale # SELECTING JOGWHEEL MODE # idea: the 6-position rotary switch determines the mode # of the jog-pendant. # for each function (Xjog, Yjog, Zjog, Feed Override, Spindle Override) # there is a match8 component which detects if its # particular function should be enabled # signals and links for the match8 blocks newsig true bit sets true 1 # create signals for the 6-position # jog-selector switch newsig jogsel0 bit newsig jogsel1 bit newsig jogsel2 bit # link jog-selector bits to hardware linksp jogsel0 m5i20.0.in-00 linksp jogsel1 m5i20.0.in-01 linksp jogsel2 m5i20.0.in-02 # determine if the jog-selector bits indicate # an X-jog linksp true match8.0.in newsig Xjogen bit linksp Xjogen match8.0.out newsig Xsel0 bit newsig Xsel1 bit newsig Xsel2 bit newsig Xsel3 bit newsig Xsel4 bit newsig Xsel5 bit newsig Xsel6 bit newsig Xsel7 bit sets Xsel0 0 sets Xsel1 0 sets Xsel2 0 sets Xsel3 0 sets Xsel4 0 sets Xsel5 0 sets Xsel6 0 sets Xsel7 0 linksp Xsel0 match8.0.b0 linksp Xsel1 match8.0.b1 linksp Xsel2 match8.0.b2 linksp Xsel3 match8.0.b3 linksp Xsel4 match8.0.b4 linksp Xsel5 match8.0.b5 linksp Xsel6 match8.0.b6 linksp Xsel7 match8.0.b7 linksp jogsel0 match8.0.a0 linksp jogsel1 match8.0.a1 linksp jogsel2 match8.0.a2 # this is the code for selecting Y-jog linksp true match8.1.in newsig Yjogen bit linksp Yjogen match8.1.out newsig Ysel0 bit newsig Ysel1 bit newsig Ysel2 bit newsig Ysel3 bit newsig Ysel4 bit newsig Ysel5 bit newsig Ysel6 bit newsig Ysel7 bit sets Ysel0 1 sets Ysel1 0 sets Ysel2 0 sets Ysel3 0 sets Ysel4 0 sets Ysel5 0 sets Ysel6 0 sets Ysel7 0 linksp Ysel0 match8.1.b0 linksp Ysel1 match8.1.b1 linksp Ysel2 match8.1.b2 linksp Ysel3 match8.1.b3 linksp Ysel4 match8.1.b4 linksp Ysel5 match8.1.b5 linksp Ysel6 match8.1.b6 linksp Ysel7 match8.1.b7 linksp jogsel0 match8.1.a0 linksp jogsel1 match8.1.a1 linksp jogsel2 match8.1.a2 # this is the code for selecting Z-jog linksp true match8.2.in newsig Zjogen bit linksp Zjogen match8.2.out newsig Zsel0 bit newsig Zsel1 bit newsig Zsel2 bit newsig Zsel3 bit newsig Zsel4 bit newsig Zsel5 bit newsig Zsel6 bit newsig Zsel7 bit sets Zsel0 0 sets Zsel1 1 sets Zsel2 0 sets Zsel3 0 sets Zsel4 0 sets Zsel5 0 sets Zsel6 0 sets Zsel7 0 linksp Zsel0 match8.2.b0 linksp Zsel1 match8.2.b1 linksp Zsel2 match8.2.b2 linksp Zsel3 match8.2.b3 linksp Zsel4 match8.2.b4 linksp Zsel5 match8.2.b5 linksp Zsel6 match8.2.b6 linksp Zsel7 match8.2.b7 linksp jogsel0 match8.2.a0 linksp jogsel1 match8.2.a1 linksp jogsel2 match8.2.a2 # this is the code for selecting Feed Override linksp true match8.3.in newsig fo_en bit linksp fo_en match8.3.out newsig fosel0 bit newsig fosel1 bit newsig fosel2 bit newsig fosel3 bit newsig fosel4 bit newsig fosel5 bit newsig fosel6 bit newsig fosel7 bit sets fosel0 0 sets fosel1 0 sets fosel2 1 sets fosel3 0 sets fosel4 0 sets fosel5 0 sets fosel6 0 sets fosel7 0 linksp fosel0 match8.3.b0 linksp fosel1 match8.3.b1 linksp fosel2 match8.3.b2 linksp fosel3 match8.3.b3 linksp fosel4 match8.3.b4 linksp fosel5 match8.3.b5 linksp fosel6 match8.3.b6 linksp fosel7 match8.3.b7 linksp jogsel0 match8.3.a0 linksp jogsel1 match8.3.a1 linksp jogsel2 match8.3.a2 # this is the code for selecting Spindle Override linksp true match8.4.in newsig so_en bit linksp so_en match8.4.out newsig sosel0 bit newsig sosel1 bit newsig sosel2 bit newsig sosel3 bit newsig sosel4 bit newsig sosel5 bit newsig sosel6 bit newsig sosel7 bit sets sosel0 1 sets sosel1 0 sets sosel2 1 sets sosel3 0 sets sosel4 0 sets sosel5 0 sets sosel6 0 sets sosel7 0 linksp sosel0 match8.4.b0 linksp sosel1 match8.4.b1 linksp sosel2 match8.4.b2 linksp sosel3 match8.4.b3 linksp sosel4 match8.4.b4 linksp sosel5 match8.4.b5 linksp sosel6 match8.4.b6 linksp sosel7 match8.4.b7 linksp jogsel0 match8.4.a0 linksp jogsel1 match8.4.a1 linksp jogsel2 match8.4.a2 # LINKING THE ENABLE SIGNALS # link the jog-enable signals to motioncontroller linksp Xjogen axis.0.jog-enable linksp Yjogen axis.1.jog-enable linksp Zjogen axis.2.jog-enable # links spindle speed override signal # if enabled, scale is 1%, otherwise 0 newsig so_scale_en float sets so_scale_en 0.01 newsig so_scale_zero float sets so_scale_zero 0.0 linksp so_scale_en mux2.1.in1 linksp so_scale_zero mux2.1.in0 linksp so_en mux2.1.sel newsig so_scale float linksp so_scale mux2.1.out linksp so_scale halui.spindle-override.scale # link the feed override enabled signal # if enabled set to 1%, otherwise 0% newsig fo_scale_en float sets fo_scale_en 0.01 # when FO mode not active, set scale to 0 newsig fo_scale_zero float sets fo_scale_zero 0.0 # connect the FO scales to a mux controlled by fo_en linksp fo_scale_en mux2.0.in1 linksp fo_scale_zero mux2.0.in0 linksp fo_en mux2.0.sel # connect mux output to motioncontroller newsig fo_scale float linksp fo_scale mux2.0.out linksp fo_scale halui.feed-override.scale # COOLANT BUTTON # this is a mechanical momentary-on button # used to both turn on and off flood coolant newsig blue bit linksp blue m5i20.0.in-06 loadrt and2 count=2 loadrt not count=3 linksp blue and2.0.in0 newsig flood_on bit linksp flood_on halui.flood.is-on # when coolant is on and we press the button we want it OFF linksp flood_on not.1.in linkpp not.1.out not.2.in linkpp not.2.out and2.0.in1 newsig coolant_off bit linksp coolant_off and2.0.out linksp coolant_off halui.flood.off # when coolant is off and we press the button we want it ON linksp flood_on not.0.in linkpp not.0.out and2.1.in0 linksp blue and2.1.in1 newsig coolant_on bit linksp coolant_on and2.1.out linksp coolant_on halui.flood.on # parameter values setp encoder.0.position-scale 1.00000e+00 setp encoder.0.x4-mode FALSE setp encoder.capture-position.tmax 5221 setp encoder.update-counters.tmax 4971 setp m5i20.0.dac-00-gain 1.00000e+00 setp m5i20.0.dac-00-interlaced TRUE setp m5i20.0.dac-00-offset 0.00000e+00 setp m5i20.0.dac-01-gain 1.00000e+00 setp m5i20.0.dac-01-interlaced TRUE setp m5i20.0.dac-01-offset 0.00000e+00 setp m5i20.0.dac-02-gain 1.00000e+00 setp m5i20.0.dac-02-interlaced TRUE setp m5i20.0.dac-02-offset 0.00000e+00 setp m5i20.0.dac-03-gain 1.00000e+00 setp m5i20.0.dac-03-interlaced TRUE setp m5i20.0.dac-03-offset 0.00000e+00 setp m5i20.0.dac-write.tmax 0 setp m5i20.0.digital-in-read.tmax 7413 setp m5i20.0.digital-out-write.tmax 0 setp m5i20.0.enc-00-scale 1.00000e+00 setp m5i20.0.enc-01-scale 1.00000e+00 setp m5i20.0.enc-02-scale 1.00000e+00 setp m5i20.0.enc-03-scale 1.00000e+00 setp m5i20.0.enc-04-scale 1.00000e+00 setp m5i20.0.enc-05-scale 1.00000e+00 setp m5i20.0.enc-06-scale 1.00000e+00 setp m5i20.0.enc-07-scale 1.00000e+00 setp m5i20.0.encoder-read.tmax 0 setp m5i20.0.led-view 0 (0000) setp m5i20.0.misc-update.tmax 0 setp m5i20.0.out-00-invert TRUE setp m5i20.0.out-01-invert TRUE setp m5i20.0.out-02-invert TRUE setp m5i20.0.out-03-invert TRUE setp m5i20.0.out-04-invert TRUE setp m5i20.0.out-05-invert TRUE setp m5i20.0.out-06-invert TRUE setp m5i20.0.out-07-invert TRUE setp m5i20.0.out-08-invert TRUE setp m5i20.0.out-09-invert TRUE setp m5i20.0.out-10-invert TRUE setp m5i20.0.out-11-invert TRUE setp m5i20.0.out-12-invert TRUE setp m5i20.0.out-13-invert TRUE setp m5i20.0.out-14-invert TRUE setp m5i20.0.out-15-invert TRUE setp m5i20.0.watchdog-control 0 (0000) setp m5i20.0.watchdog-timeout 16000 (3E80) setp mux4.0.tmax 2570 # realtime thread/function links addf m5i20.0.digital-in-read tt addf encoder.update-counters tt addf encoder.capture-position tt addf mux4.0 tt addf mux2.0 tt addf mux2.1 tt addf match8.0 tt addf match8.1 tt addf match8.2 tt addf match8.3 tt addf match8.4 tt addf match8.5 tt addf and2.0 tt addf not.0 tt2 addf not.1 tt addf not.2 tt2 addf and2.1 tt