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)
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
Re: GCode Junkies Please Educate Me / Help Me Find The Issue! GRBL "Bitsetter"
Quote:
Originally Posted by
machinehop5
...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.
Re: GCode Junkies Please Educate Me / Help Me Find The Issue! GRBL "Bitsetter"
Quote:
Originally Posted by
mactec54
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.
Re: GCode Junkies Please Educate Me / Help Me Find The Issue! GRBL "Bitsetter"
Quote:
Originally Posted by
machinehop5
...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