Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: HimyKabibble on December 17, 2009, 01:11:53 AM

Title: Using The Knee For Tool Length Comp....
Post by: HimyKabibble on December 17, 2009, 01:11:53 AM
    Today I finished the new wiring for the quill, and got limits working, so I now have a quill drive and a knee drive.  Tomorrow I want to implement the tool length comp using the knee.  Mach3 v3 doesn't really suport this, as G43/G49 are processed internally.  So, here's what makes sense to me as a temporary kludge until Mach3 v4 is ready:

Setup:
    1) Load tool table with length offsets - reference tool is longest tool of entire set, with length set to 0.000".  All other tools will have negative offsets.
    2) Setup fixture as follows:
          Load and select reference tool
          Set quill (Z axis) a reasonable distance down from top of travel (rapid/safeZ height + some pad at a minimum)
          Raise knee (A axis) until top of workpiece almost touches reference tool tip, and Zero A work offset DRO
          Lower quill to touch-off on workpiece and set Z work offset DRO

Usage:
    1) Use M143 in place of G43, M149 in place of G49, to enable/disable tool length offsets
    2) M143 will move knee up to current tool length offset.  i.e. - if tool length offset is -1.234", knee will move up to A1.234.
    3) M149 will move knee down to A0.000"

    Do you guys see any problems with this?  I can't see any reason this won't work, and it's dead-simple to implement.

Regards,
Ray L.
Title: Re: Using The Knee For Tool Length Comp....
Post by: HimyKabibble on December 17, 2009, 01:54:25 AM
Unless I'm missing something, the following two trivial macros are all that's required to make this work - four whole lines of code.  In simulation, it seems to work fine.  I'll try it on the machine tomorrow AM.


''
'   Bogus G43 Macro
'
'   Usage:
'       M143 P<OffsetNumber>
''

''========================================================================================
ToolParam_ZOffset =     2
''========================================================================================

''========================================================================================
''   Start of Macro Code
''========================================================================================

' Get the offset number to use
ToolOffsetNum = Param1()
' Lookup the offset
ToolOffset = GetToolParam(ToolOffsetNum, ToolParam_ZOffset)
' Apply it
Code "G0 A" & 0 - ToolOffset




''
'   Bogus G49 Macro
'
'   Usage:
'       M149
''

''========================================================================================
''   Start of Macro Code
''========================================================================================

Code "G0 A0.000"



Regards,
Ray L.
Title: Re: Using The Knee For Tool Length Comp....
Post by: Hood on December 17, 2009, 04:50:57 AM
Just wondering, from a practical standpoint, would  it not be easier to set the reference tool up to the gauge line on your taper and have positive offsets for your tools? My thinking is you can never have a shorter tool than your gauge line but if you were using a max length tool as the reference then it may be in the future you get a tool that is longer and thus will have to redo everything.

Hood
Title: Re: Using The Knee For Tool Length Comp....
Post by: Dan13 on December 17, 2009, 07:07:12 AM
Sorry for the silly question, but what is the benefit of using the knee for tool length compensation? Why not do everything with the quill or alternatively with the knee?

Just wondering, from a practical standpoint, would  it not be easier to set the reference tool up to the gauge line on your taper and have positive offsets for your tools? My thinking is you can never have a shorter tool than your gauge line but if you were using a max length tool as the reference then it may be in the future you get a tool that is longer and thus will have to redo everything.

Hood

Don't you have to redo everything for each job anyway? I only have 7 toolholders, so I have to setup the tools and tool table for each job.

Daniel
Title: Re: Using The Knee For Tool Length Comp....
Post by: Hood on December 17, 2009, 07:20:48 AM
Sorry for the silly question, but what is the benefit of using the knee for tool length compensation? Why not do everything with the quill or alternatively with the knee?

Knees are often slow but even if not then have a lot of mass for lots of small quick movements, that is what the quill is great at. The quill however has limited travel so putting a 30mm drill in then a 1mm endmill the next and you would run out of offset travel, the knee however usually has 16 inch plus of travel so a combination of both is the solution.
Just wondering, from a practical standpoint, would  it not be easier to set the reference tool up to the gauge line on your taper and have positive offsets for your tools? My thinking is you can never have a shorter tool than your gauge line but if you were using a max length tool as the reference then it may be in the future you get a tool that is longer and thus will have to redo everything.

Hood

Don't you have to redo everything for each job anyway? I only have 7 toolholders, so I have to setup the tools and tool table for each job.

