Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: bsharp on October 14, 2008, 02:31:40 PM

Title: Cutter Compensation
Post by: bsharp on October 14, 2008, 02:31:40 PM
Profiling Burning table.
I am still having trouble with cutter compensation.
Some times if I stop a program and restart it it will just make a strait line with a little circle at the end and then stop.
It will do this even if I put a G40 in the head of a program? If I run a G40 in MDI and then reload the G code program. It will run fine.
It seems that the cutter comp in Mach is buggy as hell. Is there any light at the end of the tunnel for cutter comp in Mach or is it dead in the water?     
Title: Re: Cutter Compensation
Post by: Vogavt on October 14, 2008, 08:18:13 PM
I was having similar issues and by happenstance used a G90 code from within the MDI without reloading the code.

Problem went away. Give that a whirl and see if you have the same result.

Must be a bug but not sure. 
Title: Re: Cutter Compensation
Post by: MarkC on October 14, 2008, 10:15:26 PM
Maybe try putting a G40 in the "all resets" line in general config?

Mark
Title: Re: Cutter Compensation
Post by: jimpinder on October 15, 2008, 03:49:21 AM
I don't know a great deal about cutter compensation, but, as far as I understand it, when cutter compensation is applied, you must then have a "run in" move for the tool - i.e. when you apply G41 or G42, the tool does not move to the new cutting position, but uses the next move to get into the right position. I assume it might take more than one move if the appropriate axis does not move (although thinking about it, that is doubtful, since, just moving one axis will get you into the right position)

If you are saying that, after you stop the program, for whatever reason, then restart, it says in the tutorials or the manual, that Mach 3 may take two or three moves to regain position.

I have recently been cutting some printed circuit boards, and I was having trouble with the Z axis not lifting properly, which caused the cutter to foul and then snap off (it is only 0.6mm). Stopping the machine had to be quick, but the point is, when restarting I had no idea where the tool was in comparrison to the program, particularly if I had jogged to change the tool.

I examined the GCode, and ran back to the last G0 movement, i.e. a move where the cutter was moving from one place to the other, without cutting. This would mean the cutter was well above the work, and the tool would move to the next cutting position accurately. This applied from whatever position I was at, whatever height the tool was at and whatever compensation I had on.

If you then looked at the code, the next move was "tool down", and the next move was "cut".

So, move back to a G0, click "set next line" and "run from here" and click "cycle start". The initial G0 move allows the cutter to move to the next position, apply the compensation, take a breath, and then get back to work again.

Restarting the program will obviously "start again" and if you look at the top of the 1024 Milling profile, you will see a list of the GCodes that are applied, and see that things are put back to a single profile, so that Mach kmows where to start from. If you look on General Config, left hand column, you will see a similar list of "tasks" when M30 is encountered.

We all have to, from time to time, stop in the middle of a run, but the thing is, after each stop, you must say to yourself "has the machine enough information to carry on from where it left off". This is particularly important if you use sub-routines and offsets, where information might be carried over. If the machine hasn't the right information, then performance is unpredictable.




 


Title: Re: Cutter Compensation
Post by: ger21 on October 15, 2008, 05:55:56 AM
There are some bugs that Brian is going to start working on pretty soon. Probably a good idea to send him examples of any problems your having so he can fix all the problems with comp.
Title: Re: Cutter Compensation
Post by: bsharp on October 15, 2008, 10:12:39 AM
Maybe try putting a G40 in the "all resets" line in general config?

Mark

Thank You all for your replies
I would like to try putting a G40 in the "all resets" but am not sure what or where "all resets" is?
Do you mean putting a G40 function on the stop and reset button?
Or is there somewhere else that I don't know of?
Title: Re: Cutter Compensation
Post by: bsharp on October 15, 2008, 10:36:37 AM
Basically I am cutting large circles out of plate with a leadin with two linear moves at 45 degrees tangent. These circles may be oriented at odd angles to provide better utilisation of material. When I stop the program I normally start it back at the beginning of a complete coordinated block of code. I normally don't try and use the "run from here" and edit the code and reload it. Most other controllers that i have used that require a preparation move for the cutter compensation to be initiated need only a move slightly longer than the offset value.
Title: Re: Cutter Compensation
Post by: bsharp on October 15, 2008, 10:41:31 AM
There are some bugs that Brian is going to start working on pretty soon. Probably a good idea to send him examples of any problems your having so he can fix all the problems with comp.

I will see if I can compile a list of examples and post them.
Title: Re: Cutter Compensation
Post by: bsharp on October 21, 2008, 09:38:31 PM
Ok after trying just about everything possible. I think it all boils down to two problems.
1:
I think there is a problem with the Stop function if you are using cutter comp.
If you start Mach load a program and hit Cycle Start it will run fine all the way through.
If you press Pause Stop then Rewind and then Cycle Start
Or if you press Pause Stop then edit the code and Cycle Start it will do some very strange things!
But if you type G40 in MDI and run that prior to running the program in any of the above situations it runs fine.

So after contemplating this for a while I figured I would change the rewind button to run a G40 and then an M30.
I also made sure that an M30 and a G40 was in the initialization string and I set to all resets.
So now if I press Pause Reset Rewind and then start it works fine no crazy stuff.

2:
The cutter comp still doesn't work correctly. If I use a linear and an arc lead to cut a circle and also use an arc lead out it will merge the lead in with the lead out and never cut the part  ;D.
I have a bad feeling that this problem is a little bigger than just a little bug. For starters it messes up at strange orientations of the same geometry. This would make me think that the logic for the offset geometric creation is not vectorized.     

Title: Re: Cutter Compensation
Post by: Graham Waterworth on October 22, 2008, 03:54:13 AM
Hi Bsharp,

It is normal on most systems to have to issue a G40 before re-running a program that uses comp.

