AR15.Com Archives
 G code for CNC
KB7  [Member]
3/19/2010 4:59:29 PM
I am tired or putting together kits from other peoples lowers and parts. I would like to have one I have built. Could you guys help me with some links to lower slugs? Also does anyone have a copy of the gcode to cnc a lower receiver or a link to the plans. I am planning to CNC one from a slug. thanks guys I have contemplated this for some time now and I am ready to take the plunge. thanks in advance guys for your assistance
horstie  [Member]
3/19/2010 5:23:23 PM
Tag

+1
Gregory_K  [Team Member]
3/19/2010 5:40:46 PM
http://www.cncguns.com/downloads.html
JustKeepSwimming  [Team Member]
3/19/2010 5:54:35 PM
Spike's has a good price on raw forgings, http://www.spikestactical.com/z/index.php?main_page=product_info&cPath=104_65&products_id=226

Can't help you with G code, I use C++ code.
PFC  [Member]
3/19/2010 6:01:19 PM
Most places would consider it a firing offense to hand out a program to anybody much less an unknown voice on the internet. You are talking about a very expensive program.
Sorry I don’t have a link, but a quick web search will turn up dimensioned drawings.
the_great_snag  [Team Member]
3/19/2010 6:37:53 PM
G code programs are a text file that are specific to the brand and type of CNC machine being used to perform the job. No one is going to be able to give you a G code program unless they are a very specialized consulting company.

Even then they would need to be intimately familiar with your machine and how you intend to fixture and locate your parts.

The fact you ask this question tells me you are probably not qualified to try to do this project yourself. I don't mean that in a mean way, so please don't take offense.
JustKeepSwimming  [Team Member]
3/19/2010 6:45:08 PM
Yeah, shouldn't forget our very own arfcom library. Scroll to the bottom of this page, there are blueprints and some CAD drawings. http://www.ar15.com/content/index.html

After reading PFC's comment, I thought surely there would be some open source AR15 G code files online somewhere, but I took a look around, and I sure don't see any. Good luck.

the_great_snag  [Team Member]
3/19/2010 7:00:58 PM
Originally Posted By JustKeepSwimming:
Yeah, shouldn't forget our very own arfcom library. Scroll to the bottom of this page, there are blueprints and some CAD drawings. http://www.ar15.com/content/index.html

After reading PFC's comment, I thought surely there would be some open source AR15 G code files online somewhere, but I took a look around, and I sure don't see any. Good luck.



G Codes are MACHINE-SPECIFIC. Even if someone was crazy enough to post programs on the internet for cutting receivers they would be useless unless you knew what machine they were written for, which tools were being use, and how the parts were being fixtured.

I am a machinist with several years' experience programming and operating CNC machines. I'm pretty sure I'm correct on this one.
JustKeepSwimming  [Team Member]
3/19/2010 7:42:16 PM
Snag, I understand that, I think I'm just looking at it from the point of view of some guy that wants to make one or two lowers in his home shop. He will be willing to put more time and effort into it as a hobby project than would make sense in a production environment.

If you were to start with the Ray-Vin manual and write several procedures, maybe one per chapter or one per setup, starting from 0,0 wherever the RV manual says, AND your goal is write code as generic as possible for the benefit of the home builder, isn't that really a pretty plausible scenario?

That's what I'm surprised *not* to see out there, some small time machine control that has the AR home builder in mind, and as long as he can learn or get help with some minor G code editing, the machine will do most of the work for him; probably not broach the mag well or thread the buffer tang, but most of the simple mill and drill operations.
the_great_snag  [Team Member]
3/19/2010 8:44:52 PM
There are machines such as the Bridgeport EZ track out there that are essentially CNC machines with user friendly controls, but they are still not hobby priced.

Your best bet is to buy fixtures like the ones made by tactical machining and use them with a hobby milling machine to finish your 80% lowers. If you DO find hobby grade/priced computer controlled milling machines let me know!

I thought you were wanting .nc or .txt program files that you could just load on a CNC machine and run and that's not really feasible.

ETA: various machines really DO vary a LOT in what codes they need. The biggest thing are the more arcane codes that set up various machine parameters or cancel them at the conclusion of the program.