Daniel

No, if you have the gauge line set as your reference tool then all tools will be offset to that and you will only ever have to alter the tool in question in the tooltable. The Gauge line will never change.
 If  you used the longest tool method then it would be the same but only if you were sure you would never ever have a tool in that was longer than the reference tool. I am not 100% sure but I seem to remember that you can have positive length offsets or negative length offsets but not a mixture of both, could be wrong though and if I am then it wouldnt matter a toss which way things were done.

Hood
Title: Re: Using The Knee For Tool Length Comp....
Post by: Dan13 on December 17, 2009, 07:45:06 AM
Thanks Hood.

The only "drawback" I can see in using the shortest "tool" as the reference is if for some reason one forgets to enable the offset for the current tool causing the quill collide with something. On the other hand, nothing would happen if the longest tool was used as a reference - the other tool tools simply won't reach the work surface if the offset is not enabled.

Daniel
Title: Re: Using The Knee For Tool Length Comp....
Post by: Hood on December 17, 2009, 07:54:04 AM
There are a lot of things that can happen if you forget to do something ;D
But I do take your point, so if you are in the habit of forgetting things then maybe moving your Quill fully up, knee fully down and call that your zero offset point, if your homing is accurate then that would never change.

Hood
Title: Re: Using The Knee For Tool Length Comp....
Post by: Dan13 on December 17, 2009, 08:01:41 AM
Just had it happen a few times :( Used the MDI after running a program forgetting that M30 turns off any offsets. Probably need a big LED on the screen to show if the offset is enabled. Another idea I had is creating a macro that would check the current tool and see of the right offset is enabled before executing any commanded move. If not it would throw a warning message.

Daniel
Title: Re: Using The Knee For Tool Length Comp....
Post by: HimyKabibble on December 17, 2009, 09:47:18 AM
Just wondering, from a practical standpoint, would  it not be easier to set the reference tool up to the gauge line on your taper and have positive offsets for your tools? My thinking is you can never have a shorter tool than your gauge line but if you were using a max length tool as the reference then it may be in the future you get a tool that is longer and thus will have to redo everything.

Hood

Hood,

I considered that, but the problem is, what happens when you do a G49 (or M149 in this cas)?  The knee would want to return full up, which will pretty much guarantee a crash unless the tool is first removed.  By referencing to the longest tool, a G49 will lower the knee, which will always be "safe".

Right now, I setup the tool table before each job, so if I get a longer tool at some point, I make a longer reference too, and I'm back in business.  I don't have enough holders to have a "persistent" tool table.

Regards,
Ray L.
Title: Re: Using The Knee For Tool Length Comp....
Post by: HimyKabibble on December 17, 2009, 09:51:15 AM
If  you used the longest tool method then it would be the same but only if you were sure you would never ever have a tool in that was longer than the reference tool. I am not 100% sure but I seem to remember that you can have positive length offsets or negative length offsets but not a mixture of both, could be wrong though and if I am then it wouldnt matter a toss which way things were done.

Hood

Hood,

Mach3 doesn't care whether the tool table offsets are all positive, all negative, or some of each.  And, in this case, circumventing G43 with a macro, it really doesn't matter.  Mach3 v4 will use a completely different setup, and probably will allow G43/G49 to invoke VB macros.

Regards,
Ray L.
Title: Re: Using The Knee For Tool Length Comp....
Post by: TOTALLYRC on December 17, 2009, 10:33:31 AM
Hi Ray, I must say I am really looking forward to seeing this working.
With the onset of cold weather I have been back in the shop trying to get to the point that I can install the knee drive.
I can really see the value in this as I have a job where I have a 7 inch tool and then a 1 inch tool. Lots of knee cranking!!!!

I may have enough tool holders that I can have a persistent tool table, will that make any difference in how this gets set up.

I wasn't sure I agreed with the negative tool offset but now I  have to agree with it since you explained what happens when you cancel the tool offset.

Even if you have to measure the tool lengths manually, this will be a great addition to any knee mill. I will hopefully be able to do it automatically soon.

Keep on plugging away at it.

Mike
Title: Re: Using The Knee For Tool Length Comp....
Post by: HimyKabibble on December 17, 2009, 10:36:41 AM
Hi Ray, I must say I am really looking forward to seeing this working.
With the onset of cold weather I have been back in the shop trying to get to the point that I can install the knee drive.
I can really see the value in this as I have a job where I have a 7 inch tool and then a 1 inch tool. Lots of knee cranking!!!!

I may have enough tool holders that I can have a persistent tool table, will that make any difference in how this gets set up.

I wasn't sure I agreed with the negative tool offset but now I  have to agree with it since you explained what happens when you cancel the tool offset.

Even if you have to measure the tool lengths manually, this will be a great addition to any knee mill. I will hopefully be able to do it automatically soon.

Keep on plugging away at it.

Mike

Mike,

We'll know within hours...  All works fine in simulation, so I don't expect any surprises.

Regards,
Ray L.
Title: Re: Using The Knee For Tool Length Comp....
Post by: HimyKabibble on December 17, 2009, 12:55:16 PM
Well, it really is just that simple.  Just tested the macros, and it all works just as it should  you can actually define the tools any way you like, but for safety sake, it really is best to make an offset of 0.000 correspond to your longest tool, so there's no danger of a crash when you turn comp off.

The macros I'm now running are below.  M843 applies the comp, M849 removes it.  Use these in place of G43 and G49.  With M843 use the P argument to specify the tool table entry whose length offset is to be applied.  You may find the "extra" moves in there confusing - I do this because I have a lot of backlash in the knee - bevel gears and a leadscrew, rather than a ballscrew - so I get most repeatable positioning by moving the knee up to final position.  So, if a down move is required, I move down a little past the target position, then back up to the target position.  This gives me excellent repeatability.

Regards,
Ray L.


Oops!  Posted the wrong M843 macro.  Now fixed.
Title: Re: Using The Knee For Tool Length Comp....
Post by: TOTALLYRC on December 17, 2009, 12:58:50 PM
Looks like I know what my next project is. LOL

Nice work Ray.

Mike
Title: Re: Using The Knee For Tool Length Comp....
Post by: Hood on December 17, 2009, 02:24:51 PM
If  you used the longest tool method then it would be the same but only if you were sure you would never ever have a tool in that was longer than the reference tool. I am not 100% sure but I seem to remember that you can have positive length offsets or negative length offsets but not a mixture of both, could be wrong though and if I am then it wouldnt matter a toss which way things were done.

Hood

Hood,

Mach3 doesn't care whether the tool table offsets are all positive, all negative, or some of each.  And, in this case, circumventing G43 with a macro, it really doesn't matter.  Mach3 v4 will use a completely different setup, and probably will allow G43/G49 to invoke VB macros.

Regards,
Ray L.

Ray,
 good to know, dont know where I got that from, just seemed to be something in the back of my head saying a mix couldnt be used but obviously the grey matter is turning more to grey  concrete :)

