{"id":3870,"date":"2026-11-21T03:24:20","date_gmt":"2026-11-20T19:24:20","guid":{"rendered":"http:\/\/www.intacthair.com\/blog\/?p=3870"},"modified":"2026-11-21T03:24:20","modified_gmt":"2026-11-20T19:24:20","slug":"what-g-codes-are-used-in-a-vertical-machining-center-4bc2-497c0c","status":"publish","type":"post","link":"http:\/\/www.intacthair.com\/blog\/2026\/11\/21\/what-g-codes-are-used-in-a-vertical-machining-center-4bc2-497c0c\/","title":{"rendered":"What G-codes are used in a vertical machining center?"},"content":{"rendered":"<p>When I was 19, I worked the night shift as a machine operator at a small job shop in eastern Michigan. Our only vertical machining center (VMC) was a beat-up 1998 Haas VF-2 that threw alarm codes if you so much as breathed wrong near its controls. Back then, G-codes felt like a secret language only a handful of us old hands spoke. I\u2019d stay late after my shift, flipping through the dog-eared Fanuc manual scrawled with coffee stains, trying to decode lines that would let me run the machine alone without begging the foreman for help. Today, after 17 years as a VMC supplier, I still get emails from new operators and small shop owners asking the same question: What G-codes do I actually need to know for a vertical machining center\u2014not just the theory, but the ones that show up on every job? <a href=\"https:\/\/www.sunshinemach.com\/vertical-machining-center\/\">\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0446\u0435\u043d\u0442\u0440<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.sunshine-machinery.com\/uploads\/48909\/small\/high-precision-vertical-lathefb517.png\"><\/p>\n<p>Let\u2019s start with the basics. G-codes are the foundation of CNC programming, the set of instructions that tell your VMC where to move, how fast to move, and when to turn the spindle on or off. Unlike horizontal machining centers, which rotate the part to access multiple sides, VMCs use a fixed table and a spindle that moves up (Z-axis) with X and Y movement across the table. That design means the G-codes we use for VMCs are tailored to that 3-axis workflow, no extra rotary axes required for standard jobs. I see too many new programmers overcomplicating this\u2014they pull a full G-code reference book and load every code on a job that only needs three. For most shops doing milling, drilling, tapping, and facing, you really only rely on a core set of G-codes, with a few extra that come up for specialized work.<\/p>\n<p>First, the linear motion codes, the bread and butter of any VMC job. G00 is rapid positioning, right? You use this to move the spindle quickly from a safe starting point to the area where you\u2019ll cut. But here\u2019s the thing I learned early on: never use G00 to move the spindle over a part. That\u2019s how you crash a tool, scratch a finished part, or break a $50 end mill. I\u2019ve had customers call me in a panic at 2 a.m. because their new operator moved too fast with G00 and totaled a $2,000 aluminum billet. For cutting moves, that\u2019s G01, linear interpolation. This is the code that makes straight cuts\u2014drilling a hole, facing a surface, cutting a slot. Every line of a job that isn\u2019t a rapid move uses G01, with feed rate specified in units per minute (G94, which we\u2019ll get to in a second) or units per revolution. I always tell new operators to program G01 with a feed rate that matches their tool material and workpiece. For example, cutting mild steel with a high-speed steel end mill? Stick to 10 to 20 inches per minute, not 100. That\u2019s a mistake that sends tool costs through the roof.<\/p>\n<p>Then there\u2019s circular interpolation, G02 and G03. These let you cut arcs and circles, which are non-negotiable for almost any part with rounded edges or holes. G02 is clockwise, G03 is counterclockwise, relative to the spindle direction. The most important detail here is how you define the arc: you can use R for radius, or I and J for the offset from the start point to the center of the arc. R is simpler for small, tight arcs, but I and J are more accurate for larger circles, because R can have two possible solutions (one turning left, one turning right). Last month, a customer had a job with 10mm bolt circle holes that kept coming out off center. It turned out their old programmer used R for a 100mm circle, and the machine picked the wrong arc direction for half the holes. Once we switched to I and J, the problem was fixed immediately. That\u2019s the kind of small G-code detail that saves you scrap and headache.<\/p>\n<p>Next, the coordinate system codes, the ones that set up where your part lives relative to the machine. G54 is the primary work offset, and this is the code you\u2019ll use for 90% of your jobs. You set G54 by touching off the part\u2019s X, Y, and Z zero points at the start of the job, and the machine uses that to map all movement relative to the part, not the machine\u2019s origin. We always tell our customers to keep G54 for their main part, and use G55, G56, etc., for secondary operations on the same part, like drilling a hole on a second face without re-zeroing. But here\u2019s a pro tip: never mix work offsets mid-job without verifying. I had a shop once that accidentally switched to G55 halfway through a job because their operator pressed the wrong button, and the entire part was 2 inches off. That was $3,000 in scrap, all from a simple G-code mix-up.<\/p>\n<p>Then there\u2019s Z-axis specific codes, which are make-or-break for VMCs since that\u2019s the axis that controls depth of cut. G20 and G21 are unit codes, super basic but everyone uses them wrong. G20 is inches, G21 is millimeters. You set this at the very start of your program, before any motion, because if you switch units later, all your coordinates are wrong. I see new programmers skip this all the time, like the guy who wrote a program in millimeters, forgot to add G21, and ended up cutting a 1 inch deep pocket that was actually 10 inches deep. His tool went through the table and into the chip conveyor. That\u2019s a $10,000 repair bill for a VMC, all because he forgot one line of code. For Z-depth, G90 is absolute positioning, meaning all coordinates are measured from part zero, and G91 is incremental, meaning each move is relative to the previous position. 99% of the time, you\u2019ll use G90 for VMC jobs because it\u2019s easier to troubleshoot\u2014you can see exactly where the spindle is supposed to be at any point, instead of counting incremental moves.<\/p>\n<p>Now, the spindle and coolant codes, which are simple but critical for tool life. M03 is spindle clockwise, M04 is counterclockwise, M05 is spindle stop. You always turn the spindle on before you make a cut, obviously. For drilling, you use M03, but for tapping some materials, M04 is better for pulling the tap out cleanly. Then there\u2019s G95 and G94, feed rate modes. G94 is units per minute (inches per minute for G20, millimeters per minute for G21), and G95 is feed per revolution of the spindle. Most VMC operators use G94 for general milling, but G95 is better for tapping, since it keeps the feed matched to spindle speed regardless of RPM changes. That\u2019s why tapping jobs almost always use G95, so you don\u2019t break taps because the feed is too fast or slow for the spindle.<\/p>\n<p>Are there any other G-codes that come up? Sure, G28 is reference return, used to move the spindle back to machine zero at the end of a job for tool changes or maintenance. G43 is tool length offset, which is how the machine compensates for different tool lengths. You set G43 with your tool height offsets in the control, so if you swap a 10mm end mill for a 15mm one, you just update the offset instead of rewriting the entire program. That\u2019s a game-changer for shops that do multiple parts, because it cuts down on setup time. I always recommend our customers use G43 Hxx, where H is the tool number\u2019s offset, instead of manually adjusting Z zero every time. It reduces errors so much.<\/p>\n<p>Now, let\u2019s talk about what doesn\u2019t matter for most VMCs. Codes like G04 dwell, which pauses the spindle for a set amount of time (good for chamfering or deburring, but you only use that occasionally). G73 peck drilling, which is great for deep holes, but that\u2019s more of a canned cycle, and honestly, most modern controls let you do that with a simple drill cycle in the CAM software, so you don\u2019t have to write it manually. The point is, you don\u2019t need to memorize every G-code in the book. For 95% of the jobs a small to mid-sized VMC owner will run, you just need G00, G01, G02, G03, G54-G59, G20\/G21, G90\/G91, G43, and G94\/G95. That\u2019s it. I\u2019ve been selling VMCs for years, and the operators who get the best results aren\u2019t the ones who know 50 G-codes\u2014they\u2019re the ones who master these core ones, and know how to avoid the common mistakes.<\/p>\n<p>Let me wrap this up with a story from last month. We sold a VMC to a shop that had been using an old manual mill, and they were scared to switch to CNC. Their operator, a guy named Joe who\u2019d been doing milling for 20 years, told me he\u2019d never touched a CNC machine. I spent an hour going over the core G-codes for his VMC, focusing on the ones we talked about today\u2014G54 work offsets, G01 for cutting, G43 for tool length, and warning him about G00 crashes. Two weeks later, he sent me an email with a photo of a perfect aluminum bracket he\u2019d cut on the new VMC, using only the codes we went over. He wrote, \u201cI thought this would be rocket science, but it\u2019s just the same milling I\u2019ve been doing for years, with a few lines of code to tell the machine where to go.\u201d That\u2019s exactly why we design our VMCs to be operator-friendly, with easy-to-read controls that don\u2019t require a PhD to use.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.sunshine-machinery.com\/uploads\/48909\/small\/deep-drawing-press-machinee3320.jpg\"><\/p>\n<p>If you\u2019re a shop owner, operator, or engineer looking for a reliable VMC that\u2019s built with operator needs in mind\u2014no hidden features, no complicated programming hoops to jump through\u2014we can help. We work with shops of all sizes, from single-operator startups to mid-sized job shops, and we\u2019ll make sure you get the training and support you need to make the most of your VMC, including a breakdown of the G-codes specific to your jobs. Reach out to discuss your needs today.<\/p>\n<p><a href=\"https:\/\/www.sunshine-machinery.com\/vertical-machining-center\/\">Vertical Machining Center<\/a> References<br \/>\nFanuc Corporation. (2020). Fanuc CNC Programming Manual for Vertical Machining Centers. Fanuc America.<br \/>\nHaas Automation. (2022). Basic G-Code Programming for Haas VMCs. Haas Automation Inc.<br \/>\nMazak Corporation. (2021). Vertical Machining Center Operation and Programming Guide. Mazak North America.<\/p>\n<hr>\n<p><a href=\"https:\/\/www.sunshine-machinery.com\/\">Shandong Sunshine Machinery Co., Ltd.<\/a><br \/>With abundant experience, we are one of the most professional vertical machining center manufacturers and suppliers in China. We warmly welcome you to buy discount vertical machining center for sale here from our factory. All customized machines are with high quality and competitive price.<br \/>Address: No. 831 Shangdu, Xingtan Road, Jinghe Street, Tengzhou City, Zaozhuang City, Shandong Province<br \/>E-mail: linna.sunshinemachinery@gmail.com<br \/>WebSite: <a href=\"https:\/\/www.sunshine-machinery.com\/\">https:\/\/www.sunshine-machinery.com\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I was 19, I worked the night shift as a machine operator at a small &hellip; <a title=\"What G-codes are used in a vertical machining center?\" class=\"hm-read-more\" href=\"http:\/\/www.intacthair.com\/blog\/2026\/11\/21\/what-g-codes-are-used-in-a-vertical-machining-center-4bc2-497c0c\/\"><span class=\"screen-reader-text\">What G-codes are used in a vertical machining center?<\/span>Read more<\/a><\/p>\n","protected":false},"author":12,"featured_media":3870,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3833],"class_list":["post-3870","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-industry","tag-6b009e64-8998-009a-44ad-49aa69"],"_links":{"self":[{"href":"http:\/\/www.intacthair.com\/blog\/wp-json\/wp\/v2\/posts\/3870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.intacthair.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.intacthair.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.intacthair.com\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"http:\/\/www.intacthair.com\/blog\/wp-json\/wp\/v2\/comments?post=3870"}],"version-history":[{"count":0,"href":"http:\/\/www.intacthair.com\/blog\/wp-json\/wp\/v2\/posts\/3870\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.intacthair.com\/blog\/wp-json\/wp\/v2\/posts\/3870"}],"wp:attachment":[{"href":"http:\/\/www.intacthair.com\/blog\/wp-json\/wp\/v2\/media?parent=3870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.intacthair.com\/blog\/wp-json\/wp\/v2\/categories?post=3870"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.intacthair.com\/blog\/wp-json\/wp\/v2\/tags?post=3870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}