Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: keithorr on February 26, 2008, 10:14:29 PM

Title: Update Tool Data using G10?
Post by: keithorr on February 26, 2008, 10:14:29 PM
I am using a surface grinder and would like to update the wheel z height after dressing.

I know how to set the tool height while running a program:

G10 L1 P1 Z1.000

Is there any syntax to update the Z value after I have removed .004 from the wheel radius? I've tried Z=(Z-.004), Z(Z -.004) etc

I'm looking around but not finding a parameter value that "might" work.

Thanks
Title: Re: Update Tool Data using G10?
Post by: Chip on February 27, 2008, 12:29:43 AM
Hi, Keithorr

Mite be off in left field hear, If you use tool #1 and set it up, Theres a wear al-ounce in the Offsets, Save Tool Offsets, Tool-Table Box, HeightWear.

Hope this Helps, Chip

Edit: Forgot to post this
Title: Re: Update Tool Data using G10?
Post by: keithorr on February 27, 2008, 01:42:10 AM
Thanks for the reply. I don't know enough about mach3 (coming from mach2) if the wear is per cycle or a one shot offset. I'll give it some reading

Any way to read the tool z length offset to a variable?

I can use G10 L1 P1 Z[#1-0.004] if I can figure out how to get the tool table value into variable #!.

Title: Re: Update Tool Data using G10?
Post by: Graham Waterworth on February 27, 2008, 02:45:52 AM
You can use G10 in 2 modes G91 incremental and G90 absolute.

So using G90 you can set a value, in G91 you increment/decrement the existing value.

Graham.

Title: Re: Update Tool Data using G10?
Post by: keithorr on February 27, 2008, 02:58:14 AM
Thanks, I tried that a little but didn't have a consistent enough approach while noodling around and then went off to the archives and forgot where I was. I'll give it another shot.
Title: Re: Update Tool Data using G10?
Post by: keithorr on February 27, 2008, 04:10:20 AM
I'm missing something :( I tried the following and was hoping the tool offset would have totaled -0.008 by the end of the file but it stays at -0.004

N1 ;
N2 ;
N3 ;
N4 M05 G40 G49 G80 G90
N5 M06
N6 T20 G43 H20 D20
N7 G10 L1 P20 Z0.0 'set tool length
N8 G01 Z-.1 F1.
N9 G00 Z0.
N10 G91
N11 G10 L1 P20 Z-.004 'set new tool length
N12 G90
N13 G01 Z-.1 F1.
N14 G00 Z0.
N15 G91
N16 G10 L1 P20 Z-.004 'set new tool length
N17 G90
N18 M30

In the MachMill3 PDF section 10.7.5 states "...reset to the coordinate values given (in terms of the absolute system)."
                   
Title: Re: Update Tool Data using G10?
Post by: Sam on February 27, 2008, 08:18:45 AM
You forgot a G92
G10 G92 L1 P20 Z-.004
Title: Re: Update Tool Data using G10?
Post by: Graham Waterworth on February 27, 2008, 08:36:42 AM
You could use this macro, save it as M1000.m1s in your current profile.

Graham.

' M1000.m1s

' Macro to increment tool height offset
' using M1000 P1 Q.004
' P = offset number to update
' Q = amount to alter offset by

P_val = Param1()
Q_val = Param2()
offset = GetToolParam(P_val,2)
offset = offset + Q_val
Code "G10 L1 P" & P_val & " Z" & offset

'End
 

Title: Re: Update Tool Data using G10?
Post by: keithorr on February 27, 2008, 03:41:56 PM
Graham,
Thanks for the silver platter.
I was looking around for VB info but I'm not familiar with this scripting. I've only learned vb.net for some other apps. Also was not finding a library of terms like GetToolParam. I was only finding bits and pieces here and there so avoiding the issue.

The macro works great. I'll be trying to use my CAM to insert the M1000 Px Qx next.

FYI : I did figure a way to update the offset in session using variables but couldn't use them to poll the tool offset from the table after a reboot. Methods from the old Ahha days.

Thanks again.
Title: Re: Update Tool Data using G10?
Post by: Graham Waterworth on February 27, 2008, 05:01:44 PM
 :)

Graham.
Title: Re: Update Tool Data using G10?
Post by: keithorr on February 28, 2008, 04:48:11 PM
Following up:

When I place the M1000 P(val) Q(val) in a tap, the macro ends up running during the file load. The tool table is annotated an amount equal to the Q(val) x the number of times the macro is called.

i.e. (to flog it another way) If M1000 macro occurs 4 times in the file with an offset of .005; the tool length is offset by .020 before I even run the file

