Hello Guest it is March 09, 2021, 01:45:18 AM

Author Topic: Auto Zero  (Read 28323 times)

0 Members and 1 Guest are viewing this topic.

Offline Toad

*
  •  58 58
    • View Profile
Auto Zero
« on: October 29, 2009, 03:55:46 PM »
I need your assistance, How can I get the Z- auto zero to work?  I have Mach-3 configured for the probe set up on a board output #14, The board is grounded to the router. What else do I need to do to get the auto zero to work?

Offline ger21

*
  • *
  •  6,289 6,289
    • View Profile
    • The CNC Woodworker
Re: Auto Zero
« Reply #1 on: October 29, 2009, 06:12:21 PM »
Do you have the VB code? Lots of info here.

http://cnczone.com/forums/showthread.php?t=36099
« Last Edit: October 29, 2009, 06:16:16 PM by ger21 »
Gerry

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

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

Offline Greolt

*
  •  956 956
    • View Profile
Re: Auto Zero
« Reply #2 on: October 29, 2009, 06:49:43 PM »
Yes there is a lot of info about.  That thread and others.

One of the first things you will need to do is use an input not an ouput.

Greg

Offline Chaoticone

*
  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: Auto Zero
« Reply #3 on: October 29, 2009, 07:16:45 PM »
This may help. There is better code floating around I'm sure. The post Gerry pointed you to probably has a good macro in it. Mine works but could have more checks in it.

http://www.machsupport.com/forum/index.php/topic,10088.0.html
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline Toad

*
  •  58 58
    • View Profile
Re: Auto Zero
« Reply #4 on: October 31, 2009, 11:28:04 AM »
Good day Chaoticone:

I pasted the script, and I get an Script compile error.  Any Idea what I did wrong?

I went to the operator tab, edit button script. The button began to blink and I pasted the code in.

Toad

Offline Chaoticone

*
  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: Auto Zero
« Reply #5 on: October 31, 2009, 12:46:59 PM »
I'm not sure unless you had my signuture at the end. If it is a later version of Mach it could have issues as well. Here is an updated one for later versions of Mach.

'Auto Tool Zero Script

CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
PlateThickness =0.059
ProbeFeed = 5

Code "G90 F" &ProbeFeed

If GetOemLed (825)=0 Then
Code "G4 P5000" 'Time to get to the z-plate
Code "G31Z-5 F" &ProbeFeed
Code "G4 P0.25"
While IsMoving()
Sleep(100)
Wend
ZProbePos = GetVar(2002)
Code "G0 Z" &ZProbePos
While IsMoving ()
Sleep(100)
Wend
Call SetDro (2, PlateThickness)
Sleep(100)
Code "G4 P0.5" 'Pause for Dro to update.
Code "G0 Z0.25" 'Change the Z retract height here
Code "(Z axis is now zeroed)"
Code "F" &CurrentFeed
Else
Code "(Z-Plate is grounded, check connection and try again)"
Exit Sub
End If 
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline Toad

*
  •  58 58
    • View Profile
Re: Auto Zero
« Reply #6 on: October 31, 2009, 06:39:02 PM »
Thanks,

I'll try this one and let you know. I do appreciate your assistance and patience.

Toad

Offline Toad

*
  •  58 58
    • View Profile
Re: Auto Zero
« Reply #7 on: October 31, 2009, 08:41:24 PM »
OK , One more time, I still get a script compile error.  Must be me, but I am pasting everything from auto zero script down to end if.

Don't know enough to know what I an doing wrong.

Toad

Offline Greolt

*
  •  956 956
    • View Profile
Re: Auto Zero
« Reply #8 on: November 01, 2009, 01:39:06 AM »
I tried the above posted script and do not get any compile errors.

However there are a couple of problems in its operation.

The first is that if you have G04 dwell time set to seconds in General Config, (the default setting) then 5000 seconds is too long to wait.  My coffee would go cold while I waited.

And if you have it set to MS, then the other G04 delays are so short as to be irrelevant.  Something like Sleep 100 would be more appropriate.

The other issue is, if a user started this script with Z axis DRO at say -6, then the first move will be in an unexpected direction.

I really hate it when a CNC machine I am operating does something I do not expect.  :)

Either zero the Z axis DRO prior to the G31, or do  G91 G31 Z-5  probe move.

Greg
« Last Edit: November 01, 2009, 01:52:13 AM by Greolt »

Offline Chaoticone

*
  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: Auto Zero
« Reply #9 on: November 01, 2009, 08:38:02 AM »
Greg, your right. That is my personal touch off routine set up up for my machine and it works well with it but it could cause others problems. We need to come up with a standard auto zero script taking into account all possibilities. Metric/Imperial, abs./inc., ms/s etc.   :)  There are a lot of auto zero scripts floating around but I haven't seen one that everyone was happy with yet.  :(  It would have to be well commented too. Maybe we need to start a topic specifically for this? This is one of the things I have wanted to do for a long time but right now time is the problem.

Brett

 
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!