PDA

View Full Version : Auto tool zero



wildcat
01-15-2007, 08:07 PM
What does the "Auto Tool Zero" button do in Mach3? I don't seem to be able to find any thing about it in the Mach3 manual.

Barker806
01-16-2007, 10:53 AM
It is a button that you can add VB code too...
You can enter in code like this:
Zmove = 1.5 'amount the tool will move down to hit the probe
Zpos = GetDRO(2)
Tool = GetDRO (24)
ZOffset = .5 'enter height of probe here

OldZpos = Zpos
ZPos = Zpos - ZMove
Code "G31 Z" & ZPos & " F20.0"
While IsMoving()
Wend
Zpos = GetVar (2002)
If Zpos = OldZpos - ZMove Then
responce = MsgBox ("ERROR! The tool did not hit the probe and DRO was not set" , 4 , "Probe ERROR!" )
Else
SetDRO (2,ZOffset)
End If

Code "G00 G53 Z-.1"



This will set the Z to the right height over the part :)

Thanks
Brian

Normsthename
02-05-2007, 06:05 PM
This will set the Z to the right height over the part
I am really interested in getting this working on my CNC setup :)
Quick question.....
When the Z axis comes down and the bit touches the plate (3mm Thick for instance), the Z axis then backs up a set distance, say 10mm
You can then remove the plate and wire clip and press cycle start??
Does the VB code then add some sort of tool compensation so it knows that the Z axis is 13mm above the actual material???

TIA

Andy

ger21
02-05-2007, 06:43 PM
Does the VB code then add some sort of tool compensation so it knows that the Z axis is 13mm above the actual material???

TIA

Andy

It resets the DRO to the correct Z height when it hit's the plate ( SetDRO (2,ZOffset)). Then when it moves up 10mm, it's just a normal 10mm Z move.

Normsthename
02-06-2007, 03:16 PM
Then when it moves up 10mm, it's just a normal 10mm Z move.
I understand that it resets the DRO, but do I need to change 'Z' origins in my CAD package to tell it that the tool is actually 13mm above the material??

Thanks

Andy

ger21
02-06-2007, 03:25 PM
No, the origin (Z=0) is still the top of the workpiece. When Mach3 moves up 10mm, it knows it's 10mm above the work.

wildcat
02-06-2007, 03:28 PM
Is the 13mm you refer to the height of your touch probe? If so, it would appear that you would alter the previously posted VB code and update the touch probe height.

Could someone post a reference to one of these electronic height probes? I have seen mechanical ones but not electrical ones that could be interfaced to a computer. I assume they have some mechanism for handling overshooting. The VB code looks like it probes at 20ipm and I know my setup would overshoot at that speed.

Normsthename
02-06-2007, 03:47 PM
s the 13mm you refer to the height of your touch probe?
The 13mm was just a 'test' figure which equated to a 3mm thick touch plate, and then the Z axis moves up 10mm to equal 13mm in total
Hope this helps.

Could someone post a reference to one of these electronic height probes?
All it consists of is an output wire from your breakout board, which you attach one end to a steel plate, and the other end you fit a crocodile clip or similar. You then put the touch plate under the bit, and attach the clip on to bit.
When the Z axis lowers and makes electrical contact, the VB code then does the rest.
You need to assign the output to the digitiser probe....I think.........

I will have a go at getting this working tomorrow.

No, the origin (Z=0) is still the top of the workpiece. When Mach3 moves up 10mm, it knows it's 10mm above the work.
Thanks GER21 for all your input :D

Andy


Andy

wildcat
02-06-2007, 04:21 PM
A potential problem with this approach may occur if the Mach debounce and G31 feed rate high enough that before Mach reports the contact as real the tool has over shot. The mechanical ones that I have seem allow for overshooting (basically they are a fancy dial indicator). The steel plate would not be as forgiving. When I use an electronic edge finder I change the debounce to a low value and feed very slowly (1ipm). It would be really slick to be able to feed down fast and measure the overshoot. Perhaps with an electronic dial indicator?

Here is a DIY version of the mechanical height gauge.

http://www.industrialhobbies.com/howto/production_notes/height_gauge/height_gauge_pt1.htm

Normsthename
02-06-2007, 04:57 PM
A potential problem with this approach may occur if the Mach debounce and G31 feed rate high enough that before Mach reports the contact as real the tool has over shot.
Other Mach users are using with no problems, I will try it and see!

Andy

ger21
02-06-2007, 06:00 PM
A potential problem with this approach may occur if the Mach debounce and G31 feed rate high enough that before Mach reports the contact as real the tool has over shot.

As you mentioned, you can set the feedrate in the VB script. It doesn't have to be 20. Set it low, and just jog down close before you run the Script.

