Machsupport Forum

G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: Jim-artsoft-zone on August 05, 2011, 02:11:48 AM

Title: G40, G41 and G42 have no effect.
Post by: Jim-artsoft-zone on August 05, 2011, 02:11:48 AM
I hope someone can help. I have tried every combination of G40, G41 and G42 (the 3 G's ) and it seems that the cutter follows the outline of the gear I'm trying to cut with no tool offset.

If I make an etching of the outline of the gear, it comes out perfectly. But I need to cut out the gear.

Remember that even though many of you feel this is an old subject, there are hundreds of newbee's every month or week. We new arrivals still need help which may be old to you.

I run G40 at the end of every program to clear offsetting. Does there need to be anything other than a line number, space, and then "G40" on the line?

How early in the program can G41 or G42 be placed (obviously before any cutter moves) and does there
need to be anything else on the line besides the line #, space and "G41 or G42"?

The gear is cut clockwise, so I would want to keep the tool to the left of the workpiece (correct?)
I have tried both right and left lead in moves, no difference.
I have tried both G41 and G42 in every configuration I could think of, no difference.
I always clear the offset with G40 first when changing.
I have entered one or the other, the diameter or the radius, on the "run" page, no difference.
The tool is definitely not too large for the gear.
The gear is involute, 8 teeth, .5 in. tooth to tooth, 20 degrees pressure, all the normal stuff.
Does the tool length need an entry to make the offset work?
I use a 25.4 multiplier for x,y and z on the "run" screen since that was the only way I found that let me work in inches with the cad software I am using.

By the way, the multipiers are not saved, what a bummer.

I've tried all combinations I can think of so there has to be something I don't know about.

I have tried it with no "G"'s at all, same effect (as expected).

Using any combination of the 3G's and diameter or radius seems to make no difference at all.

Any and all help would be greatly appreciated before I pull the remaining hair out of my head,

Thanks in advance,

Jim Gray
Title: Re: G40, G41 and G42 have no effect.
Post by: Tweakie.CNC on August 05, 2011, 02:51:16 AM
Hi Jim,

I can only help with one thing because I apply the offsets prior to the GCode compilation.

Quote
I run G40 at the end of every program to clear offsetting. Does there need to be anything other than a line number, space, and then "G40" on the line?

You need a CR so it is usual to add  %  as the last line of any GCode. (not much but it's a start  ;) )

Tweakie.

Title: Re: G40, G41 and G42 have no effect.
Post by: RICH on August 05, 2011, 06:17:22 AM
Are you hand coding this or using software to generate the code?
If software , what is the program?
RICH
Title: Re: G40, G41 and G42 have no effect.
Post by: Sargon on August 05, 2011, 06:43:36 AM
What cam program do you use? It may do it automatically if you give it a tool size.

Otherwise, the following may help:

I run G40 at the end of every program to clear offsetting. Does there need to be anything other than a line number, space, and then "G40" on the line?

Technically you don't need line numbers in your code at all. A G40 all by itself is fine, with or without a line number which is always optional.

How early in the program can G41 or G42 be placed (obviously before any cutter moves) and does there
need to be anything else on the line besides the line #, space and "G41 or G42"?

Basically it's up to when you want to call a G41 or G42. Normally you would put it after any initialization lines, such as setting the units, turning on the spindle, cancelling rotations, or whatever you need to setup the system before the run. There is no hard and fast rule, that I know of.
Along with G41 or G42 you normally add a D[tool#] and if you don't specify it should (haven't tried it) use the active tool in Mach's tool table. E.g. if you called a M6 T2 then after that point Mach would use the tool size specified in slot 2 of it's tool table if you don't specify a D parameter. You can also use P parameter to over-ride mach's tooltable and specify your own tool diameter.

The gear is cut clockwise, so I would want to keep the tool to the left of the workpiece (correct?)
Correct.

The gear is cut clockwise, so I would want to keep the tool to the left of the workpiece (correct?)

Does the tool length need an entry to make the offset work?
No.

I use a 25.4 multiplier for x,y and z on the "run" screen since that was the only way I found that let me work in inches with the cad software I am using.
I wouldn't recommend using scaling on a regular basis. Your cam program can and should do it. Simple is always better, in my experience. The more features you use the higher the chance of weird things happening! On the other hand it "should" be able to handle it, but I can't say I've used scaling with tool comp.

I've tried all combinations I can think of so there has to be something I don't know about.

I have tried it with no "G"'s at all, same effect (as expected).

Using any combination of the 3G's and diameter or radius seems to make no difference at all.
Try selecting a tool table number with D parameter when using G41/42. Make sure you first put some data into the tooltable. If you change tool numbers after putting values on the main screen it may be switching you from Tool 0 to whatever you specified on the toolchange (e.g. M6 T2) which is probably blank. Also try over-riding it with a diameter specified with a P parameter.
Title: Re: G40, G41 and G42 have no effect.
Post by: BR549 on August 05, 2011, 11:10:27 AM
What most fail to realise is that Tool Comp is not an auto process that you set once and forget. It has a specific "SET" of proceedures to make it work. AND that includes leadins and leadouts to give it ROOM to cycle in and out before the next cut move.

WHy would you need to use Scale ?? Mach3 has both  metric and inperial modes. All cams that I know can do both as well. The basic tool comp works ok in basic Gcode mode. When you get out of that basic envelope and into scaling,SUBs,Macros it is not always known how it will react untill you run into THE problem.

(;-) TP



Title: Re: G40, G41 and G42 have no effect.
Post by: Jim-artsoft-zone on August 05, 2011, 05:21:34 PM
Thanks to everyone who so generously gave help on this.

I now have lots of things, thanks to you, that I can test out to try to narrow the problem
to its simplest configuration. I will be busy tonight.

I will report what I find,
Thank you again,

Jim Gray
Title: Re: G40, G41 and G42 have no effect.
Post by: Jim-artsoft-zone on August 05, 2011, 05:33:31 PM
Oh! P.S.
I use GearGenerator to create the gear,( which etches out perfectly when using LazyCam and Mach3, but offsetting for cutting is my problem).

For cutting, I use  GearGenerator, LazyCam and then feed LazyCam's file to Mach3.

Gear Generator is at;
http://woodgears.ca/gear/

Thanks
Title: Re: G40, G41 and G42 have no effect.
Post by: RICH on August 06, 2011, 07:13:37 AM
Jim,
I don't know the quality of the dxf file as generated by Gear Generator. Once you have a dxf of the gear, you should be able to
select it's profile and create an offset provided the tool is appropriate for the shape of the profile. You can add lead-in's and lead outs in LC
if you so desire. Post the dxf file.

PS: Art created a slick gear program called Gearotic Motion.

RICH
Title: Re: G40, G41 and G42 have no effect.
Post by: BR549 on August 06, 2011, 11:26:28 AM
I have done many gear type parts (belt drive pulleys) in LC using tool comp. IF you do it correctly it works ok. It does cycle the tool comp for every pass which is anoying but the basic process  works fine.

You do have to make sure that the tool table in mach is set correctly with a proper offset value for the application. You have to have a smaller diam tool than the smallest radius your profile requires.

When testing it was min part radius X .625 to make SURE mach would not error on a gouge situation. That may have changed in mach and you can run same min radius. Check the Mach updates list.

Hope that helps. (;-) TP
Title: Re: G40, G41 and G42 have no effect.
Post by: Jim-artsoft-zone on August 07, 2011, 01:45:21 PM
Thanks for everyone's help. But now I'm running out of time. If anyone has a gcode file which I could just plug into Mach3 with no modifications, and cut an involute spur gear, I would love to try it. (might even buy it). I think once I have my first valid sample, I can do the rest myself. But the gcode file must, please, have been run before and tested.

Because my time to continue learning is running out, I am willing to pay a nominal amount for someone to create and send me a gcode file tested and ready to run by loading right into Mach3.

I need a flat spur gear with 8 teeth, 0.5 inch tooth spacing, involute (so that two of them can mesh OK), a one quarter inch hole in the middle, 20 degree contact angle, and no spokes.

This seems to work out to a gear that is just about one and a half inches outside diameter, but no exact specifications are required. The distance between shafts is not available since there will be several different gears with which to mesh. Just match two of these gears if your software requires this figure.

You can contact me faster at jgray@fred.net.

Thanks, and HELP!

Jim Gray
Title: Re: G40, G41 and G42 have no effect.
Post by: Jim-artsoft-zone on August 07, 2011, 02:04:13 PM
OOps! P.S.
The gear needs to be cut using compensation for the cutter diameter which is one eighth inch.

Thanks again

jim agray
Title: Re: G40, G41 and G42 have no effect.
Post by: Tweakie.CNC on August 08, 2011, 01:25:54 AM
Hi Jim,

Before I started using Gearotic Motion I used Gear Generator for the profile then the free version of CamBam to create the offset toolpath (tool radius offset). This then ran just fine with Mach without using the three G's.

Tweakie.
Title: Re: G40, G41 and G42 have no effect.
Post by: Jim-artsoft-zone on August 08, 2011, 04:25:54 PM
Tweakie, Thanks for the information. I'm ordering Gearotic Motion right now. I guess that should solve my remaining misunderstanding about this project plus allow me to do a whole lot more later.

Thanks,
Jim Gray
Title: Re: G40, G41 and G42 have no effect.
Post by: RICH on August 08, 2011, 05:14:58 PM
Jim,
Quote
But now I'm running out of time.
Quote
the gcode file must, please, have been run before and tested.
Really now........your time problem is not ours......... >:D

Quote
but offsetting for cutting is my problem
I generated a dxf file for the gear from two different programs and LC choked when trying to do an offset for either of them.
What happens is that a lot of gear programs generate the profile for one tooth and then you rotate / create an array for the others.
LC dosen't like that. Additionaly the programs create manny short line sgments instead of arcs and the gear profile can be made up of arcs and reduce the code significantly if drawn. I used CamBam and it also choked on the files also ( probably my doing   :D ). Didn't have time to fool with the files but think I know what you meant about offsetting them.
RICH
Title: Re: G40, G41 and G42 have no effect.
Post by: Jim-artsoft-zone on August 08, 2011, 06:57:40 PM
Rich, I wasn't critcizing nor placing any burden on you guys, I was trying to get you to sympathize with me and my being nagged on by my  wife!

I don't lay claim to any of your time nor effort, I was just trying to let you guys know I was in a pickle and needed  unusual help if there was someone who wanted to volunteer helping. The problem is definitely mine.

You mentioned that you tried to create the gear using two different programs, thank you. But you say you don't know if they were using an array to duplicate the teeth after the first?

I mentioned testing it because I always seem to leave something out of my first of anything, and find out only when I test.

Please be kind enough to let me know anything you find out, if you so desire.

When I try my best but can't get something done, I have no choice but to give up or ask for help.

Thank you,
Jim Gray
Title: Re: G40, G41 and G42 have no effect.
Post by: RICH on August 08, 2011, 07:38:04 PM
Post the dxf file generated by your program and will have a look at it in CAD and LC.
RICH
Title: Re: G40, G41 and G42 have no effect.
Post by: BR549 on August 08, 2011, 09:14:39 PM
As Rich said please post the DXF of the part your need. One of us will figure it out. 

(;-) TP
Title: Re: G40, G41 and G42 have no effect.
Post by: RICH on August 08, 2011, 10:48:59 PM
The pic below shows the results of cleaning up the gear drawing in CAD before importing into LC.
I quickly made all the segments of the gear out of arcs in the drawing. The one on the right could not be offset in LC and as you can see
there are numerous rapids created after it was cleaned. When something won't offset, manny times it's due to parts of the profile
not being connected and quickly shows up when you try to pocket it or create offsets.

The one on the left side was cleaned up in CAD by doing a zero fillet to all adjoining pieces of the profile. It is continous and there are no overlapping of elements or breaks between the elements. Notice there is only one rapid. No problem doing offsets to the profile.

The cleaner the drawing is for LC the less trouble you will have.
I drew over the numerous small straight line segments with arcs and created a different profile to be exported for use in LC.

I have found that most of the programs  that just create the actual profile of gears and allow you to DXF them out create  a poor
profile. By that I am meaning that there are no arcs used and the dxf leaves something to be desired.

I don't do manny gears and in the past drew all my gears out in CAD. I have a spread sheet that gives you all the dim's for any  spur gear
so it can be drawn quickly . Once a tooth is accurately drawn a radial matrix is done on it to provide the others in the drawing. I remember
some time ago comparing drawn gears to the gears done by some programs and although the programs created the profile manny times the profiles where not accurate. Not out by a lot but still not an accurate gear.

I have Gearotica but just can;t seem to egt around to fooling with it. It is a slick program.

So should you hear me echo that the dxf is something to be desired and is a culprit to problems remember the attached pic.

Please note that  i don't want something drawn by etch a sketch programs to check.......

But still interested in yours Jim,

RICH

Title: Re: G40, G41 and G42 have no effect.
Post by: BR549 on August 08, 2011, 11:52:09 PM
Also note the the shape of the ROOT will be different. You cannot cut a inside square edge with a round tool. It will always leave a minimum radius the size of the tool. Depending on the application whether this is a problem or not with tooth clearance.

This is the 2.5d method of CNC gear cutting. Some Gear generation programs  may use the 4th axis method to Machine the gears. Check before you buy to make sure it matches the method you have to make the gears.

Just a thought, (;-) TP
Title: Re: G40, G41 and G42 have no effect.
Post by: Tweakie.CNC on August 09, 2011, 02:01:59 AM
Tweakie, Thanks for the information. I'm ordering Gearotic Motion right now. I guess that should solve my remaining misunderstanding about this project plus allow me to do a whole lot more later.

Thanks,
Jim Gray


Hi Jim,

You won't be disappointed, Gearotic Motion is brilliant and it just keeps getting better (Thank you Art).

Tweakie.
Title: Re: G40, G41 and G42 have no effect.
Post by: RICH on August 09, 2011, 10:22:26 PM
Jim,
Just someting for you .

MODIFIED 8/24/11, LINK TO A MORE COMPLETE  WRITE UP IN MEMBERS DOCS:
http://www.machsupport.com/forum/index.php/topic,19264.msg133159.html#msg133159


RICH
Title: Re: G40, G41 and G42 have no effect.
Post by: Jim-artsoft-zone on August 10, 2011, 07:27:40 PM
Rich,
Thank you.

This will give me something to study and chew on.

I appreciate it,

Jim



Title: Re: G40, G41 and G42 have no effect.
Post by: BR549 on August 10, 2011, 09:27:54 PM
hIya, Rich that is a great example, probably the best example i have seen on the web. I will file that away in my examples file.

Now "kidding of course" do you program the gcode for that gear by hand or use one of those fancy CAM thingies.

(;-) TP
Title: Re: G40, G41 and G42 have no effect.
Post by: RICH on August 11, 2011, 06:44:47 AM
BR549,
No hand programming, I just draw the gear in CAD and make sure that the profile is drawn very well. Then export as a V12 dxf and use LC or Cambam to cut / offset the profile.
Not the sharpest tack on gears since I have no need to design them.  Gears can get complex since there are different standards and allowances so when one gets into it
it can get confusing.

There are a number of programs which provide the Gcode for a gear, they vary on what you need for input, and the gcode generation is part of the higher end CAM programs.
What i don't like is that you get a lot of code because the arc is broken up into small line segments . The code will run fine though. Art recongnized the need for a economical gcode program and frankly his program is the slickest I know of.

The spread sheet for the dimensions was really done so one could could make a gear cutter or measure or figure out what the  existing gear is. For instance;
if one wanted to make a cutter he would define pitch, # teeth, and pressure angle and then use a diameter cutter with the closest tooth profile radius
to milll the blank or even machine it and use an indexed  4th axis to cut the gear . I posted the how to in show and tell.

I tried using the gear program Jim posted and quickly remenbered that it's been around a few years and is meant for cutting out gears based on a printed profile
which won't print accurately "here" and wasn't worth fiddling with. I personaly would buy arts program and not  purchase that one.
      
Later, got to go make a lliving,
RICH


 
Title: Re: G40, G41 and G42 have no effect.
Post by: BR549 on August 11, 2011, 10:41:18 AM
Does Art's program do 2.5d gears (xyz) or does it only do 4th axis gear cutting?

(;-) TP
Title: Re: G40, G41 and G42 have no effect.
Post by: Tweakie.CNC on August 11, 2011, 12:10:24 PM
Terry,

It does the 2.5D (xyz) and 4th. axis and DXF etc. Pretty versatile and it just keeps getting better.  :D

Tweakie.
Title: Re: G40, G41 and G42 have no effect.
Post by: BR549 on August 11, 2011, 12:38:37 PM
Cool I will check it out. Always looking for new gizmos and gadgets(;-)

(;-) TP
Title: Re: G40, G41 and G42 have no effect.
Post by: Jim-artsoft-zone on August 24, 2011, 12:01:09 AM
hi all,
I got "TO DRAW A GEAR.pdf" to to open. Files certainly act oddly when grouped with this forum and Win7.

Thanks,
Jim Gray
Title: Re: G40, G41 and G42 have no effect.
Post by: RICH on August 24, 2011, 05:48:12 AM
Jim,
I placed a more complete file on drawing gears in Members Docs. Here is the link:

http://www.machsupport.com/forum/index.php/topic,19264.msg133159.html#msg133159

RICH