Hello Guest it is May 16, 2021, 05:12:59 PM

Author Topic: G28 G91 Z0.  (Read 10506 times)

0 Members and 1 Guest are viewing this topic.

G28 G91 Z0.
« on: March 27, 2014, 10:32:22 AM »
Hi everyone.  I have a concern with an HSMWorks generated Gcode program running in Mach 3 a portion posted here....

(BORE 0.050 HOLE 0.076 DP)
(T2  D=0.0394 CR=0. - ZMIN=-0.076 - FLAT END MILL)
G90 G94 G40 G49 G17
G20
G28 G91 Z0.
G90

(BORE1)
M5   
.....and on to the rest of the program.

The dilemma I'm having is that Z wants to go full speed all the way down to the limit switch, no matter what is in the way, i.e. tool, material, vice, whatever.  CRASH.  I assumed that with the Z0. in the line, it would stop Z at 0 relative to the DRO, instead, it bypasses 0 and goes completely negative to the limit switch.

I really don't want to have to edit out the G28 line every time I receive a program to run.  But doing so with this program, it runs fine. 

(Side note, also noted that in the GCode glossary in Mach3, it says not to have G28 G91 on the same line......?????  Why not???)

I am not familiar with HSMWorks to know if this can be preselected not to post this line in the program, so if that is an option, someone please let me know.  Also, if there is a setting within Mach 3 that needs to be configured, please let me know as well.  It is the dilemma of the day, and hope to get it figured out. 

Thanks, Pete.
Re: G28 G91 Z0.
« Reply #1 on: March 27, 2014, 11:09:54 AM »
Sounds like you're either not homing your machine, or you're homing it incorrectly.  The home position for the Z axis should be at the very top of travel.

Regards,
Ray L.
Regards,
Ray L.
Re: G28 G91 Z0.
« Reply #2 on: March 27, 2014, 11:53:23 AM »
Would any of this this -

(BORE 0.050 HOLE 0.076 DP)
(T2  D=0.0394 CR=0. - ZMIN=-0.076 - FLAT END MILL)
G90 ( G90:Absolute prog )
G94 ( G94:Inch per minute )
G40 ( G40:Tool radius comp off )
G49 ( G49:Tool offset comp cancel )
G17 ( G17:X-Y plane selection )
G20 ( G20:Inch system selection )
G28 G91 Z0. ( G28:Return to home G91:Incremental programming )
G90 ( G90:Absolute prog )

(BORE1)
M5 ( M05:Spindle Stop )

Throw any light on your issues?
If you're setting a tool length your code is turning that off and may be trying to drive the reference level from which you measure your tool to the desired location rather than the tool tip.
..
 - Nick
Re: G28 G91 Z0.
« Reply #3 on: March 27, 2014, 12:08:15 PM »
Thanks guys for the input.

I don't have home enabled in ports and pins.  Would assume that if home was attempted by a program then nothing would happen other than z coming up to zero after rapid or initial plane and after it was complete doing the task at hand. 

Sorry magicniner, no light shed on the issue.  I also am not setting a tool length or offsets of any sort.  Running it bare bones and have had great success except for the G28 G91 Z0. line issue. 

Also noticed in Motor Home/Soft limits I have all red X's and the G28 block has 0 listed for all axis's, again, assume everything would go zero, specifically Z, instead of ramming headlong into the work. 

Thanks all,

Pete
Re: G28 G91 Z0.
« Reply #4 on: March 27, 2014, 12:19:18 PM »
I've just tried it on my laptop (no driver loaded) and it works as you expect with Z going to zero and stopping.
Re: G28 G91 Z0.
« Reply #5 on: March 27, 2014, 12:23:03 PM »
Adding to the notes...

Just unplugged the Z motor and let Mach3 run the program.  On the G28 G91 Z0. line, the DRO for Z went to -0.9167, stopped descending and then the program went on to the next line and continued.  

Hmmm,  what the heck is up?

Pete
Re: G28 G91 Z0.
« Reply #6 on: March 27, 2014, 12:37:09 PM »
View the same while in Machine coords.
Like Himy said, you may have the Home in the wrong place.
Machine Coord z0 should be at z all the way UP.
Russ
Re: G28 G91 Z0.
« Reply #7 on: March 27, 2014, 09:15:26 PM »
Hey all,

Think I got everything figured out and got everything working without unexpected moves and crashes. 

Snippets from each posting in this subject led me to a workaround.  I couldn't figure out how to set Machine coordinates in Mach3 so I jogged everything over to the back left corner of the table and put Z all the way up.  Then unplugged each motor and then went back to Mach3 and let the whole program I posted portions of, run completely.  Machine coordinates then where 0 for all three axis at the end of the program and then I powered up the steppers, jogged back to the center front of the table, reset 0 in the DRO's and then ran the program again.  It ran the program fine to completion, then homed to the back left corner. 

May not have been the correct way to do it but I think it will now work fine with whatever program I post. 


Offline Hood

*
  •  25,838 25,838
  • Carnoustie, Scotland
    • View Profile
Re: G28 G91 Z0.
« Reply #8 on: March 28, 2014, 03:50:47 AM »
  I couldn't figure out how to set Machine coordinates in Mach3



You set Machine Coords by Homing the machine. If you do not have Home switches then you can still do it by jogging the machine to a known position and pressing RefAll button, that will set the machine coords to zero ( or the value you have in Home Off) at the position the axes are when you press RefAll

Hood
Re: G28 G91 Z0.
« Reply #9 on: December 07, 2019, 09:55:29 AM »
(Side note, also noted that in the GCode glossary in Mach3, it says not to have G28 G91 on the same line......?????  Why not???)

Did you get an error saying something like "you can't use two g-codes on the same line with the same axis values? I had a similar problem where the program crashed at:

N2030 G91 G0 G28 Z0.

Solution was just to put the G91 and G28 on separate lines. I guess the problem is it's trying to go home and Z0 at the same time.