That said, hang in there, I was discussing this very issue with Brian while he was over here in the UK, I should not be telling you this but cutter comp is to get a rewrite on his return to the US. 

This was all achieved with the power of good quality hand pulled beer  ::)

Graham
Title: Re: Cutter Compensation
Post by: Sage on October 22, 2008, 11:01:51 AM
I think I have another example of the problem with cutter compensation. My program isn't the most elegant to begin with so I'd appreciate it if someone would see if it's my problem or Machs.

Load the attached Gcode.
Be sure to set tool 1 in the tool table to have 00.00 compensation so you can see what the basic pass should look like.
Zoom in at the top of the profile and you'll see I have a very small diagonal tool path to get the tool away from the part so the plunge does not leave a mark.
If you run the program you'll see the path is fine and the tool goes off the part, plunges, and comes back in and goes on its way. You can watch it runs this path several times fine going off part on each pass ok.

Stop it, Set the toll offset for tool 1 to say .020. Save. Regenerate the tool path and run again.

This time the tool still goes off the part ok on a diagonal but when it comes around for the second pass it follows a different diagonal to get to the end of the leadin line and exits on the old path (effectively missing milling some of the part). The bigger the tool offset the larger the angle in and out of the diagonal (and the more of the part that's missed).
  If you pan left over to where the tool changes direction from coming up the left side to where it comes across the top, you can see it does that corner on a diagonal instead of square. This chops off the corner of the finished part.

My problem?

Sage
Title: Re: Cutter Compensation
Post by: bsharp on October 22, 2008, 11:16:44 AM
That's good news! I will be eagerly awaiting the update.  ;D
Title: Re: Cutter Compensation
Post by: Graham Waterworth on October 22, 2008, 12:05:15 PM
Hi Sage,

do you have CV (G64) set to on, if so that will cut the corners off and change the path, set your finish path to exact stop (G61) and run the code again. This will make Mach stop on corners and produce sharp angles.

Graham
Title: Re: Cutter Compensation
Post by: Sage on October 22, 2008, 12:34:40 PM
The path is fine sharp corners and all until you apply the compensation. Have a look at the path generated by my code. In the bottom left corner the compensation dissapears all together which sets it up for the next corner to be cut off as described.
I put a G61 in the program and also set "stop CV on angles > 45" in general config and no difference.

Sage
Title: Re: Cutter Compensation
Post by: Graham Waterworth on October 22, 2008, 02:09:26 PM
Hi Sage,

Looking at your code I think it is at fault.

Post a sketch of your part along with the dimensions and I will code you a program and lets see if it works, what cutter size are you using.

Graham
Title: Re: Cutter Compensation
Post by: Sage on October 22, 2008, 06:22:19 PM
Graham:

The best I can do is give you a DXF of the original drawing (attached). But it's been through a lot to get where it is (posted previously)
The process I followed (with great pain) is as follows:

I used LazyCam to create an outside offset so I could cut the profile with a 1/8 cutter.
I used LazyCam parameters to make it take multiple .020 passes. To .380 depth,
That's basically what you see if you don't add any cutter compensation to what I posted.

After each pass it stops and plunges another 20thou but that left a divot on the side of the finished part so I manually added the little 45 angle to the side to get away from the part a bit to plunge and then return.
It had to be run pretty slowly otherwise the cutter would get in trouble when cutting at depth (.380).
I decided I could speed it up if I used a 1/8 hogging mill to get most of the metal out and then use a standard mill to do the finish cut.
Rather than go back to LazyCam and create another offset for the rough cut I figured I would just use the cutter compensation to make the rough passes and call the subroutine again without the compensation to do the finish pass(es).

Having said all of that I hope you understand what I'm doing. I have no doubt that you can write a whole new program.

BUT

I have to ask. The program I posted is pretty simple and it works fine without the compensation. Rather than spend your valuable time creating something that is completely different. It may be more beneficial to the understanding of the problem to figure out what's wrong with my program. There must be some aspect of it that Mach does not like and it might point to a problem that needs to be fixed in Mach (or not). Or that will help me understand the programming pitfalls.

Suit youself, you know a lot more about this than I do.

Thanks


BTW this is only a simplified version of the real part I need. Reduced to the simplest version that exhibits the problem.
Sage


Title: Re: Cutter Compensation
Post by: ger21 on October 22, 2008, 08:00:55 PM
You're not allowing enough room for the comp to be applied. You need to start at least the tool radius away from the part. Here's how I do it.
Title: Re: Cutter Compensation
Post by: Sage on October 22, 2008, 08:54:17 PM
ger21:

Thanks for that. It's pretty cool. I'll have to analyze it though because I see that you have drawn "horns" on the corner of the part but they aren't even used in the resulting tool path. So I'm a bit confused how the tool path was created unless the compensation function created it's own path based on whatever it saw fit. Then I have to ask why did you make the "horns" with 45's on them when straight lines out from the corner - your suggested two cutter diameters or so  - would have sufficed.

I get your point though about the lead in/out needs to be bigger. My little attempt at that was an after thought just to stop the divot that was giving me trouble. I didn't know it was going to be a problem with the tool offset - also an after thought.
You'll notice that my little lead out is a relative move away from the part and I expected it to always be the proper amount since it was relative. I guess it was just to small.

Let me look it over and analyze what going on bit more.

Thanks

Sage.
 
Title: Re: Cutter Compensation
Post by: ger21 on October 22, 2008, 09:08:58 PM
At the start of the line, the center of the tool is on the vertex of the first line. Comp is applied while moving to the second vertex. At the second vertex, the tool is tangent to the first line and second line. I usually just extend the line by the tool diameter, which ensures that comp is applied outside the part. I also ramp in during the lead in, so I'll usually make the lead in even longer, to give a shallower ramp.
Title: Re: Cutter Compensation
Post by: ger21 on October 22, 2008, 09:27:27 PM
One other thing. You don't actually need the leadout move I used. The machine I use at work requires it, but Mach does not. Just make sure you move at least the tool radius, maybe more, beyond the part before calling G40. You can also lift the tool before G40, just to be safe. This is the same code without the leadout.
Title: Re: Cutter Compensation
Post by: Sage on October 22, 2008, 10:43:36 PM
ger21:

Thanks for that. I see it's a lot more complicated than I thought and that a lot of planning went into your code. This perplexes me quite a bit because, being that I'm just learning, I'm reading a lot of different books, and so far, I gathered that the tool compensation is something that is used to quickly make changes to a program to accommodate, for, say the fact that you may only have a 3/8 cutter instead of a 1/4 cutter or maybe something as small as a worn tool. I imply from this that cutter compensation should work (with obvious limits) on almost anything. Far cry from the tedious planning you have applied in making a complete program around tool compensation.
 I can see that the compensation works on your program but what of the real life situation such as mine where I take an otherwise properly functioning program and add cutter compensation for a perfectly good reason i.e. to add some roughing cuts to the path??
This is why I am more interested in figuring what is wrong with my simple program rather than generating something new that actually works.

BTW
Using your ideas and to see what could be done with my code, I added some simple code to take the tool on a little tour well outside the part and back again. I added only .020 compensation to tool #1 and I can see that it goes around the touring lines with the offset visible just fine. SO there is something in your "rule" about moving more than the cutter diameter. Lesson learned there.
BUT the path is still screwed up in the bottom left corner where it does not seem to go far enough in -X to clear the original path. This screwup is far remote from any of the lead in/out code. I can't figure out why it messes that up.

Still perplexed about the usability of the cutter compensation function for what (I thought) it was intended.

I've attached the modified file. Try it with 0.0 and then .020 tool #1 compensation. Look in the bottom left corner, left side and top left corner.
I'm sure I'm getting poor old Mach confused somehow. I'd like to know where.
(not sure how to attach a screen shot).

Thanks for you help in getting me to understand this.

Sage
Title: Re: Cutter Compensation
Post by: Graham Waterworth on October 23, 2008, 03:49:26 AM
Go to additional options below left of the reply box and use the attach box.

Graham
Title: Re: Cutter Compensation
Post by: Sage on October 23, 2008, 06:40:52 AM
Graham:

Reply / additional options / attach    is how I attached the file. What I don't know how to do is attach a screen shot. My problem was getting the print screen into a jpg (or the many other acceptable forms listed) to attach. I don't see a tool to insert a screen shot. The usual Paste didn't work after doing a shift-prntscrn.
Please enlighten me.
Sage
Title: Re: Cutter Compensation
Post by: ger21 on October 23, 2008, 09:11:44 AM
Paste into paint and save as .jpg.

There's no tedious planning at all with my method. Pick a corner of your part, extend the lines by the tool radius (for the biggest tool you might use), and add a lead-in line. I wrote an AutoCAD macro that automatically writes the code from within AutoCAD. Only took about a minute to open your .dxf, add the lead in, and export the code. :)

It's a littly tricker if you don't have a corner, but I can give you an example of that too if you'd like. But it'll have to wait until tonight.
Title: Re: Cutter Compensation
Post by: Graham Waterworth on October 23, 2008, 10:00:52 AM
Or go and download Screen Hunter, its free and works great, many here use it.

http://www.wisdom-soft.com/sh/sh_free.htm

Graham
Title: Re: Cutter Compensation
Post by: Sage on October 23, 2008, 11:37:23 AM
Ok guys. Give me some time to absorb this. I'm still perplexed by the actions of Gerry's code.

Any further thoughts on why Mach is screwing up on my code as described and posted a couple of messages back?(Sage_comp2).

I can learn more about what I should and should not do by understanding why something doesn't work i.e. my code.

Maybe I'm wrong?

Sage
Title: Re: Cutter Compensation
Post by: ger21 on October 23, 2008, 01:40:00 PM
I won't have time to look at yours for about another 6 hours, when I get home from work.
Title: Re: Cutter Compensation
Post by: Graham Waterworth on October 23, 2008, 02:32:15 PM
This is how I would do your job :-

The green is the job, the blue is the cutter path.
Title: Re: Cutter Compensation
Post by: ger21 on October 23, 2008, 07:41:53 PM

I've attached the modified file. Try it with 0.0 and then .020 tool #1 compensation. Look in the bottom left corner, left side and top left corner.
I'm sure I'm getting poor old Mach confused somehow. I'd like to know where.
(not sure how to attach a screen shot).

Thanks for you help in getting me to understand this.

Sage

Looks like Mach's having trouble with the very small tool. If you use a 1/8" tool, it looks OK.

Not sure if it's a good idea to use comp in the subroutine like your doing. Although it appearsto be working OK, other than the iissue with the small tool.

If you don't come in from outside the corner like I do, you should enter on an arc like Graham does.
Title: Re: Cutter Compensation
Post by: bsharp on October 23, 2008, 08:45:29 PM
This is normally what happens to me.

http://www.machsupport.com/forum/index.php?action=dlattach;topic=8231.0;id=6461
Title: Re: Cutter Compensation
Post by: Sage on October 23, 2008, 09:00:03 PM
First off thanks Graham for another version that works. I'll use the technique when the necessity arises.

BUT:

Lets all get on the same page.

I know I tend to type too much and nobody wants to read it all but:

Back at the beginning I think I explained that the path you see is already offset for a 1/8 cutter. I used LazyCam offset feature for a 1/8 cutter on the original DXF file to get the path you see. Therefore if you cut the profile as it is with a 1/8 cutter following the toopath shown the resulting part will be in the middle (.0625") smaller in all directions.

When I ran it, it was too slow and I was having trouble with chips binding up so decided I should use a 1/8 hogging mill to do a rough pass around the part and leave a bit for a finish cut.

 Rather than go back to nasty old LazyCam and generate another set of code for a bigger offset path to stay out a few thou to rough and then have two sets of code I decided to try the tool compensation feature.

This is exactly what it's intended for (as I understand it)

That's why I'm trying to generate another path only .020 (or even less) around the part. I chose .020 because you don't have to zoom the toopath screen so much to see it and to identify the "problem" which appears. (I'll change it to about 5thou later)

I wanted to use a subroutine so I could call the same code to do both paths, with and without the compensation.
I like to strive toward compact and elegant code if possible rather than having several hundred lines to do the same thing.

 I guess I / we have to start this discussion all over.

So  - how do you create a new path for a 1/8 cutter using cutter compensation so as to leave say 5thou all around the existing profile ?

Sorry for the confusion

Sage

Title: Re: Cutter Compensation
Post by: Graham Waterworth on October 24, 2008, 06:19:49 AM
The code I posted is commanded on the cutter centre line NOT an offset path, so to run the same cutter round to take a small amount more off you would change the cutter dia in the offset table from .125 to .105 and this would then remove another .02" from the part.

Graham
Title: Re: Cutter Compensation
Post by: Sage on October 24, 2008, 08:53:13 AM
Graham:
 Thanks again for the code. I have learned something from it as I now see how the cutter compensation takes effect on the first move.

Unfortunately your code shows the same problem as mine. You probably didn't notice it or there is something messed up with my default settings causing it.

First off there is some very annoying red line extending up a long way from the part that makes it necessary to zoom the image instead of it auto sizing to fit the preview screen. Not sure what causes that. But we can ignore that for now unless you know how to fix it. It will help make troubleshooting less annoying if you can.

To see the problem I'm talking about:
Load your code and then set cutter #1 to .020 (small I know but it should be valid if I want to take just a small extra cut).

Zoom in VERY VERY close on the bottom left corner and run the code.
You will see the cutter come in from the right and stop too soon. It rises up along the vertical line ON THE LINE and slowly tapers out to the left as it rises (as if cutter compensation turned off and back on again).
 This is not a display anomaly as you can also see it in the DRO's as well. The X DRO should be stationary as it rises along the Y axis because it is a square corner. The DRO is constantly counting negative all the way up the left side. It eventually reaches the correct position when it gets to the top .

If you don't see this let me know. I might have to check my default settings.

Sage
Title: Re: Cutter Compensation
Post by: ger21 on October 24, 2008, 09:08:49 AM

To see the problem I'm talking about:
Load your code and then set cutter #1 to .020 (small I know but it should be valid if I want to take just a small extra cut).

Zoom in VERY VERY close on the bottom left corner and run the code.
You will see the cutter come in from the right and stop too soon. It rises up along the vertical line ON THE LINE and slowly tapers out to the left as it rises (as if cutter compensation turned off and back on again).
 This is not a display anomaly as you can also see it in the DRO's as well. The X DRO should be stationary as it rises along the Y axis because it is a square corner. The DRO is constantly counting negative all the way up the left side. It eventually reaches the correct position when it gets to the top .

If you don't see this let me know. I might have to check my default settings.

Sage


As I said yesterday, it appears to be a bug related to the small tool diameter, because it appears to work correctly with a 1/8" tool.
Title: Re: Cutter Compensation
Post by: ger21 on October 24, 2008, 09:12:32 AM

That's why I'm trying to generate another path only .020 (or even less) around the part. I chose .020 because you don't have to zoom the toopath screen so much to see it and to identify the "problem" which appears. (I'll change it to about 5thou later)


