Hello Guest it is April 16, 2024, 04:31:37 AM

Author Topic: Auto Tool Zero for XY&Z?  (Read 17572 times)

0 Members and 1 Guest are viewing this topic.

Auto Tool Zero for XY&Z?
« on: June 23, 2010, 10:09:54 PM »
I'm using the Probe Input currently for auto zero'ing Z but I'm wondering can it also be used to then sequentially zero X&Y by modifying the VB script?  Or is the G31 code only for moving Z down?  Is G31 X1 F20 or G31 Y1 F20 legal?

Any thoughts on this would be appreciated.

airnocker

Everything depends on everything else

Offline Tweakie.CNC

*
  • *
  •  9,195 9,195
  • Super Kitty
    • View Profile
Re: Auto Tool Zero for XY&Z?
« Reply #1 on: June 24, 2010, 03:25:17 AM »
Hi,

Very interesting question - I just tried this and it seems to work OK.
I presume GetVar(2000) would return the X and GetVar(2001) the Y positions.

Tweakie.
PEACE
Re: Auto Tool Zero for XY&Z?
« Reply #2 on: June 24, 2010, 11:09:37 AM »
Thanks Tweakie.  But you just kind of went over my head.  Can you share what exactly you just tried?  And why one would need to use GetVar() to get X and Y values since all it seems there is to do is zero the X&Y DRO?

Again, I fairly new to this but wondered whether something like this would work:

Message( "Auto Zeroing Z..." )
If IsSuchSignal (54) Then
code "G31 Z-1 F20"
While IsMoving()
Wend
Call SetDRO( 2, .059 )
code "G1 Z1"
code "M6"

Message( "Auto Zeroing X..." )
If IsSuchSignal (54) Then
code "G31 X1 F20"
While IsMoving()
Wend
Call SetDRO( 0, .125 )
code "G1 X.25"
code "M6"

Message( "Auto Zeroing Y..." )
If IsSuchSignal (54) Then
code "G31 Y1 F20"
While IsMoving()
Wend
Call SetDRO( 1, .125 )
code "G1 Y.25"
End If
End If
End If


The code "M6" is just to pause to make sure the XY touch plate is in position.  I guess could be an "M1" although I know there must be other M and/or S codes that should follow and M6 judging by the way CamBam generates Drill MOP G-Code for tool changes.

airnocker

Everything depends on everything else

Offline Tweakie.CNC

*
  • *
  •  9,195 9,195
  • Super Kitty
    • View Profile
Re: Auto Tool Zero for XY&Z?
« Reply #3 on: June 24, 2010, 02:56:29 PM »
Hi,

I was interested to find out if the G31 would halt movement of other axis rather than just the Z and yes it does. This is what I tried.
The GetVar() relates to the axis position DRO at the point of touch but as you seem to be centering within a ring the actual position is not relevant as long as you zero the DROs when done you have effectively zeroed the machine to a (presume cross hair) defined point.
You still need to do a bit of work on your script but you are nearly there.

Tweakie
PEACE
Re: Auto Tool Zero for XY&Z?
« Reply #4 on: June 24, 2010, 03:51:46 PM »
Cool.  Well, I am not using a probe ring, just a simple touchplate pulled to 5V on the Probe input of the I/O board and a ground on the mill bit.  So the Z touchplate is a .06 copper clad circuit board piece.  My thought for XY is to use an piece of angle aluminum of known perpendicularity for XY touchplate faces pulled up to 5v in the same fashion and drive X to zero on the X face, then Y on the Y face, all still using the same Probe input for sensing.

XY would have to be zeroed first since the mill bit would be a steel calibration reference rod (.125 dia.), pause, then the bit changed to what would used initially on the work and then Z zeroed and tool offsets defined.

As an initial test, I had tried  the Z zero VB code followed by a "code M6" to test the pause.  Then I appended the X zero code and tried Z > pause > X VB but it seems the previous M6 code execution caused the combined script to only display the first message line then stopped as if waiting for permission to continue.  I eventually got things to reset running some other CamBam G-code with initialization strings.  That's when I decided it was time to get some more insights about this.

You are right the VB needs more work.

Thanks
airnocker

