Text Size

Auto Tool Zero Method for XYZ Axis Using Mach3 - Part 3

Re: Auto Tool Zero Method for XYZ Axis Using Mach3 - Part 3

Postby kevinl » Wed Nov 16, 2011 2:38 pm

i guess that what i was hinting at, i see the "T" commands as a selection from a list but the tool info is not pick out of the code to load the machine's tool file, but anyway, here's the file with some changes I felt eliminated some keystrokes..
Code: Select all
Sub Main()

Dim ConfirmReady As String
Dim DoXY As String
Dim DoZ As String
Dim XaxisDRO As Integer
Dim YaxisDRO As Integer
Dim ZaxisDRO As Integer
Dim ToolDia As Double


' Define some constants for MachMsg dialog types
MachMsgTypeOK = 0
MachMsgTypeOKCancel = 1
MachMsgTypeAbortRetryIgnore = 2
MachMsgTypeYesNoCancel = 3
MachMsgTypeYesNo = 4
MachMsgTypeRetryCancel = 5
MachMsgTypeCancelTryAgainContinue = 6

' Define some constants for MachMsg return codes
MachMsgReturnOK = 1
MachMsgReturnCancel = 2
MachMsgReturnAbort = 3
MachMsgReturnRetry = 4
MachMsgReturnIgnore = 5
MachMsgReturnYes = 6
MachMsgReturnNo = 7
MachMsgReturnTryAgain = 10
MachMsgReturnContinue = 11

' notice the SetDRO() command use single digit value for xyzabc
' uncomment for the correct version
XaxisDRO=0
YaxisDRO=1
ZaxisDRO=2

' notice the SetOEMDRO() command uses three digit values for xyzabc
' uncomment for the correct version
'XaxisDRO=800
'YaxisDRO=801
'ZaxisDRO=802

ConfirmReady = MachMsg("Confirm Touch plate leads are connected and ready.","",4)
If ConfirmReady = MachMsgReturnYes Then GoTo 1 Else GoTo 5

1:
DoXY = MachMsg("Zero X and Y also?","",4)
If DoXY = MachMsgReturnYes Then GoTo 2 Else GoTo 3

2:
ToolDia = Question("What is the tool diameter?")
Message( "Auto Zeroing X..." )
SetDRO(XaxisDRO, 0.0000)
'SetOEMDRO(XaxisDRO, 0.0000)
Sleep 100
If IsSuchSignal (DIGITIZE) Then
code "G31 X-2 F10"
While IsMoving()
Sleep 100
Wend
SetDRO(XaxisDRO, ToolDia/2)
'SetOEMDRO(XaxisDRO, ToolDia/2)
Sleep 100
code "G1 X.5"
End If

Message( "Auto Zeroing Y..." )
SetDRO(YaxisDRO, 0.0000)
'SetOEMDRO(YaxisDRO, 0.0000)
Sleep 100
If IsSuchSignal (DIGITIZE) Then
code "G31 Y-1 F10"
While IsMoving()
Sleep 100
Wend
SetDRO(YaxisDRO, ToolDia/2)
'SetOEMDRO(YaxisDRO, ToolDia/2)
Sleep 100
code "G1 Y.5"
End If

3:
DoZ = MachMsg("Position the touch plate to zero Z. y to continue or n to skip.","",4)
If DoZ = MachMsgReturnYes Then GoTo 4 Else GoTo 6

4:
Message( "Auto Zeroing Z..." )
SetDRO(ZaxisDRO, 0.0000)
'SetOEMDRO(ZaxisDRO, 0.0000)
Sleep 100
If IsSuchSignal (DIGITIZE) Then
code "G31 Z-2 F10"
While IsMoving()
Sleep 100
Wend
SetDRO(ZaxisDRO, .180)
'SetOEMDRO(ZaxisDRO, .180)
Sleep 100
code "G1 Z1"
End If
GoTo 6

5:
Message ("Tool zeroing aborted. Try again when ready.")
GoTo 7

6:
Message "Tool zeroing complete. Check the results on the DROs."

7:
End Sub
kevinl
 
Posts: 886
Joined: Tue Feb 02, 2010 3:47 pm
Location: Birmingham, AL, USA
CNC Machine: Custom

Re: Auto Tool Zero Method for XYZ Axis Using Mach3 - Part 3

Postby airnocker » Wed Dec 07, 2011 2:29 am

Kevinl,

Meant to reply sooner. I wanted to let you know that I copied your mods and looked them over but hadn't yet had time to load and try them. Looks like you've put some good thought into it. Can't wait to see how it works now with fewer keystrokes needed.
airnocker

Everything depends on everything else
airnocker
 
Posts: 620
Joined: Thu Mar 25, 2010 9:43 pm
Location: Wellington, CO
CNC Machine: Custom

Re: Auto Tool Zero Method for XYZ Axis Using Mach3 - Part 3

Postby kevinl » Tue Apr 22, 2014 10:27 pm

i'm in the mode to modify this auto tool zero code and wondered if there might be some changes or add request..

#1 i'm hopeing to pick up the gage block/s thickness field/s in the offset screen so the user wont need to hard code the macro..

#2 had thoughts about picking up the tool # if the gcode listed it to be greater than zero but not sure if that means anything to us users that change the bits out and not the tool holder..
kevinl
 
Posts: 886
Joined: Tue Feb 02, 2010 3:47 pm
Location: Birmingham, AL, USA
CNC Machine: Custom