When using comp, you code for the actual part size, with no offsets. If you want to do a rough pass with a 1/8" tool, set up a too in mach3 with .165 diameter, but actually use a .125 tool. This will leave .02 around your part. Then go back and cut your finishing pass, telling mach the tool is .125, and it will cut to size. Same g-code, just use a different tool in the tool table, but they can actually be the same tool.
Title: Re: Cutter Compensation
Post by: Sage on October 24, 2008, 10:16:03 AM
Ok - got it.
 The light went on with your explaination of how this is all supposed to be used.
I have the concept now and it makes more sense. Sorry it took ten pages of back and forth for it to sink into my thick skull. I guess I was devising a concept of how to do the job with the tools at hand, saw the offset feature of LazyCam and figured that's how I'd do it. Your process, now that you explain it, is much more sensible. Hopefully others will learn from this. According to what I've read, tool compensation is one of those things people give up on understanding.

Sorry I hijacked the thread but I did set out to quickly point out another example of the problem the thread was started for (honest).


Thanks to both of you.


SO now that we have confirmed that there is a problem (even though it may never be seen because such a small tool is unlikely)...

Is there anyone keeping a master list of all of these issues discovered / suspected / eluded to, so they can be investigated and corrected or are they all scattered amongst the thousands of posts on this site never to be found again?

