Reversing Axis Direction?
07 Apr 2011 14:14 #8679
by Rick4004
Reversing Axis Direction? was created by Rick4004
I hope I can word this to make sense. I have just installed EMC2 on my existing mill that I used to run with Turbocnc.
When I am looking at my screen in Mastercam, everything to the right side of x0,y0 is X+, to the left of 0,0 is X-, above 0,0 is Y+, and below 0,0 is Y-.
When I look at my screen in Axis, I see the same thing. So far so good. But, if I want to drill a hole 1 " to the right of 0,0 on my part, and I execute a line of code G00 X1.0, my table moves to the right, putting the hole 1" to the left of 0,0.
I have figured out to change my Axis Scale from 10000 to -10000 so that fixes that problem. Now if I execute G00 X1.0 the table moves to the left, putting the hole 1" to the right of 0,0, but now my jog keys are reversed, so when I press the left arrow, the table moves to the right.
I have been unable to find anything in the documentation regarding this, and I have spent a couple of hours searching the forum and I came up empty handed. Hopefully someone can point me in the right direction.
Thanks
Rick
When I am looking at my screen in Mastercam, everything to the right side of x0,y0 is X+, to the left of 0,0 is X-, above 0,0 is Y+, and below 0,0 is Y-.
When I look at my screen in Axis, I see the same thing. So far so good. But, if I want to drill a hole 1 " to the right of 0,0 on my part, and I execute a line of code G00 X1.0, my table moves to the right, putting the hole 1" to the left of 0,0.
I have figured out to change my Axis Scale from 10000 to -10000 so that fixes that problem. Now if I execute G00 X1.0 the table moves to the left, putting the hole 1" to the right of 0,0, but now my jog keys are reversed, so when I press the left arrow, the table moves to the right.
I have been unable to find anything in the documentation regarding this, and I have spent a couple of hours searching the forum and I came up empty handed. Hopefully someone can point me in the right direction.
Thanks
Rick
Please Log in or Create an account to join the conversation.
07 Apr 2011 15:07 #8681
by BigJohnT
Replied by BigJohnT on topic Re:Reversing Axis Direction?
You need to think about the tool movement not the table movement... confused the heck out of me when I first started CNC. So left arrow moves the spindle to the left and in order to do that the table has to move right.
John
John
Please Log in or Create an account to join the conversation.
07 Apr 2011 16:14 #8682
by Rick4004
Replied by Rick4004 on topic Re:Reversing Axis Direction?
I understand that, and I see the program "thinking" that it is a gantry machine, where the bed is stationary, and the head is moving. I thought there may be a way to make it understand that it is a table machine, with the head stationary and the table moves. There was a way to change this in Turbocnc and it is such a basic program I was sure there would be a way to change it in EMC. I am sure this will cause me to perform some major crashes as I am so used to doing it the old (wrong?) way. (Old dogs, new tricks,,,)
If there is no way to change that, is there a way to program the system to change the keys on the keyboard that control direction? That would cure my problem as I could just designate some different keys. I have a laptop USB numeric keypad that I was thinking of using as a pendant, can I just program those keys to go any direction I want?
Thanks
Rick
If there is no way to change that, is there a way to program the system to change the keys on the keyboard that control direction? That would cure my problem as I could just designate some different keys. I have a laptop USB numeric keypad that I was thinking of using as a pendant, can I just program those keys to go any direction I want?
Thanks
Rick
Please Log in or Create an account to join the conversation.
07 Apr 2011 21:09 #8685
by BigJohnT
Replied by BigJohnT on topic Re:Reversing Axis Direction?
I think there is a way to make the keys make the table go the wrong way but I've never looked into doing something like that. I just learned the proper way... even for an old dog like me it seems that it worked out better that I did.
John
John
Please Log in or Create an account to join the conversation.
07 Apr 2011 21:18 #8686
by andypugh
Replied by andypugh on topic Re:Reversing Axis Direction?
This is Open Source, you are free to change absolutely anything you want, but it might not be easy.
I think you need to edit the key bindings in axis.py (but I think you need to download the source to do that)
git.linuxcnc.org/gitweb?p=emc2.git;a=blo...f79b5ab5fbff;hb=HEAD
Around line 2907 onwards.
However, I am not particularly clear on Python syntax, so don't know what that all does.
I think you need to edit the key bindings in axis.py (but I think you need to download the source to do that)
git.linuxcnc.org/gitweb?p=emc2.git;a=blo...f79b5ab5fbff;hb=HEAD
Around line 2907 onwards.
However, I am not particularly clear on Python syntax, so don't know what that all does.
Please Log in or Create an account to join the conversation.
07 Apr 2011 21:32 - 07 Apr 2011 21:32 #8687
by andypugh
Replied by andypugh on topic Re:Reversing Axis Direction?
Hmm, as suggested on IRC.
You could use a .axisrc file to re-map the keys.
linuxcnc.org/docs/html/gui_axis.html#r1_11
You could use a .axisrc file to re-map the keys.
linuxcnc.org/docs/html/gui_axis.html#r1_11
Last edit: 07 Apr 2011 21:32 by andypugh.
Please Log in or Create an account to join the conversation.
08 Apr 2011 07:24 - 08 Apr 2011 07:27 #8692
by ArcEye
Replied by ArcEye on topic Re:Reversing Axis Direction?
Hi,
As Andy says the ./axisrc in your home directory works fine.
I used it to enable a non-standard jog direction when testing a machine that had one axis which moved contrary to expectations (stepper wired backwards?)
I found some more detailed guidance on its use which is reproduced below.
It doesn't strictly relate to axis jogging you want, but the syntax is the same, a minus prefix reverses the direction.
I will look out the actual file when I get down the workshop later
regards
AXIS doesn't pay attention to jog keys with modifier keys pressed
because this had some bad interactions with using the numeric keypad as
digits in MDI mode.
You can put magic incantations in the file ~/.axisrc that customize the
jog keys and also get rid of this behavior of ignoring the key if a
modifier key is pressed.
AXIS doesn't pay attention to jog keys with modifier keys pressed
because this had some bad interactions with using the numeric keypad as
digits in MDI mode.
You can put magic incantations in the file ~/.axisrc that customize the
jog keys and also get rid of this behavior of ignoring the key if a
modifier key is pressed.
Here is an example which changes the keys that jog the active axis, and
the keys that jog the A axis:
# -- cut here
# Bind ; and ' to jog active axis
root_window.bind("<semicolon>", commands.jog_minus)
root_window.bind("<apostrophe>", commands.jog_plus)
root_window.bind("<KeyRelease-semicolon>", commands.jog_stop)
root_window.bind("<KeyRelease-apostrophe>", commands.jog_stop)
# Bind ( and ) to jog axis 3 (0=X, 1=Y, 2=Z, 3=A, 4=B, ...)
root_window.bind("<parenleft>", lambda e: jog_on(3, -get_jog_speed(3)))
root_window.bind("<parenright>", lambda e: jog_on(3, get_jog_speed(3)))
root_window.bind("<KeyRelease-parenleft>", lambda e: jog_off(3))
root_window.bind("<KeyRelease-parenright>", lambda e: jog_off(3))
# -- cut here
Right arrow = <Right>
Left arroow = <Left>
Up arrow = <Up>
Down arrow = <Down>
Page Down = <Next>
Page Up = <Prior>
As Andy says the ./axisrc in your home directory works fine.
I used it to enable a non-standard jog direction when testing a machine that had one axis which moved contrary to expectations (stepper wired backwards?)
I found some more detailed guidance on its use which is reproduced below.
It doesn't strictly relate to axis jogging you want, but the syntax is the same, a minus prefix reverses the direction.
I will look out the actual file when I get down the workshop later
regards
AXIS doesn't pay attention to jog keys with modifier keys pressed
because this had some bad interactions with using the numeric keypad as
digits in MDI mode.
You can put magic incantations in the file ~/.axisrc that customize the
jog keys and also get rid of this behavior of ignoring the key if a
modifier key is pressed.
AXIS doesn't pay attention to jog keys with modifier keys pressed
because this had some bad interactions with using the numeric keypad as
digits in MDI mode.
You can put magic incantations in the file ~/.axisrc that customize the
jog keys and also get rid of this behavior of ignoring the key if a
modifier key is pressed.
Here is an example which changes the keys that jog the active axis, and
the keys that jog the A axis:
# -- cut here
# Bind ; and ' to jog active axis
root_window.bind("<semicolon>", commands.jog_minus)
root_window.bind("<apostrophe>", commands.jog_plus)
root_window.bind("<KeyRelease-semicolon>", commands.jog_stop)
root_window.bind("<KeyRelease-apostrophe>", commands.jog_stop)
# Bind ( and ) to jog axis 3 (0=X, 1=Y, 2=Z, 3=A, 4=B, ...)
root_window.bind("<parenleft>", lambda e: jog_on(3, -get_jog_speed(3)))
root_window.bind("<parenright>", lambda e: jog_on(3, get_jog_speed(3)))
root_window.bind("<KeyRelease-parenleft>", lambda e: jog_off(3))
root_window.bind("<KeyRelease-parenright>", lambda e: jog_off(3))
# -- cut here
Right arrow = <Right>
Left arroow = <Left>
Up arrow = <Up>
Down arrow = <Down>
Page Down = <Next>
Page Up = <Prior>
Last edit: 08 Apr 2011 07:27 by ArcEye.
Please Log in or Create an account to join the conversation.
08 Apr 2011 11:03 #8697
by BigJohnT
Replied by BigJohnT on topic Re:Reversing Axis Direction?
Just one more thought, I can go to any properly set up cnc machine and press the arrow keys and I know which way things will move relative to the tool.
John
John
Please Log in or Create an account to join the conversation.
08 Apr 2011 11:39 #8699
by andypugh
Replied by andypugh on topic Re:Reversing Axis Direction?
In case there is any doubt, I am with JT on sticking with the conventional arrangement.
Suggesting ways to break EMC2 is just an intellectual excercise (And because "that can't be done" is not part of the EMC2 worldview)
Suggesting ways to break EMC2 is just an intellectual excercise (And because "that can't be done" is not part of the EMC2 worldview)
Please Log in or Create an account to join the conversation.
08 Apr 2011 12:47 #8703
by ArcEye
Replied by ArcEye on topic Re:Reversing Axis Direction?
Hi again
John and Andy are completely correct about the conventions of axis jogging.
To have them set contrary to the axis directions under NC is liable to confuse and eventually lead to a messy mistake, when you use the MDI in particular, because you will not see the plot going the wrong way.
However there are good reasons to use ~./axisrc.
I had forgotten that my mill has the Z jog assigned to PageUp / PageDown keys in ~./axisrc .
I seem to remember the default assignment was something completely unintuitive under Axis, which is why I changed it.
If you swapped the minus signs over for axes 0 and 1 in the file below, you will get the table moving left on the left arrow key instead of the quill etc. etc.
So the choice is yours, just demonstrates how configurable Axis is.
regards
# Jog axis 0 (0=X, 1=Y, 2=Z, 3=A, 4=B, ...)
root_window.bind("<Right>", lambda e: jog_on(0, get_jog_speed(0)))
root_window.bind("<Left>", lambda e: jog_on(0, -get_jog_speed(0)))
root_window.bind("<KeyRelease-Left>", lambda e: jog_off(0))
root_window.bind("<KeyRelease-Right>", lambda e: jog_off(0))
# Jog axis 1
root_window.bind("<Down>", lambda e: jog_on(1, -get_jog_speed(1)))
root_window.bind("<Up>", lambda e: jog_on(1, get_jog_speed(1)))
root_window.bind("<KeyRelease-Down>", lambda e: jog_off(1))
root_window.bind("<KeyRelease-Up>", lambda e: jog_off(1))
# Jog axis 2 <Prior>=PgUp <Next>=PgDn
root_window.bind("<Prior>", lambda e: jog_on(2, get_jog_speed(2)))
root_window.bind("<Next>", lambda e: jog_on(2, -get_jog_speed(2)))
root_window.bind("<KeyRelease-Next>", lambda e: jog_off(2))
root_window.bind("<KeyRelease-Prior>", lambda e: jog_off(2))
John and Andy are completely correct about the conventions of axis jogging.
To have them set contrary to the axis directions under NC is liable to confuse and eventually lead to a messy mistake, when you use the MDI in particular, because you will not see the plot going the wrong way.
However there are good reasons to use ~./axisrc.
I had forgotten that my mill has the Z jog assigned to PageUp / PageDown keys in ~./axisrc .
I seem to remember the default assignment was something completely unintuitive under Axis, which is why I changed it.
If you swapped the minus signs over for axes 0 and 1 in the file below, you will get the table moving left on the left arrow key instead of the quill etc. etc.
So the choice is yours, just demonstrates how configurable Axis is.
regards
# Jog axis 0 (0=X, 1=Y, 2=Z, 3=A, 4=B, ...)
root_window.bind("<Right>", lambda e: jog_on(0, get_jog_speed(0)))
root_window.bind("<Left>", lambda e: jog_on(0, -get_jog_speed(0)))
root_window.bind("<KeyRelease-Left>", lambda e: jog_off(0))
root_window.bind("<KeyRelease-Right>", lambda e: jog_off(0))
# Jog axis 1
root_window.bind("<Down>", lambda e: jog_on(1, -get_jog_speed(1)))
root_window.bind("<Up>", lambda e: jog_on(1, get_jog_speed(1)))
root_window.bind("<KeyRelease-Down>", lambda e: jog_off(1))
root_window.bind("<KeyRelease-Up>", lambda e: jog_off(1))
# Jog axis 2 <Prior>=PgUp <Next>=PgDn
root_window.bind("<Prior>", lambda e: jog_on(2, get_jog_speed(2)))
root_window.bind("<Next>", lambda e: jog_on(2, -get_jog_speed(2)))
root_window.bind("<KeyRelease-Next>", lambda e: jog_off(2))
root_window.bind("<KeyRelease-Prior>", lambda e: jog_off(2))
Please Log in or Create an account to join the conversation.
Time to create page: 0.136 seconds