584,808 active members*
5,040 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > G-Code Programing > GCode Junkies Please Educate Me / Help Me Find The Issue! GRBL "Bitsetter"
Results 1 to 6 of 6
  1. #1

    Question GCode Junkies Please Educate Me / Help Me Find The Issue! GRBL "Bitsetter"

    Hello! I'll try to keep my explanation as short as possible. I'm learning, playing and have a small GRBL machine. I was able to steal / modify / make a macro that successfully facilitates a bit change at a fixed location. Essentially, the macro touches, I change the bit, touch again and Z Zero is shifted accordingly. It works fine. Again, I found some examples and refined it for my setup.

    Now, I want to explore combining GCODE files that use different tools; so I can basically run one file and the bit change occurs right in the process.

    Anyway! I was working on a project today and tried all of this out. It generally works, except for the fact that for some reason the Z offset change is not working correctly now, within the file. When it starts machining after the bit change, it wants to dive way, way too deep. The file below was very long and I shortened the boring machining sections and you'll see *** notes in there. The important stuff is the beginning, tool change and final machining.

    Can anyone see any issues that I might be able to correct? Would be highly appreciated!! Thanks!

    -Brian



    T1
    G17
    G21
    G90
    G0Z20.320
    G0X0.000Y0.000
    S16000M3
    G0X18.411Y86.089Z5.080
    G1Z-1.191F635.0
    G1X16.864Y85.009F1524.0

    *** (BEFORE AND AFTER THIS NOTE IS JUST MACHINING - M5 IS WHERE MY TOOL CHANGE BEGINS

    G1X32.742Y21.228
    G1X31.839Y21.115
    G1X30.964Y20.833
    G1X30.174Y20.381
    G1X29.469Y19.817
    G1X28.848Y19.139
    G1X28.396Y18.349
    G1X28.086Y17.502
    G1X27.916Y16.599
    G1Y15.696
    G1X28.086Y14.793
    G1X28.396Y13.946
    G0Z5.080

    M5
    %wait
    %SAFE_HEIGHT = -5
    %TOOL_PROBE_X = -34
    %TOOL_PROBE_Y = -310
    %TOOL_PROBE_Z = -10
    %PROBE_DISTANCE = 110
    %PROBE_FEEDRATE = 300
    %RETRACTION_DISTANCE = 10
    %X0=posx, Y0=posy, Z0=posz
    %WCS = modal.wcs
    %PLANE = modal.plane
    %UNITS = modal.units
    %DISTANCE = modal.distance
    %FEEDRATE = modal.feedrate
    %SPINDLE = modal.spindle
    %COOLANT = modal.coolant
    M5
    G90
    G21
    G53 Z[SAFE_HEIGHT]
    G53 X[TOOL_PROBE_X] Y[TOOL_PROBE_Y]
    G53 Z[TOOL_PROBE_Z]
    %wait
    M0
    G91
    G38.2 Z-[PROBE_DISTANCE] F[PROBE_FEEDRATE]
    G0 Z2
    G38.2 Z-5 F45
    G90
    %ORIGINAL_TOOL = posz ;store current work position
    G4 P0.5
    G91
    G0 Z[RETRACTION_DISTANCE]
    G90
    G53 Z[SAFE_HEIGHT]
    %wait
    M0
    %wait
    G53 Z[TOOL_PROBE_Z]
    G91
    G38.2 Z-[PROBE_DISTANCE] F[PROBE_FEEDRATE]
    G0 Z2
    G38.2 Z-25 F45
    G90
    G4 P0.25
    G10 L20 Z[ORIGINAL_TOOL]
    G4 P0.25
    G91
    G0 Z[RETRACTION_DISTANCE]
    G90
    G53 Z[SAFE_HEIGHT]
    %wait
    M0
    G0 X[X0] Y[Y0]
    G0 Z[Z0]
    [WCS] [PLANE] [UNITS] [DISTANCE] [FEEDRATE] [SPINDLE] [COOLANT]

    ***(NEXT MACHINING BEGINS HERE, AFTER TOOL CHANGE)

    T1
    G17
    G21
    G90
    G0Z20.320
    G0X0.000Y0.000
    S16000M3
    G0X33.300Y15.163Z5.080
    G1Z0.000F254.0
    G1X33.516Y15.265Z-0.006
    G1X33.723Y15.438Z-0.013
    G1X33.888Y15.661Z-0.020
    G1X33.989Y15.909Z-0.027

    (MACHINING CONTINUES)

  2. #2
    Join Date
    Aug 2009
    Posts
    1566

    Re: GCode Junkies Please Educate Me / Help Me Find The Issue! GRBL "Bitsetter"

    ...G43 and G49 codes may need to added to your postprocessor.

    T1
    G17
    G21
    G90

    ...insert G43 Hxx here (xx= tool offset number of your choice) or somewhere before the 1st Z axis move

    G0Z20.320
    G0X0.000Y0.000
    S16000M3
    G0X18.411Y86.089Z5.080
    G1Z-1.191F635.0
    G1X16.864Y85.009F1524.0


    ...G49 H00 to cancel Tool Length Comp before Tool change

  3. #3
    Join Date
    Jan 2005
    Posts
    15362

    Re: GCode Junkies Please Educate Me / Help Me Find The Issue! GRBL "Bitsetter"

    Quote Originally Posted by machinehop5 View Post
    ...G43 and G49 codes may need to added to your postprocessor.

    T1
    G17
    G21
    G90

    ...insert G43 Hxx here (xx= tool offset number of your choice) or somewhere before the 1st Z axis move

    G0Z20.320
    G0X0.000Y0.000
    S16000M3
    G0X18.411Y86.089Z5.080
    G1Z-1.191F635.0
    G1X16.864Y85.009F1524.0


    ...G49 H00 to cancel Tool Length Comp before Tool change
    No you should never have a need to cancel Tool length offset, by using a G49, if each tool is setup in the Tool offset control Page, you have no reason to cancel it.
    Mactec54

  4. #4
    Join Date
    Aug 2009
    Posts
    1566

    Re: GCode Junkies Please Educate Me / Help Me Find The Issue! GRBL "Bitsetter"

    Quote Originally Posted by mactec54 View Post
    No you should never have a need to cancel Tool length offset, by using a G49, if each tool is setup in the Tool offset control Page, you have no reason to cancel it.
    ...so, why is there a G49 Code if you never need it? If, you do not cancel TLC at the end of each Tool you are setting yourself or the next person to a possible crash due to an Active Offset.

  5. #5
    Quote Originally Posted by machinehop5 View Post
    ...so, why is there a G49 Code if you never need it? If, you do not cancel TLC at the end of each Tool you are setting yourself or the next person to a possible crash due to an Active Offset.
    To clarify, where would the tool offset information come from? Keep in mind I have a hobby machine so when I insert bits the position is arbitrary. Obviously the tool length is only determined by using the touch probe or manually zeroing the tool.

  6. #6
    Join Date
    Jan 2005
    Posts
    15362

    Re: GCode Junkies Please Educate Me / Help Me Find The Issue! GRBL "Bitsetter"

    Quote Originally Posted by machinehop5 View Post
    ...so, why is there a G49 Code if you never need it? If, you do not cancel TLC at the end of each Tool you are setting yourself or the next person to a possible crash due to an Active Offset.
    There are a lot of redundant codes that are not needed today, with modern controls, and with hobby controls also.

    In 50 years I have never used a G49 or seen anyone have a crash from not using it, it is not needed. back in the day when everything was hand coded, it would of been used then, as hand coding was always full of mistakes. this would of helped, maybe to save a crash. today it is not needed. a lot of controls have default codes and some may still have the G49 as one of the defaults, in this case it would be redundant to have it in you program.

    Once a tool offset is used and another tool is called with it's offset, there is nothing left, of the previous tool offset, there can never be a crash, because of the previous Tools offset not being canceled

    In this uses case he is resetting the Tool offset after each operation so there is no chance of a crash from not have a G49
    Mactec54

Similar Threads

  1. IF and GOTO gcode statements Syntec controller "syntax error"
    By jabtronic in forum G-Code Programing
    Replies: 4
    Last Post: 07-12-2021, 05:35 PM
  2. How can do ""manual stepper motor sizing for "rack and pinion"calculation""???
    By Medhat93 in forum Mechanical Calculations/Engineering Design
    Replies: 0
    Last Post: 03-03-2018, 01:50 AM
  3. Replies: 3
    Last Post: 06-25-2014, 03:51 PM
  4. X Axis "Goes Off Pattern", "Awry", "Skewed", "Travels"
    By DaDaDaddio in forum Laser Engraving / Cutting Machine General Topics
    Replies: 1
    Last Post: 05-06-2013, 09:59 AM

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
  •