mycnc:gcodes_list
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
mycnc:gcodes_list [2018/03/31 22:27] – skirillov | mycnc:gcodes_list [2022/02/04 13:34] – ivan | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== G-Codes list ===== | ===== G-Codes list ===== | ||
+ | |||
+ | Below is a list of G-codes currently implemented in the myCNC system. | ||
^ G-codes ^^^^ | ^ G-codes ^^^^ | ||
^ Code ^ Description ^ Mill (M)\\ Lathe(L)\\ Cutting table (C) ^ Comments ^ | ^ Code ^ Description ^ Mill (M)\\ Lathe(L)\\ Cutting table (C) ^ Comments ^ | ||
- | | G00 | Rapid Positioning | | + | | G00 | Rapid Positioning |
- | | G01 | Linear Interpolation | | + | | G01 | Linear Interpolation |
- | | G02 | Arc CCW Interpolation | | + | | G02 | Arc CCW Interpolation |
- | | G03 | Arc CW Interpolation | + | | G03 | Arc CW InterpolatioMotion Mode Canceln | | {{: |
- | | G04 | Dwell | | + | | G04 | Dwell | | In milliseconds. Will prevent the axes from moving during the specified time period |
- | | G5.1 | < | + | | G5.1 | < |
- | | G5.2 | < | + | | G5.2 | < |
- | | G5.3 | < | + | | G5.3 | < |
| G10 | [[mycnc: | | G10 | [[mycnc: | ||
| G11 | Mirror Cancel | | | G11 | Mirror Cancel | | ||
Line 21: | Line 23: | ||
| G18 | Plane ZX | | | G18 | Plane ZX | | ||
| G19 | Plane YZ | | | G19 | Plane YZ | | ||
- | | G20 | Unit Inches | | | + | | G20 | Set Units to Inches | | |
- | | G21 | Unit Metric | | | + | | G21 | Set Units to Metric | | |
- | | G28 | G28 Home | | + | | G28 | [[mycnc: |
| G28.1 | Home Position Set | | | G28.1 | Home Position Set | | ||
| G28.2 | Home Position #1 Save | | | G28.2 | Home Position #1 Save | | ||
Line 30: | Line 32: | ||
| G28.5 | Home Position #1 Restore | | | G28.5 | Home Position #1 Restore | | ||
| G28.6 | Home Position #2 Restore | | | G28.6 | Home Position #2 Restore | | ||
- | | G28.7 | Home Position #3 Restore | | ||
| G28.7 | Home Position #3 Restore | | | G28.7 | Home Position #3 Restore | | ||
| G28.9 | Home Position Address | | | G28.9 | Home Position Address | | ||
Line 37: | Line 38: | ||
| G33 | Spindle Synchronization | | | G33 | Spindle Synchronization | | ||
| G33 | Spindle Synchronization | | | G33 | Spindle Synchronization | | ||
- | | G38.2 | G38.2 Probing | | + | | G38.2 | G38.2 Probing |
| G38.3 | G38.3 Probing | | | G38.3 | G38.3 Probing | | ||
| G38.4 | G38.4 Probing | | | G38.4 | G38.4 Probing | | ||
| G38.5 | G38.5 Probing | | | G38.5 | G38.5 Probing | | ||
| G38.9 | Tool Measure | | | G38.9 | Tool Measure | | ||
- | | G40 | Tool Correction Cancel | | + | | G40 | Tool Correction Cancel |
- | | G41 | Tool Correction Left | | + | | G41 | Tool Correction Left | | {{: |
- | | G42 | Tool Correction Right | | + | | G42 | Tool Correction Right | | {{: |
| G43 | G43 Tool Length Offset | | | G43 | G43 Tool Length Offset | | ||
| G44 | G44 Tool Length Offset | | | G44 | G44 Tool Length Offset | | ||
Line 67: | Line 68: | ||
| G64 | < | | G64 | < | ||
| G65 | G-code macro | M | | | G65 | G-code macro | M | | ||
- | | G68 | Rotation Coordinates Mode On | M | | + | | G73 | [[mycnc: |
- | | G69 | Rotation Coordinates Mode Off | M | | + | |
- | | G73 | Cycle Deep Hole Drilling | M | | + | |
| G74 | Cycle Left Hand Tapping | M | | | G74 | Cycle Left Hand Tapping | M | | ||
- | | G76 | Cycle Lathe Thread | L | | + | | G76 | Cycle Lathe Thread | L | [[mycnc: |
- | | G76 | Motion Mode Cancel| L | | + | |
| G80 | Cancel Motion Mode | | | | G80 | Cancel Motion Mode | | | ||
- | | G81 | Cycle Drilling | | | + | | G81 | [[mycnc: |
| G82 | Cycle Drilling Dwell | | | | G82 | Cycle Drilling Dwell | | | ||
- | | G83 | Cycle Peck Drilling | | | + | | G83 | [[mycnc: |
| G84 | Cycle Right Hand Tapping | | | | G84 | Cycle Right Hand Tapping | | | ||
| G85 | Cycle Boring No Dwell Feed Out | | | G85 | Cycle Boring No Dwell Feed Out | | ||
Line 88: | Line 86: | ||
| G91.1 | Arc Center Incremental Programming | | | | | G91.1 | Arc Center Incremental Programming | | | | ||
| G92 | Set Work Position | M | | | G92 | Set Work Position | M | | ||
- | | G92 | Lathe Thread | L | | + | | G92 | Lathe Thread | L | For example, < |
| G94 | Feedrate Per Minute | L | | | G94 | Feedrate Per Minute | L | | ||
| G95 | Feedrate Per Revolution | | | G95 | Feedrate Per Revolution | | ||
- | | G96 | Lathe Surface Speed | L | (constant | + | | G96 | Lathe Surface Speed | L | Constant |
| G97 | Set Spindle Speed | L | (revolutions per minute) | | | G97 | Set Spindle Speed | L | (revolutions per minute) | | ||
- | | G98 | TURN_FEEDRATE_PER_MINUTE | L | | + | | G98 | Turn Feedrate per Minute |
- | | G99 | TURN_FEEDRATE_PER_REVOLUTION | + | | G98 | Canned Return Back to initial height |
- | | G98 | Canned Return Back | M | | | + | | G99 | Turn Feedrate per Revolution |
- | | G99 | Canned Return R | M | | | + | | G99 | Canned Return to a set height |
- | | G70 | Unit Inches (2) | | | | + | |
- | | G71 | Unit Metric | + | |
| G150 | Tool Correction Radius Set | | | G150 | Tool Correction Radius Set | | ||
^ Miscellaneous M-codes ^^^^ | ^ Miscellaneous M-codes ^^^^ | ||
Line 110: | Line 106: | ||
| M06 | Change Tool | Macro | | | | M06 | Change Tool | Macro | | | ||
| M07 | Mist On (Cutting On) | PLC | | | M07 | Mist On (Cutting On) | PLC | | ||
+ | | M07 | [[gcodes_list# | ||
| M08 | Flood On (Cutting On) | PLC | | | M08 | Flood On (Cutting On) | PLC | | ||
+ | | M08 | [[gcodes_list# | ||
| M09 | All Coolant Off (Cutting Off) | PLC | | | M09 | All Coolant Off (Cutting Off) | PLC | | ||
| M14 | THC Off | Native + PLC | Cutting tables | | | M14 | THC Off | Native + PLC | Cutting tables | | ||
Line 118: | Line 116: | ||
| M20 | Start Cutting | PLC | Cutting Tables | | | M20 | Start Cutting | PLC | Cutting Tables | | ||
| M21 | Stop Cutting | PLC | Cutting Tables | | | M21 | Stop Cutting | PLC | Cutting Tables | | ||
- | | M23 | Thread Finishing | + | | M23 | [[mycnc: |
- | | M24 | Thread Finishing | + | | M24 | [[mycnc: |
- | | M30 | End Program with Rewind Pointer | Macro | | | + | | M30 | [[mycnc: |
| M41 | Set Low Gears | PLC | | | | M41 | Set Low Gears | PLC | | | ||
| M41 | Set High Gears | PLC | | | | M41 | Set High Gears | PLC | | | ||
Line 133: | Line 131: | ||
| M64 | Turn On binary output pin | PLC | | | | M64 | Turn On binary output pin | PLC | | | ||
| M65 | Turn Off binary output pin | PLC | | | | M65 | Turn Off binary output pin | PLC | | | ||
- | | M71 | Start Cutting | PLC | Cutting Tables | | + | | M71 | Start Cutting |
| M72 | Begin Plasma Marking Section | PLC | Cutting Tables | | | M72 | Begin Plasma Marking Section | PLC | Cutting Tables | | ||
| M73 | End Plasma Marking Section | PLC | Cutting Tables | | | M73 | End Plasma Marking Section | PLC | Cutting Tables | | ||
Line 146: | Line 144: | ||
| M101-199 | User defined M-codes (Section 2) | | | M101-199 | User defined M-codes (Section 2) | | ||
| M200-999 | User defined M-codes (Section 3) | | | M200-999 | User defined M-codes (Section 3) | | ||
+ | | M421 | Tool Length Measure | | ||
+ | | M422 | Tool Breakage Check | | ||
+ | | M440-M470 | Probing tool macros (locating surface, edges, etc) | | ||
^ Misc Macros ^^^^ | ^ Misc Macros ^^^^ | ||
^ Code ^ Description ^ Implementation ^ Comments ^ | ^ Code ^ Description ^ Implementation ^ Comments ^ | ||
^ Homing ^^^^ | ^ Homing ^^^^ | ||
- | | M131 | Homing X axis | Macro | | | ||
- | | M132 | Homing Y axis | Macro | | | ||
- | | M133 | Homing Z axis | Macro | | | ||
- | | M134 | Homing A axis | Macro | | | ||
- | | M135 | Homing B axis | Macro | | | ||
- | | M136 | Homing C axis | Macro | | | ||
- | | M138 | Homing All axes | Macro | | | ||
- | ^ Tool Measure ^^^^ | ||
| M131 | Homing X axis | Macro | | | | M131 | Homing X axis | Macro | | | ||
| M132 | Homing Y axis | Macro | | | | M132 | Homing Y axis | Macro | | | ||
Line 164: | Line 157: | ||
| M136 | Homing C axis | Macro | | | | M136 | Homing C axis | Macro | | | ||
| M138 | Homing All axes | Macro | | | | M138 | Homing All axes | Macro | | | ||
- | |||
Line 176: | Line 168: | ||
* Q - Parameter #2 | * Q - Parameter #2 | ||
* X, | * X, | ||
+ | |||
+ | - **L2** - set an offset between program and machine coordinates. P1 to P9 for coordinate systems G54 to G59.3 < | ||
- **L70** - set position to given values | - **L70** - set position to given values | ||
- | - **P0** - Set **Machine Position** to given values < | + | - **P0** - Set **Machine Position** to given values < |
- | - **P1** - Set Work Position in **G54** Coordinates system to given values < | + | - **P1** - Set Work Position in **G54** Coordinates system to given values < |
- | - **P2** - Set Work Position in **G55** Coordinates system to given values < | + | - **P2** - Set Work Position in **G55** Coordinates system to given values < |
- | - **P3** - Set Work Position in **G56** Coordinates system to given values < | + | - **P3** - Set Work Position in **G56** Coordinates system to given values < |
- | - **P4** - Set Work Position in **G57** Coordinates system to given values < | + | - **P4** - Set Work Position in **G57** Coordinates system to given values < |
- | - **P5** - Set Work Position in **G58** Coordinates system to given values < | + | - **P5** - Set Work Position in **G58** Coordinates system to given values < |
- | - **P6** - Set Work Position in **G59** Coordinates system to given values < | + | - **P6** - Set Work Position in **G59** Coordinates system to given values < |
- | - **P7** - Set Work Position in **G59.1** Coordinates system to given values < | + | - **P7** - Set Work Position in **G59.1** Coordinates system to given values < |
- **P8** - Set Work Position in **G59.2** Coordinates system to given values | - **P8** - Set Work Position in **G59.2** Coordinates system to given values | ||
- **P9** - Set Work Position in **G59.3** Coordinates system to given values | - **P9** - Set Work Position in **G59.3** Coordinates system to given values | ||
- | - Current coordinates number is stored in Global variables register #5220. This register can be used to set Work coordinates in **the Current Coordinates System** < | + | - Current coordinates number is stored in Global variables register #5220. This register can be used to set Work coordinates in **the Current Coordinates System** < |
- | - L80 - **Assign** value from **Q** to Register Address **P**< | + | - L80 - **Assign** value from **Q** to Register Address **P**< |
- | - L81 - **Copy** value from Register Address **Q** to Register Address **P**< | + | - L81 - **Copy** value from Register Address **Q** to Register Address **P**< |
- | - L180 - **Add** **Q** value to Register Address **P** and store the result to Register Address **P** <code C>G10 L180 P100 Q10 (//Add 10 to Register #100 // #100=#100 + 10 // | + | - L180 - **Add** **Q** value to Register Address **P** and store the result to Register Address **P** <code C>G10L180 |
- | - L181 - **Subtract** **Q** value from Register Address **P** and store the result to Register Address **P** <code C>G10 L181 P100 Q10 (//Subtract 10 from Register #100 // #100=#100 - 10 // | + | - L181 - **Subtract** **Q** value from Register Address **P** and store the result to Register Address **P** <code C>G10L181 |
- | - L182 - **Mul** Register Address **P** by **Q** value and store the iresult to Register Address **P** <code C>G10 L180 P100 Q10 (//Multiply Register #100 by 10 // #100=#100 * 10 // | + | - L182 - **Mul** Register Address **P** by **Q** value and store the iresult to Register Address **P** <code C>G10L182 |
- | - L183 - **Divide** Register Address **P** to **Q**value and store the result to Register Address **P** <code C>G10 L180 P100 Q10 (//Divide Register #100 by 10 // #100=#100 / 10 // | + | - L183 - **Divide** Register Address **P** to **Q**value and store the result to Register Address **P** <code C>G10L183 |
- | - L184 - **Binary AND** value **Q** with Register Address **P** and store the result to Register Address **P** <code C>G10 L184 P100 Q66 (//Binary AND Register #100 with 66 // #100=#100 & 66 // | + | - L184 - **Binary AND** value **Q** with Register Address **P** and store the result to Register Address **P** <code C>G10L184 |
- | - L185 - **Binary OR** value **Q** with Register Address **P** and store the result to Register Address **P** <code C>G10 L185 P100 Q66 (//Binary OR Register #100 with 66 // #100=#100 | 66 // | + | - L185 - **Binary OR** value **Q** with Register Address **P** and store the result to Register Address **P** <code C>G10L185 |
- | - L186 - **Binary XOR** value **Q** with Register Address **P** and store the result to Register Address **P** <code C>G10 L186 P100 Q77 (//Binary XOR Register #100 with 77 // #100=#100 ^ 77 // | + | - L186 - **Binary XOR** value **Q** with Register Address **P** and store the result to Register Address **P** <code C>G10L186 |
- | - L190 - **Add** value from Register Address **Q** with Register Address **P** and store the result to Register Address **P** <code C>G10 L190 P100 Q101 (//Add Register #100 with Register #101 // #100=#100 + #101 // | + | - L190 - **Add** value from Register Address **Q** with Register Address **P** and store the result to Register Address **P** <code C>G10L190 |
- | - L191 - **Subtract** value from Register Address **Q** from Register Address **P** and store the result to Register Address **P** <code C>G10 L191 P100 Q101 (//Subtract Register #101 from Register #100 // #100=#100 - #101 // | + | - L191 - **Subtract** value from Register Address **Q** from Register Address **P** and store the result to Register Address **P** <code C>G10L191 |
- | - L192 - **Mul** value from Register Address **Q** by Register Address **P** and store the result to Register Address **P** <code C>G10 L192 P100 Q105 (//Multiply Register #100 by Register #105 // #100=#100 * #105 // | + | - L192 - **Mul** value from Register Address **Q** by Register Address **P** and store the result to Register Address **P** <code C>G10L192 |
- | - L193 - **Divide** value from Register Address **P** to Register Address **Q** and store the result to Register Address **P** <code C>G10 L193 P100 Q101 (//Divide Register #100 to Register #101 // #100=#100 / #101 // | + | - L193 - **Divide** value from Register Address **P** to Register Address **Q** and store the result to Register Address **P** <code C>G10L193 |
- | - L194 - **ABS** calculate absolute value of Register Address **P** and store the result to Register Address **P** <code C>G10 L194 P100 (//Absolute value of Register #100 // # | + | - L194 - **ABS** calculate absolute value of Register Address **P** and store the result to Register Address **P** <code C>G10L194 |
+ | |||
+ | ==== M07 - Plasma Dot Marking ==== | ||
+ | |||
+ | M07 is used as Plasma Dot Marking. Dot Marking procedure is - | ||
+ | * Plasma Torch moves down till probe sensor activated | ||
+ | * The torch moves up to **Ignition Height** | ||
+ | * Plasma Power source is turned ON | ||
+ | * System wait Dot Time which is sum of **Plasma Power Source Delay Time** and **Dot Time** | ||
+ | * Plasma Power source is OFF | ||
+ | * Torch moves up to 20mm | ||
+ | |||
+ | M07 PLC procedure source code is below | ||
+ | <code C M07.plc> | ||
+ | #include pins.h | ||
+ | #include vars.h | ||
+ | #include func_ihc.h | ||
+ | |||
+ | main() | ||
+ | { | ||
+ | portclr (OUTPUT_MARKER1); | ||
+ | portclr (OUTPUT_MARKER2); | ||
+ | |||
+ | do_plasma_probe(); | ||
+ | |||
+ | if (marker_ihc_dot_height< | ||
+ | |||
+ | gvarset(7080, | ||
+ | |||
+ | g0moveA(0x0, | ||
+ | timer=200; | ||
+ | do { code=gvarget(6060); | ||
+ | |||
+ | portset(OUTPUT_PLASMA); | ||
+ | portset(OUTPUT_MARKER1); | ||
+ | |||
+ | timer=marker_dot_time; | ||
+ | timer=timer+marker_dot_delay; | ||
+ | |||
+ | portclr(OUTPUT_PLASMA); | ||
+ | portclr(OUTPUT_MARKER1); | ||
+ | |||
+ | g0moveA(0x0, | ||
+ | timer=200; | ||
+ | do { code=gvarget(6060); | ||
+ | |||
+ | proc=plc_proc_idle; | ||
+ | exit(99); | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== M08 - Plasma cutting table - Drill Marking ==== | ||
+ | |||
+ | M08 is used for Drill Marking operations on Plasma Cutting machines which have drill head. Drill Marking procedure is the following: | ||
+ | * Drill Head Cylinder and Drill Power turned ON | ||
+ | * Drill Head moves down on **Probing Speed** until **Drill probe sensor** activated | ||
+ | * Moving speed switched to **Drill Speed** and the Head move lower to programmed **Drill Depth** | ||
+ | * Drill Head moves up to **Lift Height** | ||
+ | * Drill Head Cylinder and Drill Power turned OFF | ||
+ | |||
+ | M08 PLC source code example is shown below | ||
+ | |||
+ | <code C M08.plc> | ||
+ | #include pins.h | ||
+ | #include vars.h | ||
+ | main() | ||
+ | { | ||
+ | portset(OUTPUT_DRILL_VALVE); | ||
+ | portset(OUTPUT_DRILL_POWER); | ||
+ | |||
+ | gvarset(7080, | ||
+ | timer=200; | ||
+ | |||
+ | sens=portget(INPUT_DRILL); | ||
+ | if (sens==0) | ||
+ | { | ||
+ | g0moveA(0x0, | ||
+ | timer=200; | ||
+ | do{ | ||
+ | code=gvarget(6060); | ||
+ | sens=portget(INPUT_DRILL); | ||
+ | if (sens!=0) | ||
+ | { | ||
+ | code=1; | ||
+ | message=PLCCMD_LINE_STOP;// | ||
+ | }; | ||
+ | }while (code==0); | ||
+ | do { code=gvarget(6060); | ||
+ | }; | ||
+ | |||
+ | gvarset(7080, | ||
+ | if (drill_depth> | ||
+ | { | ||
+ | depth=0-drill_depth; | ||
+ | g0moveA(0x0, | ||
+ | timer=200; | ||
+ | do{code=gvarget(6060); | ||
+ | }; | ||
+ | |||
+ | gvarset(7080, | ||
+ | |||
+ | if (drill_lift_height< | ||
+ | { | ||
+ | drill_lift_height=100; | ||
+ | }; | ||
+ | |||
+ | g0moveA(0x0, | ||
+ | timer=200; | ||
+ | do { code=gvarget(6060); | ||
+ | |||
+ | portclr(OUTPUT_DRILL_VALVE); | ||
+ | portclr(OUTPUT_DRILL_POWER); | ||
+ | exit(99); | ||
+ | }; | ||
+ | </ | ||
==== M45 - Start Plasma Marking ==== | ==== M45 - Start Plasma Marking ==== | ||
Line 216: | Line 324: | ||
- | < | + | < |
#include pins.h | #include pins.h | ||
#include vars.h | #include vars.h |
mycnc/gcodes_list.txt · Last modified: 2023/09/29 14:15 by ivan