Now I have the Beaver NC5 up and running the knee will be getting a servo put on it, hopefully over the holiday period. This shouldnt take me long as there is already an induction motor there for raising/lowering the knee.
 I would certainly prefer to look at having the gauge line as the reference tool but if it has to be done the other way so be it.
Hood
Title: Re: Using The Knee For Tool Length Comp....
Post by: HimyKabibble on December 17, 2009, 02:57:56 PM
Hood,

No reason you can't use the gauge line as the reference, and my understading it that's the way it is done on VMCs.  You'll just need to modify which way the knee moves when changing tools.  But I don't understand how you know when it's safe to turn off length compensation, and not risk crashing the tool.  But, then, I don't even know enough to know what I don't know.  I only barely know what I'm doing here.  I've never worked on a "real" machine.

Regards,
Ray L.
Title: Re: Using The Knee For Tool Length Comp....
Post by: Hood on December 17, 2009, 03:05:27 PM
You and me both Ray ;D
 I have never used length comp on the mill as on the Bridgeport it just has the quill driven and the range of tools I use (long drills to tiny endmills) I thought it a waste of time setting it up. With the Beaver I am going to do exactly the same as you have done, and eventually hope to make a toolchanger as well, will have to put the thinking cap on.
 Would length comp ever not be used if you were using the tooltable?

Hood
Title: Re: Using The Knee For Tool Length Comp....
Post by: HimyKabibble on December 19, 2009, 06:36:39 PM
I now have all the macros I need to use probing to initialize the tool table, and apply the offsets when milling.  Hopefuilly, tomorrow I'll have the time to acrually "use them in anger" for the first time!

Regards,
Ray L.
Title: Re: Using The Knee For Tool Length Comp....
Post by: TOTALLYRC on December 19, 2009, 06:44:40 PM
Use them with calm thoughts of perfection in mind and all will go well my son.

Sorry I must have been meditating.

Good luck and I await the results.