I can manually re-edit the tool table after the file is loaded and before it is run.
Just wanted to put it out there that VB scripts can run during a file load and could cause some problems if you aren't looking.

Is there a way to call the macro only when the file is running using some sort of conditional syntax along the lines of; IF cycle is running THEN do magic ELSE pound sand?

Is there a signal or condition that is only true when the file runs, not loading? The start led flickers during load so nothing on the screen I can see to link to.

N1 ; run in offline mode to test
N2 ; runs M1000 macro to update tool length after grinding wheel is dressed
N3 ;
N4 M05 G40 G49 G80 G90
N5 T1 G43 H1 D1
N6 M06
N7 G00 Z0.0
N8 G01 Z-.1 F1.
N9 G00 Z0.0
N10 M1000 P1 Q.004 ;runs G10 with P(toolnum) Q(lengthoffset update)
N11 G04 P1.
N12 
N13 G01 Z-.1 F1.
N14 G00 Z0.0
N15 M1000 P1 Q.004
N16 G04 P1.
N17
N18 M30
               
Title: Re: Update Tool Data using G10?
Post by: Overloaded on February 28, 2008, 05:48:06 PM
 :)
Title: Re: Update Tool Data using G10?
Post by: keithorr on February 28, 2008, 07:16:23 PM
Ahhh!!
thanks for the tip. unfortunately I'm using an out of the box version of Mach3 that ships with a Tormach mill.  It does the job within limits and does have some dedicated features that are helpful. The only thing I can jigger is the xml file. If we try to touch anything else, we get our little hands slapped. I'll hunt around and then download the full version if need be.
Thanks again.
Title: Re: Update Tool Data using G10?
Post by: Hood on February 28, 2008, 08:06:12 PM
That setting is in the General cofig from the Config menu, does the Tormach version not have that?
Hood
Title: Re: Update Tool Data using G10?
Post by: keithorr on February 28, 2008, 09:48:17 PM
OH MY GOD!!!!
WHY DIDN'T ANYONE TELL ME??? THIS IS AMBROSIA!!!
 ;D ;D ;D
 Downloaded the full copy and placed my xml  and screen set in the folder, renamed and off I go. ;D
No, Tormach doesn't allow any configuration changes. The program is locked. They used to have the password in the Mach2 xml but deleted it from the latest version. Gee, a script editor and everything just like the grownups.
Boy Howdy!
Title: Re: Update Tool Data using G10?
Post by: Hood on February 29, 2008, 02:57:14 AM
I suppose I can see their point in locking it, makes support for them a lot easier if they dont give you all the toys :)

Hood
Title: Re: Update Tool Data using G10?
Post by: Graham Waterworth on February 29, 2008, 09:43:00 AM
If you modify the macro, now that you can, to look like this it will only run in cycle.

' M1000.m1s

' Macro to increment tool height offset
' using M1000 P1 Q.004
' P = offset number to update
' Q = amount to alter offset by

If IsLoading() Then
  ' Do now't
Else
  P_val = Param1()
  Q_val = Param2()
  offset = GetToolParam(P_val,2)
  offset = offset + Q_val
  Code "G10 L1 P" & P_val & " Z" & offset
End If

'End

Graham.
Title: Re: Update Tool Data using G10?
Post by: keithorr on February 29, 2008, 01:11:31 PM
Thanks for the patience, maybe I'll have something to give back one of these days.

Now't ???
I have more fun with google and wikipedia I may never get my work done.
http://en.wikipedia.org/wiki/Yorkshireisms
Title: Re: Update Tool Data using G10?
Post by: Graham Waterworth on February 29, 2008, 02:26:29 PM
Thank theur fert Yorksha link, ah finn' it reeight odd 'a' mooar fowk waint speyk uz lingoa.

Or for the non Yorkshire.

Thank you for the Yorkshire link, I find it very odd that more people do not speak my lingo.

Graham.
Title: Re: Update Tool Data using G10?
Post by: keithorr on February 29, 2008, 03:13:38 PM
OK
I run the updated code in the debugger and it stops on line 15 with a comment on the mach3 comp run screen:
P value out of range with g10 l2

although it works fine running in mach3

I'm not sure what to think. If I were trying to make a script in the future and rec'd that message I wouldn't know whether to ignore or not.

Any pointers?
Thanks
Title: Re: Update Tool Data using G10?
Post by: Graham Waterworth on February 29, 2008, 04:00:05 PM
The debugger can have problems with live data, some startup values are defaulted outside the range we may need. Its something you have to get used to.

Graham.