Newbie GCode home


Results 1 to 8 of 8

Thread: GCode home

  1. #1
    Registered itolond's Avatar
    Join Date
    Jul 2013
    Posts
    84
    Downloads
    0
    Uploads
    0

    Default GCode home

    Dear forum,

    i wish my mill on tool change to return back to the start position - essentially X0 Y0 and Z0 +30 via g-code from my post processor in MACH3

    For each tool change I re-zero (no G43/offset)

    G28 /30 indicate this is one method am I on the right path?

    Similar Threads:


  2. #2
    Community Moderator Jim Dawson's Avatar
    Join Date
    Dec 2013
    Posts
    5717
    Downloads
    0
    Uploads
    0

    Default Re: GCode home

    A G28 or G28.1 is what you want to use. Look at the Mach3 documentation for a description of those commands.



  3. #3
    Registered
    Join Date
    Aug 2017
    Location
    Canada
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default Re: GCode home

    a quick google search brought this up.

    https://machmotion.com/cnc-info/g-code.html

    I do not use mach 3 but here is an example of the end of my program.

    G91G28Z0.;
    G28Y0.;
    M30;



  4. #4
    Member mactec54's Avatar
    Join Date
    Jan 2005
    Location
    USA
    Posts
    15362
    Downloads
    0
    Uploads
    0

    Default Re: GCode home

    Quote Originally Posted by itolond View Post
    Dear forum,

    i wish my mill on tool change to return back to the start position - essentially X0 Y0 and Z0 +30 via g-code from my post processor in MACH3

    For each tool change I re-zero (no G43/offset)

    G28 /30 indicate this is one method am I on the right path?
    You never want to use a G28 unless nothing else works for your control

    G0Z0 or G0Z30. or what ever number you want it to move up then
    G53 X0Y0. you can also do it like this G53X___ Y___ to where ever you want it to move, G53

    A G28 goes with a G91 meaning it is an incremental move, before you can go to use your program after using a G91 you would have to cancel the G91 by using a G90, or you will have a crash, that is why don't use a G91G28Z0 unless that is all your control can use

    Mactec54


  5. #5
    Registered itolond's Avatar
    Join Date
    Jul 2013
    Posts
    84
    Downloads
    0
    Uploads
    0

    Default Re: GCode home

    Quote Originally Posted by mactec54 View Post
    You never want to use a G28 unless nothing else works for your control

    G0Z0 or G0Z30. or what ever number you want it to move up then
    G53 X0Y0. you can also do it like this G53X___ Y___ to where ever you want it to move, G53

    A G28 goes with a G91 meaning it is an incremental move, before you can go to use your program after using a G91 you would have to cancel the G91 by using a G90, or you will have a crash, that is why don't use a G91G28Z0 unless that is all your control can use
    Ok digesting this the following would be (assuming Z0 was tool to Stock surface, reset each tool change) and X0 and Y0 are where i need them to be (start of program).......then back to previous feedrate?

    on Tool change ( Fast move to Z0 +30 mm, then fast move to X0Y0.....Stop..
    G00
    G0Z30
    G53 X0Y0
    G01

    or..

    F100
    G0Z30
    G53 X0Y0
    G01

    Am i getting close to utopia?



  6. #6
    Registered itolond's Avatar
    Join Date
    Jul 2013
    Posts
    84
    Downloads
    0
    Uploads
    0

    Default Re: GCode home

    this is the sub tool change my post processor puts out

    N281 (16MM 60 DEG CARB CENTERDRILL)
    N291 T05 M06
    N301 S2000 M03
    N311 G54
    N321 M08
    N331 G90 X-49.497 Y49.497
    N341 G43 Z1. H05



  7. #7
    Member mactec54's Avatar
    Join Date
    Jan 2005
    Location
    USA
    Posts
    15362
    Downloads
    0
    Uploads
    0

    Default Re: GCode home

    Quote Originally Posted by itolond View Post
    this is the sub tool change my post processor puts out

    N281 (16MM 60 DEG CARB CENTERDRILL)
    N291 T05 M06
    N301 S2000 M03
    N311 G54
    N321 M08
    N331 G90 X-49.497 Y49.497
    N341 G43 Z1. H05
    This is looking quite good, just a few changes an you will have it, nothing is written in stone, and you can have some variation's of what is below, but clean formatted code will always run better, once you get used to programing you can eliminate the line numbers, makes for a lot less clutter, the N321 Etc

    %

    O3434 (16MM 60 DEG CARB CENTERDRILL) ( some controls may require the program number also to be like this (O3434 16mm 60 Deg Carb Centerdrill )

    N1G17G40G80 (safety line )

    T5M6

    G54

    M8

    S2450M3

    G90G0 X-49.497 Y49.497 ( You need a G0 in this line or it won't know what to do, You can use a G1 also but would need a Feed call F__. )

    G43Z1.H5 ( This will rapid also to 1. ) (why because the G0 is active from the line above )

    G1__________F15. ( This line would change from a rapid to a feed move )


    End of program

    G0Z30.

    M9

    M5

    G53 X0Y0.

    M30

    %

    Mactec54


  8. #8
    Member mactec54's Avatar
    Join Date
    Jan 2005
    Location
    USA
    Posts
    15362
    Downloads
    0
    Uploads
    0

    Default Re: GCode home

    Quote Originally Posted by itolond View Post
    Ok digesting this the following would be (assuming Z0 was tool to Stock surface, reset each tool change) and X0 and Y0 are where i need them to be (start of program).......then back to previous feedrate?

    on Tool change ( Fast move to Z0 +30 mm, then fast move to X0Y0.....Stop..
    G00
    G0Z30
    G53 X0Y0
    G01

    or..

    F100
    G0Z30
    G53 X0Y0
    G01

    Am i getting close to utopia?
    I missed this post neither are correct, read carefully as there is a lot of things happening in these few lines of programing

    All that is needed, there are some variation's it will depend if you are cutting or drilling, drilling ( Canned Cycle you should have a G80 before any other move this cancels the Drilling Cycle )

    for a Drilling Cycle it would look like this

    G80G0Z30. (After a Drilling Cycle )

    G0Z30. (After a Cut Cycle )

    M9 ( turn coolant off, if not using coolant then you don't need to have a M9 )

    M5 ( Turn Spindle OFF )

    G53X0 Y0. ( This can be also G53X____ Y____. to where ever you want to move your machine

    M30 ( This will rewind the program to the Start, Ready to go again )
    %


    You added a Feed move F100. this will not do anything, if you want to use a Feed move, instead of a Rapid move ( G0 ) then you would use it like this

    When you change your tool the next line of code would have a move to cut position, this can be a Feed move or a Rapid move G0X____ Y____ then a G1Z-35 F100. move to start cutting


    G0Z30.
    M9
    M5
    G53X0Y0.
    G1X____Y____F100. or G0X____Y_____ if you want to Rapid to the start point
    G1Z-30F100.

    Mactec54


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

GCode home

GCode home