mux4 for axis select??

More
8 years 7 months ago #107406 by rodw
Replied by rodw on topic mux4 for axis select??
And, thanks, it just dawned on me that I have 3 spare MPG inputs on my pendant that I might be able to use for speed overrides and other adjustments using the axis select button :)

Please Log in to join the conversation.

More
8 years 7 months ago #107407 by OT-CNC
Replied by OT-CNC on topic mux4 for axis select??
Thank you all for your suggestions! I got Todd's example to work. Below is a partial sample of the hal file with lowpass for the mpg and the working inc and axis selector switches:

# ---jogwheel signals to mesa encoder - shared MPG---

setp axis.x.jog-vel-mode 1
setp axis.y.jog-vel-mode 1
setp axis.z.jog-vel-mode 1

net scale1 mux4.0.sel0 <= hm2_5i25.0.7i77.0.0.input-22
net scale2 mux4.0.sel1 <= hm2_5i25.0.7i77.0.0.input-23

setp mux4.0.in0 0.0000001
setp mux4.0.in1 0.00001
setp mux4.0.in2 0.000001
setp mux4.0.in3 0.000015

net mpg-out ilowpass.0.in <= hm2_5i25.0.7i77.0.0.enc0.count

#### jog enable with 4 selctor sw, 2 inputs, 4 out logic ####

#a=00
#x=01
# y=10
# z=11

#loadrt and2 count=4
addf and2.4 servo-thread
addf and2.5 servo-thread
addf and2.6 servo-thread
addf and2.7 servo-thread

net input1-not <= hm2_5i25.0.7i77.0.0.input-20-not => and2.4.in0
net input2-not <= hm2_5i25.0.7i77.0.0.input-21-not => and2.4.in1
net mpg-a <= and2.4.out => axis.a.jog-enable

net input1-not => and2.5.in0
net input2 <= hm2_5i25.0.7i77.0.0.input-21 => and2.5.in1
net mpg-x <= and2.5.out => axis.x.jog-enable

net input1 <= hm2_5i25.0.7i77.0.0.input-20 => and2.6.in0
net input2-not => and2.6.in1
net mpg-y <= and2.6.out => axis.y.jog-enable

net input1 => and2.7.in0
net input2 => and2.7.in1
net mpg-z <= and2.7.out => axis.z.jog-enable

#### end of jog enable selector switch ######
###continuation of mpg jog wheel ####

net mpg-scale <= mux4.0.out
net mpg-scale => axis.x.jog-scale
net mpg-scale => axis.y.jog-scale
net mpg-scale => axis.z.jog-scale

net encoder-counts <= ilowpass.0.out
net encoder-counts => axis.x.jog-counts
net encoder-counts => axis.y.jog-counts
net encoder-counts => axis.z.jog-counts

Please Log in to join the conversation.

More
8 years 7 months ago #107408 by OT-CNC
Replied by OT-CNC on topic mux4 for axis select??
I noticed I need to hit the jog arrows first to get the jog wheel to respond. Is this fixed in the latest version?

Also, I noticed that the axis gui does not reflect my selected axis from the handheld pendant to the manual control tab. What halui pin is set aside for that? What do I need to add?

Thank you!

Please Log in to join the conversation.

