What's new
What's new

Trouble with G41 compensation for end mill on Fanuc O Mate control

shopsmithjack

Plastic
Joined
Jul 19, 2015
Hi,

I'm having trouble with how my CNC mill interprets the G41 offset compensation. When it executes the code it plows a channel at a diagonal that is .99 on the right and .75 on the left. The total travel is only 5.875 on the X axis. Here is the block of code. Any thoughts would be most appreciated.

(1/2 FLAT ENDMILL TOOL - 2 DIA. OFF. - 42 LEN. - 2 DIA. - .5)
T2
M6
G0G90X6.175Y-2.571S750M3
G43H2Z.1M8
G1G41H21Z-.365F25. (I have the end mill radius set on tool 21 in tool offset grid).
X-.3F10.G0Z.1Y-3.304 (It's in this block where it plows a diagonal slot across the work).
G1Z-.365F25.
X6.175F10.
G0Z.1
Y-2.561
G1Z-.375F25.
X-.3F10.
G0Z.1
Y-3.314
G1Z-.375F25.
X6.175F10.
G0Z.1
G40M5
G91G28Z0.M9
M01

I have experimented with adding more moves to the G41 line. At one point the X jumped all the way to the + side and started cutting from the wrong side. Weird.
 
I think your G41 line needs to reference your "D" value, not "H", right? You may need to make an X or Y move on the same line to invoke the cutter comp....I don't know if a Z move counts.
 
It plows a slot because you are going from X6.175 Y-2.571 to X-.3 Y-3.304 in one move. It will do that regardless of cutter comp or not. That what you programmed it to do.
I think you need to separate that line into 3 lines of code

Also, you should use D21 if your control is capable.
Also, you need to make a X or Y move in your G41 block. Cutter comp won't activate in a Z movement. It won't activate til your first X or Y move
 
Thanks for you insight. I did get direction from the manufacturer that I was to use H21 and not D21. The machine only uses H for both length and width offsets.
 
You're also milling right to left, left to right etc. you'll need to switch between G41(climb milling) and G42(conventional milling) with a lead in and lead out in Y for each direction change.
 
Greetings,

First thing I see right off is G41 activated in a Z move. Not possible.What CAD/CAM software are you using, or are you writing this off the cuff? (Which is fine also.) Here's your code.

(1/2 FLAT ENDMILL TOOL - 2 DIA. OFF. - 42 LEN. - 2 DIA. - .5)
T2
M6
G0G90X6.175Y-2.571S750M3
G43H2Z.1M8
G1G41H21Z-.365F25.
X-.3F10.G0Z.1Y-3.304
G1Z-.365F25. (Why is this line here? You're already at Z-0.365)
X6.175F10.
G0Z.1
Y-2.561
G1Z-.375F25.
X-.3F10.
G0Z.1
Y-3.315
G1Z-.375F25.
X6.175F10.
G0Z.1
G40M5
G91G28Z0.M9
M01

Now let's try to clean it up a bit. OM can do the following no problem.

T2M6 (1/2 END MILL 2.0LOC- H21)
G17G20G40G49G54G64G80G90G98

G0X6.175Y-2.571
G43Z0.1H2S750M3T3
/M8
G1Z-0.635F25.
G41X0.3Y-3.304F10.H21 (This coordinate is a hundred miles away from your start point. I see why you're plow-plow-plowing.)

Dear Jack... I see there might be the need for more studying up on cutter comp. (Don't feel bad, it's tuff at first for all of us.) Other than what I just showed you above, the fact that there's a line that says G40M5 tells me so. Cutter comp must be turned on and off with a move in either the X or Y axis or both. Also any radii that the cutter will encounter along it's tool path has to be equal to or greater than the radii of the tool set in your tool offset library (H21) or you will get a G41 error. Although I'm not 100% certain, but still I do it out of practice, is I go in and out of cutter comp before and after any Z axis retract to clear move.

I always had trouble with magnetism in electronics. You're not alone in getting the hang of cutter comp in machine programming. I was there at one time too. Peter Smid has a great book on CNC programming, and it's even steered towards Fanuc, so you'll be in luck for reading it. Cutter comp is super handy for dialing in part feature sizes in an OM control without having to create a new tool path to do so. That control doesn't have the extra libraries for wear and whatever else machinists use to tweak their part profiles. At least not the lower versions of OM. Study up and make good use of CC. Couldn't live without it.
 
Thanks for you insight. I did get direction from the manufacturer that I was to use H21 and not D21. The machine only uses H for both length and width offsets.
Hello shopsmithjack,
You can change that characteristic via parameter so that address D is used for Cutter Radius Compensation. H21 and D21 would still access the same Offset Number (21), but it would allow H to be used for Tool Length and D for Cutter Radius Offsets.

Regards,

Bill
 
This is a great response. Thank you for your guidance. I'm using an older version of MasterCam and this is the Fanuc export post. I have moved some code around trying to get OM to like it. For example. OM won't process any A0. statements in the code. It throws a P/S 009 Alarm. So would this be an accurate way to program this block for my OM?

T2M6 (1/2 END MILL 2.0LOC- H21)
G17G20G40G49G54G64G80G90G98

G0X6.175Y-2.571
G43Z0.1H2S750M3T3
/M8
G1Z-0.365F25.
G41X-0.3Y-3.304F10.H21
G0X6.175Y-2.561F10.
G1Z-.375F25.
G0X-.3 Y-3.315F10.
G1Z-.375F25.
G0X6.175Y
G40M5
G91G28Z0.M9
M01

I'll pick up Peter's book. I'm also going through CNC Cookbook tutorials. Your input is very much appreciated.
 
Hi Jack,

Glad you liked the help. Still I see you'd better get to doing a little reading. Not that I've done a ton of different formats, I have yet to see a post processor deliver properly right out of the box. They all need a little tweaking to get them to do what you want, and there's no way you can do that without knowing exactly how to program manually.

I think what you've got written there will not work for anything. To begin with, there is no such thing as a feed rate for a G0 rapid move. After your G41 line, get rid of all the G0's and G1's. G1 is set earlier in your Z minus move and doesn't need to be repeated again until after you rapid retract (G0Z0.1) and move to another area of the part. And get rid of all the Z-0.375 lines, as your tool was at that level ages ago and doesn't need to be told to go there again. Remember most G codes are Modal, meaning they stay set until another mode switches them over. G0 to G1, G1 to G2 and so on. You also have a Y with nothing next to it. I see why you're getting 009 alarms. That just means you've typed something that isn't allowed. (Like a feed rate with a rapid move. (which the control may just ignore) or a Y with nothing after it. You also can't use letter A unless you've got a forth axis activated through parameters.) And I'll say it again, you don't exit cutter comp (G40)without an axis move in the same line. Ditch the M5 till later. Swap it's place with the M9. Put M9 in a line by itself after your last move. If you leave M9 with a rapid Z plus move to Z home, you're going to get a stream of coolant shooting across the machine as the head goes up and the pump is winding down.

I don't think what Bill above said is true. Different versions of controls, especially older ones cannot be switched over to a different offset schemes. Someone else may have to chime in on this.

Anyway study up... it's not rocket science but it does take some practice. Good luck.
 
If you're using Mastercam, you may not be using all the check boxes correctly and it might not be a post problem. Are you checking cutter comp in contol and program? Are use using lead in/lead out at all?
Are you using clearance plane? Mastercam needs to know all kinds of info to output usable code.

Just a thought.
 
Hi Jack,

I don't think what Bill above said is true. Different versions of controls, especially older ones cannot be switched over to a different offset schemes. Someone else may have to chime in on this.

Ummm, I'm going to bet what Bill said IS true.
 
Hi,

I'm having trouble with how my CNC mill interprets the G41 offset compensation. When it executes the code it plows a channel at a diagonal that is .99 on the right and .75 on the left. The total travel is only 5.875 on the X axis. Here is the block of code. Any thoughts would be most appreciated.

(1/2 FLAT ENDMILL TOOL - 2 DIA. OFF. - 42 LEN. - 2 DIA. - .5)
T2
M6
G0G90X6.175Y-2.571S750M3
G43H2Z.1M8
G1G41H21Z-.365F25. (I have the end mill radius set on tool 21 in tool offset grid).
X-.3F10.G0Z.1Y-3.304 (It's in this block where it plows a diagonal slot across the work).(SEEMS THIS LINE NEEDS TO BE SEPARATED)
G1Z-.365F25.
X6.175F10.
G0Z.1
Y-2.561
G1Z-.375F25.
X-.3F10.
G0Z.1
Y-3.314
G1Z-.375F25.
X6.175F10.
G0Z.1
G40M5
G91G28Z0.M9
M01

I have experimented with adding more moves to the G41 line. At one point the X jumped all the way to the + side and started cutting from the wrong side. Weird.

This should work granted you are using G54.

N1[/B](1/2 FLAT ENDMILL TOOL - 2 DIA. OFF. - 42 LEN. - 2 DIA. - .5)
G28G91Z0.T2
M6
G0G90G54X6.175Y-2.571
S750M3
G43H2Z.1M8
G1Z-.365F25.
G1G41D22X6.15F10.(APPLY CUTTER COMP TO THIS LINE)
X-.25F10.(COMPENSATION BEGINS EFFECT ON THIS LINE)
G40X-.3 (END CUTTER COMPENSATION)
G0Z.1(RETRACT)
X-.3Y-3.304 (REPOSITION)
G1Z-.365F25.
G41X-.25F10.
X6.15F10.
G40X6.175
G0Z.1
X6.175Y-2.561(REPOSITION)
G1Z-.375F25.
G41X6.15F10.
X-.3F10.
G0Z.1
Y-3.314
G1Z-.375F25.
G41X-.25F10.
X6.15F10.
G40X6.175
G0Z.1M9
G91G28Z0.M5
M01


Things to note: CC value remains model until other wise changed, meaning you do not need to repeat the D/H CC number unless you want it changed from last time it was called up. Depending on how your machine is setup, upon reading M30 or entering reset state, this will clear the modal D/H value
The program I corrected will not cut a straight line across the length of the cut if there is a value used in cutter comp. The reason is when comp is applied, the machine (you can see this in the distance to go screen. single block on the G41 line with feed over-ride at 0%) will pulse the opposite axis away or towards the work depending on the CC being + or -. Generally I lead into the material (i.e. activate CC) on a move in the opposite. For example, in your program we are CC a move in X, therefore I will begin my approach slightly away in Y and apply CC moving the Y axis to position before cutting the intended line. For Example:
G0G90X1.Y-.15
G1Z-.5
G1G41D21Y0.
X-2.
G40Y-.15
G0Z.5

Things to note, as stated earlier, CC activates on the block after its called up. Must be turned on in G1 (it will call up in G0 but will not take any effect)
Cannot be called using G2/G3
Should turn it off prior to tool changes.
Hope this helps
 
I don't think what Bill above said is true. Different versions of controls, especially older ones cannot be switched over to a different offset schemes. Someone else may have to chime in on this.

Cut and Paste from Fanuc O-Mate Operators Manual (Left Picture) and Parameter Manual (Right Picture).

Fanuc O-Mate1.JPG Fanuc O-Mate 2.JPG
 
Things to note, as stated earlier, CC activates on the block after its called up. Must be turned on in G1 (it will call up in G0 but will not take any effect)
Hello Antfriesen,
That is not actually correct. As you state, Cutter Radius Comp can be started with G00, but it also takes effect in the same way it does with G01.

You may be referring to the CRC not taking effect until the next Block for the OP's corrected code. That wouldn't be the best way to program the Tool Path, as you have pointed out in your second example. In your second example and the following Code snippet that applies to the moves shown in Green in the attached picture, CRC takes effect in the same Block in which its initiated.

In the following example, the Linear move from the arc centre to 3 o'clock is the "G41 G01 X20.000 Y0.000 D21 F_ _" Block in which CRC is initiated and where CRC takes effect.

G00 X0.000 Y0.000
G41 G01 X20.000 Y0.000 D21 F_ _
G03 X0.000 Y20.000 I-20.000 J0.000

CRComp2.JPG

Regards,

Bill
 
Okay ... I ran this code in my machine. It cut a diagonal slot 1.003 inch wide. I need a left to right slot .753. I am using G54. I'm not sure that I should be turning cutter compensation off during the second pass. The first pass cuts .5 and the second pass should be cutting .233. The finishing passes should be cutting .010 off either side. I still don't see why it wants to move in a slow diagonal direction.

N1[/B](1/2 FLAT ENDMILL TOOL - 2 DIA. OFF. - 42 LEN. - 2 DIA. - .5)
G28G91Z0.T2
M6
G0G90G54X6.185Y-2.571
S750M3
G43H2Z.1M8
G1Z-.365F25.
G1G41H21X6.185F10.
X-.35F5.
G40X-.35
G0Z.1
X-.35Y-3.304
G1Z-.365F25.
G41X-.35F5.
X6.185F5.
G40X6.175
G0Z.1
X6.175Y-2.561
G1Z-.375F25.
G41X6.185F5.
X-.35F5.
G0Z.1
Y-3.314
G1Z-.375F25.
G41X-.35F5.
X6.185F5.
G40X6.175
G0Z.1M9
G91G28Z0.M5
M01
 
Okay ... I ran this code in my machine. It cut a diagonal slot 1.003 inch wide. I need a left to right slot .753. I am using G54. I'm not sure that I should be turning cutter compensation off during the second pass. The first pass cuts .5 and the second pass should be cutting .233. The finishing passes should be cutting .010 off either side. I still don't see why it wants to move in a slow diagonal direction.

Hello shopsmithjack,
What do you mean "I need a left to right slot .753"? 0.753 from Left Wall to Right Wall? That can't be it, as the tool path is along the X axis.

Make a sketch of what you want and post it here so the Forum can see exactly what you're trying to achieve. The only reason your code even runs without alarm is that you're Starting CRC and then continuing along the same axis as the Start Block. Your starting point is X6.185 and you're Starting CRC with a move to the same coordinate. The Look-ahead is the only thing that prevents an alarm from being raised.

Post a sketch and you will get an example that works that you can mull over.

Regards,

Bill
 
Hi Bill, Thank you. Here is the object. It is 5.875 X 5.875. The slot is .753 wide and .375 deep. The slot is dead center in the piece and is open on both ends. In other words the slot is through and through.

There are operations before and after this block of code but I can't get it right. I very much appreciate your help. I have a production run. Normally I would rely on Mastercam to output a meaningful file but my control just won't process the post where cutter compensation is used.

SampleObject.jpg
 








 
Back
Top