Objective
My objective was to be able to use a mix of fixed length tool and variable length tools. I only want to measure the variable length tools like drill bits or other rarely user tools that I don’t keep in a dedicated tool holder. My setup is a Sieg X3 mill LinuxCNC 2.8 using the QTDragon screen with an ASUS 1920x1080 touch screen and 3D probe. I based my remap on the work done by Peter Dam that I found through this post
forum.linuxcnc.org/qtvcp/39423-qtdragon-...ange?start=20#190243
.
Workflow
Start machine and home all.
Touch off work piece X,Y,Z, using 3D probe. See note below.
Load G-Code file.
Cycle start
At each tool change the user is prompted to load the tool and indicate when this is complete.
If the tool is a fixed length tool indicated by the presence of a Z value other than zero in the tool table measuring will be skipped and machining will proceed.
If the tool is variable length the tool will move to the tool setter location and will probe the sensor to determine the tool’s length and then machining will proceed
Note: When the work piece is probed in the Z direction with the 3D probe, the value of the touch-off minus the length of the probe is stored in parameters #4001-4006 for G54-G59. This measurement would be as if the spindle nose is sitting on the work piece. The length of the probe is stored in the .ini file.
Setup
Place the m6remap.ngc file in the ~linuxcnc/nc_files/probe/basic_probe/macros directory
Place the measure_tool_inch.ngc and measure_tool_mm.ngc files in the ~linuxcnc/nc_files directory
Place the measure_toolsetter_inch.ngc and measure_toolsetter_mm.ngc files in the ~linuxcnc/nc_files directory
Add the following to the .ini file under [RS274NGC]
REMAP=M6 modalgroup=6 ngc=m6remap.ngc
SUBROUTINE_PATH = macros
Add the following to the .ini file.
[PROBE]
LENGTH=<probe length>
I made a slight change to the probe_z_minus_wco.ngc file. I added the bold line to save the Z touch-off value minus the probe length for G54 - G59 in parameters #4001 - #4006 respectively.
G10 L2 P#5220 Z[#<z_minus_probed> + #<workspace_z>]
#[4000 + [#5220]] = [#<z_minus_probed> + #<workspace_z> - #<_ini[PROBE]LENGTH>]
o<probe_z_minus_wco> return
Add the following lines to linuxcnc.var file. This will make parameters #4001-#4006 persistent.
4001 0.000000
4002 0.000000
4003 0.000000
4004 0.000000
4005 0.000000
4006 0.000000
Edit: I made some changes and corrections. I made imperial and metric versions of the measure_toolsetter and measure_tool macros. I also made changes to m6remap.ngc to work with both imperial and metric and corrected and issue with restoring the G59.1 & G59.2 work offsets should they be is use at the time of the tool change.
File Attachment:
File Name:
m6remap.ngc
File Size:3.26 KB