Re: Auto Tool Zero Method for XYZ Axis Using Mach3 - Part 3

Postby airnocker » Mon Jun 29, 2015 8:36 pm

Hi Kevin,

I'm revisiting my auto tool zero code after seeing what ger21 has done with his. In particular, I liked his method of after first "touching" Z on the touch plate he backed off a tiny bit then did a second touch at a much slower feedrate to get a more accurate value.

Did you do your modifications you spoke of April of 2014?
airnocker

Everything depends on everything else
airnocker
 
Posts: 620
Joined: Thu Mar 25, 2010 9:43 pm
Location: Wellington, CO
CNC Machine: Custom

Re: Auto Tool Zero Method for XYZ Axis Using Mach3 - Part 3

Postby kevinl » Mon Jul 06, 2015 7:37 pm

with no other comments, I've kind of let the sleeping dog lay.. when I was more active in the idea, I had hope to have someone cut a specifically shaped aluminum block for this whole experiment. the one block I had cut I've just not been impressed by and the two try with a different machinist is catching dust on his workbench..

there's times I wished for a manual milling machine, I'm not much into using other folks equipment even though I have his blessing..
kevinl
 
Posts: 886
Joined: Tue Feb 02, 2010 3:47 pm
Location: Birmingham, AL, USA
CNC Machine: Custom

Re: Auto Tool Zero Method for XYZ Axis Using Mach3 - Part 3

Postby airnocker » Mon Jul 06, 2015 8:14 pm

Hi Kevin, thanks for the reply.

Are you thinking about making it easier to re-zero Z after a tool change? Ger21 has an easy great solution. Let me know if this is the case and I will elaborate.
airnocker

Everything depends on everything else
airnocker
 
Posts: 620
Joined: Thu Mar 25, 2010 9:43 pm
Location: Wellington, CO
CNC Machine: Custom

Re: Auto Tool Zero Method for XYZ Axis Using Mach3 - Part 3

Postby kevinl » Mon Dec 28, 2015 7:09 pm

Hi airnocker, I'd like to wake this project up.. I've final gotten my larger cnc table machine running and what like / wish to start changing bit in the middle of the gcode file..

any thoughts, thinking about having it move to a specific area and zero on a touch plate after the bit change / cycle start, then return to part xy zero and continue with the code.. also would like to incorporate the use of a specific type of gage/zeroing block and a generic machinist cage block.
kevinl
 
Posts: 886
Joined: Tue Feb 02, 2010 3:47 pm
Location: Birmingham, AL, USA
CNC Machine: Custom

Re: Auto Tool Zero Method for XYZ Axis Using Mach3 - Part 3

Postby airnocker » Sun Jun 19, 2016 10:22 pm

Hi Kevin,

Sorry I missed seeing your post. I haven't been on this forum much as the basement finish-out has prioritized my time. My machine has been idle for almost a year and I'm just now waking it back up. (jeez, I've almost had to retrain myself on how to use it, especially after upgrading my PC to Win7 32-bit).

Any who, I did see Ger21's implementation and I thought, wow, that's would be a good feature to implement. Let me know what you have done if anything or if you are still interested.

I had to revert to my posts here on how to do get this Auto Tool Zero macro setup again on a new Mach3 profile. If you don't use it ya loose it.
airnocker

Everything depends on everything else
airnocker
 
Posts: 620
Joined: Thu Mar 25, 2010 9:43 pm
Location: Wellington, CO
CNC Machine: Custom

Re: Auto Tool Zero Method for XYZ Axis Using Mach3 - Part 3

Postby kevinl » Wed Sep 21, 2016 7:20 pm

Hi airnocker, I've also been away from forum or at least not as active as I once was, but do check in from time to time.

what I remember or had hope to add to this macro was using a gage block with a 1" hole centered over the 0,0 point and then mill the gage block about .5" thick and write the macro to center X on touches to both sides of the gage block then repeat the same touching in the Y direction and set 0,0 to the center of the gage block hole. once XY is complete then rise to .75" and move to .75,.75 and do a double touch for the Z axis.

But so far I do a couple of project and find that the machine needs another upgrade or update with my current upgrade needing more than 6" clearance between table and top of Z, which requires changing the two XY plates.

have you try the current macro, think most parts work, but one day I tried bypassing the XY touch and just using the Z probe and it still went through the XY motions and required touches. not sure if the by-pass was me or the program, hope to test again soon..
kevinl
 
Posts: 886
Joined: Tue Feb 02, 2010 3:47 pm
Location: Birmingham, AL, USA
CNC Machine: Custom

Re: Auto Tool Zero Method for XYZ Axis Using Mach3 - Part 3

Postby airnocker » Wed Sep 21, 2016 10:45 pm

Hi Kevin, no problem, it is about the same for me in checking this forum.

Regarding your idea for using a gauge block with a hole, it might be easier to mill a 1/8" "L" pocket just inside the 0,0 and insert some 90 deg 1 1/2" aluminum angle in the pocket so it sticks up an inch or so above the table surface and use it as a touch plate for XY zeroing.

I use "my" current macro all the time to bypass XY zeroing and just use the Z-probe without issue. I will post a copy of the macro I use later this evening.

Best,
airnocker

Everything depends on everything else
airnocker
 
Posts: 620
Joined: Thu Mar 25, 2010 9:43 pm
Location: Wellington, CO
CNC Machine: Custom

PreviousNext

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 158 on Thu Mar 08, 2012 8:54 pm

Users browsing this forum: No registered users and 1 guest