Auto Tool Zero button fixed position???

Auto Tool Zero button fixed position???

Postby pontiac1978 » Thu Nov 23, 2017 5:41 am

Hello Everyone. Its been a while since I've been on.

I have been racking my small brain on trying to get my "Auto Tool Zero" button in Mach3 to goto a "Fixed" position to zero the tool. I have a permanent "Zero plate" fixed to the machine. Right now I basically have to move the Spindle over to the fixed plate and then hit the button to zero. I would like to be able to hit the button and it goes from wherever the spindle is to the location (fixed plate) I set to Zero the tool. Here is the Generic code I have now:

Dim Zprobe, Zretract, ZfeedRate

'Note: TouchPlateHeight represents the actual height of the
' Auto Z Touch Plate from the work surface.
' Minor adjustments can be made for calibration purposes (use caution)
TouchPlateHeight = .089

Message( "Auto Tool Zeroing..." )

If IsSuchSignal (22) Then
isMetric = GetOEMLED(801)
Zprobe = -3
Zretract = 1.5
ZfeedRate = 10
If isMetric = 0 Then
Zprobe = Zprobe * 25.4
Zretract = Zretract * 25.4
ZfeedRate = ZfeedRate *25.4
TouchPlateHeight = TouchPlateHeight * 25.4
End If
Call SetDRO( 2, 0.00 )
code "G31 Z" & Zprobe & " F" & ZfeedRate
While IsMoving()
Wend
Call SetDRO( 2, TouchPlateHeight )
code "G1 Z" & Zretract
End If


I would appreciate it if you could add to this simple code to have the machine goto a specific X,Y,Z location to Zero the tool when the "Auto Zero Tool" button is pressed.

Thank You and have a SAFE & Happy Thanksgiving! Gobble Gobble!!! :-)
pontiac1978
Vectric Apprentice
 
Posts: 8
Joined: Sun May 03, 2015 9:55 pm
Model of CNC Machine: CRP4896

Re: Auto Tool Zero button fixed position???

Postby ger21 » Thu Nov 23, 2017 5:54 am

The following code should do it. You need to change the values for PlateX and PLate Y to your fixed plate coordinates, in Machine Coordinates, and you need to home your machine before running this. Homing is required so that Mach3 knows where your plate is.

Is your fixed plate on your spoilboard? And are you zeroing to the spoilboard? If not, then I don't know how this works?


Code: Select all
Dim Zprobe, Zretract, ZfeedRate
Dim PlateX, PlateY

'Note: TouchPlateHeight represents the actual height of the
' Auto Z Touch Plate from the work surface.
' Minor adjustments can be made for calibration purposes (use caution)
TouchPlateHeight = .089

Message( "Auto Tool Zeroing..." )

If IsSuchSignal (22) Then
isMetric = GetOEMLED(801)
Zprobe = -3
Zretract = 1.5
ZfeedRate = 10
PlateX = 10
PlateY = 10
If isMetric = 0 Then
Zprobe = Zprobe * 25.4
Zretract = Zretract * 25.4
ZfeedRate = ZfeedRate *25.4
TouchPlateHeight = TouchPlateHeight * 25.4
PlateX = PlateX * 25.4
PlateY = PlateY * 25.4
End If
Code "G53 G0 X" & PlateX & " Y" & PlateY
Call SetDRO( 2, 0.00 )
code "G31 Z" & Zprobe & " F" & ZfeedRate
While IsMoving()
Wend
Call SetDRO( 2, TouchPlateHeight )
code "G1 Z" & Zretract
End If
Gerry
ger21
Vectric Wizard
 
Posts: 887
Joined: Sun Sep 16, 2007 2:59 pm
Location: Shelby Township, MI, USA

Re: Auto Tool Zero button fixed position???

Postby pontiac1978 » Fri Nov 24, 2017 9:22 am

Thank You and I will give it a Try and let you know how it does. Yes the plate is located on the spoilboard and yes I am zeroing Z from the spoilboard. Which PlateX & PlateY are you meaning to change?

PlateX = 10
PlateY = 10

-OR-

PlateX = PlateX * 25.4
PlateY = PlateY * 25.4


I figure its the top PlateX PlateY, its always better to ask Questions, versus buying parts after a crash :-)

Thank You
pontiac1978
Vectric Apprentice
 
Posts: 8
Joined: Sun May 03, 2015 9:55 pm
Model of CNC Machine: CRP4896

Re: Auto Tool Zero button fixed position???

Postby ger21 » Fri Nov 24, 2017 12:22 pm

Yes, change it at PlateX=10.

The other lines scale the values if the machine is in metric mode.
Gerry
ger21
Vectric Wizard
 
Posts: 887
Joined: Sun Sep 16, 2007 2:59 pm
Location: Shelby Township, MI, USA

Re: Auto Tool Zero button fixed position???

Postby bravesoul » Fri Nov 24, 2017 1:08 pm

You could enter this into your post processor at the 'End of File' area. That would be my preference as you wouldn't have to do anything special at the end of each file.. I have 2 post processors, one without the return to home and one with a specific location. Hope that helps.
bravesoul
Vectric Apprentice
 
Posts: 143
Joined: Thu Sep 11, 2014 8:53 pm
Location: Cleveland, TN
Model of CNC Machine: ShopBot PRT ALPHA 48"x96"

Re: Auto Tool Zero button fixed position???

Postby pontiac1978 » Mon Nov 27, 2017 11:15 am

The code worked Perfect! Thank you for all your Help! Have a Wonderful Christmas!
pontiac1978
Vectric Apprentice
 
Posts: 8
Joined: Sun May 03, 2015 9:55 pm
Model of CNC Machine: CRP4896


Return to Control Software related questions

Who is online

Users browsing this forum: martin54 and 2 guests