Hello Guest it is December 11, 2019, 11:47:40 AM

Author Topic: Tool measure macro  (Read 26509 times)

0 Members and 1 Guest are viewing this topic.

Re: Tool measure macro
« Reply #20 on: August 27, 2006, 05:21:45 PM »
Hi everybody,

First I just wanted to let you know that the macro Faby wrote works perfectly for my machine. ThanksĀ  ;)

However I have a strange behaviour of the motors. All the axis have a lot of interruptions when moving during the macro execution while their movements are very fluid when I simply run a GCode.
Does a macro execution require more ressources from the computer (the one I use is not very powerful : only 300 MHz however it has always been sufficient until now) or did I miss something (the macro has been saved as "M6Start.m1s" in the "Mach3/macros/mach3mill" directory) ?

Thanks for your help.
Jean-Louis
Jean-Louis

Offline faby

*
  •  74 74
    • View Profile
Re: Tool measure macro
« Reply #21 on: August 29, 2006, 01:55:02 PM »
I write this new version, but I have still a problem.
There's an error measuring the tool, from 0.15 to 0.5mm out, this is not due to the switch because when the tool hit it the measured value is always the same.

there's something that i don't know?

well, this is the new version.

ChX = GetUserDRO( 1200 )
ChY = GetUserDRO( 1201 )
ChZ = GetUserDRO( 1202 )

Code "G53 G00 Z-1" 'Move the tool all the way up
While IsMoving()
Wend
ZOld = Getdro(2)
Code "G53 G00 X" & ChX & "Y" & ChY 'Move to the probe position
While IsMoving()
Wend

Code "G31 Z-230 F600" 'Z move down untill hit
While IsMoving()
Wend
Code "G91 G00 Z5"
Code "G31 Z-10 F60"
While IsMoving()
Wend
HitOldA = GetVar(2002) 'Get the Position that the Porbe hit at

Code "G91 G00 Z5"
Code "G31 Z-10 F60"
While IsMoving()
Wend
HitOldB = GetVar(2002)

Code "G91 G00 Z5"
Code "G31 Z-10 F60"
While IsMoving()
Wend
HitOldC = GetVar(2002)

HitOld = (HitOldA + HitOldB + HitOldC)/3

Code "G90"
Code "G53 G00 Z-1"'Z move all way up
Code "G53 G00 X65 Y-200" 'Move to change tool position
While IsMoving()
Wend

MsgBox ("Insert the new tool")

Code "G53 G00 X" & ChX & "Y" & ChY 'Move to the probe position
While IsMoving()
Wend

Code "G31 Z-230 F600" 'Z move down untill hit
While IsMoving()
Wend
Code "G91 G00 Z5"
Code "G31 Z-10 F60"
While IsMoving()
Wend
HitNewA = GetVar(2002) 'Get the Position that the Porbe hit at

Code "G91 G00 Z5"
Code "G31 Z-10 F60"
While IsMoving()
Wend
HitNewB = GetVar(2002)

Code "G91 G00 Z5"
Code "G31 Z-10 F60"
While IsMoving()
Wend
HitNewC = GetVar(2002)

HitNew = (HitNewA + HitNewB + HitNewC)/3

Diff = HitOld - HitNew
DiffABS =Abs(Diff)

If DiffABS=0 Then End
ZNew=0
If HitOld < HitNew Then ZNew = ZOld - DiffABS
If HitOld > HitNew Then ZNew = ZOld + DiffABS

Code "G90"
Code "G53 G00 Z-1"
While IsMoving()
Wend
Call setdro(2,ZNew)

'FxModel Creation

End
               
Bye

Offline faby

*
  •  74 74
    • View Profile
Re: Tool measure macro
« Reply #22 on: August 29, 2006, 05:08:18 PM »
I tried whit my usual software, and the tool measure works perfect...the machine is the same...

Brian have you some suggestions?

It is always out of 0.1 to 0.8/1 mm... and it's too much, but I can't understand why...
Re: Tool measure macro
« Reply #23 on: August 29, 2006, 09:36:23 PM »
HitOldA = GetVar(2002) 'Get the Position that the Porbe hit at
Code"G4 P.1" ',<------ add dwell here to be sure that Get VAr has time to work and add is moving
While IsMoving()
Wend
Code "G91 G00 Z5"
Code "G31 Z-10 F60"
While IsMoving()
Wend


Is that any help?
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline faby

*
  •  74 74
    • View Profile
Re: Tool measure macro
« Reply #24 on: August 30, 2006, 05:18:20 AM »
I'll try, I thought about it but I didn't know how to add a delay... :P

Thanks

Offline faby

*
  •  74 74
    • View Profile
Re: Tool measure macro
« Reply #25 on: August 30, 2006, 08:15:45 AM »
No way... it doesn't work... I'm unlucky   :'(
Re: Tool measure macro
« Reply #26 on: August 30, 2006, 08:27:09 AM »
I don't know if this could be the problem... but try to code this with ABS programing. I never use Inc programing in a macro... Other then that I am at a loss and will have to set it up on my mill to test it..

Thanks
Brian
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline faby

*
  •  74 74
    • View Profile
Re: Tool measure macro
« Reply #27 on: August 30, 2006, 08:42:03 AM »
You mean when I use "G91 G00 Z5"?
I don't think that it's a problem because in previous version I didn't use it and the problem was the same.

Asked to Popeye if on his machine it works correctly, I'm waiting for an aswer.

Maybe my pc??
Re: Tool measure macro
« Reply #28 on: August 30, 2006, 01:41:28 PM »
Hello Fabiano,

At the moment, the mechanical installation of the switch on the mill is not finalized therefore I didn't do any accuracy test.
I can't make further investigation during the week (I'm not where the mill is) but this week end I will try to make a preliminary installation of the switch and then make some tests. I'll post the results on the forum.
I hope that the movement interruption problem that I have described in my previous post will not affect the results (any clue about it Brian ?).

Jean-Louis
Jean-Louis

Offline faby

*
  •  74 74
    • View Profile
Re: Tool measure macro
« Reply #29 on: August 30, 2006, 03:58:07 PM »
when I execute the macro step by step it works fine... than Brian says right, I have to put a "G04" code but... I have to find where...  ;D

I'm working on it  :P