I tested my first version of what I am calling the Touch Probe Tool Change macro, and my order of operations went like so to test it, and it seems to have worked swimmingly.
PRE-MACRO SETUP
I first ran the modified bitsetter routine, to determine the activation height relative the the aluminum shroud/floor of the nomad. I then measured my ProbeSetter Pad’s height, and subtracted the two to get an appropriate offset. For me, that is noted as variable %probesetter_height_offset
This will probably be different on a machine to machine basis, and obviously on whatever type of pad one decides to come up with and the accuracy of how the machine it or make it.
FIRST TEST RUN
Step 1: Open gSender
Step 2: Insert Touch Probe
Step 3: Run Touch Probe Tool Change macro
Step 4: Set Z zero using Touch Probe (and set XY somewhere i wouldnt hit anything)
i set my Z zero at the height of my SMW soft jaw, just as a useful datum that i could jog over/to later
Step 5: Run BitSetter ToolChange macro [from @natewalck]
Step 6: Move tool back to XY zero, then manually jog back to work zero
(i used the goto once before and it went too low because i forgot a step, and nearly s**t myself)
During Step 6 i slowly jogged over to the SMW jaw, and 1mm at a time, jogged the new tool (actually a probing dowel for the bitzero) over the jaw, and the bottom of the dowel right up against the jaw. I had the ability to slide the jaw (with resistance) under the dowel, which indicates to me that its pretty damn close.
without an indicator of some sort im not sure of a more accurate method of verification.
Tentative Touch Probe Tool Change Macro [in reality this is @natewalck’s BitSetter Macro modified to adjust the X position for the ProbeSetter pad location, the tooltip to remind the user to plug in the cable for the touch probe, and the additional offset subtraction]
; measure touch probe length
; Wait until the planner queue is empty
%wait
%global.state.SAFE_HEIGHT = -10 ; clear everything height(negative number, distance below Z limit)
; Set BitSetter probe location
%global.state.PROBESETTER_X_LOCATION = -18.50 ; machine coordinates
%global.state.PROBESETTER_Y_LOCATION = -3 ; machine coordinates
%global.state.PROBESETTER_Z_LOCATION = -20 ; machine coordinates --> lower this (more negative) to start the probing closer to wasteboard
; Location for tool changes
%global.state.TOOLCHANGE_X = -125
%global.state.BITSETTER_PROBE_DISTANCE = 100
%global.state.BITSETTER_PROBE_FEEDRATE = 100 ; mm/min
; Wait until the planner queue is empty
%wait
; Keep a backup of current work position
%X0=posx, Y0=posy, Z0=posz
; Save modal state
%WCS = modal.wcs
%PLANE = modal.plane
%UNITS = modal.units
%DISTANCE = modal.distance
%FEEDRATE = modal.feedrate
%SPINDLE = modal.spindle
%COOLANT = modal.coolant
G21 ; metric
M5 ; Stop spindle
G90 ; Absolute positioning
; Get to a safe height and park for tool change
G53 G0 Z[global.state.SAFE_HEIGHT]
G53 X[global.state.TOOLCHANGE_X] Y[global.state.PROBESETTER_Y_LOCATION]
; Pause for manual tool change & probing
%wait
M0 ; Please insert touch probe and connect cable!
; Go to BitSetter
G53 X[global.state.PROBESETTER_X_LOCATION] Y[global.state.PROBESETTER_Y_LOCATION]
G53 Z[global.state.PROBESETTER_Z_LOCATION]
%probe_start_z = posz
G91 ; Relative positioning
G38.2 z-[global.state.BITSETTER_PROBE_DISTANCE] F[global.state.BITSETTER_PROBE_FEEDRATE]; fast probe (so it doesn't take forever)
G0 z2
G38.2 z-5 F40 ; "dial-it-in" probes
G4 P.25
G38.4 z10 F20
G4 P.25
G38.2 z-2 F10
G4 P.25
G38.4 z10 F5
G4 P.25
G90 ; Absolute positioning
%wait
; Get the Z position at the end of measuring tool length
; the probe_setter_height_offset will be different for each user or machine
%probesetter_height_offset = 14.51; mm height to subtract from tool length because probesetter is shorter than bitsetter activation height
%probe_end_z = posz
%probe_actual_distance = probe_start_z - probe_end_z
%probe_compensated_distance = probe_actual_distance - probesetter_height_offset ; subtract offset from actual length, because it will always be longer by offset.
(actual=[probe_actual_distance] compensated=[probe_compensated_distance])
%probe_actual_distance = probe_compensated_distance ; assign tempvariable we used for printing to console
%is_initial_tool = ! (global.state.PROBE_ACTUAL_DISTANCE > 0)
; Update Z offset for new tool
; note: do this in individual steps otherwise it sometimes treats some variables as strings (wtf??)
; resulting in new_z=-31.0423.3225252
%delta_z = is_initial_tool ? 0 : probe_actual_distance*1.0 - global.state.PROBE_ACTUAL_DISTANCE*1.0
%new_z = posz*1.0 + delta_z*1.0
%new_z = Math.round(new_z * 1000) / 1000
(old=[global.state.PROBE_ACTUAL_DISTANCE] new=[probe_actual_distance] new_z=[new_z])
G10 L20 Z[new_z]
%global.state.PROBE_ACTUAL_DISTANCE = probe_actual_distance
%wait
G91 ; Relative positioning
G0 Z5
G90 ; Absolute positioning
G53 Z[global.state.SAFE_HEIGHT] ; Move in machine coordinates to safe height
%wait
; go back to tool change location to begin toolpath again
G53 X[global.state.TOOLCHANGE_X] Y[global.state.PROBESETTER_Y_LOCATION]
; Restore modal state
[PLANE] [UNITS] [DISTANCE] [FEEDRATE] [SPINDLE] [COOLANT]