Hello Guest it is October 16, 2019, 09:11:59 PM

Author Topic: help with auto tool zero macro  (Read 4365 times)

0 Members and 1 Guest are viewing this topic.

help with auto tool zero macro
« on: March 12, 2008, 09:29:17 PM »
Hi all,
If anyone can help,
Having a problem with a macro,which was posted awhile back on
zeroing a tool with a touch plate.
I am using the latest version of Mach and with a G100 GREX (could be the problem?)and stepper motors.
and very limited knowledge of scripting etc,however have read alot of posts on the subject .

The problem appears to be around the line Code "G0 Z" &ZProbePos 'go back to that point



as everything works up until there.

I position the tool over the plate about 1mm
run the macro with the M command
The Z axis zero`s.........The tool comes down and stops on the touch plate
and returns in the plus direction to about 18 - 19mm (varies each time I do it)........then the Z axis changes to 12mm .....then the Z axis positions to 38.## -  39.##mm

Here is the macro Iam using ,also I have only changed ,Plate thickness = 12



CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
PlateThickness = 12

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" ' two second delay
Code "G31 Z-20 F100" 'Z goes down a max of 20mm at 100mm/min
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
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 "G0 Z20" 'retract Z to 20 mm
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)"
Exit Sub
End If


I know if I change the feed rate in this line of the script (Code "G31 Z-20 F100"

it changes the distance that z axis goes to after it touches the plate.

F100 z axis goes to about 10mm
F200 Z axis goes to about 5mm

My guess is the macro is looking at and computing  the feed rate DRO ,but how can I tell

Maybe its a another G100 thing,but if anyone can help,that would be great.
Regards
Whatda?

Offline Chaoticone

*
  • *
  •  5,607 5,607
  • Precision Chaos
    • View Profile
Re: help with auto tool zero macro
« Reply #1 on: March 12, 2008, 11:16:14 PM »
Whatda,
   I'm not sure that will work with the G100. Can't remember it has been so long. I don't see any time in the near future to test it for ya, but maybe someone else will chime in.

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!

Offline Bodini

*
  •  216 216
    • View Profile
Re: help with auto tool zero macro
« Reply #2 on: March 12, 2008, 11:21:28 PM »
I am using the latest version of Mach

v2.63 or v3.something?  If 3.something, try it with v2.63.
Re: help with auto tool zero macro
« Reply #3 on: March 12, 2008, 11:32:29 PM »
OK,
Thanks ,I will give it ago.
If I try a different version and it dosnt work how can I go back to my old config.
Do I just copy my .XML file now and save it?

Regards
Whatda?

Offline Bodini

*
  •  216 216
    • View Profile
Re: help with auto tool zero macro
« Reply #4 on: March 12, 2008, 11:54:05 PM »
I'd save your XML someplace safe or the desktop or whatever, just in case (although I think it should be OK, but why risk it?)

I only suggest the older version because I had weird problems with "G0 Z" when I went to 3.something (made my motor skip).  I switched back to v2.63 and everything was fine again.  I have not had the time to mess with it any more and try and figure out what the problem is... time is money!

-Nick
Re: help with auto tool zero macro
« Reply #5 on: March 13, 2008, 01:28:37 AM »
OK,gave V 2.63 ago and still the same. no good?

When you uninstall, it leaves the mach folder still with lots of files in there,do you have to delete all files
for the other version to work?

I know I had a version working the auto zero, but I just cant remember which version it was.

Thanks
Regards
Whatda?

Offline Greolt

*
  •  956 956
    • View Profile
Re: help with auto tool zero macro
« Reply #6 on: March 13, 2008, 04:34:06 AM »
Whatda

That Zero Macro is the one I posted and is a variation of one that Scott originally posted.

It has been working for me and many others for some time.  Using Printer Port.

However I now have another machine using a NCpod instead of a LPT and it was not working.

Doing really weird things that made no sense.  Fixed it by removing the line that you referred to earlier.

Now working good on the NCpod.

So the moral of the story is that external pulsing devices do not always act the same as the LPT.

Greg
Re: help with auto tool zero macro
« Reply #7 on: March 13, 2008, 05:24:32 AM »
Thanks Greg for your reply,

I just gave it ago and it works, Thanks.
I haven't tried using a dial gauge to show if it returns to perfect Z zero ,but with the eye it looks pretty good.
Will have a look at it tomorrow.

With using this macro on the LPT computers what would the difference (measurement) be between when the tool touches the
the touch plate to where the axis ends up,on the downward motion, as it is meant to correct this time error.
The reason I ask is that if we take out this  line  Code "G0 Z" &ZProbePos 'go back to that point
then is it not compensating for the overrun?

Thanks again for this info
Regards
Whatda?

Offline Greolt

*
  •  956 956
    • View Profile
Re: help with auto tool zero macro
« Reply #8 on: March 13, 2008, 05:42:27 AM »
The thing about this zero routine is that you need to adjust the plate thickness to fine tune it.

The measured thickness of the plate is just a starting point to the fine tune.

So with that in mind the line referred to is not needed anyway.

The adjustment of plate thickness is the reason that I have a "Plate Thickness"  DRO on screen.

Also I do not have, as some do, a "Probe Feedrate"  DRO on screen as I prefer this to remain constant.  One less variable.

Greg
Re: help with auto tool zero macro
« Reply #9 on: March 13, 2008, 07:00:25 AM »
Thanks for the info,I am starting to slowly understand it,
But as I didn't write the script,and probably couldn't if my life depended on it,
I was just curious as to why someone writes lines for no apparent reason.
Perhaps a reason for LPT setups ,......not so for NCpod/G100 etc???I dont know.

I thought this line cater for electronic timing issues,as to when the   probe/tool   touched the plate
to when it stopped.?
As I am not into electronics,I figured................ (because of electronics) this must change each time you zeroed the tool,
so compensating in the touch pad thicknest would only be a one off practice.........like I say I dont know.

But ,It works so far ,more testing tomorrow.
Thanks again for all this great info.
Regards
Whatda?