Normsthename
02-08-2007, 02:15 PM
Today I made up the touch plate, and wired this into Pin 15 on my breakout board, and the other wire to a earth on the breakout board.
Finally I assigned the probe to this signal.
Everything works fine when I touch the crocodile clip to the plate, I get a probe signal showing on the diagnostics screen in Mach3
Problem is when I actually clip the crodile clip onto the router bit, I get an intermittent signal flashing on the probe signal display
I would guess the intermittent signal is flashing approx. twice every second. It is very random flashing signal.
The router is powered off at the electrical socket. As soon as I unclip the wire from the router bit, the flashing signal stops???
I thought that it could be picking up noise from the Stepper motors, so I positioned the plate very near to the stepper motors with the clip off the router bit, and no flashing??
I tried altering the debounce setting, and it made it better, but I have to have a large value (2000+) before it is usuable.
Its very odd, Anyone know why I am getting this.
I have temporally altered the VB script so I now lower the router bit manually while watching the diagnostics screen, and when the probe signal is solid, I press the auto tool zero button.
It then records the thickness of the touch plate, and then moves the Z axis back upto 15mm
This works fine, but I would like to know why I get the flashing signal.

TIA

Andy

wildcat
02-08-2007, 03:04 PM
You might need better grounding, shielding, or need to add a small filter cap on the signal line. Be aware that a filter cap will delay the signal. Was the router completely switched off or was only the variable speed, if so equipped, reduced to "0?"

FWIW:

Consider the impact of using a debounce of 2000. The previous code as a I understand was setup for 20ipm. So with Mach3 in 45,000Hz mode the overshoot is

2000/45000/60*20 = .015

in 25,000 mode:

2000/25000/60*20 = .027

The value becomes linearly worse if debounce or feed is increased or if Hz is decreased.

I am cautious of this approach out of concerns of not getting an accurate depth and chipping tools. In the end it is whatever you are comfortable with.

Normsthename
02-08-2007, 06:15 PM
You might need better grounding, shielding, or need to add a small filter cap on the signal line.
I did'nt use any shielded cable, but neither do any of my limit swictches or EM Stops and I have never had any problems with any of those.
If I changed to a shielded cable, do I connect the screen to the chasssis earth at the box end??

Was the router completely switched off or was only the variable speed, if so equipped, reduced to "0?"
Yes, the router was completely switched off at the mains outlet, which makes it very strange!

Consider the impact of using a debounce of 2000.
I only tried the debounce setting to see if it made the problem better or worse, the delay was much too long as you say

Andy

riporeno
09-08-2007, 03:34 PM
It is a button that you can add VB code too...
You can enter in code like this:
Zmove = 1.5 'amount the tool will move down to hit the probe
Zpos = GetDRO(2)
Tool = GetDRO (24)
ZOffset = .5 'enter height of probe here

OldZpos = Zpos
ZPos = Zpos - ZMove
Code "G31 Z" & ZPos & " F20.0"
While IsMoving()
Wend
Zpos = GetVar (2002)
If Zpos = OldZpos - ZMove Then
responce = MsgBox ("ERROR! The tool did not hit the probe and DRO was not set" , 4 , "Probe ERROR!" )
Else
SetDRO (2,ZOffset)
End If

Code "G00 G53 Z-.1"



This will set the Z to the right height over the part :)

Thanks
Brian

Hi,
I am a new Italian consumer.
excuse me but I don't speak well the English.
I have a problem with Auto TOOL Zero because when the clicco with the mouse
it tells me: function not implemented.
This that you/he/she is written above where I have to put him/it?
How do I have to name him/it?
When use screen 4 thing do I have to write in the key Auto TOOL Zero?
thanks and excused me if I don't speak well
hi
moreno

ger21
09-08-2007, 05:06 PM
From the menu, choose Operator>Edit Button Script, then click the Auto Tool Zero button. Put the code there.

Screen 4 is not used for VB script.

Greolt
09-08-2007, 06:28 PM
T
Problem is when I actually clip the crodile clip onto the router bit, I get an intermittent signal flashing on the probe signal display


This works fine, but I would like to know why I get the flashing signal.



Andy did you get this sorted?

This is what I found.

I had exactly the same symptom and fixed it by putting a pullup resistor on the pin that the probe is connected to. Fixed it completely.

The pin may be "floating" until the probe makes contact and picking up stray noise. That is what mine was doing.

It now works reliably and faultlessly. I don't have shielded cable and I have debounce set a 10 :)

Greg

riporeno
09-08-2007, 06:55 PM
From the menu, choose Operator>Edit Button Script, then click the Auto Tool Zero button. Put the code there.

Screen 4 is not used for VB script.

Thanks
I have resolved the problem.
very kind
regards

moreno

Switcher
09-09-2007, 06:22 AM
I am really interested in getting this working on my CNC setup :)
Quick question.....
When the Z axis comes down and the bit touches the plate (3mm Thick for instance), the Z axis then backs up a set distance, say 10mm
You can then remove the plate and wire clip and press cycle start??
Does the VB code then add some sort of tool compensation so it knows that the Z axis is 13mm above the actual material???

TIA

Andy


