by Ed Hume

This article introduces the basic G-code sequences that are used with a CNC rotary table to step through positions on a circle. It doesn’t take an elaborate program to apply this code to making gears, fluted knobs, ratchet wheels, or other rotationally symmetric parts.

padmjun09

Take a look at the setup in Photo 1. A Sherline rotary table under computer control is being used to index the positions of a pinion gear. Each run of the G-code program advances the table to the next tooth position, and then the tooth profiling cut is made manually. Here is the complete program, which includes some initialization commands that are not strictly necessary, but good to have since the startup condition is not known (Listing 1). (Editor’s note: Listing One is available for download on our website.) Typically, you don’t even think about the initialization commands; you just copy them to the start of every program to specify your usual settings.

The heart of the logic is the pair of lines “#1007 =

[#1007 – #1009]” and “G0 A#1007”. The pound symbol (#) indicates that use of a variable value is being made. The square brackets indicate that evaluation of a math expression is desired, so this logic is taking the value of variable 1007, subtracting the value of variable 1009, and saving the result as an updated value for variable 1007. The second line, the G0 command, is telling the system to move at high speed to the angle specified by the value of variable 1007. Here is something you might not realize about variable values: they persist between runs of your programs. So each time we run this program, the rotary table advances from its current position by the degree amount specified by variable value 1009. The value of 22.5 for variable 1009 is for a 16-tooth gear, since 360 degrees divided by 16 is 22.5. Did you read the comment near the top, “initialize #1007 at MDI”? When you set up the rotary table, you will move it to the position of your first cut. Before you run the program, you want to set the value of variable 1007 to the current table position in degrees. So if that initial position is 0 degrees, you would enter the command “#1007 = 0” at the G-code command prompt of your CNC system before running the program.

“Hands–on with the Rotary Table” appears in the Summer 2009 issue of Digital Machinist. If you’re already a subscriber, stay tuned! Your issue will be in your mailbox soon. If you are not a subscriber, and would like to read the rest of the article, request a no-obligation issue now! If you do so by July 31st, you’ll receive the issue with this article in it! You can request an issue by following the links below or by calling 1-800-447-7367. Make sure you tell our circulation representatives that you’d like the Summer 2009 issue!

Click Here to Sign Up for Pass Along Email Tips

Please do us a tremendous favor and forward this e-mail on to your machining friends!

sp09cvr

Are you not a subscriber to DIGITAL MACHINIST? Visit us at www.digitalmachinist.net and request a no-obligation issue, or call and request it at 1-800-447-7367. Tell them you received an e-mail from a friend!

And don’t forget to check out Digital Machinist’s page on Facebook and our Twitter feed!

Your friend thinks you’ll enjoy DM, or you wouldn’t have this e-mail!

We hope you enjoyed this e-mail tip, brought to you by your friends at Digital Machinist.

Get Involved!

Do you enjoy our e-mail tips? Has one of them ever “knocked something loose” in your head? Your tip could be a future e-mail blast from your favorite magazine. Just send your tips to george.bulliss@VPDemandCreation.com. If we use your tip, we will extend your subscription by an issue. We like to see 200 to 300 words, plus an image, if available. Thanks!


We hope you enjoyed this e-mail tip, brought to you by your friends at Digital Machinist, dedicated to precision metalworking.