CNC Gunsmithing Forum

General Category => The Machine Shop => : lolwut September 06, 2007, 05:05:41 PM

: G-Code Portability
: lolwut September 06, 2007, 05:05:41 PM
I found the g-code for the ar-15 lower receiver in another thread.  How portable is the code created for one cnc machine to another?  Given a block of aluminum, a cnc mill, and the right tools what do I need to do to reproduce the results?  I know keeping the metal at a right angle with the tool is important. 
: Re: G-Code Portability
: Taylor September 12, 2007, 10:03:38 PM
The code does vary sometimes from one brand of controller to another. .  Things like cutter lengths are sometimes a different code from one to another and sometimes the controller will require a unique start to the program. 

Anyplace with a CNC mill should also have cad/cam to write code. If they don`t I wouldn`t trust them to turn out anything complex.

The iges file on this site should be enough for a shop to turn out a lower.

: Re: G-Code Portability
: kcstott November 27, 2007, 06:16:28 PM
I general It's not. G code is the final instructions the machine will receive to cut your part. Tool length and cutter offset are saved to the parameters on the machine control and with out this information the code is nearly useless. not to mention g code also tells the machine what rpm to run at and at what feed. If your machine is a slower spindle or has a less rigid fixture well you could be in trouble. All these setting need to be made for each machine and each setup. they are in no way generic. As stated above .igs is the standard and if the shop can't use that then run far and fast.
: Re: G-Code Portability
: Shepard December 01, 2007, 06:32:45 AM
I'm a newbie so if my question is too far afield just nudge me back in line. If you knew the post/machine type this g code was written for could you open the .NC file in your cam, save it, change to the proper machine type and re-post the code for his machine?
: Re: G-Code Portability
: kcstott December 03, 2007, 02:32:40 PM
Yes and no. Because not all G code is the same. One machine may require more parameters listed in the code and the other machine may not need them and then when it sees code it doesn't need or can't use it's spits out an error So the answer is yes if you know the format the machine you will use likes to see.
On and Okuma spaceturn lathe
To cut a radius the code would look something like this
note this will cut it all in one pass bad idea but just as an example

G0 X .50 Z.05 (move to clear point near part)
G1 Z.0 F.01    (Advance to face of part @ .010" per rev feed Assumes G95 active)
G3 X.75 Z.25 L.5 F.005 (cut 1/2" radius on face of part @ .005" per rev feed)
G0 X20Z20     (move to clear away from part usually limits of Z & X travel)

Now the change come if you have a machine that is a bit older and runs a more traditional fanuc style of code. The line G3 would look like this
G3 X.75 Z.25 I## K##
These I and K parameters tell the machine in triginomic function where to go and some CAM systems spit out this code in their post process programs. But that little change on some machines will cause the machine to stop and throw out a error that may or may not be helpfull in solving the problem. On our Okuma it will take the code either way but the first is easier for editing.