Mach is a very excellent program. I hope to see it get closer to perfect.

Sage
Title: Re: Cutter Compensation
Post by: ger21 on October 24, 2008, 11:24:23 AM
Hopefully Brian has a list, that he will be using to fix the issues shortly. :)

Quote
The light went on with your explanation of how this is all supposed to be used.

How it's supposed to be used is very subjective. As long as it works for you (once you understand how it works), you can use it any way you want. :)
Title: Re: Cutter Compensation
Post by: Graham Waterworth on October 24, 2008, 12:59:55 PM
Hi guys,

even setting the tool dia to .005" on my system the path is perfect, I have Mach set to G61 (exact stop mode) if I set it to G64 (CV mode) I get rounded and miss formed profiles.

O0001 (SAGE BUSHING)

G20 G40 G00 G80 G17
G61

N1 (FLAT -  1-8 IN DIA)
T1 M6
G00 G90 G43 X0 Y0.569
Z0.1
S4500 M3
Z0.05
G01 Z0 F2.
M98 P0002 L19
G00 Z1.
G91 G28 Y0 Z0
M30
 
O0002 (CONTOUR SUB)
G91
G01 Z-.02 F2.
G90
G41 D1 X-0.141 F8.
Y0.491
G03 X0. Y0.35 R0.141
G01 X0.217
G02 X0.392 Y0.175 R0.175
X0.217 Y0. R0.175
G01 X0.
Y0.35
G03 X0.141 Y0.491 R0.141
G01 G40 Y0.569
X0
M99

