G28, moves all 3 axis at once!

Post Reply
BenL
Posts: 9
Joined: Mon Jul 10, 2017 7:56 pm
Location: Bay Area

G28, moves all 3 axis at once!

Post by BenL » Mon Jul 10, 2017 10:59 pm

Hello everyone,
I am currently using fusion 360 to as CAM my shapeoko 3. I use the generic carbide 3d grbl post processing config. I use Universal Gcode Sender to run my Gcode (I don't want to use carbide motion, it has better tool changes but it is always giving me an error and stopping 1/2 through my jobs generated by fusion). The start up code is as follows:

%
(Clamp V10.00)
(T1 D=6.35 CR=0 - ZMIN=-21.59 - flat end mill)
G90
G17
G21
G28 G91 Z0
G9

Everything works great except for one line, G28 G91 Z0. As I understand it this code should:
1. move Z to 0mm relative to its current position(ie do nothing)
2. move all axis to the predefined location G28.1
3. continue running the job

My problem with this is that it moves all 3 axis of motion at once. This means that before z reaches its maximum height x and y are moving leaving an opportunity for the end mil to a. begin cutting into my stock where I don't want it to or b. cut into clamps or other similar objects.
What I want it to do in order to solve this is:
1. move Z to 0mm relative to my machine home
2. move all axis to park position G28.1
3. continue running the job

So, what my machine doing normal? If it isn't, is there a GRBL setting I need to change? Also, is the second startup sequence I described possible to create? If so how would you do that? Should I just home my machine using my limit switches before each job?(I set G28.1 to 5mm away from my homing position in each axis) Does anyone else have this problem?

Thanks so much,
Ben
Shapeoko 3 Serial #4077- threaded inserts in waste board, makita router, suck-it dustboot

RobCee
Posts: 587
Joined: Wed Jan 08, 2014 11:33 am
Location: Birmingham, UK

Re: G28, moves all 3 axis at once!

Post by RobCee » Tue Jul 11, 2017 8:25 am

I had the same issue with Fusion and had to alter the post processor a little to get it working as I had expected (move in Z first, then XY).

If I remember correctly, GRBL processes the commands sequentially, so the correct format for the command needs to be:

G91 G28 Z0

Try typing it in and you should get what you are looking for. If it works, then you need to alter your post processor.

To fix it in your post processor, search for the number 28 in the Fusion post processor editor and fiddle around with the order of the commands in the appropriate 'writeblock' lines.

I had to alter mine in three places to get it working as I thought was correct.

I always home my machine on the limit switches before each job, just in case something moved when I changed tools or bumped things when loading a workpiece.
If you are happy with G28, then you could also try G30 for tool changes, it is pretty handy and works in a similar way (move to a preset position).
ShapeOko2 #3400 - Chinese 800W AC Spindle - Stiffened X-Axis - TR10 Z-Axis - Inverted Z Motor - Hall Effect Limits - Drag Chains & Custom Brackets

BenL
Posts: 9
Joined: Mon Jul 10, 2017 7:56 pm
Location: Bay Area

Re: G28, moves all 3 axis at once!

Post by BenL » Tue Jul 11, 2017 2:12 pm

RobCee wrote:If I remember correctly, GRBL processes the commands sequentially, so the correct format for the command needs to be:

G91 G28 Z0
From the shapeoko wiki it says
G91:Coordinates are now relative to the current position, with no consideration for machine origin. G0 X-10 Y5 will move to the position 10 units to the left and 5 above the current position.
G53:Move in Machine Coordinates. Preface to a movement command on the same line which causes the machine to disregard any coordinate system which is in effect. G53 G0 X0 Y0 Z0 will return to the machine home / origin.[16] Useful to move the tool relative to the machine, e.g., for tool changes.

So wouldn't G91 G28 Z0 not move the machine anywhere until G28 is run? Could I do the following(or would this cause some form of a failure):
G53 G28 Z-1 (-1 so no limit switches are hit)
Shapeoko 3 Serial #4077- threaded inserts in waste board, makita router, suck-it dustboot

RobCee
Posts: 587
Joined: Wed Jan 08, 2014 11:33 am
Location: Birmingham, UK

Re: G28, moves all 3 axis at once!

Post by RobCee » Tue Jul 11, 2017 6:37 pm

It is all made slightly confusing by the fact that G28 uses stored absolute coordinates, but to make it move less than all axes at once you have to specify an axis and intermediate position.
The fun part is that the axes you specify must contain a number value, so using a relative value of zero allows the G28 command to move straight to the position stored by G28.1.
It seems superfluous, but is just one of the quirks of an older command in gcode.

G53 is a newer command and has not been around as long as G28, but is is much simpler to understand. Check this short article for further information.

Your code will not quite work as you intend, but you can simply use the following to achieve the same thing as your G28 (assuming your G28.1 stores X-1 Y-1 Z-1)

G53 G0 Z-1
G0 X-1 Y-1

Just remember to switch back to your working coordinate system afterwards
ShapeOko2 #3400 - Chinese 800W AC Spindle - Stiffened X-Axis - TR10 Z-Axis - Inverted Z Motor - Hall Effect Limits - Drag Chains & Custom Brackets

sjj47
Posts: 57
Joined: Thu Jul 02, 2015 10:40 pm

Re: G28, moves all 3 axis at once!

Post by sjj47 » Thu Nov 21, 2019 9:05 pm

I'm confused by this. From what I've read on the web,

G28 G91 Z0

should move the Z-axis ONLY to the position specified by G28.1 (normally the uppermost position of the Z-axis).

Instead, when I execute that string, I get movement in the X, Y, and Z axes simultaneously, back to the G28.1 position.

In fact,

G28 G91 X0 Y0

does the exact same move; all three axes move simultaneously. So does

G28

It seems as if for some reason only the G28 command is being interpreted; the axes codes are ignored.
--------------------------------
Shapeoko 3 # 0761 - DW611 - Limit switches - probe
Current tool chains: Inkscape > MakerCAM > UGS | bCNC & F-Engrave > UGS | bCNC

Post Reply