Even assuming you had a "generic" .nc program that would work, you would still need to know how the programmer established his work zero in relation to the lower.

You would need to know if there are clearances issues in regards to how you wish to clamp down the workpiece.

You would also need to know what each tool represented by the "T" codes is. Is it a drill? Is it a milling cutter?

You may have the luxury of using D offsets to compensate for the actual diameter of the tools, but lengths can be important too. A case in point is the trigger hole in the bottom of the lower. That takes a long skinny milling cutter.

ETA II: If you have a machine available to you now, you could probably research things a bit and figure out how to write your own code, but be prepared for trial and error. There are some budget CAM software titles available too, but they can be of questionable value.
bigdick  [Member]
3/19/2010 10:56:56 PM
i write polaris code for an old labond mill and bridgeport discoveery , all you need is a good blue print and a little knowledge of your mill and the tools you are planing on using . like stated above g codes do not transfer from one mill to another
OhioAstromech  [Member]
3/20/2010 6:39:37 AM
CNC would also be a waste of time for just one receiver.
If he was going into the business I could understand.

What's wrong with cranking handles or ProtoTRAK?
the_great_snag  [Team Member]
3/20/2010 10:47:48 AM
Originally Posted By OhioAstromech:
CNC would also be a waste of time for just one receiver.
If he was going into the business I could understand.

What's wrong with cranking handles or ProtoTRAK?


Yup, a Bridgeport clone with a digital readout could do fine work on 80% lowers.
Mad-Machinist  [Member]
3/20/2010 11:49:39 AM
Hell...a Bridgeport with DRO will do a beautiful job on a 0% blank forging......the secret is making a nice pair of setup blocks to simplify clapming and positioning the lower. Do a little research and find the E book by Ray-Vin on completeing a 0% lower....it's well written ......and spoon feeds the process where even a novice has an exceptional probability of successfully completing a blank forging.
OhioAstromech  [Member]
3/20/2010 1:34:42 PM
Originally Posted By Mad-Machinist:
Hell...a Bridgeport with DRO will do a beautiful job on a 0% blank forging......the secret is making a nice pair of setup blocks to simplify clapming and positioning the lower. Do a little research and find the E book by Ray-Vin on completeing a 0% lower....it's well written ......and spoon feeds the process where even a novice has an exceptional probability of successfully completing a blank forging.





You mean like these?

PFC  [Member]
3/20/2010 3:10:33 PM
No doubt manual machining has its fascinations, but lets think about this.
Given a person has access to a CNC machine center.
Given a person could anodize in house if needed.
What could such a person do with a program to cut receivers?
With states lining up to tell the FedGov to mind it’s own business one could imagine several things.
OhioAstromech  [Member]
3/20/2010 3:52:58 PM
Originally Posted By PFC:
No doubt manual machining has its fascinations, but lets think about this.
Given a person has access to a CNC machine center.
Given a person could anodize in house if needed.
What could such a person do with a program to cut receivers?
With states lining up to tell the FedGov to mind it’s own business one could imagine several things.


CNC has its place if you are making billet receivers or many forgings.
But the amount of time it would take to make the fixtures, write the program, set up the mill, run the first part, make adjustments to the presets or program to correct errors, and run the second part that hopefully will be within tollerence; you could have the receiver done on a manual mill.
OhioAstromech  [Member]
3/20/2010 4:16:17 PM
Here's some generic G and M Codes.
There are special lines of code to make sure the machine is ready to run the program (This is one place the reason for not being able to just give out the program can be seen), canned cycles for drilling, tapping and reaming and too many more to list here.

It's a headache mainly.