Everything depends on everything else
Re: Auto Tool Zero for XY&Z?
« Reply #5 on: July 09, 2010, 02:00:31 AM »
Here's a thread from another forum that I found helpful, including a probing section for the Offsets screen.
http://www.hossmachine.info/forum/yaf_postst7_Automatic-Tool-Probe.aspx
Re: Auto Tool Zero for XY&Z?
« Reply #6 on: July 09, 2010, 02:09:27 PM »
After a little bit of research I resolved the "Code M6" problem because I found the "code" commands that were needed.  The good news is it seems to work great for zeroing X & Y!  I am in the processing of testing the code where the M6 command is invoked prior to zeroing Z, by single stepping through the macro.

I must give credit to Cockrum ( http://cockrum.net/cnc.html ) for sharing his solution to zero Z with the Auto Tool Zero button, I simply extended off of his solution by confirming that the "G31" probe command will also move in the X and Y direction as well.  I am using Output 13 to sense the reference plates.  That is what the "If IsSuchSignal(22)" relates to.  

At present I'm using a 1.125" x1.125" x3" piece of angle aluminum (check for perpendicularity on all angles and sides) for the XY touch plate. It is stood vertically (inside corner of the aluminum angle against the outside corner of the work) against the desired work piece corner to be defined as 0,0.  A 16 gauge piece of silicon wire terminated with a spade lug on one end and a banana jack on the other end is connected to the aluminum angle by an 8-32 machine screw.  I'm using a 2" x 3" x .059" piece of copper clad circuit board for the Z touch plate like Cockrum also with a 16 gauge silicon wire soldered to a corner of the circuit board on one end and terminated with a banana jack on the other.  Both touch plates plug into to female bananas jacks connect to the Output 13 terminal of the I/O board, but only when I am doing the XYZ zeroing process.  

I start with a .125" steel reference in the tool that came with my precision collets.  X is set to half the diameter of the reference (.0625") , then Y, then a Tool change command is issued.  I install my first cutting bit to be used with my CAMBAM G-Code, then continue with the execution of G17, M3, S0 and the zeroing of the Z axis at the work level.

Here is my code to zero X,Y (tool change pause) then Z, using the Auto Tool Zero button.  It is simple and I know there are more elaborate ways to accomplish the same thing but it is what works best me and for what I currently need.
Try it at your own risk. Adjust the code according to your Mach3 setup.

I highly recommend first single stepping through the code, with the button macro editor open and with one hand on the eStop button.

Message( "Auto Zeroing X..." )
If IsSuchSignal (22) Then
code "G31 X-2 F20"
While IsMoving()
Wend
Call SetDRO( 0, .0625 )
code "G1 X.5"
End If

Message( "Auto Zeroing Y..." )
If IsSuchSignal (22) Then
code "G31 Y-1 F20"
While IsMoving()
Wend
Call SetDRO( 1, .0625 )
code "G1 Y.5"
End If
code "M6"
code "G17"
code "M3 S0"

Message( "Auto Zeroing Z..." )
If IsSuchSignal (22) Then
code "G31 Z-1 F20"
While IsMoving()
Wend
Call SetDRO( 2, .059 )
code "G1 Z1"
End If
 

Feedback appreciated. (And I gotta remember how to add comment lines to the code  ;) )

Cheers
 
airnocker

Everything depends on everything else
Re: Auto Tool Zero for XY&Z?
« Reply #7 on: July 09, 2010, 04:11:59 PM »
Update:

This macro code does indeed work as is when I single step through it.  However, I think I need to do something else rather than use M6, G17, M3 S0, (although it works in single step).

More later.
airnocker

Everything depends on everything else

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Auto Tool Zero for XY&Z?
« Reply #8 on: July 09, 2010, 05:46:14 PM »
Just for the record the G31 works with XYZ&A (;-) Mach will also post all 4 axis to the points file with and without axis letters
Re: Auto Tool Zero for XY&Z?
« Reply #9 on: July 10, 2010, 11:31:22 PM »
Hey thanks BR549.

A correction to my post above with the VB code, I mentioned "Output13" but I think it is actually the "Digitize" signal name that equates to "If IsSuchSignal(22)".  This also makes me wonder about signal name "Probing" and whether "If IsSuchSignal(54)" is equivalent to 22.

Also, I found it to be highly desirable to add some code to prompt the user with a message to confirm the signal clips are in place by clicking an ok button in the message dialogue window.


airnocker

Everything depends on everything else