What Is G-Code And How Does It Fit With CNC
What Is G-Code And How Does It Fit With CNC

G-Code Is The Common Name For The Programming Language Of CNC Machines. Somewhat Of A Generic, Catch-all Type Of Term For CNC Programming Language. Very Few Machines Adhere To This Standard Today. There Are As Many Varations As There Are Manufacturers.This Is How I Think Of G-Code. It Is A Simple Language Built Off Of The Cartesian Coordinate System For Motion Control. I Dont Know If That Is Exactly Right But You Will Get My Meaning In A Second When We Go Through Some Code Line By Line. You Will Remember Your High School Geometry Soon Enough. For The Real Pros Out There You Know There Is Much More To G-Code Then That, But It Is A Good Place To Start.You Will See Many Variations Of The G-Code Name Like:GcodegcodeG-Codeg-codeG CodeG-CodeAre There Other Codes?In A WordYes. We Will Get To That In A Moment. G-code Is Also The Name Of Any Command In A CNC Program That Begins With The Letter G. G-Codes Generally Tell The Machine To Perform An Action. G-Codes Can Tell Machine To Move A Certain Distance In The X-Axis For Example. Or, Make A Rapid Move To Another Location. Or, Move In An Arcing Fashion While Milling. An On And On And On.Here Are Some Examples Of G-Codes. Remember These Change To A Certain Degree Between CAM Software Packages And CNC Machine Manufacturers.G00 Rapid PositioningG01 Linear InterpolationG02 CW Circular InterpolationG03 CCW Circular InterpolationG04 DwellG20 Programming In InchesG21 Programming In MmG28 Return To Home PositionG40 Tool Radius Compensation OffG41 Tool Radius Compensation LeftG42 Tool Radius Compensation RightG43 Tool Offset Compensation PositiveG44 Tool Offset Compensation NegativeWhy Does G-Code Change?We Humans Like Flexibility. We Also Like Standards. G-Codes Are Standardized In A Certain Sense. Once You Start To Be Able To Read It, You Can Read Just About Any Flavor Of It. That Is The Standardized Part.All Machines Are Not Created Alike Though. Even Identical Machines Are Different To A Certain Degree. They May Not Have The Same Tools Loaded Or They Have Been Slightly Modified To Produce A Certain Type Of Part. Interesting How People Like To Customize.That Is Why G-Codes Are Not The Same. You Need Some Flexibility In The Programming To Accommodate All Situations. Couple That With Every Manufacture Thinks Their Version Is The Best And You Get A Myriad Of G-Codes Out There.Many Manufacturers Also Try To Force You To Only Use Their Code. For Example, They Give You A Design Interface To Make Parts And A CAM Interface To Produce Code. They Lock You Into Their Black Box So You Cant Go Elsewhere For Service And Support. They Lock You In Their Family. Sometimes They Make Up A Whole Different Kind Of G-Code Language That No One Can Understand But Them To Keep You Hand Tied Up.