I have succesfully been able to ReMap my M6 tool change to allow for a tool touch off after each manual change to adjust the Z height without requiring a new WCS touch off or manual measurement.
You can see an example of this in work with the following videos;
https://youtu.be/rIDMpuUcoYg
https://youtu.be/6yEWJ09mp1I
If you have further questions or need clarification, you can message me on discord @kotlikm
This is an alternative to using the Probe Screen developed by Vers.by
I utilized this soultion as it seems the Probe Screen does not work easily with the use of the GMOCCAPY UI.
Minimal changes overall are required.
This is all based off the work that was openly shared on the LCNC forums seen at the following link. I made modificiations to get it working reliably as I ran into issues when using the original on the latest LCNC release.
http://www.linuxcnc.org/index.php/english/forum/10-advanced-configuration/5596-manual-tool-change--tool-lengh-touch-off?start=30#48235
At this point in time, this has been shown to work in the AXIS GUI at least once, I dont have as much experience with it, but overall should work with the use of different toolchange pins noted further along this page.
Under the [RS274NGC] section add:
change/add/use SUBROUTINE_PATH to point to the location where these tool-change subroutines are located:
[RS274NGC]
...
SUBROUTINE_PATH = macros
REMAP=M6 modalgroup=6 ngc=tool-change
REMAP=M600 modalgroup=6 ngc=tool-job-begin
Under the [EMCIO] section add:
[EMCIO]
...
TOOL_CHANGE_AT_G30 = 0
Ensure neither TOOL_CHANGE_POSITION nor TOOL_CHANGE_QUILL_UP is set.
Add the following POSTGUI_HALFILE callout
[HAL]
...
POSTGUI_HALFILE = custom_postgui.hal
Create a new file in your configuration folder called custom_postgui.hal
If you already have a postgui hal file, you can add the following lines to it, if not put the following in the newly created file
net tool-change gmoccapy.toolchange-change <= iocontrol.0.tool-change
net tool-changed gmoccapy.toolchange-changed <= iocontrol.0.tool-changed
net tool-number gmoccapy.toolchange-number <= iocontrol.0.tool-prep-number
net tool-prepare-loopback iocontrol.0.tool-prepare <= iocontrol.0.tool-prepared
By adding these pins in your postgui, the tool change notification will reference your tool table and provide the tool description in the pop-up. This requires that you keep your tool table updated with an accurate description for the associated tool number, but i find it extremely helpful since F360 free version does not allow for setup sheets.
your postgui.hal should contain the following, as AXIS does not use the detailed tool change pins the same way as GMOCCAPY
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
This remapping has only been tested in AXIS once that i know of, issues may occur, please reach out to me if you need help configuring.
Map an input pin to be the probe input, e.g.:
net probe-in => motion.probe-input
net probe-in <= hm2_7i96.0.gpio.005.in
For multiple probe inputs, the following can be used, in this case a MESA 7i96 is controlling a NO probe, and a NC Toolsetter;
loadrt or2 count=1
addf or2.0 servo-thread
net probe-in <= hm2_7i96.0.gpio.005.in
net length-in <= hm2_7i96.0.gpio.009.in_not
net probe-in => or2.0.in0
net length-in => or2.0.in1
net probe-or-length <= or2.0.out => motion.probe-input
The following tool change pin is required as well;
loadusr -W hal_manualtoolchange
In your Linuxcnc.var file, ensure you have the following variables;
#5061
#5062
#5063
They can be manually added and assigned a 0.000 to start
Add the following sub-routines to the folder you identified in your .ini file as the SUBROUTINE_PATH
tool-job-begin.ngc
tool-change.ngc
The following parameters will need to be set in the subroutine tool-change.ngc as appropriate for your machine configuration;
#<_UseInches> = 1.0 ( set to 1 to use inches here, or 0 to use millimeters; should match units on tool.tbl dimensions )`
#<_TravelZ> = -.25 ( machine ABS Z coordinate for travelling, typically near max Z to avoid ever hitting the work )
#<_TravelFeed> = 200.0 ( feedrate used for general Z moves when avoiding G0 )
#<_ProbeX> = 38.77 ( machine ABS X coordinate of switch/touch-off plate )
#<_ProbeY> = 25.27 ( machine ABS Y coordinate of switch/touch-off plate )
#<_ProbeFastZ> = -2.0 ( machine Z coord to move to before starting probe, longest tool should not touch switch at this Z )
#<_ProbeMinZ> = -4.75 ( machine Z coord to stop probe, shortest tool must touch switch at this Z, must be > min Z )
#<_ProbeRetract> = 0.125 ( small distance to retract before approaching switch/touch-off plate second time )
#<_ProbeFastFeed> = 100.0 ( feed rate for moving to _ProbeFastZ )
#<_ProbeFeed1> = 20.0 ( feed rate for touching switch/touch-off plate first time )
#<_ProbeFeed2> = 4.0 ( feed rate for touching switch/touch-off plate second time )
#<_ToolChangeX> = 4.0 ( machine ABS X coordinate to pause at for manual tool changing )
#<_ToolChangeY> = 1.0 ( machine ABS Y coordinate to pause at for manual tool changing )
#<_MistOnDuringProbe> = 0 ( set to 1 for mist, or 2 for coolant, or 0 for nothing during probing, to clear switch of swarf )
In addition I have had to modify the post-processor for the following (see attached .cps file for use);
This is not required, but takes full advantage of the new setup for tool touchoff when using the free version of F360.
The following link takes you to a plugin that was developed to combine multiple tools back into a single program in F360 which was removed with the restrictions in the free version. It will also add rapids back in. I highly recommend using this post processor if you are on the free version of F360, but please use at your own risk, and thouroughly vet and test your ngc code prior to running parts.
https://github.com/TimPaterson/Fusion360-Batch-Post
M6 in the g-code will invoke a manual tool change with automatic tool height adjustment.
M600 is used at the beginning of the first g-code file of a job so that the next M6 will measure the tool for reference instead of calculating a tool length offset. It can also be invoked manually through the MDI before a job starts.