Hello Guest it is March 28, 2024, 05:43:14 AM

Author Topic: Z Zero touchplate oddity...  (Read 4146 times)

0 Members and 1 Guest are viewing this topic.

Offline Zaae

*
  •  120 120
    • View Profile
Z Zero touchplate oddity...
« on: June 02, 2010, 02:18:32 PM »
Hey guys,

EDIT: Oops, forgot to mention, parallel port driven steppers, no smoothstepper. Everything else seems to be working fine.

I've been using the code below for quite a while for my Z zero touch plate. I'm not sure why, but something odd has started happening recently.

I get everything ready, click the button, the Z axis starts coming down, hits the touch plate, then shoves itself down another 1.5-2mm, then retracts to an inaccurate reading. Needless to say, that's not so good for the bit.

The problem seems to be coming from this line. If I remove the line, the downward motion doesn't happen.
Code: [Select]
Code "G0 Z" &ZProbePos 'go back to that point
I double checked, and yes, positive numbers are supposed to make the axis go up, not down. All I can guess is that it's getting a strange reading into the ZProbePos variable. I disabled my macro pump script, but that made no difference.

Any ideas?

Code: [Select]
PlayWave ("SOUNDS\AUTOZZERO.WAV")

CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
PlateThickness = 2.40 'GetUserDRO(2.40) 'Z-plate thickness DRO

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" ' two second delay
Code "G31 Z-80 F100" 'Z goes down a max of 20mm at 100mm/min
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
While IsMoving ()
Wend
Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
Code "G0 Z4" 'retract Z to 4 mm
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)"
Exit Sub
End If
« Last Edit: June 02, 2010, 02:24:54 PM by Zaaephod »
Re: Z Zero touchplate oddity...
« Reply #1 on: June 03, 2010, 05:28:22 AM »
Have you got a tool offset enabled ?

In my version of the tool zero script i turn off all offsets

Phil
The Good Thing About Mach3, Is It's very Configurable

The Bad Thing About Mach3, Is It's Too Configurable

Offline Zaae

*
  •  120 120
    • View Profile
Re: Z Zero touchplate oddity...
« Reply #2 on: June 03, 2010, 09:54:12 AM »
I don't use them, so I shouldn't have, but I'll check when I get back. Thanks :)

Offline budman68

*
  • *
  •  2,352 2,352
    • View Profile
Re: Z Zero touchplate oddity...
« Reply #3 on: June 03, 2010, 11:52:04 AM »
Hi Zaaephod,

Just thought I'd offer up the code that I'm using with my touchplate. It's the latest version that I know of and I haven't had any issues, and I use it ALL the time.

Obviously some of the settings may be different for you so use with caution.

Dave

Code: [Select]
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
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO

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 F10" '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 axact 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, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
Code "G1 Z.250 F60" 'put the Z retract height you want here
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 aplicable
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
Exit Sub

----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline Tarak

*
  •  229 229
    • View Profile
Re: Z Zero touchplate oddity...
« Reply #4 on: June 04, 2010, 06:33:28 PM »
I was having exactly the same problem, I added a line to zero Z axis before it started to move down, now everything works fine.