Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: wvancura on September 21, 2010, 12:45:10 AM

Title: Wanted: Position X & Y at the Center of a Hole Macro
Post by: wvancura on September 21, 2010, 12:45:10 AM
I have seen a lot of talk about center finding and it all seems to boil down to finding the Z height and bug fixing... Is there a direct  posting of a working  macro, for Mach3, that will find the center of a drilled hole? I need to reliably find the center of a hole that has been drilled in a metal material for rework. The electric touch sensor can be positioned to fit in the hole without touching the sides as a starting point. Trying to read hundreds of pages of commentary with hundreds if external thread references is a bit much.

Thanks,
Bill
Title: Re: Wanted: Position X & Y at the Center of a Hole Macro
Post by: Dan13 on September 21, 2010, 03:12:59 AM
If you need accuracy, I'd use a dial indicator held in the spindle chuck.

Dan
Title: Re: Wanted: Position X & Y at the Center of a Hole Macro
Post by: ostie01 on September 21, 2010, 07:41:30 AM
This comes from the hoss website

Hope this help.

Jeff
Title: Re: Wanted: Position X & Y at the Center of a Hole Macro
Post by: wvancura on September 22, 2010, 09:42:52 AM
Thanks,
The files are very useful.

I noticed that if the 'Machine Coordinates' button happens to be pressed, strange things happen. I need to find how to determine that button is ON so I can force a warning message.
Thanks again,
Bill
Title: Re: Wanted: Position X & Y at the Center of a Hole Macro
Post by: Hood on September 22, 2010, 10:57:12 AM
I noticed that if the 'Machine Coordinates' button happens to be pressed, strange things happen. I need to find how to determine that button is ON so I can force a warning message.
Thanks again,
Bill

Something like this at the start of the macro should do it.

If GetOemLED(16) Then
MsgBox("Machine Coord's Active, change and restart macro")
End
End If

Hood
Title: Re: Wanted: Position X & Y at the Center of a Hole Macro
Post by: wvancura on September 23, 2010, 01:28:43 PM
Hood,
OEMLed(16) did the trick. I Found this solution works well. I used an ElseIf and posted the message in the status window. That way the process is automatically terminated on this error condition. Added it as follows:

===============================
If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty
    Code "(Probe is grounded, check clearance and try again)"

ElseIf GetOemLed (16) <> 0 Then 'Warning Wrong Coordinate system
    Code "(Center Finder Error: Exit Machine Coordinate Mode)"

Else
 (Body of the code)
===============================

I added a second pass at finding the center of the X axis, because I didn't trust the probe to give me good results if it starts out next to the Y edge of a hole. Once the near X axis center is found, the probability of a clean touch goes way up. The process now searches for X, then Y, then X again, done. On several practice runs, I noticed that the X center moved a few thousandths on the second pass, but never by more than 0.001 on a search starting from the near center of the circle. This is well within the slop of the CNC machine.

Thanks,
Bill
Title: Re: Wanted: Position X & Y at the Center of a Hole Macro
Post by: Hood on September 23, 2010, 02:46:07 PM
The other way you could do it is if in Machine coords you could change it from the macro rather than aborting.
Hood
Title: Re: Wanted: Position X & Y at the Center of a Hole Macro
Post by: DaveCVI on September 23, 2010, 04:59:11 PM
Hi,
If you don't like reinventing the wheel, you might be interested to know that circular hole center finding is a built in feature of MachStdMill's probing support.

Drop over to the MSM forum for more info.
http://www.machsupport.com/forum/index.php/topic,15291.0.html (http://www.machsupport.com/forum/index.php/topic,15291.0.html)

Dave