I have a little issue were I am having a very hard time setting up my Z tool offset. first, I would level my bed the usual way with the first probe in the center of the bed. then it would go to each of the 3 lead screws and do the same. My bed has already been mesh compensated as well. Next, I would mount the tool and manually jog Z until the nozzle barely touches the bed. whatever value=n this is , I enter it into my tooloffset.g file in this format G10 Pn Z-n.
Upon every power up, i call tooloffset.g to set all my tools to the right offset. however, during print, my nozzle always crashes into the bed. I would have to use babysteps to bring it back up, usually about 1-2mm before the first layer even looks right. I have tried multiple times to adjust the Z-n by the amount of baby steps, apply the new offset, reset babysteps to 0mm and it still has issues, either too high or too low from the bed. I am not sure where these inconsistent Z height is coming from.
below are my files.
TOOLOFFSET.g
;TOOL OFFSET
G10 P1 X3.3 Y37.5 Z-7.6 ; set tool 1 axis offsets
G10 P2 X0 Y0 Z-9.15 ; set tool 2 axis offsets
G10 P3 X5.6 Y38.73 Z-9.15 ; set tool 3 axis offsets
G10 P4 X-.2 Y38.9 Z-8.12 ; set tool 4 axis offsets . with 0.4mm offset
tfree4.g
; tfree4.g
G91 ; Relative Mode.
G1 Z2 ; Pop Z up slightly so we don't crash while traveling over the usable bed region.
G90 ; Absolute Mode.
m564 s0
G53 G1 x-38.8 Y191 F20000 ; Rapid to the back of the post. Stay away from the tool rack so we don't collide with tools.
; This position must be chosen such that the most protruding y face of the current tool
; (while on the carriage) does not collide with the most protruding y face of any parked tool.
G53 G1 x-38.8 Y244 F5000 ; Controlled move to the park position with tool-0. (park_x, park_y)
M98 P"/macros/01_MAINTENANCE/tool_unlock.g" ; Unlock the tool
G53 G1 Y191 F6000 ; Retract the pin.
m564 s1 ;limit movement outside boundaries
tpost4.g
set global.PTOOL={state.currentTool}
m703
G4 s1
if {job.file.fileName != null} && {job.build.currentObject = -1} ;if file name exist amd no current object
M98 P"/sys/PRINTCODE/startbedtemp.g" ;evoke startbedtemp.g to warm bed
m568 P4 A2 ;then set T4 to active temp
g4 s5
M116 P4 ; Wait for set temperatures to be reached
G90 ; Ensure the machine is in absolute mode before issuing movements.
m564 s0 ;allow movement outside boundaries
G53 G1 x-38.8 Y246 F5000 ; Move to pick up position for tool-4.
M98 P"/macros/01_MAINTENANCE/tool_lock.g" ; Lock the tool
G1 R2 Z0 ; Restore prior Z position before tool change was initiated.
; Note: tool tip position is automatically saved to slot 2 upon the start of a tool change.
; Restore Z first so we don't crash the tool on retraction.
g1 y209
m564 s1 ;limit movement outside boundaries
G1 R0 Y0 ; Retract tool by restoring Y position next now accounting for new tool offset.
; Restoring Y next ensures the tool is fully removed from parking post.
G1 R0 X0 ; Restore X position now accounting for new tool offset.
M106 R2 ; restore print cooling fan speed
m564 s1 ;limit movement outside boundaries
tpre4.g
; tpre4.g
G90 ; Ensure the machine is in absolute mode before issuing movements.
G53 G1 x-38.8 y209 F20000 ; Rapid to the approach position without any current tool.
G60 S0 ; Save this position as the reference point from which to later apply new tool offsets.
bed.g
M561 ; clear any bed transform
g29 s2 ; disable bed height map
g91 ; relative position
g1 z10 ; drop bed 10mm
G90 ; absolute position
g1 X-191.5 Y-172 F30000
G30 P0 X-191.5 Y-172 Z-9999 ; probe front left leadscrew
G30 P1 X4.5 Y200 Z-9999 ; probe back leadscrew
g1 X4.5 Y200 f30000
G30 P2 X204.5 Y-172 Z-9999 S3 ; probe front right leadscrew and calibrate 3 motors
g1 X204.5 Y-172 f30000
G29 S1 ; Enable Mesh Bed Compensation
homez.g
Home Z Axis
; In case homez.g is called in isolation, ensure
; (1) U axis is homed (which performs tool detection and sets machine tool state to a known state) and
; (2) X&Y axis is homed (to prevent collisions with the tool posts)
; (3) No tools are loaded.
; (4) Endstop is not already triggered (in case of damaged endstop)
; Ask for user-intervention if any case fails.
if !move.axes[3].homed
M291 R"Cannot Home Z" P"U axis must be homed before Z to prevent damage to tool. Press OK to home U or Cancel to abort" S3
M98 P"homeu.g"
; RRF3 does not permit Z homing without x&y being homed first. Popup window for convenience.
if !move.axes[0].homed || !move.axes[1].homed
M291 R"Cannot Home Z" P"X&Y Axes must be homed before Z for probing. Press OK to home X&Y or Cancel to abort" S3
M98 P"homey.g"
M98 P"homex.g"
if state.currentTool != -1
M84 U
M291 R"Cannot Home Z" P"Tool must be deselected before homing. U has been unlocked, please manually dock tool and press OK to continue or Cancel to abort" S3
M98 P"homeu.g"
if sensors.probes[0].value[0] != 0
M291 R"Cannot Home Z" P"Z Probe is already triggered!" S2
abort "Z Probe was triggered before homing."
M98 P"probepickup.g" ;pick up probe
M561 ; Disable any Mesh Bed Compensation
G90 G1 X4.5 Y0 F10000 ; Move to the center of the bed
M558 F500 ; Set the probing speed
G30
M558 F50 ; Set a slower probing speed
G30
;G92 z0 ; set z0 as min Z
G32 ; Run 3-point bed calibration defined in bed.g
M98 P"probedropoff.g" ;pick up probe
G1 X4.5 Y0 F20000
G29 S1 ; Enable Mesh Bed Compensation)
startgcode.g (this script gets ran at the start of every print)
m98 p"0:/sys/PRINTCODE/TOOLOFFSET.g"
M929 P"0:/sys/LOG/printlog.txt" S1 ; start logging to file
M929 P"0:/sys/LOG/printlog.txt" S2 ; start logging to file
M929 P"0:/sys/LOG/printlog.txt" S3 ; start logging to file
g4 s2
echo "Started print at" , state.time
g4 s2
M929 P"0:/sys/LOG/printlog.txt" S0 ; stop logging to file
M106 F0 S1 ;turn on LED
G31 K0 X0 Y0 Z0