G0 rapid positioning
G1 linear interpolation
G2 circular/helical interpolation (clockwise)
G3 circular/helical interpolation (c-clockwise)
G4 dwell
G10 coordinate system origin setting
G17 xy plane selection
G18 xz plane selection
G19 yz plane selection
G20 inch system selection
G21 millimeter system selection
G40 cancel cutter diameter compensation
G41 start cutter diameter compensation left
G42 start cutter diameter compensation right
G43 tool length offset (plus)
G49 cancel tool length offset
G53 motion in machine coordinate system
G54 use preset work coordinate system 1
G55 use preset work coordinate system 2
G56 use preset work coordinate system 3
G57 use preset work coordinate system 4 G58 use preset work coordinate system 5
G59 use preset work coordinate system 6
G59.1 use preset work coordinate system 7
G59.2 use preset work coordinate system 8
G59.3 use preset work coordinate system 9
G80 cancel motion mode (includes canned)
G81 drilling canned cycle
G82 drilling with dwell canned cycle
G83 chip-breaking drilling canned cycle
G84 right hand tapping canned cycle
G85 boring, no dwell, feed out canned cycle
G86 boring, spindle stop, rapid out canned
G87 back boring canned cycle
G88 boring, spindle stop, manual out canned
G89 boring, dwell, feed out canned cycle
G90 absolute distance mode
G91 incremental distance mode
G92 offset coordinate systems
G92.2 cancel offset coordinate systems
G93 inverse time feed mode
G94 feed per minute mode
G98 initial level return in canned cycles

M0 program stop
M1 optional program stop
M2 program end
M3 turn spindle clockwise
M4 turn spindle counterclockwise
M5 stop spindle turning
M6 tool change
M7 mist coolant on M8 flood coolant on
M9 mist and flood coolant off
M26 enable automatic b-axis clamping
M27 disable automatic b-axis clamping
M30 program end, pallet shuttle, and reset
M48 enable speed and feed overrides
M49 disable speed and feed overrides
M60 pallet shuttle and program stop
PFC  [Member]
3/20/2010 5:44:46 PM
Originally Posted By OhioAstromech:
CNC has its place if you are making billet receivers or many forgings.
But the amount of time it would take to make the fixtures, write the program, set up the mill, run the first part, make adjustments to the presets or program to correct errors, and run the second part that hopefully will be within tollerence; you could have the receiver done on a manual mill.



I would imagine a good machinist could do several forgings in the time it would take.
However that’s not really the point. People don’t do stuff like this because it is quicker or easier or whatever.
Typically CNC does not screw up, receiver number 10 will be the same as number 1. Yes, crap happens and you get the occasional reject and yes getting the first good part can be an adventure. No this is not for everyone, but I would bet there are a number of people on the board who can see the potential and would jump on this in a second if they had the resources to do it. Also don’t discount the commercial aspects of pulling this off.
OhioAstromech  [Member]
3/20/2010 6:37:04 PM
You can ask Jason of JC Weaponry and several others.
They already have footed the money and time to do this already.
Why reinvent the wheel?
gunznjeeps  [Team Member]
3/20/2010 7:10:02 PM
My buddy and I just finished up machining the mag wells today on 4 lowers. Took me an hour just to program, 15 minutes to set all the tools, and about 35 minutes to single step the first part. The next 3 were cake....we just hung out and watched the machine all morning. We have a manual mill but I prefer the cnc. I have thought about machining a lower from a block but to be honest it would be cheaper just to buy 1. Even the 0% forgings end up costing me more than if I just went out and bought 1 but I still wanted to make my own
the_great_snag  [Team Member]
3/20/2010 7:13:19 PM
Originally Posted By OhioAstromech:

<snip>

It's a headache mainly.

<snip>



This... Most of the time you don't even read the G codes when you are programming or operating a CNC. This is why we have CAM software.
the_great_snag  [Team Member]
3/20/2010 7:15:55 PM
Originally Posted By gunznjeeps:
My buddy and I just finished up machining the mag wells today on 4 lowers. Took me an hour just to program, 15 minutes to set all the tools, and about 35 minutes to single step the first part. The next 3 were cake....we just hung out and watched the machine all morning. We have a manual mill but I prefer the cnc. I have thought about machining a lower from a block but to be honest it would be cheaper just to buy 1. Even the 0% forgings end up costing me more than if I just went out and bought 1 but I still wanted to make my own


I would not do 0% lowers unless I had access to a full stocked machine shop.

Some of the tooling is too oddball and/or expensive for most small shops to have or afford. The receiver extension tap would be a good example.

80%'ers still allow you to "make it your own" without the huge investment in tooling.