{"id":24363,"date":"2024-09-09T09:56:02","date_gmt":"2024-09-09T09:56:02","guid":{"rendered":"https:\/\/yijin.seo2.au\/?p=24363"},"modified":"2024-09-09T10:09:15","modified_gmt":"2024-09-09T10:09:15","slug":"cnc-lathe-codes","status":"publish","type":"post","link":"https:\/\/yijin.seo2.au\/es\/cnc-machining\/types\/lathe\/codes\/","title":{"rendered":"C\u00f3digos de tornos CNC"},"content":{"rendered":"<h1>What are CNC lathe codes?<\/h1>\n<p>CNC lathe codes consist primarily of <strong>G-codes<\/strong> and <strong>M-codes<\/strong>, along with <strong>address codes<\/strong> and <strong>canned cycles<\/strong>. These codes form a programming language that controls the operations of a <strong>CNC lathe<\/strong>, including tool movement, spindle control, coolant management, and various machining functions.<\/p>\n<p>The codes can range from simple movement commands to complex parametric programming, allowing for precise control and automation of the machining process.<\/p>\n<div class=\"flex max-w-full flex-col flex-grow\">\n<div class=\"min-h-[20px] text-message flex w-full flex-col items-end gap-2 whitespace-normal break-words [.text-message+&amp;]:mt-5\" dir=\"auto\" data-message-author-role=\"assistant\" data-message-id=\"51579c20-8990-4c2e-bc6c-893394de3246\">\n<div class=\"flex w-full flex-col gap-1 empty:hidden first:pt-[3px]\">\n<div class=\"markdown prose w-full break-words dark:prose-invert light\">\n<h2>Common G-codes and M-codes in CNC Lathe Programming<\/h2>\n<p>This table covers the most commonly used G-codes and M-codes in CNC lathe programming.<\/p>\n<p><em>Note that some codes may vary slightly depending on the specific CNC control system being used. Always refer to your machine&#8217;s programming manual for the exact implementation of these codes.<\/em><\/p>\n<table border=\"1\" data-sheets-root=\"1\" data-sheets-baot=\"1\">\n<colgroup>\n<col width=\"100\" \/>\n<col width=\"100\" \/>\n<col width=\"100\" \/>\n<col width=\"191\" \/><\/colgroup>\n<tbody>\n<tr>\n<td><strong>Code<\/strong><\/td>\n<td><strong>Category<\/strong><\/td>\n<td><strong>Function<\/strong><\/td>\n<td><strong>Notes<\/strong><\/td>\n<\/tr>\n<tr>\n<td>G00<\/td>\n<td>Motion<\/td>\n<td>Rapid positioning<\/td>\n<td>\n<div>\n<div>Moves at maximum speed to specified position<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G01<\/td>\n<td>Motion<\/td>\n<td>Linear interpolation<\/td>\n<td>\n<div>\n<div>Moves in a straight line at specified feed rate<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G02<\/td>\n<td>Motion<\/td>\n<td>Circular interpolation CW<\/td>\n<td>\n<div>\n<div>Creates clockwise circular arc<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G03<\/td>\n<td>Motion<\/td>\n<td>Circular interpolation CCW<\/td>\n<td>\n<div>\n<div>Creates counterclockwise circular arc<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G20<\/td>\n<td>Unit<\/td>\n<td>Inch system<\/td>\n<td>\n<div>\n<div>Sets programming to inch system<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G21<\/td>\n<td>Unit<\/td>\n<td>Metric system<\/td>\n<td>\n<div>\n<div>Sets programming to metric system<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G28<\/td>\n<td>Motion<\/td>\n<td>Return to home position<\/td>\n<td>Moves to machine zero point<\/td>\n<\/tr>\n<tr>\n<td>G96<\/td>\n<td>Spindle<\/td>\n<td>Constant surface speed<\/td>\n<td>\n<div>\n<div>Maintains constant cutting speed<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G97<\/td>\n<td>Spindle<\/td>\n<td>Constant spindle speed<\/td>\n<td>Maintains constant RPM<\/td>\n<\/tr>\n<tr>\n<td>M03<\/td>\n<td>Miscellaneous<\/td>\n<td>Spindle on clockwise<\/td>\n<td>\n<div>\n<div>Starts spindle rotation clockwise<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>M04<\/td>\n<td>Miscellaneous<\/td>\n<td>Spindle on counterclockwise<\/td>\n<td>\n<div>\n<div>Starts spindle rotation counterclockwise<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>M05<\/td>\n<td>Miscellaneous<\/td>\n<td>Spindle stop<\/td>\n<td>Stops spindle rotation<\/td>\n<\/tr>\n<tr>\n<td>M30<\/td>\n<td>Miscellaneous<\/td>\n<td>Program end<\/td>\n<td>Ends program and resets<\/td>\n<\/tr>\n<tr>\n<td>G00<\/td>\n<td>Motion<\/td>\n<td>Rapid positioning<\/td>\n<td>\n<div>\n<div>Moves at maximum speed to specified position<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G01<\/td>\n<td>Motion<\/td>\n<td>Linear interpolation<\/td>\n<td>\n<div>\n<div>Moves in a straight line at specified feed rate<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G02<\/td>\n<td>Motion<\/td>\n<td>Circular interpolation CW<\/td>\n<td>Creates clockwise circular arc<\/td>\n<\/tr>\n<tr>\n<td>G03<\/td>\n<td>Motion<\/td>\n<td>Circular interpolation CCW<\/td>\n<td>\n<div>\n<div>Creates counterclockwise circular arc<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G04<\/td>\n<td>Dwell<\/td>\n<td>Dwell<\/td>\n<td>\n<div>\n<div>Pause program for specified time<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G20<\/td>\n<td>Unit<\/td>\n<td>Inch system<\/td>\n<td>\n<div>\n<div>Sets programming to inch system<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G21<\/td>\n<td>Unit<\/td>\n<td>Metric system<\/td>\n<td>\n<div>\n<div>Sets programming to metric system<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G28<\/td>\n<td>Motion<\/td>\n<td>Return to home position<\/td>\n<td>Moves to machine zero point<\/td>\n<\/tr>\n<tr>\n<td>G40<\/td>\n<td>Compensation<\/td>\n<td>Tool nose compensation cancel<\/td>\n<td>\n<div>\n<div>Cancels tool nose radius compensation<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G41<\/td>\n<td>Compensation<\/td>\n<td>Tool nose compensation left<\/td>\n<td>\n<div>\n<div>Applies left tool nose radius compensation<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G42<\/td>\n<td>Compensation<\/td>\n<td>Tool nose compensation right<\/td>\n<td>\n<div>\n<div>Applies right tool nose radius compensation<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G50<\/td>\n<td>Setting<\/td>\n<td>Set coordinate system<\/td>\n<td>Establishes a coordinate system<\/td>\n<\/tr>\n<tr>\n<td>G54<\/td>\n<td>Coordinate<\/td>\n<td>Work coordinate system 1<\/td>\n<td>\n<div>\n<div>Selects work coordinate system 1<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G55<\/td>\n<td>Coordinate<\/td>\n<td>Work coordinate system 2<\/td>\n<td>\n<div>\n<div>Selects work coordinate system 2<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G56<\/td>\n<td>Coordinate<\/td>\n<td>Work coordinate system 3<\/td>\n<td>\n<div>\n<div>Selects work coordinate system 3<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G57<\/td>\n<td>Coordinate<\/td>\n<td>Work coordinate system 4<\/td>\n<td>\n<div>\n<div>Selects work coordinate system 4<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G58<\/td>\n<td>Coordinate<\/td>\n<td>Work coordinate system 5<\/td>\n<td>\n<div>\n<div>Selects work coordinate system 5<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G59<\/td>\n<td>Coordinate<\/td>\n<td>Work coordinate system 6<\/td>\n<td>\n<div>\n<div>Selects work coordinate system 6<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G70<\/td>\n<td>Cycle<\/td>\n<td>Finishing cycle<\/td>\n<td>Performs finishing cycle<\/td>\n<\/tr>\n<tr>\n<td>G71<\/td>\n<td>Cycle<\/td>\n<td>Stock removal in turning<\/td>\n<td>Performs rough turning cycle<\/td>\n<\/tr>\n<tr>\n<td>G72<\/td>\n<td>Cycle<\/td>\n<td>Stock removal in facing<\/td>\n<td>Performs rough facing cycle<\/td>\n<\/tr>\n<tr>\n<td>G73<\/td>\n<td>Cycle<\/td>\n<td>Pattern repeating<\/td>\n<td>\n<div>\n<div>Performs pattern repeating cycle<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G74<\/td>\n<td>Cycle<\/td>\n<td>Face grooving<\/td>\n<td>Performs face grooving cycle<\/td>\n<\/tr>\n<tr>\n<td>G75<\/td>\n<td>Cycle<\/td>\n<td>Outer\/Inner diameter grooving<\/td>\n<td>Performs OD\/ID grooving cycle<\/td>\n<\/tr>\n<tr>\n<td>G76<\/td>\n<td>Cycle<\/td>\n<td>Threading cycle<\/td>\n<td>\n<div>\n<div>Performs multi-pass threading cycle<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G90<\/td>\n<td>Mode<\/td>\n<td>Absolute programming<\/td>\n<td>\n<div>\n<div>Sets absolute coordinate programming<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G91<\/td>\n<td>Mode<\/td>\n<td>Incremental programming<\/td>\n<td>\n<div>\n<div>Sets incremental coordinate programming<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G94<\/td>\n<td>Feed<\/td>\n<td>Feed per minute<\/td>\n<td>\n<div>\n<div>Sets feed rate in units per minute<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G95<\/td>\n<td>Feed<\/td>\n<td>Feed per revolution<\/td>\n<td>\n<div>\n<div>Sets feed rate in units per revolution<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G96<\/td>\n<td>Spindle<\/td>\n<td>Constant surface speed<\/td>\n<td>\n<div>\n<div>Maintains constant cutting speed<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G97<\/td>\n<td>Spindle<\/td>\n<td>Constant spindle speed<\/td>\n<td>Maintains constant RPM<\/td>\n<\/tr>\n<tr>\n<td>G98<\/td>\n<td>Return<\/td>\n<td>Return to initial level<\/td>\n<td>\n<div>\n<div>Returns to initial Z-axis level in canned cycles<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>G99<\/td>\n<td>Return<\/td>\n<td>Return to R level<\/td>\n<td>\n<div>\n<div>Returns to R-axis level in canned cycles<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>M00<\/td>\n<td>Miscellaneous<\/td>\n<td>Program stop<\/td>\n<td>Stops program execution<\/td>\n<\/tr>\n<tr>\n<td>M01<\/td>\n<td>Miscellaneous<\/td>\n<td>Optional stop<\/td>\n<td>\n<div>\n<div>Stops program if optional stop switch is on<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>M03<\/td>\n<td>Miscellaneous<\/td>\n<td>Spindle on clockwise<\/td>\n<td>\n<div>\n<div>Starts spindle rotation clockwise<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>M04<\/td>\n<td>Miscellaneous<\/td>\n<td>Spindle on counterclockwise<\/td>\n<td>\n<div>\n<div>Starts spindle rotation counterclockwise<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>M05<\/td>\n<td>Miscellaneous<\/td>\n<td>Spindle stop<\/td>\n<td>Stops spindle rotation<\/td>\n<\/tr>\n<tr>\n<td>M06<\/td>\n<td>Miscellaneous<\/td>\n<td>Tool change<\/td>\n<td>\n<div>\n<div>Performs automatic tool change<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>M08<\/td>\n<td>Miscellaneous<\/td>\n<td>Coolant on<\/td>\n<td>Turns on flood coolant<\/td>\n<\/tr>\n<tr>\n<td>M09<\/td>\n<td>Miscellaneous<\/td>\n<td>Coolant off<\/td>\n<td>Turns off all coolant<\/td>\n<\/tr>\n<tr>\n<td>M10<\/td>\n<td>Miscellaneous<\/td>\n<td>Chuck clamp<\/td>\n<td>Clamps the chuck<\/td>\n<\/tr>\n<tr>\n<td>M11<\/td>\n<td>Miscellaneous<\/td>\n<td>Chuck unclamp<\/td>\n<td>Unclamps the chuck<\/td>\n<\/tr>\n<tr>\n<td>M19<\/td>\n<td>Miscellaneous<\/td>\n<td>Oriented spindle stop<\/td>\n<td>\n<div>\n<div>Stops spindle at a specific orientation<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>M30<\/td>\n<td>Miscellaneous<\/td>\n<td>Program end<\/td>\n<td>Ends program and resets<\/td>\n<\/tr>\n<tr>\n<td>M41<\/td>\n<td>Miscellaneous<\/td>\n<td>Gear select 1<\/td>\n<td>Selects spindle gear range 1<\/td>\n<\/tr>\n<tr>\n<td>M42<\/td>\n<td>Miscellaneous<\/td>\n<td>Gear select 2<\/td>\n<td>Selects spindle gear range 2<\/td>\n<\/tr>\n<tr>\n<td>M43<\/td>\n<td>Miscellaneous<\/td>\n<td>Gear select 3<\/td>\n<td>Selects spindle gear range 3<\/td>\n<\/tr>\n<tr>\n<td>M44<\/td>\n<td>Miscellaneous<\/td>\n<td>Gear select 4<\/td>\n<td>Selects spindle gear range 4<\/td>\n<\/tr>\n<tr>\n<td>M98<\/td>\n<td>Miscellaneous<\/td>\n<td>Subprogram call<\/td>\n<td>Calls a subprogram<\/td>\n<\/tr>\n<tr>\n<td>M99<\/td>\n<td>Miscellaneous<\/td>\n<td>Subprogram end<\/td>\n<td>Ends a subprogram and returns<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Example of a simple CNC lathe program:<\/h2>\n<pre><code>O1000 (SIMPLE TURNING PROGRAM)\r\nG21 G40 G95 G97\r\nG28 U0 W0\r\nT0101 (TURNING TOOL)\r\nG50 S2000\r\nG96 S180 M03\r\nG00 X50.0 Z0.1\r\nG01 X-1.6 F0.15\r\nG00 X50.0 Z2.0\r\nG28 U0 W0\r\nM30\r\n<\/code><\/pre>\n<p><strong>This program does the following:<\/strong><\/p>\n<ol>\n<li>Sets up the machine (metric, tool comp off, feed per rev, constant RPM)<\/li>\n<li>Returns to home position<\/li>\n<li>Selects tool 1<\/li>\n<li>Sets max spindle speed and turns on constant surface speed<\/li>\n<li>Moves to starting position<\/li>\n<li>Performs a facing cut<\/li>\n<li>Retracts<\/li>\n<li>Returns home<\/li>\n<li>Ends the program<\/li>\n<\/ol>\n<p>While these codes are standardized to some extent, there can be variations between different machine manufacturers and controllers.<\/p>\n<p>Back to Top: <a href=\"https:\/\/yijin.seo2.au\/cnc-machining\/types\/lathe\/codes\/\">CNC Lathe Codes<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>What are CNC lathe codes? CNC lathe codes consist primarily of G-codes and M-codes, along with address codes and canned cycles. These codes form a programming language that controls the operations of a CNC lathe, including tool movement, spindle control, coolant management, and various machining functions. The codes can range from simple movement commands to [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":24367,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_seopress_robots_primary_cat":"none","_seopress_titles_title":"CNC Lathe Codes | Complete G Code and M Code List for CNC","_seopress_titles_desc":"Discover a comprehensive reference list of G-code and M-code for CNC lathes, featuring commands, examples, and practical applications for your CNC programming needs.","_seopress_robots_index":"","footnotes":""},"categories":[37],"tags":[],"class_list":{"0":"post-24363","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-cnc-guides"},"acf":[],"_links":{"self":[{"href":"https:\/\/yijin.seo2.au\/es\/wp-json\/wp\/v2\/posts\/24363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yijin.seo2.au\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yijin.seo2.au\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yijin.seo2.au\/es\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/yijin.seo2.au\/es\/wp-json\/wp\/v2\/comments?post=24363"}],"version-history":[{"count":0,"href":"https:\/\/yijin.seo2.au\/es\/wp-json\/wp\/v2\/posts\/24363\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/yijin.seo2.au\/es\/wp-json\/wp\/v2\/media\/24367"}],"wp:attachment":[{"href":"https:\/\/yijin.seo2.au\/es\/wp-json\/wp\/v2\/media?parent=24363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yijin.seo2.au\/es\/wp-json\/wp\/v2\/categories?post=24363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yijin.seo2.au\/es\/wp-json\/wp\/v2\/tags?post=24363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}