Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: jackson74 on April 24, 2016, 12:02:34 AM

Title: Mach3 Auto Z Won't Retract
Post by: jackson74 on April 24, 2016, 12:02:34 AM
Having problems getting the Auto Z and touch plate/probe to retract.

Any ideas?  I am not a programmer and am lost...

What needs to go here:

Code "G0 Z" &Retract+PlateThickness 'put the Z retract height you want here

My retract is 0.10"
My PlateThickness is 0.787402"

Thank you
Title: Re: Mach3 Auto Z Won't Retract
Post by: kolias on April 24, 2016, 12:42:36 AM
I use the following script and its working well on my cnc router

Message( "Auto Zeroing..." )
If IsSuchSignal (22) Then
code "G31 Z-2 F20"
While IsMoving()
Wend
Call SetDRO( 2, .125 )
code "G1 Z1"
End If

On the line Call SetDRO( 2, .125 )
replace the .125 with your plate thicknes
Title: Re: Mach3 Auto Z Won't Retract
Post by: jackson74 on April 24, 2016, 01:44:27 AM
Thanks, it still does not retract at all though... yours pulls back?

Title: Re: Mach3 Auto Z Won't Retract
Post by: kolias on April 24, 2016, 07:27:54 AM
Yes mine retracts too

You should provide more info if you want others to give you a hand like is it a new install, machine type, BOB type etc. Look at this thread for a problem I had with my Z, perhaps you may find it helpful

http://www.machsupport.com/forum/index.php/topic,32054.0.html
Title: Re: Mach3 Auto Z Won't Retract
Post by: ger21 on April 24, 2016, 08:19:48 AM
Your missing lines earlier in your code that should say:
PlateThickness = 0.787402
Retract = 0.1

Or, you could just use:

Code "G0 Z0.878402"
Title: Re: Mach3 Auto Z Won't Retract
Post by: jackson74 on April 24, 2016, 01:10:27 PM
Quote
Your missing lines earlier in your code that should say:
PlateThickness = 0.787402
Retract = 0.1

Or, you could just use:

Code "G0 Z0.878402"

Thanks, I actually had these lines in the code and played with them for an hour before coming in here for help.  I had it all set up a couple weeks ago but bought a Vista MPG and set that up.  I upgraded to Windows 10 before realizing Mach3 would not run with Windows 10.  I tried to uninstall and reinstall Mach3 on 10, then realized I lost all my Mach3 codes I did.  Really wish I remembered to copy the Auto Z code. I swear I am going though the same thing but it does no retract for some reason.  I get it to put the plate thickness in the DRO and to say "Z is Zeroed" in the window, but the bit sits touching the plate.  In the diagnostic screen the "green" light stays lit as well unless I manually back the bit off.

I will try again in a bit, not sure what I am missing.

Title: Re: Mach3 Auto Z Won't Retract
Post by: ger21 on April 24, 2016, 01:36:13 PM
You need to show the entire code, but it's probably not reading your plate thickness DRO.
Title: Re: Mach3 Auto Z Won't Retract
Post by: jackson74 on April 24, 2016, 08:23:07 PM
Thanks,

I have been trying basically different things with this code: It was the original one I had working  before I tweaked things and forgot what I did...

CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
PlateThickness =  0.787402
Retract = 0.10

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 "G31Z-1 F4" '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 "G1 Z1" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, .887402) 'set the Z axis DRO to whatever is set as plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
Code "G0 Z.887402"  'put the Z retract height you want here
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
Exit Sub
End If
Title: Re: Mach3 Auto Z Won't Retract
Post by: ger21 on April 24, 2016, 09:24:57 PM
Call SetDro (2, .787402) 'set the Z axis DRO to whatever is set as plate thickness
Title: Re: Mach3 Auto Z Won't Retract
Post by: jackson74 on April 25, 2016, 12:57:15 AM
I have tried that, just did again... 

I have tried every combination of numbers in those key areas, took out code and put it back in with no luck.

The DRO reading will change but the Z will not pull back off the probe plate.

Is the top part Retract = .10 the only thing telling it to retract?

