Hello Guest it is October 17, 2019, 04:53:45 AM

Author Topic: Auto Tool Zero / Touch Plate issues  (Read 6715 times)

0 Members and 1 Guest are viewing this topic.

Auto Tool Zero / Touch Plate issues
« on: July 24, 2013, 02:03:24 PM »
Hey all,
I've been trying to set up a touch plate, and having little to no success. I'm using the script that seems to have been going around for a few years:

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 = .028 '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-5 F5" '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 Z0.5 F10" '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 

The main issue is that GetVar(2002) always returns "0" regardless of where the probe touched.
Also, I hard-coded the plate thickness, since GetUserDRO(1151) also always returned "0" (I entered the thickness in both of the "Gage (sic) Block Height" DROs in the Offsets tab -- why are there two anyway?)

Any help is greatly appreciated.

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: Auto Tool Zero / Touch Plate issues
« Reply #1 on: July 24, 2013, 04:49:20 PM »
Also, I hard-coded the plate thickness, since GetUserDRO(1151) also always returned "0" (I entered the thickness in both of the "Gage (sic) Block Height" DROs in the Offsets tab -- why are there two anyway?)

Does your screenset have a DRO #1151? If not, you'll need to add one for that call to work.
The two gauge block DRO's each have a button next to them, that have different functions. The buttons read the data from the adjacent DRO's. One button is for setting the Z zero position, the other is for setting a tool length offset.


Quote
The main issue is that GetVar(2002) always returns "0" regardless of where the probe touched.

The probe is actually working, but it's not setting the DRO?
How are you checking the value of GetVar(2002)?

Try adding

msgbox ZProbePos

after

 ZProbePos = GetVar(2002)

and see what you get.
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Auto Tool Zero / Touch Plate issues
« Reply #2 on: July 24, 2013, 07:57:02 PM »
Hi Gerry, thanks for the reply.
I'm using the default screenset, so no idea if it has DRO # 1151 or not. I thought it was one of those two "gage" block DROs, since that's what the image next to them is showing. Not a big deal, since the height of the gauge block won't change.

The probe itself works fine. I stepped through the code, added a breakpoint and checked the value that way (same end result as adding a msgbox), and it always returns "0"
Re: Auto Tool Zero / Touch Plate issues
« Reply #3 on: August 01, 2013, 04:28:46 PM »
Any additional help? Thanks in advance.

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: Auto Tool Zero / Touch Plate issues
« Reply #4 on: August 01, 2013, 06:09:28 PM »
Your probe is wired to the Probe input in ports and pins > Input pins?

Do you have a valid license file?

I honestly have never heard of this before. And thousands of people do this in Mach3 all the time.
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline BR549

*
  •  6,902 6,902
    • View Profile
Re: Auto Tool Zero / Touch Plate issues
« Reply #5 on: August 01, 2013, 08:10:08 PM »
Remember you can always use the Var monitor to see the values as they change.

Just a thought, (;-) TP
Re: Auto Tool Zero / Touch Plate issues
« Reply #6 on: August 01, 2013, 08:50:17 PM »
Thanks for the replys.
Gerry, it's wired to port 1, pin 7, and in the Diagnostics screen, the Digitize light is lit when the circuit is completed.
I assume it's a valid version, I bought the whole shebang (cnc router, laptop, mach3) second-hand.

I did inadvertently hit the "Remember" button under the Auto Tool Zero button if that makes a difference.

I'm sure it's something that I'm missing.

Thanks again.

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: Auto Tool Zero / Touch Plate issues
« Reply #7 on: August 01, 2013, 10:36:50 PM »
On the Input Pins page it says you can only use pins 10-13 and 15.
Pin 7 is an output pin only.
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Auto Tool Zero / Touch Plate issues
« Reply #8 on: August 02, 2013, 04:04:19 PM »
Weird. On my Input Signals tab (Config/Ports and Pins), all the enabled signals are Port 1, and pins from 1-5, 7, and 9-32 assigned to the various signals...

At any rate, back to the original issue, anyone have an idea why the script isn't resetting the Zero Z DRO?

Thanks!

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: Auto Tool Zero / Touch Plate issues
« Reply #9 on: August 02, 2013, 05:15:22 PM »
Are you using a motion controller? If so, which one? Sounds like your motion controller isn't handling probing correctly.
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html