Hello Guest it is March 28, 2024, 05:51:59 PM

Author Topic: Mach3 Auto Z Won't Retract  (Read 8076 times)

0 Members and 2 Guests are viewing this topic.

Re: Mach3 Auto Z Won't Retract
« Reply #10 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
« Last Edit: April 25, 2016, 02:32:12 AM by ozymax »

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Mach3 Auto Z Won't Retract
« Reply #11 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
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Mach3 Auto Z Won't Retract
« Reply #12 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,

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Mach3 Auto Z Won't Retract
« Reply #13 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
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Mach3 Auto Z Won't Retract
« Reply #14 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!

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Mach3 Auto Z Won't Retract
« Reply #15 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.
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Mach3 Auto Z Won't Retract
« Reply #16 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.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Mach3 Auto Z Won't Retract
« Reply #17 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?
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Mach3 Auto Z Won't Retract
« Reply #18 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!
Re: Mach3 Auto Z Won't Retract
« Reply #19 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?