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 "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?
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