Machsupport Forum

Third party software and hardware support forums. => SmoothStepper USB => Topic started by: Bravo1 on June 29, 2017, 11:30:57 PM

Title: Auto Tool height does not set correctly. Help.
Post by: Bravo1 on June 29, 2017, 11:30:57 PM
Hi, I've loaded this code into the Auto tool height button on Mach3 to set the X axis height (I'm using Z Axis for a lathe function, so it has been configured as the X Axis). When it runs it funds zero but then rises to some random height and sets the Axis to Zero (0). I've programmed zero (0) 'plate thickness' and 'retract' distance to exclude these as factors but still the problem persists. Mach3 appears to be finding some other value to apply. The Z Axis version of this works perfectly. I'm using SS via USB on a Syil X5 mill


'Lathe version is testing for X-Axis
CurrentAbsInc = GetOemLED (48) 'Copy current G90/G91 state
CurrentGMode = GetOemDRO (819) 'Copy current G0/G1 state
CurrentFeed = GetOemDRO (818) 'Copy current feedrate
Contact = 0 'Clear the contact flag
PlateThickness = 0.0 'Touch Plate thickness is set here
ProbeFeed = 40 'Probing feedrate is set here
SetVar (1, -15) 'Maximum probing distance is set here
SetVar (2, 0) 'Retract height is set here
Code "M5" 'Ensures spindle is not running
Code "G21" 'Ensure metric units are used
Xs = GetOemDRO (59) 'Copy current X-Scale DRO
Call SetOemDRO (59,1) 'Set X-Scale DRO to 1
Label1: 'Entry point for Retry
DoOemButton (1008) 'Zero X-Axis DRO
Code "(Setting Tool Zero)" 'Message for status bar
While IsMoving () 'Wait until task has been completed
Wend
If GetOemLED (825) = 0 Then 'Check to see if touch plate is already grounded
Code "G90 G31 X #1 F" & ProbeFeed 'Probing move
While IsMoving () 'Wait until task has been completed
Wend
If GetOemLED (825) = True Then 'Check to see if probe has touched plate
Contact = 1 'Set the contact flag
End If
ProbePos = GetVar (2000) 'Exact point probe touched
Code "G0 X" & ProbePos 'Go back to exact point of touch if there was any overrun
While IsMoving () 'Wait until task has been completed
Wend
Call SetOemDRO (2,PlateThickness) 'Set X-Axis DRO to Touch Plate thickness
Code "G0 X #2" 'Retract off Touch Plate the set distance
While IsMoving () 'Wait until task has been completed
Wend
Code "(X-Axis is now Zeroed.)" 'Message for status bar
Code "F" & CurrentFeed 'Restore feedrate to original setting
If Contact = 0 Then 'Probe reached max travel without touching
Code "(ERROR - Probe did not touch.)" 'Message for status bar
Response = MsgBox ("ERROR - Probe did not touch.",37,"Auto Tool Zero")
If (Response = 4) Then 'User chose Retry
GoTo Label1 'Retry Probing routine
End If
End If
Else
Code "(ERROR - Touch Plate is grounded.)" 'Message for status bar
Response = MsgBox ("ERROR - Touch Plate is grounded.",16,"Auto Tool Zero")
End If
Call SetOemDRO (59,Xs) 'Restore X-Scale DRO to original setting
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  

  

Title: Re: Auto Tool height does not set correctly. Help.
Post by: Tweakie.CNC on June 30, 2017, 06:18:22 AM
Hi Bravo1,

I thought I had an answer but subsequent testing disproved my theory.

I will keep thinking.

Tweakie.
Title: Re: Auto Tool height does not set correctly. Help.
Post by: Bravo1 on July 01, 2017, 05:24:24 AM
thanks for taking a look.
Title: Re: Auto Tool height does not set correctly. Help.
Post by: Tweakie.CNC on July 01, 2017, 06:19:17 AM
Hi Bravo1,

My machine which has the Smooth Stepper connected is more of less in constant use so I don't get much time for testing different things so a couple of thoughts for you to try:

I am assuming you are using Mach3 version R3.043.062 and the current (up to date) SS plugin and firmware ?

Can you try making the plate thickness and retract distance something other than zero - it could be a small amount, less than one step, anything other than zero and then see if this makes a difference ?

Does your incorrect rise height match the Z axis DRO ? (as if the Var(2000) was interpreting the Z axis DRO instead of the X axis DRO).

Tweakie.
Title: Re: Auto Tool height does not set correctly. Help.
Post by: Bravo1 on July 02, 2017, 04:21:32 AM
Hi Tweakie,

I will check it out tomorrow, thanks for the suggestions. I am using R3.043.062 version of Mach 3, not sure if I have the latest SS firmware.
Title: Re: Auto Tool height does not set correctly. Help.
Post by: Bravo1 on July 05, 2017, 09:47:06 PM
I've done some further testing and found the following; if PlateThickness is set to 10 and Retract (SetVar #2) is set to 20 then the Head should retract 20 minus the plate thickness and set X as 20.

