Creating a "one button touch off" button

More
18 Sep 2012 13:52 #24367 by btvpimill
Hello all, I have a new desire for my machine. I want to put it in a position somewhere that I see fit, then press a button and have it "touch off" for all axis at once automagically for me. the button code will already have the G5x selected.

So I am thinking all I need to do is grab the machine position for each axis from some #variable, and store each in the correct #variable. Does this sound right?

Please Log in or Create an account to join the conversation.

More
18 Sep 2012 15:29 #24378 by andypugh
Replied by andypugh on topic Re:Creating a
btvpimill wrote:

So I am thinking all I need to do is grab the machine position for each axis from some #variable, and store each in the correct #variable. Does this sound right?


It's even easier than that. If your "reference position" is (1,2,3) then G10 L20 P1 X1 Y2 Z3 will set the G54 coordinates of the current machine position to (1,2,3)

You could have that G-code line as an MDI_COMMAND in the INI file, linked to a hardware button in the HAL
www.linuxcnc.org/docs/html/config/ini_co..._sub_halui_section_a

Please Log in or Create an account to join the conversation.

More
18 Sep 2012 15:39 #24379 by btvpimill
Replied by btvpimill on topic Re:Creating a
Thanks Andy, Can I also say x0y0z0, as I want to set a "current location is origin". I must have mis-read the doc's and am thinking setting them to zero will clear the current g5x data?

Please Log in or Create an account to join the conversation.

More
18 Sep 2012 15:52 #24380 by andypugh
Replied by andypugh on topic Re:Creating a
btvpimill wrote:

Thanks Andy, Can I also say x0y0z0, as I want to set a "current location is origin". I must have mis-read the doc's and am thinking setting them to zero will clear the current g5x data?


G10 L20 P1 X0 Y0 Z0 will set the current location to the origin.
G10 L2 P1 X0 Y0 Z0 will set the G54 Offsets to 0. The difference is in the L2 or L20.

www.linuxcnc.org/docs/html/gcode/gcode.h...em_a_id_sec_g10_l2_a

Please Log in or Create an account to join the conversation.

More
18 Sep 2012 16:32 #24381 by btvpimill
Replied by btvpimill on topic Re:Creating a
Thank You Andy :)

Please Log in or Create an account to join the conversation.

More
18 Sep 2012 16:43 #24382 by btvpimill
Replied by btvpimill on topic Re:Creating a
Hate to beat on a dead horse here, but I really have to be clear on this, So:

If the machine is moved to a G53 position of X2
Then
G10 L20 P1 X0

will store a value of 2 in #5221?

Now if G55 is set such that X0 in G55 is really X2 in G53, When I move to G55G0X2 will #5221 have a value of 2 or 4?

Please Log in or Create an account to join the conversation.

More
18 Sep 2012 16:52 #24383 by BigJohnT
Replied by BigJohnT on topic Re:Creating a Monster
The variable #5221 will always have the G54 offset for axis 0 no matter what coordinate system is in use.

linuxcnc.org/docs/html/gcode/overview.ht...umbered_parameters_a

John

Please Log in or Create an account to join the conversation.

More
18 Sep 2012 17:36 #24385 by btvpimill
Replied by btvpimill on topic Re:Creating a Monster
So it would hold the value of 4 for the second example? The G5x's are ALWAYS absolute distance from machine 0 yes?

Please Log in or Create an account to join the conversation.

More
18 Sep 2012 19:41 #24390 by BigJohnT
Replied by BigJohnT on topic Re:Creating a Monster
The best thing is to test your commands and use a debug comment to print out the value of the variable before and after. This can be done from the MDI window quite easily.

linuxcnc.org/docs/html/gcode/overview.ht...sec_debug_messages_a

John

Please Log in or Create an account to join the conversation.

More
18 Sep 2012 20:40 #24392 by BigJohnT
btvpimill wrote:

So it would hold the value of 4 for the second example? The G5x's are ALWAYS absolute distance from machine 0 yes?


No and Yes.

G55 uses separate variables from G54, so #5241 would hold the G55 axis 0 offset.

John

Please Log in or Create an account to join the conversation.

Time to create page: 0.098 seconds
Powered by Kunena Forum