Thread: Touching on
Threaded View
-
03-03-2015 #7
For those Mach3 users who want a more automated solution; I found a macro somewhere (so I am not taking any credit for writing it).
1, you need a plate with an insulated base (if you bed is conductive and earthed). A piece of pcb is fine, but I use a piece of brass with an acrylic sheet bonded to it.
2. Measure the thickness and put the value in the 'Gage plate height' box on the Offsets screen.
3. make sure that 'Digitize' blinks on the Diagnostics screen when you touch the plate to earth. (test it against the tool to check that the spindle gives you an earth return if you don't get an earth then you will need a clip lead to earth the tool when you run the Macro)
4. On the Program Run screen select the operator tab and choose 'Edit Button Script' The programmable buttons should flash.
5. Select 'Auto Tool Zero' and copy the Macro below into the box, replacing all existing text.
6. File and Save.
7. Jog Z axis upwards to a high point and click on Auto tool zero. When the axis moves touch the plate. If the axis pulls up 10mm (on the existing settings), then it is working. If not hit the Mach3 Estop and check what was done
To use the macro bring the tool to within a few mm of the touch plate on the top face of your work and click 'Auto Tool Zero'.
Hope you find this useful,
Cheers,
Rob
'Tool Zero Setting Macro
' Change the following three lines to suit your machine
PlateThickness = GetOEMDRO(1001) ' Thickness of touch plate
RetractClearance = 10 ' Clearance above touch plate to retract to
ProbeFeed = 20 ' Feedrate to use for probing
' Define some constants
ZDRO = 2 ' Z Axis DRO
AbsoluteModeLED = 48 ' Absolute Coordinate Mode LED
IncrementalModeLED = 49 ' Incremental Coordinate Mode LED
FeedrateDRO = 818 ' OEM code for feedrate DRO
ProbeLED = 825 ' OEM code for probe input LED
ZTouchDRO = 2002 ' OEM code for DRO that holds Z touch position
' Do nothing if probe is already grounded
If GetOemLed(ProbeLED) = 0 Then
' Wait a few seconds for user to get touchplate in place
Code "G4 P2"
' Save current feedrate
CurrentFeed = GetOemDRO(FeedrateDRO)
' Save current coordinate mode
AbsMode = GetOemLED(AbsoluteModeLED)
' Set absolute coordinate mode
Code "G90"
' Zero Z DRO
Call SetDro (ZDRO, 0.0000)
' Pause for DRO to update
Code "G4 P0.5"
' Do the touch move
Code "G31 Z-20 F" & ProbeFeed
' Wait for it to complete
While IsMoving()
Wend
' Delay a bit for
Code "G4 P0.25"
' Get the Z position where probe input triggered
ZProbePos = GetVar(ZTouchDRO)
' Go back to touch position (G31 backs off after touch)
Code "G0 Z" & ZProbePos
' Wait for it to complete
While IsMoving ()
Wend
' Set Z DRO to touch plate thickness
Call SetDro (ZDRO, PlateThickness)
' Pause for DRO to update
'Code "G4 P0.5"
' Retract Z to SafeZ, if enabled, else to RetractClearance above plate
If(IsSafeZ() = 1) Then
SafeZ = GetSafeZ
If SafeZ > PlateThickness Then
GotoSafeZ()
End If
Else
RetractHeight = PlateThickness + RetractClearance
Code "G0 Z" & RetractHeight
End If
' Tell user we're done
Code "(Z axis is now zeroed)"
' Reset feedrate to original value
Code "F" & CurrentFeed
' Reset coordinate mode to original value
If AbsMode = 0 Then
Code "G91"
End If
Else
Code "(Z-Plate is grounded, check connection and try again)"
End If
Exit SubLast edited by cropwell; 03-03-2015 at 05:11 PM.
-
The Following User Says Thank You to cropwell For This Useful Post:
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks