LAIR82 wrote:I am trying to use the original 6 position selector switch for my jog increments on our 10CC lathe project and am trying to figure out how to interface it with the AXIS dropdown box of increments. I have been reading about different configurations that must use 2 momentary pushbuttons to raise and lower the value but could not find anything on a selector switch style setup.
As far as I can see it is not possible to set the values in the Axis dropdown from hardware. This is partly because, whilst the physical switch could set the on-screen value, there is no way for the on-screen value to change the physical switch, so who gets to win?
I am also fairly sure that the Axis GUI jog drown doesn't control the jog speed with physical buttons, only with the keyboard or GUI. (though axisui does provide pins to hook them together, but only with the GUI as an output)
What you might want to do is hide the On-screen jog dropdown, which can be done with code added to a file called .axisrc in the home folder. (you will probably have to create the file, and because it begins with a "." it will be invisible.
I am hopeless with Python, so don't know the inaction offhand, but you might be able to figure it out if no-one else has a suggestion. (look in axis.py for how the spindle buttons get hidden when no spindle is configured)
The second part of your problem is converting 6 bit signals into one of 6 float values. I think that the easiest way in HAL is probably to sum the values of two mux8 components.
loadrt mux8 count=2
loadrt sum2 count=1
addf mux8.0 servo-thread
addf mux8.1 servo-thread
addf sum2.0 servo-thread
setp mux8.0.in1 1
setp mux8.0.in2 .1
setp mux8.0.in4 .001
setp mux8.1.in1 .0001
setp mux8.1.in2 .00001
setp mux8.1.in4 .000001
net switch-pin-1 mux8.0.sel0
net switch-pin-2 mux8.0.sel1
net switch-pin-3 mux8.0.sel2
net switch-pin-4 mux8.1.sel0
net switch-pin-5 mux8.1.sel1
net switch-pin-6 mux8.1.sel2
net fast mux8.0.out sum2.0.in0
net slow mux8.1.out sum2.0.in1
net jog-speed-out sum2.0.out