Tool changes And Z Height

Hey all,

feel free to test this (you can copy it with all the comments directly into the ‘tool-change’ field of SETTINGS Tab):

Aiph5u’s ‘tool-change’ routine

 

Version 2024-03-31a
(Runs on M6, tool change)
M70 ; Save modal states
G90 ; Set absolute distance mode
G21 ; Set metric units mode
S0 ; Set spindle speed to 0
G53 G0 Z0 ; Go rapidly to the Z machine home position - manual tool change position
G53 G0 X0 Y0 ; Go rapidly to the X,Y machine home position - manual tool change position
M0 M6 (debug, Please insert tool Nr. #<_selected_tool> and tighten the collet with both wrenches)
G0 X0 Y0 ; Go to the workpiece X and Y zero
G0 Z35 ; Lower Z to a position 35 mm above old workpiece zero before probing
M0 (MSG, Please connect the touch plate to the controller, place the touch plate underneath the bit and attach the magnet end to the collet of your milling motor.)
F100 ; Set feedrate to 100 mm/min for probing. (which means slow)
G91 ; Set incremental distance mode
G38.2 Z-50 ; Move the milling motor downwards until the bit touches the touch plate
G92 Z15.4 ; Set this position as the new Z zero value (to reflect new tool length - including subtraction of the touch plate's height which is 15.4 mm thick)
G0 Z30 ; Lift Z by 30 mm
M0 (MSG, Please remove the touch plate and start the milling motor)
M72 ; Restore the modal states that we previously saved with M70 above

(Feel free to accomodate the Z-50 and the Z30 to your needs)

Note 1: The above ‘tool-change’ routine is for the case you have the workpiece zero on top of the workpiece in your 3D model. Should you have the workpiece zero at the bottom of your workpiece, you have to disable this line by prepending a semicolon:

; G0 X0 Y0                                                    

; Go to the workpiece X and Y zero

This will make that you probe on machine bed at home position instead of workpiece top.

I will work on this to automatize the selection of these two different cases.

How to copy this ‘tool-change’ routine to your machine

  1. Open a new browser tab on the user interface and open the page you look at at the moment by navigating to its forum.onefinitycnc.com URL or by pasting the exact URL (https://forum.onefinitycnc.com/t/tool-changes-and-z-height/7715/29) into the URL bar.

    Note that attaching a USB keyboard (and a USB mouse) to the Onefinity Controller, or opening the user interface in the web browser of a computer connected remotely over network (http://onefinity.local) helps a lot, especially as the touch display’s on-screen keyboard lacks a Ctrl key :frowning: which you usually use for “select all” (Ctrl-A), “cut” (Ctrl-X), “copy” (Ctrl-C), and “paste” (Ctrl-V).

  2. Please follow these steps:


On the SETTINGS page, click into the ‘tool-change’ text field, do “select all” (Ctrl-A), and “cut” (Ctrl-X)


Switch to the new tab which shows this forum page. Select the new routine with finger (touch screen) or pointer (mouse). Now “copy” (Ctrl-C) to clipboard.


Now go back to the Onefinity User Interface tab, click into the 'tool-change" field, and “paste” (Ctrl-V)


Click on the green “Save” button.

Now on the next occurence of M6 (tool-change) in your g-code, the new tool-change routine will be used.

Note: Inside the ‘tool-change’ text field, all text after the “;” is treated as comment and ignored. Therefore you can paste the routine with all its comments, it will still work.

6 Likes