Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Culturebeast on January 28, 2017, 12:15:53 PM

Title: Set tool height zero - Z axis retracts wrong way
Post by: Culturebeast on January 28, 2017, 12:15:53 PM
Hi
Does anyone in this great forum, have any experience with the phenomena, where the Z-axis during a "set tool height zero" using a probe, on the retract motion, continues to go down (negative) towards the probe/table, BUT, the Z- axis DRO counts up (positive) on the Mach3 screen?

After the motion, set to 30mm. in the macro, it stops and the DRO for the Z-axis counts correct again (UP counts positive, DOWN count negative) But the retraction of the Z-axis vent the wrong way.

Hope for your help  ;)
Thanks Brian
Title: Re: Set tool height zero - Z axis retracts wrong way
Post by: ger21 on January 28, 2017, 06:50:45 PM
Need to see your macro.
Title: Re: Set tool height zero - Z axis retracts wrong way
Post by: Culturebeast on January 29, 2017, 08:08:25 AM
Hi
I have made some macro modifications since yesterday, thanks to an instruction video from "gurubrew" youtube  /watch?v=G4DeVa8rzA0 Good instruction!

There is progress in the way, that the Z-axis does not retract as much in the wrong way as before. I'll explain.. The Z-axis still (sometimes) moves down towards the probe/table even though the tool activates the probe, (just a few millimeters), before the Z-axis retracts.
But the machine does'nt do it every time, and it does'nt seem to be systematic.  ???
It most often seems like the machine "notice" the activation of the probe, but then contiues a few millimeters before retracting, instead of retracting imideatly.
The probe works
Hope it makes some kind of sence  :)
Well here's the macro:

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 P5" ' this delay gives me time to get from computer to hold probe in place
Code "G90 G31Z-30. 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 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, 32.20) 'change 32.20 to your plate thickness and then adjust for final accuracy
sleep 200 'Pause DRO to update
Code "G1 Z40. F400" 'put the Z retract height you want here
While IsMoving() 'wait while it happens
Wend
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Code "F" &CurrentFeed 'Returns to prior feedrate
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
End If
Title: Re: Set tool height zero - Z axis retracts wrong way
Post by: ger21 on January 29, 2017, 08:27:04 AM
What version of Mach3 are you using? If using 3.043.066, then try 3.043.062.

Are you using the parallel port, or a motion controller?
Title: Re: Set tool height zero - Z axis retracts wrong way
Post by: Culturebeast on January 29, 2017, 12:50:07 PM
Have to check up on the mach3 version, but the machine has a Break out Board connected via UC100 usb adapter.
Title: Re: Set tool height zero - Z axis retracts wrong way
Post by: ger21 on January 29, 2017, 12:50:58 PM
My guess is that it's an issue with the Mach3 version.
Make sure you have the latest UC100 plugin as well.
Title: Re: Set tool height zero - Z axis retracts wrong way
Post by: Culturebeast on January 30, 2017, 11:22:51 AM
Thank you!! Definitely worth a try :-) I'll check it out and get back to you.

Again,- thank you!

Brian
Title: Re: Set tool height zero - Z axis retracts wrong way
Post by: Culturebeast on February 01, 2017, 09:45:40 AM
I am very happy!
It seemed to be a UC100 update that was needed. Perfect!

Thanks Gerry

Brian
Title: Re: Set tool height zero - Z axis retracts wrong way
Post by: willfly4food on November 08, 2017, 03:54:29 PM
@Culturebeast Where did you find the update for the UC100?
Title: Re: Set tool height zero - Z axis retracts wrong way
Post by: willfly4food on November 08, 2017, 03:55:35 PM
I used the latest update from CNCdrive and i am still having this proplem
Title: Re: Set tool height zero - Z axis retracts wrong way
Post by: willfly4food on November 08, 2017, 04:16:52 PM
Sub Main() 'made it a sub, so you can return on "show stopper" errors
'Option Explicit 'Written by Big-Tex Dec 26 2010 Updated Jun 3 2014
'Mod pb 11dec10

Dim ZNew, Zplate, Zrestposition, ZMaterialmachcoord, ZPlatejobcoord, Zplatetomaterial
Dim xjobcoord, yjobcoord, xmachcoord, ymachcoord, zmachcoord
Dim xprobeloc, yprobeloc, xtoprobe, ytoprobe, PlateOffset
Dim CurrentFeed, Zretract
Dim CurrentAbsInc