More
8 years 7 months ago #107416 by andypugh
Replied by andypugh on topic mux4 for axis select??
[quote="OT-CNC" post=107408Also, I noticed that the axis gui does not reflect my selected axis from the handheld pendant to the manual control tab. What halui pin is set aside for that? What do I need to add?[/quote]

I don't think that there is any way to tell Axis which axis is selected.

There are pins that are outputs from Axis so you can integrate a jogwheel:
linuxcnc.org/docs/2.7/html/gui/axis.html#_axisui_pins

Axis and Halui are basically two separate user interfaces, both of which have different concepts of "current axis". In fact I would not be surprised to find that you can jog one axis with a jogwheel while jogging a different one in Axis.

Please Log in to join the conversation.

More
8 years 7 months ago #107470 by OT-CNC
Replied by OT-CNC on topic mux4 for axis select??
Now that my jog pendant is built and working all this makes sense. As cmorley explained this to me before( forum.linuxcnc.org/38-general-linuxcnc-q...ternal-feed-override ) the gui sliders reflect the external inputs of the feed and rapid override knobs and the selected axis do not. I was not fully grasping that before. I was hoping that selecting axis "x" on the jog pendant would also update axis "x" on the gui's manual control tab. Main reason for this is I wanted to have a store position or zero set button for g54 that jived with what's shown selected on the gui. This way I can jog an edge finder to locate part zero then hit a button that sets that selected axis from the jog wheel to 0.
I'm guessing it can be done independently from the gui?

Need help with something like:
net zero-set button hm2_5i25.0.7i77.0.0.input-xx => selected axis from pendant to issue g92 0 for that axis???

Please Log in to join the conversation.

More
8 years 7 months ago #107501 by OT-CNC
Replied by OT-CNC on topic mux4 for axis select??
Let me know if I need to start a new topic as this relates more to expanding the jog wheel pendant.

I added the following:

#connect jog wheel set zero button to selected axis

net zero-set-button hm2_5i25.0.7i77.0.0.input-24 => halui.mdi-command-00
net zero-set-button hm2_5i25.0.7i77.0.0.input-24 => halui.mdi-command-01

and used what's in the halui;

[HALUI]
MDI_COMMAND = G10 L20 P0 X0 ( Set X to zero )
MDI_COMMAND = G10 L20 P0 Y0 ( Set Y to zero )
MDI_COMMAND = G10 L20 P0 Z0 ( Set Z to zero )

This works as expected updating 0 to the x and y.

How do I reconfigure this to work with my hal code's selected mpg axis? I want to set zero individually based on the selected switch position, x, y , z, a and then hitting my set zero button for each.

Please Log in to join the conversation.

More
8 years 7 months ago #107510 by rodw
Replied by rodw on topic mux4 for axis select??
I think you'd and2 your button with the signals you created mpg-x and mpg-y
Code:
# touchoff X net mpg-x => and2.8.in0 net zero-set-button <= hm2_5i25.0.7i77.0.0.input-24 net zero-set-button => and2.8.in1 net touch-off-x <= and2.8.out1 net touch-off-x => halui.mdi-command-00

PS. I've found it so much easier to write to HAL files to do one thing per line as opposed to the shorter style you've used that is doing 2 things per line.

Please Log in to join the conversation.

More
8 years 7 months ago #107667 by OT-CNC
Replied by OT-CNC on topic mux4 for axis select??
Thanks rodw, I got your example to work. Some of this is starting to make sense now. B)

net zero-set-button <= hm2_5i25.0.7i77.0.0.input-24

addf and2.9 servo-thread
addf and2.10 servo-thread
addf and2.11 servo-thread
addf and2.12 servo-thread

net mpg-a => and2.9.in0
net zero-set-button => and2.9.in1
net zero-a <= and2.9.out => halui.mdi-command-03

net mpg-x => and2.10.in0
net zero-set-button => and2.10.in1
net zero-x <= and2.10.out => halui.mdi-command-00

net mpg-y => and2.11.in0
net zero-set-button => and2.11.in1
net zero-y <= and2.11.out => halui.mdi-command-01

net mpg-z => and2.12.in0
net zero-set-button => and2.12.in1
net zero-z <= and2.12.out => halui.mdi-command-02

#################

Please Log in to join the conversation.

More
8 years 7 months ago #107698 by rodw
Replied by rodw on topic mux4 for axis select??
Glad you got a result. Yes, it takes a long time to understand what you can do in hal and then one day it all kinda clicks!

Please Log in to join the conversation.

Time to create page: 0.049 seconds
Powered by Kunena Forum