can I define G55, G56, etc as an offset from G54?

More
5 years 2 months ago #216752 by gerrg
I'm wondering if there's a way in G code to define the X0 and Y0 of different corrdinate systems as an offset from another corrdinate system. Lets say for instance that I want to have 3 corrindate systems, G54, G55, and G56. I want to manually set G54 just by touching off something on my workspace. then i want to define G55 as being +100mm in the X direction, and +0mm in the Y direction, and have G56 as being +200mm in the X direction and 0 in the Y. Is that possible?

I know i can do it manually, but I'm hoping I can do it in Gcode somehow. I would even be fine with doing something weird like below (in sudo-code)
G54
G90
G0 X100 Y0
G55
<some G code to set G55 origin)
<repeat for G56>

This might be a strange request, but I figured I'd ask you all who know much more about all of this than I do. Thanks for your help!

Please Log in to join the conversation.

More
5 years 2 months ago #216756 by andypugh
Yes, that can be done with a combination of G10 L2 and numbered parameters .

For example, so set the offset of G55X as 100mm greater than G54X

G10 L2 P2 X[#5221 + 100]

Please Log in to join the conversation.

More
5 years 2 months ago #216761 by gerrg
I had just found that and was coming here to ask if that was correct. so it would look something like this, right?
Code:
G54 (switch to G54 cord system) G90 (use Absolute Positioning) G0 X0 Y0 (go to origin on G54 cord system) G10 L20 P2 X-100 Y0 (set G55 orgin to +100mm on the X axix and 0 on the Y compared to G54) G10 L20 P3 X-200 Y0 (set G56 orgin to +200mm on the X axix and 0 on the Y compared to G54)

Please Log in to join the conversation.

More
5 years 2 months ago #216762 by gerrg
oooh, i don't even have to move the machine then, that's nice! I guess #5221 is the variable for the X orgin for G54?

Please Log in to join the conversation.

More
5 years 2 months ago #217016 by andypugh

oooh, i don't even have to move the machine then, that's nice! I guess #5221 is the variable for the X orgin for G54?
Yes:  linuxcnc.org/docs/2.8/html/gcode/overview.html#gcode:parameters

(There are lots of useful parameters that you can use) 

Please Log in to join the conversation.

Time to create page: 0.288 seconds
Powered by Kunena Forum