Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Jerry In Maine on April 22, 2014, 05:38:45 PM

Title: Spring loaded touch plates for Z auto-zero
Post by: Jerry In Maine on April 22, 2014, 05:38:45 PM
There's lots of threads about auto-zero Z macros, but I'm wondering about touch plates used with them. I recently chipped a new V carving bit when the macro went a little wacky and brought the bit down too hard on the brass touch plate. I've tried several of the auto-zero macros and all at one time or another have gone  a little nuts...often the speed will be much slower than usual or the touch will occur w/o a retract. It doesn't happen often but it does happen.

I've seen a couple spring loaded touch plates and these seem like they could save a bit in such a circumstance. I can't figure how they don't introduce errors though. If there's a spring it must deflect at least a few thousandths before mach realizes the touch happened. I suppose this amounts to backlash within the touch plate.

Any way to compensate for this and get a true zero despite the spring?

Title: Re: Spring loaded touch plates for Z auto-zero
Post by: ger21 on April 22, 2014, 06:59:24 PM
First, you either have a problem with Mach3, or with the macros you're using. The speed should never change.
Often times, failure to retract and other similar issues can be caused by noise on the probe input pin. If you're macro has good messages spread throughout, you can often tell what went wrong by the messages displayed. Eben a simple "Finished" message at the end of the macro can be a big help. If you see the message, but the probing didn't work correctly, there's a very good chance that noised triggered the input.
Another source of trouble is if your macro doesn't account for being in incremental mode. A typical macro designed for use in Absolute mode can easily drive the tool e into the plate after probing.

There are hundreds of people using the macros in my 2010 screenset, and I've not heard a single report of an issue with the auto zero macros, in over 3 years.

While I don't believe that a spring loaded plate should be needed, the spring shouldn't affect the accuracy, unless you're probing too fast.
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: stirling on April 23, 2014, 06:40:04 AM
If a good macro is used correctly a spring loaded plate should not affect accuracy but will also be pointless. Perhaps you could post your macro(s) along with details of how fast you probed, your steps/per and accel settings of the Z axis.

Title: Re: Spring loaded touch plates for Z auto-zero
Post by: Jerry In Maine on April 23, 2014, 07:34:30 AM
This is the macro I'm using.

-------------
Message( "Auto Zeroing..." )
If IsSuchSignal (22) Then
code "G31 Z-3 F5"
While IsMoving()
Wend
Call SetDRO( 2, .75)
code "G1 Z1.5"
End If
-----------------
I had a soft brass plate (non-spring loaded). In use it would develop pits from the bit coming down onto it. I do V carving and the tips some of my bits are very fine and would sometimes chip from the pressure.

As mentioned there's a lot of macros out there. If there's a preferred one I'd appreciate someone pointing me to it.
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: stirling on April 23, 2014, 07:43:14 AM
OK - That is ONE of the MANY macros out there that is just plain wrong. However I need the other info I asked for also to explain why you're seeing the pitting.
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: Jerry In Maine on April 23, 2014, 07:51:12 AM
Z axis  info:

Steps  - 1622.5 / inch
Velocity - 250 in/min
Acceleration - 8 in/sec

Speed in the macro was set as F5
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: stirling on April 23, 2014, 10:03:29 AM
OK first that particularly nasty macro!

1) Its accuracy is totally speed and accel dependant because it doesn't handle the actual trip point and instead ATTEMPTS to store the stop point.

2) Perhaps worse though is that because its attempt to store the stop point may well fail, the retraction will be pretty random/un-predictable and in worst case could seriously crunch your tool tip/plate.
Could be worse, you could have a Renishaw which could be destroyed by this little piece of macro genius. ;D

The probe speed and the accel you've posted will not show the errors behind 1) but faster probing or less accel certainly will. You will however more than likely see the effects of 2).

I'm left guessing then that the pitting you're seeing is probably down to not getting good electrical contact until you've pushed hard enough against the plate. If this IS the case then a sprung plate is not going to help for obvious reasons. Either way - I'd junk that macro if I were you.
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: Jerry In Maine on April 23, 2014, 10:11:26 AM
Ok, understood, thanks.
Is there a macro that's preferred? I've tried a couple others with similar results so I obviously don't know a good  one from a poor one.
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: ger21 on April 23, 2014, 10:17:17 AM
Read through this thread.
http://www.cnczone.com/forums/cnc-wood-router-project-log/36099-another-aussie-auto-tool-zero-setter.html
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: stirling on April 23, 2014, 11:14:56 AM
What -  all 44 pages of it Gerry?  ;D

Just a comment about the code presented on the first page.

The line:

Code "G4 P0.25" 'Pause for Dro to update.

would be better replaced by a while isMoving loop. The problem is I'm pretty sure that using a G4 for temporarily blocking the macro is version dependent and anyway, the wait is needed by the macro thread not by the Mach thread. A while isMoving() guarantees it's the CB that waits.

Ian
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: ger21 on April 23, 2014, 11:44:58 AM
I use Sleep(250) in my macros. Not sure if it's the right way, but it works. Not for waiting for movement to stop, but just for slight delays or pauses.

I know there were several changes made to that macro along the way. I'd start at the last page and work forward to find the latest version.
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: mbele on April 23, 2014, 05:53:18 PM
I made spring loaded touch plate just a few weeks ago and it was a big improvement over fixed touchplate for me.

