I wanted to implement the Auto Z Zero probe upgrade for the Kronos KRMx02, but didn’t want to use the XBox360 controller (which is how Michael implemented it). This post explains how I modified the KRMx02 MACH3 screen to run the macro using the (not implemented) “Auto Tool Zero” button on the main MACH3 screen (in the KRMx02 profile).
Note that the probe construction and wiring are not covered here: For this, you could buy the KRMx02 Upgrades book. Or you can figure it out yourself; it’s not rocket science. Just note that when input terminal 3 on the G540 gets a ground signal, it means the tool bit has touched the probe plate. Also, make sure you have a backup copy of your “KRMx02.set” file somewhere, just in case.
I also modified the macro a little, using modern versions of some commands, adding more extensive comments, and modifying some of the specific parameters like probe speed and depth. You’ll at least want to set the Plate Thickness value! The macro is included below: Copy the text, paste it into a file named “M910.m1s” and put it into the “C:\Mach3\macros\KRMx02\” subdirectory (assumes default locations).
Second step is to edit the existing screen set. Use “MachScreen” from Klaus Dietz (Google it), load the program onto your computer, run it and load the KRMx02.set file. Move the “MachScreen properties” window off to the side.
Single-click on the “Auto Tool Zero” button (in the “Tool Information” area of the Program Run screen) and, in the dialog window that opens (“MachSreen” <sic>) single-click on the “button” line. In the MachScreen properties window, set the Button parameters as follows:
Global: No
Function: Execute Basic-Script (Find this near the bottom of the list in the “Std” section when you double-click the value. Double-click again to ‘save’ it)
Standard Code: 34 (This should come up automatically when the above is selected)
Hotkey: (I left this blank, but you can pick a key value, such as 119 which is the “F8” key)
Execute Code: Code “m910” (Use “File > Open file” to select the macro file on your computer. Once you see the text of the macro you can close that window. Answer “Yes” to “Include data to screen set”)
Text on ctrl: Auto Tool Zero (Leave it as it is, trust me)
Locked for mouse: No
SAVE the screen set file and close MachScreen.
Now when you open your KRMx02 profile for Mach3, the “Auto Tool Zero” button will start the probe down auto-zero process.
Here is the macro “M910.m1s”
Code:
Rem Auto Z Zero with Probe 'Orig. Written by Michael Simpson, re-written by Don N2 IRZ 30DEC2014
If GetOemLed (825) <> 0 Then 'check probe first see if it is grounded
Code "(Probe Grounded, check connection and try again)" 'Status Bar display
Else
Code "(Probe Down)" 'Status Bar display
Code "G4 P1" 'Pause for a second
PlateThk = .375 'Thickness of probe plate in inches
SaveFeed = GetOemDRO(818) 'Store the current feed rate
'------------------------------------------------------------------------------
'Fast Probe Down
Code "F8" 'Set the Fast feed rate to 8 IPM
ZNew = GetOEMDRO(802) - 7 'Get Z axis value, subtract 7 to set ZNew target for maximum probe depth
'7 is the maximum Z axis movement and then some, you may decide to use a smaller value
Code "G31Z" &ZNew 'Perform a G31 probe down to ZNew
While IsMoving()
Wend
Code "(Touch Down.. Backup)" 'Status bar display
ZNew = GetVar(2002) +.1 'read the touch G31 Response (probe value for z aka 2002) Z and add 0.1, set ZNew to this value
Code "(Z=" &ZNew &")" 'Status bar display?
Code "G0 Z" &ZNew 'move back to ZNew
While IsMoving ()
Wend
Code "(Brief Pause)" 'Status bar display
Code "G4 P5" 'Wait 5 seconds in case of problems
'------------------------------------------------------------------------------
'Slow Probe Down
Code "F2" 'Set the feed rate to 2 IPM
ZNew = GetOEMDRO(802) - .25 'Set the ZNew target to 0.25 inches below current reading
Code "G31Z" &ZNew 'Perform G31 probe down to ZNew
While IsMoving()
Wend
Code "(Slow Touch)"
ZNew = GetVar(2002) 'Read the touch G31 response
Code "G0 Z" &ZNew 'Move to ZNew with G0
While IsMoving ()
Wend
'----------------------------------------------------------------------------
'Set Dro
Call SetOEMDRO(802, PlateThk) 'Sets the Z DRO reading to plate thickness
Code "G4 P0.5" 'Pause 1/2 second for DRO to update
ZNew = PlateThk + 0.8 'Set ZNew to current plus 0.8 inches (retract distance)
Code "G0 Z" &ZNew 'Retract to ZNew (the retract amount)
While IsMoving ()
Wend
Code "(Z axis is now zeroed)" 'Status bar message
Code "F" &SaveFeed 'Resets the feed rate to what it was
End If
Have fun and post here with your results!