Hello Guest it is April 18, 2021, 11:01:41 PM

Author Topic: Spring loaded touch plates for Z auto-zero  (Read 7620 times)

0 Members and 1 Guest are viewing this topic.

Offline ger21

*
  • *
  •  6,289 6,289
    • View Profile
    • The CNC Woodworker
Re: Spring loaded touch plates for Z auto-zero
« Reply #10 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.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline mbele

*
  •  58 58
    • View Profile
Re: Spring loaded touch plates for Z auto-zero
« Reply #11 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.


Re: Spring loaded touch plates for Z auto-zero
« Reply #12 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.
« Last Edit: April 23, 2014, 06:53:26 PM by Jerry In Maine »

Offline ger21

*
  • *
  •  6,289 6,289
    • View Profile
    • The CNC Woodworker
Re: Spring loaded touch plates for Z auto-zero
« Reply #13 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.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline Greolt

*
  •  956 956
    • View Profile
Re: Spring loaded touch plates for Z auto-zero
« Reply #14 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.
Re: Spring loaded touch plates for Z auto-zero
« Reply #15 on: April 23, 2014, 07:30:48 PM »
This comprises most of the script that I'm using. Works great! Thanks for it!

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Spring loaded touch plates for Z auto-zero
« Reply #16 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.
« Last Edit: April 24, 2014, 07:48:55 AM by stirling »
Re: Spring loaded touch plates for Z auto-zero
« Reply #17 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.

Offline mbele

*
  •  58 58
    • View Profile
Re: Spring loaded touch plates for Z auto-zero
« Reply #18 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.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Spring loaded touch plates for Z auto-zero
« Reply #19 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.