Hello Guest it is November 18, 2019, 03:22:01 AM

Author Topic: G10 L20 or setting DROs to zero from G-code  (Read 3652 times)

0 Members and 1 Guest are viewing this topic.

G10 L20 or setting DROs to zero from G-code
« on: October 08, 2017, 05:18:38 AM »
I would like to set DROs to zero (or any other value) from G-code without touching the G54/G92 offsets.

I've not tried this but from reading the LinuxCNC documentation it seems to me that this can be done with:

G10 L20 P1 X0 Y0 Z0

But reading the Mach documentation this does not seem to be supported.

Is there a G-code in Mach dialect that allows me to do that?

Also I note that Fanuc and other seem to interpret L20 differently from LinuxCNC so
I'm awarding extra points for answers that are 'platform' indendent ;)

cheers Kusti


Online Tweakie.CNC

*
  • *
  •  8,002 8,002
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: G10 L20 or setting DROs to zero from G-code
« Reply #1 on: October 08, 2017, 06:07:46 AM »
Hi Kusti,

Easiest way to set a DRO from within Gcode is…

#99aaa = bbb

Where aaa is the DRO number and bbb the value you want to set.

DRO numbers can found in the OEM code list here; http://www.machsupport.com/forum/index.php/topic,9312.0.html

This method is totally Mach3 specific.

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
Re: G10 L20 or setting DROs to zero from G-code
« Reply #2 on: October 08, 2017, 07:24:27 AM »
Thanks Tweakie!

This is all new territory for me.

I downloaded the spread sheet and google a bit about OEM DROs but the penny did not drop,
can you give a concrete example please?

Say may abs machine position X=100, supposing my current work offset set is 1 (G54),
the if I press ZERO this will set X of work offset 1 to 100 and the X DRO reads now 0, correct?

So exactly how would I do this in G-code?

wbr Kusti


Online Tweakie.CNC

*
  • *
  •  8,002 8,002
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: G10 L20 or setting DROs to zero from G-code
« Reply #3 on: October 08, 2017, 08:06:21 AM »
Quote
Say may abs machine position X=100, supposing my current work offset set is 1 (G54),
the if I press ZERO this will set X of work offset 1 to 100 and the X DRO reads now 0, correct?

So exactly how would I do this in G-code?


Hi Kusti,

Within your Gcode the line

#99800=0

would set the X axis DRO to zero.

Unfortunately I never use offsets so Roger's guide may be the place for you to look;

http://www.machsupport.com/forum/index.php/topic,33595.0.html

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
Re: G10 L20 or setting DROs to zero from G-code
« Reply #4 on: October 08, 2017, 01:03:07 PM »
Thanks for the example and Roger's guide.

I guess I need to experiment a bit to see what really happens, looks like this is somewhat uncharted even if Roger has done a good write up.

wbr Kusti

Offline RICH

*
  • *
  •  7,371 7,371
    • View Profile
Re: G10 L20 or setting DROs to zero from G-code
« Reply #5 on: October 09, 2017, 08:52:33 AM »
The G10 command in Mach3 is / can be used to set a fixture coordinate system.
You will find info on the command in the Mach manuals. You need to understand that
there are different "dialects" of Gcode commands and Mach has it's owne dialect for the commands. Read the Mach manual! Linux, Fanuc, Hauss, etc have additional commands
and variations / dialects of the commands, so, again quit getting confused and read / use Mach3  gcode as defined.

What DRO's are you talking about?
Machine coordinates? Part coordinates? Program Coordinates?
See commands G53, G54, G52, G92
You need to understand the different coordinate systems and how they relate to each other. Read the Mach3 Manual.

Roger introduces "his" concept of "space", which is fine.BUT
To get grounded in terminology of CNC Peter Smid's books are an excellent
industry accepted standard.

fwiw,
RICH
Re: G10 L20 or setting DROs to zero from G-code
« Reply #6 on: October 09, 2017, 01:42:46 PM »
Thanks Rich,

I think I'm have a fair (I hope) understanding of the  coordinate systems.
And I've read both Mach3 and Mach4 manuals and I do not see how G10
can be used to get the same effect as pressing ZERO button that is next to the DROs.

Like I tried to explain, this is what I thing happens when you press ZERO:
"Assume abs machine position X=100, suppose my current work offset set is 1 (G54),
the if I press ZERO this will set X of work offset 1 to 100 and the X DRO reads now 0, correct?"

If that is not what happens I'd be happy to be educated (of course above assumes all
other offsets are zero).

So to get that effect what should I do?

In LinuxCNC  (according to manual, have no experience there) this would be achieved
for X-DRO with:

G54 G10 L20 P1 X0

Mach3 manual does not mentio G10 L20, Mach4 manual says G10 L20 is used to:
"Additional fixture offsets, G54.1 Pxx, can also be set using G10.
"Setting of these offsets is the same, except it is done using L20."
so I conclude that it cannot be used to zero the DROs.

wbr Kusti



Offline RICH

*
  • *
  •  7,371 7,371
    • View Profile
Re: G10 L20 or setting DROs to zero from G-code
« Reply #7 on: October 09, 2017, 07:01:55 PM »
Mach 4 is Fanuc based, Mach 3 is different.
So only read the Mach3 manual for definition of the G10.  G10 L2  is used to set a work offset / fixture offset.
The fixture offset is from  machine coordinate datum to the fixture datum. G52 is a temporary offset relative to the fixture offset.


Quote
if I press ZERO this will set X of work offset 1 to 100 and the X DRO reads now 0, correct
?"

Yes, because that creates a fixture offset. so when you do that change between MC and PC coordinates and see what the DRO's
displays. Better yet, go to diagnostics and look at the values for the different coordinates.

Quote
Mach3 manual does not mention G10 L20

Because it doesn't exist in Mach3, the L20 part!

Try this for testing your understanding of things ........
Make machine coordinate and part coordinate the same and also be the  home position........

RICH



Re: G10 L20 or setting DROs to zero from G-code
« Reply #8 on: October 09, 2017, 11:04:25 PM »
Thanks Rick,

I'm not really making myself clear.

My question is simply how: how can I do the equivalent of pressing the ZERO button with G-code?

wbr Kusti


Online Tweakie.CNC

*
  • *
  •  8,002 8,002
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: G10 L20 or setting DROs to zero from G-code
« Reply #9 on: October 10, 2017, 01:24:17 AM »
Quote
My question is simply how: how can I do the equivalent of pressing the ZERO button with G-code?

Thought I already covered that  :-\

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.