Test Condition 1.
When:
PlateThickness = 0
Retract = 20
The head rise is 20mm + 7.96mm and X is set to 20.

Test Condition 2.
When:
PlateThickness = 10
Retract = 0
The head rise is 7.96 mm and X is set to zero.

It appears that the line >Call SetOemDRO (2,PlateThickness)< is not being seen. Originally this line was >Call SetDRO (2,PlateThickness)< but the Z Axis would be attributed with the updated Retract value (not the X Axis as was intended).

I've tried a few changes to this line but not found any solution and added >Sleep 500< after the ProbePos but it didn't make any difference.

Thanks in advance.
Title: Re: Auto Tool height does not set correctly. Help.
Post by: Tweakie.CNC on July 06, 2017, 01:05:50 AM
Quote
It appears that the line >Call SetOemDRO (2,PlateThickness)< is not being seen. Originally this line was >Call SetDRO (2,PlateThickness)< but the Z Axis would be attributed with the updated Retract value (not the X Axis as was intended).

Have you tried:   Call SetDRO (0,PlateThickness)   ?


Tweakie.
Title: Re: Auto Tool height does not set correctly. Help.
Post by: TPS on July 06, 2017, 07:57:48 AM
Hello Bravo1,

went through your code, i think , like tweakie, the Problem is:

Call SetOemDRO (2,PlateThickness) 'Set X-Axis DRO to Touch Plate thickness

OemDRO 2 is in my documentation -> Pulse Freq DRO

should be SetDRO(0,PlateThickness) 'Set X-Axis DRO to Touch Plate thickness

Thomas

Title: Re: Auto Tool height does not set correctly. Help.
Post by: Bravo1 on July 06, 2017, 09:45:13 PM
Hi Guys,

I will test this out, thanks for giving this your time.
Title: Re: Auto Tool height does not set correctly. Help.
Post by: ger21 on July 07, 2017, 06:09:36 PM
Or oemdro 800 I think.
Title: Re: Auto Tool height does not set correctly. Help.
Post by: Bravo1 on July 08, 2017, 06:55:05 AM
Hi Guys,

SetDRO(0,PlateThickness) worked fine....so thanks! (read; singing and dancing). I have realised that my Z version is doing something similar but I've yet to apply this change to the code. I'm away for a few days so will give it a go then.

I have another issue to raise but is this the best thread to raise it ? I want to auto tool height mills and drills down to 0.10 mm in diameter. They are too delicate to touch in a probe routine unless turning at high speed. Is there a way to use something other than a collision with a hard surface to 'capture' the event?

Kind regards

Bravo1.
Title: Re: Auto Tool height does not set correctly. Help.
Post by: RICH on July 08, 2017, 08:19:22 AM
Bravo1,
I would suggest that you use a slow probe rate as that will minimize the overtravel.
It's very small at a slow  feedrate. Here is link to some probing info:

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

Now on the practical side, I doubt very much that you can even measure the overtravel and the overtravel
amount can vary and is dependant on the accuracy of YOUR system. I'll add that with small diameter drills
a top quality chuck and alignment are required.

RICH

Title: Re: Auto Tool height does not set correctly. Help.
Post by: TPS on July 08, 2017, 12:37:44 PM
or you try something like this:
(https://i.ebayimg.com/thumbs/images/g/S7gAAOxy3yNTfQx3/s-l225.jpg)

sorry don't know the englisch word for this Thing.

something like tool lenght sensor.

Thomas
Title: Re: Auto Tool height does not set correctly. Help.
Post by: Bravo1 on July 13, 2017, 01:30:45 AM
Hi Rich and TPS,

thanks for your comments.

Rich, I can see from your work that a slow feed rate should return a result that is as good as possible. My trouble is that even at slow feed rates a 0.10 mm drill must be rotating at high speed or it will snap at insignificant pressure. It occurred to me that there may be a 'non pressure' system that could be used.

TPS, does your picture have a link or name? Is it 'non pressure'?

Thanks

Bravo1
Title: Re: Auto Tool height does not set correctly. Help.
Post by: RICH on July 13, 2017, 06:29:54 AM
Bravo1,
Smallest drill size I have touched off was an #87 (.010), but, as you say your going down approx.  1/2 of a  #97 (.006").
Hmm...... 0.1mm is just a human hair in diameter at .004" so understand your concern.

Curious, what are you drilling and what federate and  rpm are you using?
Are you using cnc to peck drill with that size?
Use Mascot drills?

RICH

  

Title: Re: Auto Tool height does not set correctly. Help.
Post by: TPS on July 13, 2017, 04:16:07 PM
Hi,
as i have written, i don't know the english Translation for this thing.

if you Google for "cnc tool presetter" i think you will get into the wright direction.

Thomas