Hello Guest it is October 17, 2019, 04:46:40 AM

Author Topic: Auto Tool height does not set correctly. Help.  (Read 3772 times)

0 Members and 1 Guest are viewing this topic.

Auto Tool height does not set correctly. Help.
« 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  

  

Offline Tweakie.CNC

*
  • *
  •  7,950 7,950
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Auto Tool height does not set correctly. Help.
« Reply #1 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.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
Re: Auto Tool height does not set correctly. Help.
« Reply #2 on: July 01, 2017, 05:24:24 AM »
thanks for taking a look.

Offline Tweakie.CNC

*
  • *
  •  7,950 7,950
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Auto Tool height does not set correctly. Help.
« Reply #3 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.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
Re: Auto Tool height does not set correctly. Help.
« Reply #4 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.
Re: Auto Tool height does not set correctly. Help.
« Reply #5 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.

Offline Tweakie.CNC

*
  • *
  •  7,950 7,950
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Auto Tool height does not set correctly. Help.
« Reply #6 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.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.

Offline TPS

*
  •  1,389 1,389
    • View Profile
Re: Auto Tool height does not set correctly. Help.
« Reply #7 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

anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Auto Tool height does not set correctly. Help.
« Reply #8 on: July 06, 2017, 09:45:13 PM »
Hi Guys,

I will test this out, thanks for giving this your time.

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: Auto Tool height does not set correctly. Help.
« Reply #9 on: July 07, 2017, 06:09:36 PM »
Or oemdro 800 I think.
Gerry

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

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