Before that I've been using fixed PCB touch plate connected via switch to estop input, so my machine would stop as rapid as it could when the plate was touched. Then I would isolate the plate from estop with a switch, reset Mach, and manualy enter Z offset. In that scenario feed(v) can be calculated if max overtravel(s) and acceleration(a) are known: v=sqrt(2as). Actually, i'm pretty sure that motors decelerate faster in case of e-stop, and machine position is lost by some number of steps (depending on the feed rate), but it worked OK, especially because PCB material is relatively soft.
In my example, a=2000mm/s^2, s=0.0125mm (one microstep), v=sqrt(2*2000*0.0125)=~7mm/s=420mm/min

Spring loaded brass plate is housed in POM-C case (since my machine is made of metal and it's grounded), connected to probe input, and it works on the same principle of closing electrical circuit (instead of using microswitch). Spring allows plate to travel a few mm, which allows Mach3 to decelerate (and sleep while isMoving()) when the probe signal is activated. Then the tool retracts rapid to touch position, and then retracts slowly step-by-step until electrical connection has been broken for at least second and a half. It's very acurate and I haven't broken any endmills/tips yet. I will share the script if you want, it's based on the script found on this forum.

Now, stirling got me worried about accuracy/unpredictability of trip point:
Quote
2) Perhaps worse though is that because its attempt to store the stop point may well fail, the retraction will be pretty random/un-predictable and in worst case could seriously crunch your tool tip/plate.
so I'll make rapid retract conditional in respect to current tool position.


Title: Re: Spring loaded touch plates for Z auto-zero
Post by: Jerry In Maine on April 23, 2014, 06:50:11 PM
Thanks but I seem to have a script working. Did some research today and cobbled one together from examples in several threads here. Seems to be very accurate and repeatable. I'm using a spring loaded plate I made earlier.

The fine points on my v carving bits were taking a beating on the fixed plate. Even a slight overshoot can chip the tips, especially on the lower angled bits. Now they come down on what amounts to a cushion and I don't seem to have to sacrifice accuracy.
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: ger21 on April 23, 2014, 06:54:54 PM
Quote
I made spring loaded touch plate just a few weeks ago and it was a big improvement over fixed touchplate for me.

Yeah, because of the way you were using it.
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: Greolt on April 23, 2014, 07:29:06 PM
I know there were several changes made to that macro along the way. I'd start at the last page and work forward to find the latest version.

Yeah that is a long thread.  I started it 7 years ago.  :)

There are more ways of writing a script than you can poke a stick at. Imagine asking 50 people to write down how to tie your shoelaces.

You would get 50 different texts that would most all achieve the same outcome.

Here is what I use.

CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state

If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P2" ' this delay gives me time to get from computer to hold probe in place
Code "G90 G31Z-20 F100" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the exact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, 1.5) ' change 1.5 to your plate thickness and then adjust for final accuracy
Sleep 200 'Pause for Dro to update.
Code "G1 Z20 F800" 'put the Z retract height you want here, must be greater than the touch plate thickness
While IsMoving ()
Wend
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Code "F" &CurrentFeed 'Returns to prior feed rate
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if applicable
End If
If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
Code "G91"
End If
If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
Code "G0"
End If


Of course this is in modern metric units, if you use medieval units then change as appropriate.
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: Jerry In Maine on April 23, 2014, 07:30:48 PM
This comprises most of the script that I'm using. Works great! Thanks for it!
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: stirling on April 24, 2014, 07:38:47 AM
@Michael (mbele) - I'll give you 10 out of 10 for creativity. Sadly your scheme is based on an incorrect assumption. G31 is polled at kernel speed i.e. after each and every single step whereas Mach continues to put out steps for 1/10th second after E-Stop goes active. Surprising perhaps - but true here with the PP.

G31 is step accurate. You can't get more accurate than that.

The fine points on my v carving bits were taking a beating on the fixed plate. Even a slight overshoot can chip the tips

If G31 is used below the speed which requires a deceleration phase then it stops within ONE step - on your machine that's 0.0006 inches. I doubt that movement even gets transmitted to the spring - never mind actually deflects it.

Now they come down on what amounts to a cushion and I don't seem to have to sacrifice accuracy.

How can you NOT be losing accuracy if the plate moves?

I can see only ONE reason why the plate moves if you're probing slow enough and that's because you're not getting good electrical contact. Switch cleaner might be worth a consideration.

Now, stirling got me worried about accuracy/unpredictability of trip point:
Quote
2) Perhaps worse though is that because its attempt to store the stop point may well fail, the retraction will be pretty random/un-predictable and in worst case could seriously crunch your tool tip/plate.
so I'll make rapid retract conditional in respect to current tool position.

You're mis-quoting my quote. You said trip point - I said stop point.

I was pointing out that in the first macro posted, the author was storing the STOP point in the DRO - NOT the TRIP point. More importantly though he then went on to command movement immediately afterwards that was based on that DRO. This is a no-no unless you want tears before bed-time.
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: Jerry In Maine on April 24, 2014, 07:49:10 AM
This is what I know...

I can auto-zero onto my spring loaded plate, then enter G0Z1 on the MDI screen. I then check the bit height with a 1-2-3 block as a gauge and it fits under the bit perfectly time after time.
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: mbele on April 24, 2014, 07:54:44 AM
Stirling, thank you, for the kind words and great info. I'm sorry I missunderstood and missquoted you, probably causing confusion.
Title: Re: Spring loaded touch plates for Z auto-zero
Post by: stirling on April 24, 2014, 08:21:04 AM
This is what I know...

I can auto-zero onto my spring loaded plate, then enter G0Z1 on the MDI screen. I then check the bit height with a 1-2-3 block as a gauge and it fits under the bit perfectly time after time.

I understand. If it's doing what you want then to you that's all that matters. From my perspective I like to know WHY things are as they are. Anyway - happy probing.

@michael - no worries.