It looks like the sample code already shows the "Z-axis" offset (touch plate thickness).



Zmove = 1.5 'amount the tool will move down to hit the probe
Zpos = GetDRO(2)
Tool = GetDRO (24)
ZOffset = .5 'enter height of probe here

OldZpos = Zpos
ZPos = Zpos - ZMove
Code "G31 Z" & ZPos & " F20.0"
While IsMoving()
Wend
Zpos = GetVar (2002)
If Zpos = OldZpos - ZMove Then
responce = MsgBox ("ERROR! The tool did not hit the probe and DRO was not set" , 4 , "Probe ERROR!" )
Else
SetDRO (2,ZOffset)
End If




So in your example, I think it would look like this.

ZOffset = 3.0 'enter height of probe here





.

Greolt
09-10-2007, 03:23 AM
I only tried the debounce setting to see if it made the problem better or worse, the delay was much too long as you say



It is worth mentioning in this thread for readers info that since Mach version 2.4 probe has been removed from the debounce code. Good move IMO.

Greg

m1911bldr
08-10-2008, 10:45 AM
I finally got my Auto Tool Zero working! Using the VB script and a TP100 probe (http://www.cadcamcadcam.com/index.asp?PageAction=VIEWPROD&ProdID=10), I get perfectly set tool heights every time. I use the TP100 probe with it's "tool height platform" (measured the TP100's height using a surface plate and a height guage - it's 2.041" high) sitting on the material to be cut and the cutting tool holds typing paper tightly until I raise "Z" 2 thou. I measured the paper and it's .0022 thick so the tool's only into the paper by 2 ten thousandths when it starts to be released by the tool. I checked the accuracy again using a carbide tipped scriper in my router collet and, after setting the tool height, the scriper made some TINY intermittent scratches on the surface of the aluminum. They were so small they looked like single scratches made by 220 or so sandpaper! Question: how would I modify the script to move a specified distance up from the probe touch point? I'd like it to raise 2 inches after it touches the probe instead of going all the way up to the Z height (Z-.1 in my case) entered in the last line:
Code "G00 G53 Z-.1

mkenney
02-05-2009, 08:21 AM
I finally got my Auto Tool Zero working! Using the VB script and a TP100 probe (http://www.cadcamcadcam.com/index.asp?PageAction=VIEWPROD&ProdID=10), I get perfectly set tool heights every time.

About how much does the TP100 probe cost? I'm interested in a method to reliably set height's but recently spent A LOT of money getting the CNC added to my mill.

Thanks in advance for any info!!

Mark [mkenney]

ger21
02-05-2009, 11:29 AM
Check out the probe's this guy makes.

http://www.machsupport.com/forum/index.php/topic,5004.0.html

mkenney
02-06-2009, 06:47 AM
Check out the probe's this guy makes.

http://www.machsupport.com/forum/index.php/topic,5004.0.html

Thanks for the info! Looks real nice to me and I e-mailed him for some more info/price...

Mark [mkenney]

mcyr
02-06-2009, 11:44 PM
Andy,

Its probably noise. Another option besides increasing the debounce setting is to solder a cap across the lead at Pin 15 and gnd. Doesn't have to be much 47uF or so.

Mike

CNCezee
02-08-2010, 06:21 AM
Hi would somone please help an old numskull into getting this working.
I have done this
"From the menu, choose Operator>Edit Button Script, then click the Auto Tool Zero button. Put the code there.

Screen 4 is not used for VB script." but when i click the Auto Tool Zero button the vb script window disappears behind the main Mach3 screen, and when i test the button i get the message not yet implemented
I must save this code somwhere too any clues where?
Sorry i just cannot do code!!

m1911bldr
02-08-2010, 07:04 AM
You should be on the first screen. Click the dropdown and go to "edit button script". All the buttons that have script available or assigned will start blinking. Click the "Auto Tool Zero" button. A VB script window will open. Copy and past the code into this window. Click the red "X" for the VB script window and it will ask you if you want to save the code. Click "Yes". The code is now assigned to the Auto Tool Zero button. If the VB script window doesn't come up or you don't get a prompt to save the code, you're not in the correct place to assign code to the button.

CNCezee
02-08-2010, 09:45 AM
Thanks m1911bldr, it is like everthing else so simple when you know how i will let you know if it all works.

oscbe112
10-06-2010, 10:08 AM
This almost works for me.

When I'm using the "Auto tool zero" it touches the plate and reseting the DRO Z perfectly. THEN it returns to machine zero, that in my previus case was underneath the material (not good).

So what am I doing wrong? (I dont want to use machine koordinates)

soldier1968
10-07-2010, 10:59 PM
oscbe112, read over this link:

http://www.cnczone.com/forums/mach_wizards_macros_addons/56079-xyz_probe_modification.html

and try the setup erniebro has done. If you are still having problems then repost with a few more details.

Cheers
DC

oscbe112
10-08-2010, 12:03 PM
That did the trick! :banana:

Thank you soldier1968