TIA
Title: Re: Mach3 Auto Z Won't Retract
Post by: ozymax on April 25, 2016, 02:24:01 AM
Here is the script code I use and it has always worked for me.
My plate is 1.5mm and it retracts 10mm from the plate.

I did notice that I have a line different to yours. I've highlighted it in red.
Maybe mine isn't correct, but it works. ???

CurrentFeed = GetOemDRO(818)
PlateThickness =  1.5
If GetOemLed (825)=0 Then
DoOEMButton (1010)
Code "G4 P2"
Code "G31 Z-5 F100"
While IsMoving()
Wend
ZProbePos = GetVar(2002)
Code "G0 Z" &ZProbePos
While IsMoving ()
Wend
Call SetDro (2, PlateThickness)
Code "G4 P0.25"
Code "G0 Z10"
Code "(Well done the Z axis is now zeroed)"
Code "F" &CurrentFeed
Else
Code "(Z-Plate is grounded, check connection and try again)"
Exit Sub
End If
Title: Re: Mach3 Auto Z Won't Retract
Post by: ger21 on April 25, 2016, 07:02:09 AM
No, you had this:
Call SetDro (2, .887402) 'set the Z axis DRO to whatever is set as plate thickness

It should be this:
Call SetDro (2, .787402) 'set the Z axis DRO to whatever is set as plate thickness
Title: Re: Mach3 Auto Z Won't Retract
Post by: jackson74 on April 25, 2016, 01:06:50 PM
Quote
No, you had this:
Call SetDro (2, .887402) 'set the Z axis DRO to whatever is set as plate thickness

It should be this:
Call SetDro (2, .787402) 'set the Z axis DRO to whatever is set as plate thickness

Correct, but I had it with the .787402 before and then tried it again after you wrote this and it still does not retract.  If I put the .887402 it does not retract but the DRO will read the correct number.


so with the Call SetDro (2, .787402) 'set the Z axis DRO to whatever is set as plate thickness code the DRO reads .787402 and does not retract.

Thanks for the help,
Title: Re: Mach3 Auto Z Won't Retract
Post by: ger21 on April 25, 2016, 07:26:30 PM
Try this. You had some other issues in there as well:


Sub Main()

CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
PlateThickness =  0.787402
Retract = 0.10

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 "G31 Z-1 F4" '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 "G1 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
Sleep(250)
Code "G0 Z" & Retract 'put the Z retract height you want here
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
Exit Sub
End If

End Sub
Title: Re: Mach3 Auto Z Won't Retract
Post by: jackson74 on April 25, 2016, 10:57:52 PM
No luck, it did not retract nor put any change in the DRO nor say "Z axis is now zeroed" at the contact.

Is there anything I needed to input into this code?

Thanks!
Title: Re: Mach3 Auto Z Won't Retract
Post by: ger21 on April 26, 2016, 06:50:49 AM
Are you sure your not running a different copy of this macro? It sounds like your editing a different macro then the one you're actually running.
Title: Re: Mach3 Auto Z Won't Retract
Post by: jackson74 on April 26, 2016, 01:46:47 PM
Not sure, I am new to this but some changes make changes to the DRO so I assume it is in the correct place.

Click the button in the one area ( I forget the path) but all the buttons blink.  I click on the Auto Z one and an editor opens which I past the code and save.

Not sure if there is something else I need to do.
Title: Re: Mach3 Auto Z Won't Retract
Post by: ger21 on April 26, 2016, 07:55:37 PM
Are you using a parallel port, or a motion controller? If a motion controller, which one?
Which version of Mach3?
Title: Re: Mach3 Auto Z Won't Retract
Post by: jackson74 on April 26, 2016, 09:48:26 PM
I use a parallel port with a Vista M1 usb pendant.

I use : Mach3Version3.043.062

Thanks!
Title: Re: Mach3 Auto Z Won't Retract
Post by: jackson74 on April 28, 2016, 05:30:06 PM
I think in the "diagnostics" tab when I would make the connection between the plate and bit that a yellow light would also come on?  Now only a green light comes on when I touch the bit to the plate for a test?

Title: Re: Mach3 Auto Z Won't Retract
Post by: ger21 on April 28, 2016, 06:18:01 PM
The Digitize LED should light up when you touch the plate.

The macro I posted above should be working, so I don't know what else it could be.