587,693 active members*
3,562 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > G-Code Programing > Need help with g-codes for my CNC mill, I'm new and bad at it any help is appreciated
Results 1 to 20 of 38

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Posts
    15362

    Re: Need help with g-codes for my CNC mill, I'm new and bad at it any help is appreci

    Quote Originally Posted by Openstarling694 View Post
    Thank you, I'll try this out and see how it works, I'm guessing that I also need to fix the other tool changes as well.
    Yes if they look like this then yes, any comments need to have parentheses at each end or this will be a problem also ( )

    Beginning and end of the program needs % also some controls don't need it but most do %


    A safety line is normal at the beginning of a Program


    %

    G90 G40 G17 G80 ( can be in any order )


    Program Here


    End


    G0Z3. ( Or where ever you want the Z Axes to retract too )
    G53X0Y0. ( X and Y can also be where you want the each Axes to go )
    M5
    M30
    %
    Mactec54

  2. #2

    Re: Need help with g-codes for my CNC mill, I'm new and bad at it any help is appreci

    Quote Originally Posted by mactec54 View Post
    Yes if they look like this then yes, any comments need to have parentheses at each end or this will be a problem also ( )

    Beginning and end of the program needs % also some controls don't need it but most do %


    A safety line is normal at the beginning of a Program


    %

    G90 G40 G17 G80 ( can be in any order )


    Program Here


    End


    G0Z3. ( Or where ever you want the Z Axes to retract too )
    G53X0Y0. ( X and Y can also be where you want the each Axes to go )
    M5
    M30
    %
    I have done all of these things already and still nothing has changed, I'm sorry to keep asking more and more questions but could there be anything else that I could fix, I also changed the tool numbers not sure if that will affect it or not.

    first tool change

    %
    (knuck bottle opener test)
    (T1 D=0.125 CR=0.0625 - ZMIN=-0.015 - ball end mill)
    (T2 D=0.1875 CR=0 - ZMIN=-0.35 - flat end mill)
    (T3 D=0.25 CR=0.125 - ZMIN=-0.0491 - ball end mill)
    N0 G90
    N1 G17
    N3 G0 Z0
    N4 T2 M6
    N6 S5000 M3
    N7 G54
    N9 G0 X0.1255 Y0.7255
    N10 G43 Z0.6 H4

    second tool change

    N24193 Z0.08 F40
    N24194 G0 Z0.6
    N24196 M5
    N24197 G53 Z0
    N24198 M1
    N24199 T3 M6
    N24201 S5000 M3
    N24202 G54
    N24204 G0 X1.9061 Y0.3243
    N24205 G43 Z0.6 H5
    N24206 Z0.2

    third tool change

    N24475 Z0.2
    N24476 G0 Z0.6
    N24478 M5
    N24479 G53 Z0
    N24480 M1
    N24481 T1 M6
    N24483 S5000 M3
    N24484 G54
    N24486 G0 X0.4355 Y1.5
    N24487 G43 Z0.6 H2
    N24488 Z0.2
    N24489 G1 Z0.065 F40

  3. #3
    Join Date
    Jan 2005
    Posts
    15362

    Re: Need help with g-codes for my CNC mill, I'm new and bad at it any help is appreci

    Quote Originally Posted by Openstarling694 View Post
    I have done all of these things already and still nothing has changed, I'm sorry to keep asking more and more questions but could there be anything else that I could fix, I also changed the tool numbers not sure if that will affect it or not.

    first tool change

    %
    (knuck bottle opener test)
    (T1 D=0.125 CR=0.0625 - ZMIN=-0.015 - ball end mill)
    (T2 D=0.1875 CR=0 - ZMIN=-0.35 - flat end mill)
    (T3 D=0.25 CR=0.125 - ZMIN=-0.0491 - ball end mill)
    N0 G90
    N1 G17
    N3 G0 Z0
    N4 T2 M6
    N6 S5000 M3
    N7 G54
    N9 G0 X0.1255 Y0.7255
    N10 G43 Z0.6 H4 ( T2=H2 )

    second tool change

    N24193 Z0.08 F40
    N24194 G0 Z0.6
    N24196 M5
    N24197 G53 Z0 ( G0Z0 )
    N24198 M1
    N24199 T3 M6 ( T3M6 must match G43 line H3 )
    N24201 S5000 M3
    N24202 G54
    N24204 G0 X1.9061 Y0.3243
    N24205 G43 Z0.6 H5 ( H5 is incorrect has to be the same as the Tool number T3=H3 )
    N24206 Z0.2

    third tool change

    N24475 Z0.2
    N24476 G0 Z0.6
    N24478 M5
    N24479 G53 Z0 ( G0Z0 )
    N24480 M1
    N24481 T1 M6
    N24483 S5000 M3
    N24484 G54
    N24486 G0 X0.4355 Y1.5
    N24487 G43 Z0.6 H2 ( Tool T1=H1 )
    N24488 Z0.2
    N24489 G1 Z0.065 F40
    No you have not you don't want G53 in your program anywhere, not configured like this any way


    You have to change all your H numbers to the same as the tool number
    Mactec54

  4. #4
    Join Date
    Dec 2008
    Posts
    3134
    Quote Originally Posted by mactec54 View Post
    No you have not you don't want G53 in your program anywhere, not configured like this any way


    You have to change all your H numbers to the same as the tool number
    On some controls G53 is a one-shot use of the machine co-ord system.... so if the control can read G53 codes, and, you have proved that it does work by MDI... there should be no problem keeping it in your program. ie G53Z0 is go home fast to the machine Z zero position.

    As for H numbers matching the tool #... that should be a "standard" you should adopt..... it won't stop a program from running

    My 2cents.... sequence number zero (N0) may not be a legit range.
    ... best advice would be to single step the program to stop at the offending line.... then delete/modify items one at a time
    .... if you run a program. your machine may read ahead many lines, making it harder to isolate any problem code.

    If your machine requires you to manually toolchange.... M6 is an auto operation.... replace it with M00.. this makes the running program stop... forcing you to do something ... then cycle start to continue.

  5. #5
    Join Date
    Jan 2005
    Posts
    15362

    Re: Need help with g-codes for my CNC mill, I'm new and bad at it any help is appreci

    Quote Originally Posted by Superman View Post
    On some controls G53 is a one-shot use of the machine co-ord system.... so if the control can read G53 codes, and, you have proved that it does work by MDI... there should be no problem keeping it in your program. ie G53Z0 is go home fast to the machine Z zero position.

    As for H numbers matching the tool #... that should be a "standard" you should adopt..... it won't stop a program from running

    My 2cents.... sequence number zero (N0) may not be a legit range.
    ... best advice would be to single step the program to stop at the offending line.... then delete/modify items one at a time
    .... if you run a program. your machine may read ahead many lines, making it harder to isolate any problem code.

    If your machine requires you to manually toolchange.... M6 is an auto operation.... replace it with M00.. this makes the running program stop... forcing you to do something ... then cycle start to continue.
    The control he is using quite often will not run the G53 so is better off not being in the program a G53 does not move any different than a G0 move

    His control will stop for a Tool change T1M6 is fine
    Mactec54

  6. #6
    Join Date
    Dec 2008
    Posts
    3134
    Quote Originally Posted by mactec54 View Post
    The control he is using quite often will not run the G53 so is better off not being in the program a G53 does not move any different than a G0 move

    His control will stop for a Tool change T1M6 is fine
    You seem to know what his machine & control is... want to let the rest of us know ? (the question was asked, but not answered)

    I did say "some controls".... and if the actual code worked...it is his choice to keep using it, not yours.

    I understand you have a lot of experience up your sleeve, but compelling a newbie to do jt to your coding method is not allowing him to develop on his own. There is quite often alternative methods

  7. #7
    Join Date
    Jan 2005
    Posts
    15362

    Re: Need help with g-codes for my CNC mill, I'm new and bad at it any help is appreci

    Quote Originally Posted by Superman View Post
    You seem to know what his machine & control is... want to let the rest of us know ? (the question was asked, but not answered)

    I did say "some controls".... and if the actual code worked...it is his choice to keep using it, not yours.

    I understand you have a lot of experience up your sleeve, but compelling a newbie to do jt to your coding method is not allowing him to develop on his own. There is quite often alternative methods

    In testing the G53 worked so not a problem to have it in his program,

    I'm just guessing like everyone else, but Mach3 I would say is his control a little out of your league, I just run his program through 2 different controls and it will run if he corrects it as I posted

    When someone is learning they should start with the basic codes or know what the likes of G53 does, How it needs to be formatted in a line for it to work correct, so a standard G-Code like ( G0 ) is the simplest form of G-Code to know and what it does, Just the 2 letters tell you what it is going to do ( G0 )

    Depending on how it is used in Mach3 it will either pass it by and not do that line which is bad, or just stop some of these control just won't run the program from the start if it has a Code that it does not like

    You need to have used and installed these controls to make the comments you do
    Mactec54

  8. #8
    Join Date
    Oct 2008
    Posts
    2100

    Re: Need help with g-codes for my CNC mill, I'm new and bad at it any help is appreci

    Quote Originally Posted by mactec54 View Post
    Yes if they look like this then yes, any comments need to have parentheses at each end or this will be a problem also ( )

    Beginning and end of the program needs % also some controls don't need it but most do %


    A safety line is normal at the beginning of a Program


    %

    G90 G40 G17 G80 ( can be in any order )


    Program Here


    End


    G0Z3. ( Or where ever you want the Z Axes to retract too )
    G53X0Y0. ( X and Y can also be where you want the each Axes to go )
    M5
    M30
    %

    If manually inserting a retract for safety I prefer to enter a G53 for absolute machine position rather than G00 which is in the current coordinate offset. The negative for using a G53 is that it moves at the last F speed, so its also good to add an F value. G53 Z0 F300. On some machines I used to use a G28 or a G30, but now I have multiple machines different setups. I actually prefer to modify my M30 macro on each machine to include a G53 Z0 F300 along with an extra M5 M9 just in case. G28 and G30 don't perform exactly the same on every control program. For one machine I rewrote the post processor to insert all kinds of safety and tool change position code. On others I did that in the tool change macros.
    Bob La Londe
    http://www.YumaBassMan.com

  9. #9
    Join Date
    Jan 2005
    Posts
    15362

    Re: Need help with g-codes for my CNC mill, I'm new and bad at it any help is appreci

    Quote Originally Posted by Bob La Londe View Post
    If manually inserting a retract for safety I prefer to enter a G53 for absolute machine position rather than G00 which is in the current coordinate offset. The negative for using a G53 is that it moves at the last F speed, so its also good to add an F value. G53 Z0 F300. On some machines I used to use a G28 or a G30, but now I have multiple machines different setups. I actually prefer to modify my M30 macro on each machine to include a G53 Z0 F300 along with an extra M5 M9 just in case. G28 and G30 don't perform exactly the same on every control program. For one machine I rewrote the post processor to insert all kinds of safety and tool change position code. On others I did that in the tool change macros.
    G53 and G0 are exactly the same either can be used for the same purpose if your program has and should be programed in G90 there is no difference, not all cam programs can have the post processor changed very easy so you got lucky with what you are using


    A lot of controls won't run a G53 without the G0 in the mix ether in a line before or on the same line like G0G53----
    Mactec54

  10. #10
    Join Date
    Oct 2008
    Posts
    2100

    Re: Need help with g-codes for my CNC mill, I'm new and bad at it any help is appreci

    Quote Originally Posted by mactec54 View Post
    G53 and G0 are exactly the same either can be used for the same purpose
    if your program has and should be programed in G90 there is no difference, not all cam programs can have the post processor changed very easy so you got lucky with what you are using


    A lot of controls won't run a G53 without the G0 in the mix ether in a line before or on the same line like G0G53----


    What reference are you using that says G00 and G53 are exactly the same? All those I've read say G00 is a rapid move in the current work offset coordinate system, and G53 is a feed rate move in the machine coordinate system.

    Can't customize the post processor? Wow. I have only used a few CAM programs, but they definitely allow me to modify or create a new post processor. One I use even allows a script system to modify the code after the post processor is done, and its a cheap CAM program (under $200). Still haven't used most of the high end CAM systems. I guess they could be more limited, but Fusion which is arguably not low end allows for custom and new post processors as well. Further many CAM programs allow you to create templates or styles and libraries of styles. Often you can add customized header or footer code to your styles and when you apply a style (or template) to an operation it automatically applies that header and footer code. In one Cam program I use I just set universal things in the root style and all other styles in that library inherit those properties unless they are changed.
    Bob La Londe
    http://www.YumaBassMan.com

  11. #11
    Join Date
    Jan 2005
    Posts
    15362

    Re: Need help with g-codes for my CNC mill, I'm new and bad at it any help is appreci

    Quote Originally Posted by Bob La Londe View Post


    What reference are you using that says G00 and G53 are exactly the same? All those I've read say G00 is a rapid move in the current work offset coordinate system, and G53 is a feed rate move in the machine coordinate system.

    Can't customize the post processor? Wow. I have only used a few CAM programs, but they definitely allow me to modify or create a new post processor. One I use even allows a script system to modify the code after the post processor is done, and its a cheap CAM program (under $200). Still haven't used most of the high end CAM systems. I guess they could be more limited, but Fusion which is arguably not low end allows for custom and new post processors as well. Further many CAM programs allow you to create templates or styles and libraries of styles. Often you can add customized header or footer code to your styles and when you apply a style (or template) to an operation it automatically applies that header and footer code. In one Cam program I use I just set universal things in the root style and all other styles in that library inherit those properties unless they are changed.
    G53 moves at the Rapid rate unless you tell it to use a feed rate, it is non modal so you have to remember it is a ( 1 ) shot code, I said it does the same thing but with some differences a G53 uses your absolute machine position this means all the moves are from your machine Home position and are not affected by datums like G54 Etc or tool length offsets

    So when programing you have to figure where you want to use it or you can have problems with the following code work offsets Etc
    Mactec54

  12. #12
    Join Date
    Oct 2008
    Posts
    2100

    Re: Need help with g-codes for my CNC mill, I'm new and bad at it any help is appreci

    To the OP. Moving to a work offset coordinate may work if you are sure its within the machine work envelope. Moving to a machine coordinates will always work, unless you hit a vise. LOL When I do safe position moves for tool changes I push the current XYZ off to variables, retract Z, then perform any other moves that are appropriate, change the tool, apply tool offsets, and then use a safe path return to the previous XYZ coordinate. Even that can have issues if for instances you are zeroing to a different level after a tool change, but for the most part it works.
    Bob La Londe
    http://www.YumaBassMan.com

Similar Threads

  1. Replies: 7
    Last Post: 12-09-2017, 01:08 PM
  2. New steel mill/router design. Feedback appreciated.
    By geekness in forum CNC Wood Router Project Log
    Replies: 11
    Last Post: 06-19-2014, 05:24 PM
  3. Replies: 4
    Last Post: 08-19-2010, 09:04 PM
  4. roland camm3 mill any info appreciated
    By m8kingit in forum Benchtop Machines
    Replies: 1
    Last Post: 08-23-2008, 03:38 PM

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
  •