xjobcoord = GetDRO(0) 'get current job coordinate for X
yjobcoord = GetDRO(1) 'get current job coordinate for Y
xmachcoord = GetOemDRO(83) 'get current machine coordinate for X
ymachcoord = GetOemDRO(84) 'get current machine coordinate for Y
zmachcoord = GetOemDRO(85) 'get current machine coordinate for Z
xprobeloc = GetUserDRO(1100) 'get X machine coordinate location of the touch plate
yprobeloc = GetUserDRO(1101) 'get Y machine coordinate location of the touch plate
xtoprobe = (xprobeloc - xmachcoord + xjobcoord) 'calculate the X move from the current location to the touch plate
ytoprobe = (yprobeloc - ymachcoord + yjobcoord) 'calculate the Y move from the current location to the touch plate
PlateOffset = GetUserDRO(1151) 'get plate offset DRO
CurrentFeed = GetOemDRO(818) 'get the current feedrate to return to later
Zretract = GetOemDRO(1202) 'get Z tool change location
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state

'//////// the block below will set all your reusable vars depending on Inch or mm.
'//////// this sets the vars so you only need ONE large block of probing code.

if GetOEMLED(801) Then 'ON = English Measure INCH
FirstProbeDist = 6.0 'first probe travel
FirstRetractDist = 0.1 'first probe retract travel
SecProbeDist = 0.25 'second probe travel
FirstProbeFeed = 10 'First Probe Feed Speed
SecondProbeFeed = 2 'Second Probe Feed Speed
Else 'OFF = Metric Measure MM
FirstProbeDist = 150.0 'first probe travel
FirstRetractDist = 3.0 'first probe retract travel
SecProbeDist = 6.0 'second probe travel
FirstProbeFeed = 300 'First Probe Feed Speed
SecondProbeFeed = 50 'Second Probe Feed Speed
End If

'//////// Error Condition checking code

If GetOemLED(16)<>0 Then 'Checks for machine coordinates
Code "(Please change to working coordinates)"
Exit Sub 'ERROR! exit the macro
End If

If GetOemLED(825)<>0 Then
Code "(Z-Plate Grounded Check connection and try again)"
Exit Sub 'ERROR! exit the macro
End If

'//////// Start Probing Code, Probe In -Z direction.MOVABLE PROBE PLATE
'//////// The vars will be Inch or Metric from above if/else statment

sleep(1000) 'pause 1 seconds to give time to position probe plate
Code "F" & FirstProbeFeed 'slow down feedrate to 10 ipm
ZNew = ( GetDro(2) - FirstProbeDist ) 'probe move to current z - 6 inches
Code "G90 G31Z" & ZNew
While IsMoving() 'wait for probe move to finish
Wend
ZNew = GetVar(2002) 'read the touch point
Code "G0 Z" & ( ZNew + FirstRetractDist ) 'move back to hit point incase there was overshoot +.1
While IsMoving ()
Wend
Code "F" & SecondProbeFeed 'slow down feedrate to 2 ipm
ZNew = ( GetDro(2) - SecProbeDist ) 'probe move to current z - .25 inches
Code "G90 G31Z" & ZNew
While IsMoving() 'wait for probe move to finish
Wend
ZNew = GetVar(2002) 'read the touch point
Code "G0 Z" & ZNew 'move back to hit point incase there was overshoot
While IsMoving ()
Wend
Call SetDro (2, PlateOffset) 'set the Z axis DRO to plate thickness
sleep(250) 'pause for Dro to update.
Code "G53 G0 Z" & Zretract
While IsMoving ()
Wend
Code "F" & CurrentFeed 'returns to prior feed rate

'//////// End Probing Code,

If GetOEMLED(801) Then 'ON = English Measure INCH
Code "(Z axis is now zeroed in English Units)" 'puts this message in the status bar
Else 'OFF = Metric Measure MM
Code "(Z axis is now zeroed in Metric Units)" 'puts this message in the status bar
End If

If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
Code "G91"
End If

End Sub
Title: Re: Set tool height zero - Z axis retracts wrong way
Post by: ger21 on November 08, 2017, 07:54:20 PM
In Mach3, go to Config > Plugins, then click on Config for the UC100 plugin, and you should get a window where you can download the latest plugin.
Title: Re: Set tool height zero - Z axis retracts wrong way
Post by: willfly4food on November 08, 2017, 08:04:24 PM
ok will try tomorrow. Thank you