G Code for a "Park" command-This look right?

Discussion about the arduino based g-code interpreter, grbl
Post Reply
woodworkerbob
Posts: 244
Joined: Tue Apr 15, 2014 6:31 pm
Location: SVE - Mesa, AZ

G Code for a "Park" command-This look right?

Post by woodworkerbob » Tue Jul 28, 2015 12:43 am

One of the good and bad things about having homing switches is the homing process each time the controller is powered up. I work with the router at the opposite corner from where the limit switches are located. I tend to just power it down and the router remains at this location. Then at next power up, the router slowly moves the whole length of my SO3 until it bumps into the limit switches, aka the homing cycle. (Yea I know, first world problems :D )

I would like to create a "Park" macro, just like big CNC equipment has. The process would be just before powering down to issue the "Park" macro. The router would then move to a location very close to the limit switches. Why not just power down, grab the router and push it to the corner? Good working practices. Not good to be yanking the machine around.

So here are my first thoughts:

Park -> G21 G01 G53 X-5 Y-5 Z-5

G21 - Change to millimeters, I often use inches
G01 - Move, G00 would be faster
G53 - Absolute Work Coordinates, machine coordinates, I think
X, Y, Z - these are the homing pull off values defined in GRBL $27

Am I on the right track?

Bob
Shapeoko 3 - #13, dust deputy, precision collets, limit switches.
SVEMakerSpaces

WillAdams
Posts: 8628
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: G Code for a "Park" command-This look right?

Post by WillAdams » Tue Jul 28, 2015 12:59 am

G01 will require a feed rate. Why not use G0? That's what it's for.
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: G Code for a "Park" command-This look right?

Post by cvoinescu » Tue Jul 28, 2015 1:14 am

You may want to do it in two steps: first Z up, then X and Y to the home position. That way, you don't risk traversing through the workpiece...
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

woodworkerbob
Posts: 244
Joined: Tue Apr 15, 2014 6:31 pm
Location: SVE - Mesa, AZ

Re: G Code for a "Park" command-This look right?

Post by woodworkerbob » Tue Jul 28, 2015 1:26 am

cvoinescu wrote:You may want to do it in two steps: first Z up, then X and Y to the home position. That way, you don't risk traversing through the workpiece...
Thanks for both suggestions.

Old Park -> G21 G01 G53 X-5 Y-5 Z-5
New Park -> G21 G00 G53 Z-5 G00 G53 X-5 Y-5

Do I need a separator in front of the second G00?

Bob
Shapeoko 3 - #13, dust deputy, precision collets, limit switches.
SVEMakerSpaces

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: G Code for a "Park" command-This look right?

Post by cvoinescu » Tue Jul 28, 2015 12:26 pm

As far as I know, it needs to be on a separate line.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

chamnit
Posts: 376
Joined: Tue Aug 12, 2014 2:16 pm
Location: Albuquerque NM, USA
Contact:

Re: G Code for a "Park" command-This look right?

Post by chamnit » Tue Jul 28, 2015 2:20 pm

FWIW, I've been working silently on a safety door parking motion feature for Grbl. It's undergoing final testing before release.

It's a real-time command and works like an expanded feed hold, where if the park is triggered, GRbl will automatically feed hold, retract z, turn off the spindle/coolant, and then park, usually just the top of Z+. It can be resumed by a cycle start, reversing the order, and then resuming like nothing happened. For the most part, the parking motion can be customized with some basic knowledge of programming. It's a little different from what you want it to do, but it's useful if you want to pause the job and de-energize the spindle automatically as a safety feature or to inspect the workpiece and cutters mid-job.

As for creating your own parking motion, like you describe, people most often use a macro, just as you did. You can also use the G28 and G30 quick go-to saved-position commands, which are what these are for. Typically, they are set to go to a tool probe location to do a quick tool length measurement, go to the center of the machine right after homing, or go to a parking location like you want.

woodworkerbob
Posts: 244
Joined: Tue Apr 15, 2014 6:31 pm
Location: SVE - Mesa, AZ

Re: G Code for a "Park" command-This look right?

Post by woodworkerbob » Tue Jul 28, 2015 3:19 pm

chamnit wrote:FWIW, I've been working silently on a safety door parking motion feature for Grbl. It's undergoing final testing before release.

It's a real-time command and works like an expanded feed hold, where if the park is triggered, GRbl will automatically feed hold, retract z, turn off the spindle/coolant, and then park, usually just the top of Z+. It can be resumed by a cycle start, reversing the order, and then resuming like nothing happened. For the most part, the parking motion can be customized with some basic knowledge of programming. It's a little different from what you want it to do, but it's useful if you want to pause the job and de-energize the spindle automatically as a safety feature or to inspect the workpiece and cutters mid-job.
.
Yea, this is another feature I've wanted. On another CNC machine it's called "Tool Check". We use it as a teaching moment to explain what's happening and let the students get up close mid-job.

On this machine you can move the spindle out of the way, then at cycle start the spindle returns to the correct location.

Way cool feature.

Bob
Shapeoko 3 - #13, dust deputy, precision collets, limit switches.
SVEMakerSpaces

Post Reply