This was the rough instructions I used:
INI must have under the VERSA_TOOLSETTER heading:
X
Y
Z
MAXPROBE
Z_MAX_CLEAR
DIAMETER
tool set probe the bare spindle with 'probe tool setter height' button. this number is without tool or user offsets.
load/call a tool in linuxcnc - jog into toolsetter position
Tool set the tool with the 'tool height of current tool' button'
tool table should update and the status tab will show the calculated offset as well as the tool setter height and raw probe results.
I loaded and tool set a couple tools.
Now I have heard of people tool setting the probe but I can't see how that can be accurate (hard to get both trip points to trip at the same time), so i did something different:
before I but the probe in, I used one of the tools I had already tool set and positioned it over my vice. I used a 1/2 diameter pin to set the height above my vice. Then I zeroed my user system (g54 in my case).
Now I installed my probe (didn't change the tool number in linuxcnc) and again used the roll pin to set the Z height of the probe on my vice. Now the Z DRO reading is the difference between the original tool length and the tool probe length. So now I take the original tool Z offset (found in the tool table) and added (subtracted? I can't remember) the DRO setting and entered that as Z for tool 99 (the probe).
Then I called up tool 99 in linuxcnc.
Not saying this is the best way - just what I did. Should only need to do this once as long as both probe lengths don't change.
I set the 'auto zero' button in versa probe and used the spindle probe to 'down z probe' the top of my vice.
Finally I changed tools back to one of the tool set tools and jogged it to the top of my vice and the dro was very close to zero.
the routine code is this:
Code:
def probe_tool_with_toolsetter(self):
try:
# basic sanity checks
for test in('ts_x','ts_y','ts_z','ts_max','ts_diam','tool_probe_height', 'tool_block_height'):
if self['data_{}'.format(test)] is None:
return'Missing toolsetter setting: {}'.format(test)
if self.data_tool_diameter is None or self.data_tool_number is None:
return 'No tool diameter found'
# see if we need to offset for tool diameter
# if so see if there is enough room in X axis limits
if self.data_tool_diameter > self.data_ts_diam:
# if close to edge of machine X, offset in the opposite direction
xplimit = float(INFO.INI.find('AXIS_X','MAX_LIMIT'))
xmlimit = float(INFO.INI.find('AXIS_X','MIN_LIMIT'))
if not (self.data_tool_diameter/2+self.data_ts_x) > xplimit:
Xoffset = self.data_tool_diameter/2
elif not (self.data_ts_x -(self.data_tool_diameter/2)) < xmlimit:
Xoffset = 0-self.data_tool_diameter/2
else:
return 'cannot offset enough in X for tool diameter'
else: Xoffset = 0
# offset X by tool radius (from toolfile) if required
# probe Z
# raise Z clear
# move back X by tool radius if required
cmdList = []
cmdList.append('F{}'.format(self.data_rapid_vel))
cmdList.append('G49')
cmdList.append('G91')
# should start spindle in proper direction/speed here..
cmdList.append('G1 X{}'.format(Xoffset))
cmdList.append('G38.2 Z-{} F{}'.format(self.data_ts_max,self.data_search_vel))
cmdList.append('G1 Z{} F{}'.format(self.data_latch_return_dist, self.data_rapid_vel))
cmdList.append('F{}'.format(self.data_probe_vel))
cmdList.append('G38.2 Z-{}'.format(self.data_latch_return_dist*1.2))
cmdList.append('#<touch_result> = #5063')
# adjustment to G53 number
cmdList.append('#<zworkoffset> = [#[5203 + #5220 *20] + #5213 * #5210]')
cmdList.append('G10 L1 P#5400 Z[#5063 + #<zworkoffset> - {}]'.format( self.data_tool_probe_height))
cmdList.append('G1 Z{} F{}'.format(self.data_z_clearance, self.data_rapid_vel))
cmdList.append('G1 X{}'.format(-Xoffset))
cmdList.append('G90')
cmdList.append('G43')
# call each command - if fail report the error and gcode command
rtn = self.CALL_MDI_LIST(cmdList)
if rtn != 1:
return rtn
h = STATUS.get_probed_position()[2]
self.status_z = h
p = self.data_tool_probe_height
toffset = (h-p)
self.add_history('''ToolSetter:
Calculated Tool Length Z: {:.4f}
Setter Height: {:.4f}
Probed Position: {:.4f}'''.format(toffset, p, h ))
# report success
return 1
except Exception as e:
return '{}'.format(e)