Graham
Title: Re: Cutter Compensation
Post by: Sage on October 24, 2008, 02:23:03 PM
Definately a problem here.
I tried the G61 at the start of your program and it did not help here.
I still see X changing as it goes up the left side. Cutter set for .005.
He attached screen shot shows the bottom left corner how it comes across bottom with compensation and then goes up left side without it but slowly tapers back out to left as it rises.

I've atached my xml file maybe you can see something I'm missing. It's off my test laptop. I haven't tried your code on my actual mill.

(the attachments were an after thought look carefully hey are both there. One is above the picture.)

Maybe Gerry would be so kind as to try it.

You say Brian probably has a list. I was wondering how Brian is finding out about the issues. Are you guys making him aware?

Sage




Title: Re: Cutter Compensation
Post by: Overloaded on October 24, 2008, 02:37:18 PM
Been following intently.
Great topic.
Just copied Grahams last code and get the same as Sage.
Strange.
RC
Title: Re: Cutter Compensation
Post by: Sage on October 24, 2008, 02:44:04 PM
Whew. I was beginning to think it was just me.  ;)
What was the tool set for?  It's hard to tell.
I just noticed on yours that it also rounds the corner at the top left before it goes on to the lead out. I don't think it should be doing that either. Should probably be hanging a hard right there.
I also notice that when you set the tool to say .125 it rounds both top and bottom left side corners even though it does stop the X creeping as it climbs. Seems maybe it's not paying attention to exact stop?

Sage
Title: Re: Cutter Compensation
Post by: Overloaded on October 24, 2008, 02:50:46 PM
Sage , the radiused tool path is normal... to go around a sharp corner without the cutter leaving the profile. I saw that illustrated with the triangles in the manual.
I'll keep watching.
Thanks,
RC
Title: Re: Cutter Compensation
Post by: Overloaded on October 24, 2008, 02:56:00 PM
Here is a clip from the manual.

"For Mach2 to work, the tool path must be
such that the tool stays in contact with the edge of the part geometry, as shown on the left
side of figure 10.1. If a path of the sort shown on the right of figure 10.1 is used, in which
the tool does not stay in contact with the part geometry all the time, the interpreter will not
be able to compensate properly when undersized tools are used."
Title: Re: Cutter Compensation
Post by: Overloaded on October 24, 2008, 03:17:34 PM
D1  .025" is bad.
Anything .030' and over is good.
Probably should stick to the more conventional method mentioned earlier by Ger.
Either use 2 offsets, OR use 2 D's and comp.
RC
Title: Re: Cutter Compensation
Post by: Sage on October 24, 2008, 04:53:06 PM
Interesting comment from the manual. (Noticed figure number is wrong - another one for the list).
Especially the point about small tools being a problem. Also the fact that it is not rounding some corners (bottom left) and is therefore not following it's own rules is perplexing.
I think it's one for the programmer(s). Hopefully they get wind of it.

You are correct about sticking to what works.  I'd like to stick with one tool path and two offet numbers. I beleive there is way to use G-code to change the values in the tool table. Perhaps G41 P0.###
Is that it?
Tat way I can call the same subroutine twice and keep the code compact.

Sage

Title: Re: Cutter Compensation
Post by: Overloaded on October 24, 2008, 04:58:45 PM
I noticed the fig. # also.
The only time it doesn't round the lower left corner is when the path goofs up (.025" or less). Otherwise, it's rounded.
Not familiar with changing the table with code, but you could easily call a different tool. D1=.125, D2=.145  or whatever to create the desired offset.

Just like Ger said in reply #34.

Good luck Sage,
RC
Title: Re: Cutter Compensation
Post by: ger21 on October 24, 2008, 08:43:51 PM
You can't change the tool table with g-code. You can however, use P to specify the tool radius used for comp. So, you can use:

G41 P0.165

for roughing, and:

G41 D1

for finishing, and use T1 for both without changing tools.

As for the manual, the comp section was originally copied from the EMC manual. (pictures and all)

And I get the same error as the posted pics as well.
Title: Re: Cutter Compensation
Post by: Sage on October 24, 2008, 10:40:21 PM
Ok, thanks for the tip. I'll be using it big time in my re-write of the part G-code.

So, case closed I guess unless Graham maintains his is working ok. Then I'd be interested to figure out why.

Can someone make sure this is put on "the list"?

I'm assuming the programmer will have more insight as to why the small cutters screw up.

It is a pretty small part and a small cutter. Maybe the math is buried in the decimal places and falls apart.

I'll just add it to my list of things to watch out for.

Thanks everyone.

Sage

