Mixed tool M6 remap

More
15 Feb 2021 03:54 - 17 Feb 2021 02:22 #198896 by JohnnyCNC
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: measure_to...2-16.ngc
File Size:0 KB

File Attachment:

File Name: measure_to...2-16.ngc
File Size:0 KB

File Attachment:

File Name: measure_to...2-16.ngc
File Size:0 KB

File Attachment:

File Name: measure_to...2-16.ngc
File Size:0 KB

File Attachment:

File Name: m6remap.ngc
File Size:3 KB
Last edit: 17 Feb 2021 02:22 by JohnnyCNC. Reason: Updated attached files
The following user(s) said Thank You: ikkuh

Please Log in or Create an account to join the conversation.

More
15 Feb 2021 14:51 #198936 by seebaer1976
Replied by seebaer1976 on topic Mixed tool M6 remap
Hi,

thank you for your great work.

can i use it with metric or do i have to change it beforehand? since you have inch in your description.

get in touch with chris (cmorley), maybe he can build it into qtvcp and qtdragon directly.
because with the next update, the change in the file probe_z_minus_wco.ngc is deleted again. or am I wrong now?

Kind regards
markus

Please Log in or Create an account to join the conversation.

More
16 Feb 2021 00:23 #199001 by JohnnyCNC
Replied by JohnnyCNC on topic Mixed tool M6 remap

Hi,

thank you for your great work.

can i use it with metric or do i have to change it beforehand? since you have inch in your description.

get in touch with chris (cmorley), maybe he can build it into qtvcp and qtdragon directly.
because with the next update, the change in the file probe_z_minus_wco.ngc is deleted again. or am I wrong now?

Kind regards
markus


I don't think the probe macros get overwritten but that doesn't mean they might not in the future. I know the QTDragon .ui and .py files do. I think I read somewhere that you can put the file in another place in the path so that they are found before the factory ones but I haven't looked into that yet. I think I read that Chris was also working on a built in remap but I could be wrong. This was as much a learning experience as it was a means to an end. I haven't tested it using metric but I don't see why it would work if you used the appropriate values for a metric setup. This work still needs some refinement. There are some hard-coded inch values in the .ngc files that would need to be changed to the appropriate metric values. Using hard-coded values is poor practice and I will look at parameterizing them next.
The following user(s) said Thank You: ikkuh

Please Log in or Create an account to join the conversation.

Time to create page: 0.105 seconds
Powered by Kunena Forum