G code for a gear

quickcut

H-M Supporter - Gold Member
H-M Supporter Gold Member
Joined
Apr 9, 2014
Messages
74
Good Day all,

Can someone please point me in the right direction as to writing G code for a gear . I have a 4th axes on my cnc mill . I am using Mach3 and the A axes is set up for it. So where would I start if I wanted to make gear say of 26 teeth 50mm long with a depth of 3.5 mm . Any help appreciated .
thanks
charles
 
I'd suggest reading up on gear terminology and figuring out a proper definition for what you want to make as a starting point. Gears are defined by a function of their number of teeth in relation to their diameter, either using the diametral pitch or module system. Every other aspect of a gear is derived from the chosen tooth pitch and count.

As for cutting, how do you plan to accomplish this? For small gears, end milling the teeth would be extremely challenging. You'd be looking at setting up a hobb, which requires that the spindle and 4th axis rotation be carefully synchronised, or using a form cutter and using the 4 axis to index as you would in a manual machine. The latter is by far the easiest way, though there are others if you want to get creative. What did you have in mind?

Gears, it's worth mentioning, are not usually made on even the most fancy of general purpose CNC mills. There are machines dedicated solely to gear production. That's not to say it can't be done, but like a manual machine, they're not the ideal tool for the job so you'll have to get creative or make compromises.
 
Try geargenerator.com I am not sure if you can get the G codes but you can figure out diametrical pitch and diameters there first. Costs a couple bucks but I have used them in the past. Worked very well.
Cheers
Martin
Gear Generator
 
Mach3 has a gear wizard see:
I have made a few gears with it and it works fine

Steve
 

Attachments

  • cut_gear.jpg
    cut_gear.jpg
    64.2 KB · Views: 18
Last edited:
You can download an OpenSCAD script that creates gears (in DXF format). It's basically program code so you can tell it to make any kind of gear you want. I don't have a CNC setup so have no direct experience regarding the quality of gears you will get this way.

Of course, you also have to install OpenSCAD -- but it's free.
 
Thanks for all the replies and apologies for not being clear . Actually I have been cutting gears manually (dividing head ) for a number of years . I currently need to automate the process and the cnc seemed the way to go. Thanks Steve for the Mach link. I have Mach but never looked at the wizards. I tried it and it works for me.
charles
 
This may be what you're after. I can't take credit for the programming, was given the routine from a member (kstrauss) of the CNCZone forum. I have not used the routine so I can't vouch for it in function.

Naturally, you'll have to go into the routine and plug in your specific parameters. The text file was pre-populated with a gear the CNCZone contributor had just cut. You'll also need to plug in your own safety start G-codes too (i.e. G17, G20, G94, G40, G80, etc.). Looks like the parameters are:

#<GearTeeth> = x ; number of teeth
#<GearWidth> = x ; length of gear face
#<GearDiameter> = x ; outside diameter of the gear blank
#<ToothDepth> = x ; finished depth of cut for one tooth
#<ToolNum> = x ; tool# of your involute gear cutter
#<DoC> = x ; depth of cut for the roughing passes
#<FinalDoC> = x ; depth of cut for the finish pass
#<cutFeed> = x ; feed rate
#<cutRPM> = x ; spindle RPMs

I also attached a TXT file routine for cutting a 45 deg. angle helical gear. You'd need to change a lot of stuff in this one for other gears. This is one I wrote and used to make some small helical gears. The safety start G-codes are my generic ones for the Tormach 1100. You'll need to change those to your machine.

Bruce
 

Attachments

  • gear cutter routine.txt
    2.4 KB · Views: 41
  • FL_helical_gear.txt
    2 KB · Views: 31
By the way, the routines above are set up for G20 inches, you'll need G21 metric and the other appropriate unit of measure changes (G94 feed rate is one I can think of off hand).

Bruce
 
Back
Top