Title: Re: Cutter Compensation
Post by: bsharp on October 25, 2008, 12:32:16 PM
This is an old program I ran on my mill. I don't use cutter comp on the mill as the cam calculates for the tool offset.
But to try and better understand where and how cutter comp was goofing up I started trying as many programs as I could.
The picture below is an interesting example of how the arc in the profile should have been trimmed to stay within the starting area.
The profile should never cross its self. Although there is times when you may want to cross a profile like in a figure eight it should not be possible to do so using left or right cutter comp.
It should only recreate offset periphery geometries for the first area that can be painted "Flooded" with a brush "Tool" the size of the current active tool.
The specification of the G4* offset word would determine in witch bounds of the area to fill.
A determination of open ended and area type geometries would need to be determined.
Geometry specifying a G4* word and which does not intersect itself would be considered open ended.
Geometry intersecting itself without the G4* word would be a center line tool path no offset needed.
Geometry intersecting itself with the G4* word would need to be "Flooded" like stated above.

If we can get that working in the X Y plane then maybe we can move on two all three.  ???


(http://) 
       
     
Title: Re: Cutter Compensation
Post by: Graham Waterworth on October 25, 2008, 05:07:53 PM
Hi Guys

after much experimenting I now have the same fault as you do, the difference was I was running Mach in Metric and entering metric values e.g. .02mm , running it in inches gives the same fault.

I am in contact with Brian about this, so we will see what he has to say.

Graham
Title: Re: Cutter Compensation
Post by: Sage on October 25, 2008, 09:20:33 PM
Swoosh !!!

bsharp:

Wow - that went right over my head. I'll let you explain that theory along to Brian.

Sage
Title: Re: Cutter Compensation
Post by: ger21 on October 25, 2008, 11:14:12 PM
The picture below is an interesting example of how the arc in the profile should have been trimmed to stay within the starting area.
The profile should never cross its self. Although there is times when you may want to cross a profile like in a figure eight it should not be possible to do so using left or right cutter comp.
It should only recreate offset periphery geometries for the first area that can be painted "Flooded" with a brush "Tool" the size of the current active tool.
The specification of the G4* offset word would determine in witch bounds of the area to fill.
A determination of open ended and area type geometries would need to be determined.
Geometry specifying a G4* word and which does not intersect itself would be considered open ended.
Geometry intersecting itself without the G4* word would be a center line tool path no offset needed.
Geometry intersecting itself with the G4* word would need to be "Flooded" like stated above.

If we can get that working in the X Y plane then maybe we can move on two all three.  ???
 
     

It's cutter comp, not comp / pocketing / magic bad code correction.

It's hard enough to just get it to offset correctly. Comp shouldn't try to decide what I'm trying to do, it should just offset the coded path. That's it.
Title: Re: Cutter Compensation
Post by: bsharp on October 26, 2008, 12:25:17 AM


It's cutter comp, not comp / pocketing / magic bad code correction.

It's hard enough to just get it to offset correctly. Comp shouldn't try to decide what I'm trying to do, it should just offset the coded path. That's it.
Quote

Yea but look at the picture in my last post. It did it wrong. I gave my Opinion on how to make it work correctly. What is yours?
Title: Re: Cutter Compensation
Post by: Graham Waterworth on October 26, 2008, 05:51:55 AM


It's cutter comp, not comp / pocketing / magic bad code correction.

It's hard enough to just get it to offset correctly. Comp shouldn't try to decide what I'm trying to do, it should just offset the coded path. That's it.
Quote

Yea but look at the picture in my last post. It did it wrong. I gave my Opinion on how to make it work correctly. What is yours?

I am afraid you did it wrong,  there are rules with any form of machining e.g. you have to drill the hole before you can tap it.

Well tool radius compensation is the same.

The golden rule is that the tool must always travel in the same direction tangent to the part, it must never reverse its direction, this means when you are working with angles less than 90 degree the point must have a tiny rad on the end, if not the path stops and the direction is reversed.

Graham
Title: Re: Cutter Compensation
Post by: bsharp on October 26, 2008, 02:04:30 PM
If I have to code the exact tool path and not the outline of the part then what is the point of advanced cutter compensation?
It sounds like a simple problem "you just need to offset it" but it is not.

Please read.
http://www.linuxcnc.org/handbook/gcode/diacomp.html  (http://www.linuxcnc.org/handbook/gcode/diacomp.html)

From the source:
"The cutter radius compensation capabilities of the interpreter enable the programmer to specify that a cutter should travel to the right or left of an open or closed contour in the XY-plane composed of arcs of circles and straight line segments. The contour may be the outline of material not to be machined away, or it may be a tool path to be followed by an exactly sized tool"

"Open ended and Closed" Sound familiar?

Thinking that it is simple is probably why it still does not work. And it probably will not work correctly until someone realizes this. 
Fire up an old GE550 control it will do the same crazy stuff. It took even the likes of GE quite a few years to figure it out.
 
All the new controls do pretty much what I said. I program machines every day that have no problems cutting a simple circle at any orientation or throw an err if the projected offset geometry intersects itself or trim the geometry to fit the tool. The simple fact that this trivial aspect of the control is not refined shows the immaturity of it. To make the cutter comp work correctly it will  take a little wider eye view to see than with what has been looking at it. Mach is to promising to be held back by such a primitive gaping wound.

I gave my opinion on how to make "Advanced cutter compensation" work. And I am sure you know what they say about Opinions!
"Everybody has one" And I showed you mine.  ;D
Title: Re: Cutter Compensation
Post by: ger21 on October 26, 2008, 02:20:59 PM
Expecting it to work on a closed path is asking a lot. I think you're misinterpreting what they mean. If you read farther along, they talk about using an entry move. This is contrary to using a closed shape. Imo, it's probably almost impossible to comp a closed shape without a lead in move.

Looking through the EMC manual, I don't see anything different then it's always been, and have a feeling EMC won't do what you want either. Mach2's comp was based on EMC's, and mach3's advanced comp improved on it. Perhaps EMC has caught up and passed Mach's implementation, but I'll have to see it to believe it.

I don't think anyone's saying you have to code the comped path. You code the exact part, but you also need to code the correct lead-in move(s), and not try to do something that is invalid for comp.

Quote
General Method

The general method includes programming an alignment move and two entry moves. The entry moves given above will be used as an example.

Title: Re: Cutter Compensation
Post by: bsharp on October 27, 2008, 08:35:25 PM
I think I just was not explaining my self enough.
The cutter comp in EMC is atrocious. Basically non existent. I think it was just never fully developed.
And after looking at the EMC source code I am amazed it works as well as it does.
What it mainly lacks is the curve fitting part of the complete cutter comp package that most industrial controls nowadays have.
I believe that is what ART was trying to do with Advanced Compensation. Advanced compensation sometimes works but is buggy and problematic. I sat and thought about this for a few hours and noticed that in any profile that you would use compensation on would be ether a open ended or closed loop profile. Open ended profiles are not a problem. But it is when you get into complex closed profiles it gets buggy. Now with any closed loop profile you will only have one intersection. If for some reason the tool to be offset is to big for the profile this will cause another intersection in the generated offset profile. If you simply stop at that second intersection witch will be at the radius of the tool and continue on from that point within the current profile. It would be no different than milling an internal square with a 1 inch cutter and expecting the corners to be perfect 90'S. Would you do that of course not so doing this wouldn't be any different.
I have attached some pictures to explain a little about what I am talking about
The first three sets are of common offset geometry and show how Compensation in the software generates the tool path "Offset Geometry". The last is and example of incorrectly compensated geometry "tool to large for profile". My suggestion would be to trim the geometry at the second intersection like I had said. But it could ultimately just call an error and refuse to run the code. Anyway it would be a good idea to implement ether to prevent scrapping a part or parts by simply punching in a wrong tool table entry.

(http://)
(http://)
(http://)

Title: Re: Cutter Compensation
Post by: ger21 on October 27, 2008, 09:02:00 PM
The last is and example of incorrectly compensated geometry "tool to large for profile". My suggestion would be to trim the geometry at the second intersection like I had said. But it could ultimately just call an error and refuse to run the code. Anyway it would be a good idea to implement ether to prevent scrapping a part or parts by simply punching in a wrong tool table entry.



While either of those two options would indeed be nice to have, I wouldn't expect to see either. I think most comp users would just rather see the bugs fixed, and I really don't consider this a bug. In your "correct" solution, while you don't get a gouge, you're still not getting what you really want. Isn't it pretty simple to just not use the wrong size tool? :) Probably an awful lot of work for Brian to check for tool table typos. :)
Title: Re: Cutter Compensation
Post by: bsharp on October 28, 2008, 12:48:24 AM
That's the thing I think it need's a little more than just a few bugs fixed to get it to work right. You shouldn't have to fight with the thing to make it work. Like I said I don't use compensation on the Mach mill so I never realized how bad it actually works. Figured it would be a simple thing for the Mach burning table like with the Mazak Lasers and MG plasma cutter but nope Mach instantly turns into a pain in the but as soon as you call a G4*. But even with the sad excuse for cutter compensation it is well worth the money. I do hope it gets fixed but I am not going to hold my breath.

Thanks for all the post to my topic
I am done with it.   
Title: Re: Cutter Compensation
Post by: ger21 on October 28, 2008, 06:51:44 AM
Other than a few minor bugs, it actually works pretty good for what I do, and I use it all the time.
Title: Re: Cutter Compensation
Post by: Sage on November 29, 2010, 08:11:05 PM
Sorry to post on such an old topic but I'm wondering if this cutter compensation issue ever got fixed (in a lock down verison).
I seem to remember some posts saying icutter compensation was close to being fixed or was fixed. It sure would be nice to use it to make small changes for worn or undersized cutters.

Does anyone remember if cutter compensation got fixed (and released).

Sage
Title: Re: Cutter Compensation
Post by: ger21 on November 29, 2010, 09:35:32 PM
Nope. But just like I said 2 years ago, I use it all the time, and it works fine for me. :)

The comp was redone and released in a test version, but that version had other bugs and was pulled. Don't expect to see the updated comp until the next version of MAch3 is released.
Title: Re: Cutter Compensation
Post by: ger21 on November 29, 2010, 09:38:40 PM
Reading back a few posts, I don't think the new version is going to work the way you want either. There's a thread here somewhere started by Brian that layed out rules that must be followed for the new comp to work correctly.
Title: Re: Cutter Compensation
Post by: Sage on November 29, 2010, 09:43:22 PM
Yeah - Somewhere  :-\

I guess I could search on "Barker" he doesn't chime it too often.


Sage
Title: Re: Cutter Compensation
Post by: BR549 on November 29, 2010, 10:04:31 PM
The new comp code is very much Fanuc in nature and worked very well when I tested it a while back.
(;-) TP
Title: Re: Cutter Compensation
Post by: BR549 on November 29, 2010, 10:09:28 PM
http://www.machsupport.com/forum/index.php/topic,9915.0.html

The new Comp discussion.

(;-) TP
Title: Re: Cutter Compensation
Post by: btu44 on November 30, 2010, 01:17:56 PM
Hope you guys don't mind a lurker chiming in but I would like to describe my experiences with Mach3's cutter comp.
I've been using Mach3 on a Tormach mill for about 4 years now. Back then I tried cutter comp and things went terribly.
So after reading this thread I decided to revisit cutter comp.
The original problem I was having turned out to be, that I was putting the cutter comp entry in the 'Diam. wear' innstead of 'Diameter' was the issue.

So this time I followed the cutter comp instructions carefully. I was using a .75" linear lead in for a .5" cutter after invoking the G41 code.
I was only using -.001" to -.005" cutter comp during testing. Things were working great for about 20 different test cycles.
But then all of a sudden the the cutter rapid'd in to the part. All I had changed was the cutter comp entry.
I continued testing with the cutter above the part and no cutter comp entry changes. The rapid problem still excised.
Next I rebooted the computer, restarted Mach3, and reran the same test code. The problem went away for awhile and then came back for no reason I can determine.
If I edit the code to 'remark' the G41 and the G40 entry, the problem went away. Unremarking the G41 & G40 and the problem returned. Only a Mach3 restart fixed the problem for a time.

So IMHO the cutter comp is still a no go. To bad thou...i really miss it.
Barry


Title: Re: Cutter Compensation
Post by: Sage on November 30, 2010, 02:47:22 PM
Thanks for finding the link to the discussion on the fix. So it does appear that it is fixed if you use the development version 3.043
Since this has been out for a couple of years now, I assume it hasn't had any other show stopping problems  ;)
It's probably the best we're going to see for now until the re-write becomes gospel.

Maybe I'll give it a try.

Thanks guys

Sage
Title: Re: Cutter Compensation
Post by: BR549 on November 30, 2010, 02:58:11 PM
I don't know for shure IF the code made it into a version or not. I know it was in a devel version for testing purposes. One way to test is IF it excepts arcs for leadins then it is NOT the new code.

(;-) TP
Title: Re: Cutter Compensation
Post by: ger21 on November 30, 2010, 04:41:29 PM
Afaik it's only in 3.43.000, which apparently has other issues, so is no longer available.

And Barry, are you running Tormach's version of Mach3? if so, what version is it.

Maybe my use of comp is a lot more basic than others, but it works 100% of the time for me.
Title: Re: Cutter Compensation
Post by: btu44 on November 30, 2010, 06:52:22 PM
Gerry, I'm running Tormachs latest, PCNC1100M3-IIRell3.12b, the licence info shows R3.042.029 as the Mach version.
I was running a pretty simple program. Just a .75" linear feed in, CCW .25" arc in, a CW 360 degree 2.75" circle, & a CCW .25" arc out.

Here is the code:
%
N100 O0000 (CUTTER COMP TEST 2)
(MASTERCAM - X3)
(PROGRAM   - CUTTER COMP TEST 2.NC)
(DATE      - NOV-27-2010)
(TIME      - 10:39 AM)
(T23  - EM, 1/2, 4 OAL, 3F, FN, PM - H23  - D23  - D0.5000")
N102 G00 G17 G20 G40 G80 G90
N104 M998 ( TOOLCHANGE )
N106 T23 M06 (EM, 1/2, 4 OAL, 3F, FN, PM)
(MAX - Z1.)
(MIN - Z-.5)
N108 G00 G90 G54 X1.8934 Y.4419 S3000 M03
N110 G43 H23 Z1.
N112 G00 G90 Z.1
N114 G94 G01 Z-.5 F64.
N116 G41 D23
N118 X1.6282 Y.1768 F15.
N120 G03 X1.555 Y0. R.25
N122 G02 X-1.555 R1.555
N124 X1.555 R1.555
N126 G01 Y-.01
N128 G03 X1.6271 Y-.1872 R.25
N130 G40
N132 G01 X1.8905 Y-.4541
N134 G00 G90 Z-.4
N136 G00 G90 Z.1
N138 G00 G90 X1.8884 Y.4419
N140 G01 Z-.5 F64.
N142 G41 D23
N144 X1.6232 Y.1768 F15.
N146 G03 X1.55 Y0. R.25
N148 G02 X-1.55 R1.55
N150 X1.55 R1.55
N152 G01 Y-.01
N154 G03 X1.622 Y-.1872 R.25
N156 G40
N158 G01 X1.8855 Y-.4541
N160 G00 G90 Z1.
N162 M09
N164 M05
N166 M998 ( TOOLCHANGE )
N168 G28 Y0.
N170 G90
N172 M30

It looks to me to be correct...?

Barry
Title: Re: Cutter Compensation
Post by: ger21 on November 30, 2010, 08:07:31 PM
It's a bad idea to do 1/4" arcs with a 1/2" tool. It throws an error for me there. Try making them .26". Any inside radius should always be larger than the tools radius.
Title: Re: Cutter Compensation
Post by: btu44 on November 30, 2010, 08:22:31 PM
OK, I'll try that tomorrow...thanks.

Barry
Title: Re: Cutter Compensation
Post by: btu44 on December 01, 2010, 08:03:01 PM
That did the trick, I've had the mill running with different diameter offset for the last 12 hours and all is great.

Thanks again Gerry for the help!!!
Title: Re: Cutter Compensation
Post by: BobWarfield on December 02, 2010, 07:54:43 PM
LOL, I sympathize with Brian (and Art before him).  Cutter comp is HARD!

I'm in the middle of implementing it for the G-Wizard G-Code Editor.  The doc from my Fanuc manual is 40 pages long.  It's filled with probably 20 or 30 geometry diagrams that show what Fanuc Type "C" comp is supposed to do in various cases. 

Much easier to write software that doesn't do cutter comp.  OTOH, much easier for people to deal with g-code with the help of cutter comp.

Cheers,

BW
www.cnccookbook.com
Title: Re: Cutter Compensation
Post by: perryalarcon on December 08, 2012, 05:50:12 PM
cutter comp for mach 3 works good. I discovered a minute ago that my earlier posted code was fine except it lacked one move per cut;

-
*G0-X.5 Y.5
G1 Z-.03125 F15.
*G41 X0. Y0.
X16.25 Y0.
-

G41 is not modal n must be put in with a small move to fixture offset position (cut start point) per cut.

Perry A.
Title: Re: Cutter Compensation
Post by: ger21 on December 08, 2012, 06:48:31 PM
Quote
cutter comp for mach 3 works good.

It does a lot of the time, but not always.  >:D