User Tools

Site Tools


en:x300:g-code_and_m-code

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:x300:g-code_and_m-code [2022/09/28 11:26]
erik.ketele
en:x300:g-code_and_m-code [2023/05/17 10:05] (current)
Line 151: Line 151:
 G-codes G-codes
  
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G-code</font>  \\ +|G-code|meaning| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>meaning</font>  \\ +|G0|rapid positioning| 
-| +|G1|linear interpolation| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G0</font>  \\ +|G2|helical interpolation (clockwise)| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>rapid positioning</font>   \\ +|G3|circular/helical interpolation (counterclockwise)| 
-| +|G4|dwell| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G1</font>  \\ +|G10|coordinate system origin setting| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>linear interpolation</font>   \\ +|G17|XY-plane selection| 
-| +|G18|XZ-plane selection| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G2</font>  \\ +|G19|YZ-plane selection| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>circular/helical interpolation (clockwise)</font>   \\ +|G20|inch system selection| 
-| +|G21|millimeter system selection| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G3</font>  \\ +|G28|move to park position 1, setup on variable page| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>circular/helical interpolation (counterclockwise)</font>   \\ +|G30|move to park position 2, setup on variable page| 
-| +|G33|Lathe, motion synchronized to spindle| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G4</font>  \\ +|G38.2|straight probe| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>dwell</font>   \\ +|G40|cancel cutter radius compensation| 
-| +|G41|start cutter radius compensation left| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G10</font>  \\ +|G42|start cutter radius compensation right| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>coordinate system origin setting</font>   \\ +|G43|tool length offset (plus) , tool X offset for lathe| 
-| +|G49|cancel tool length offset| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G17</font>  \\ +|G53|motion in machine coordinate system| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>XY-plane selection</font>   \\ +|G54|use preset work coordinate system 1| 
-| +|G55|use preset work coordinate system 2| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G18</font>  \\ +|G56|use preset work coordinate system 3| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>XZ-plane selection</font>   \\ +|G57|use preset work coordinate system 4| 
-| +|G58|use preset work coordinate system 5| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G19</font>  \\ +|G59|use preset work coordinate system 6| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>YZ-plane selection</font>   \\ +|G59.1|use preset work coordinate system 7| 
-| +|G59.2|use preset work coordinate system 8| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G20</font>  \\ +|G59.3|use preset work coordinate system 9| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>inch system selection</font>   \\ +|G61|set path control mode: exact path| 
-| +|G61.1|set path control mode: exact stop| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G21</font>  \\ +|G64|set path control mode: continuous| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>millimeter system selection</font>   \\ +|G68|XY rotation| 
-| +|G76|Lathe, threading| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G28</font>  \\ +|G80|cancel motion mode (including any canned cycle)| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>move to park position 1, setup on variable page</font>   \\ +|G81|canned cycle: drilling| 
-| +|G82|canned cycle: drilling with dwell| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G30</font>  \\ +|G83|canned cycle: peck drilling| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>move to park position 2, setup on variable page</font>   \\ +|G84|canned cycle: right hand tapping| 
-| +|G85|canned cycle: boring, no dwell, feed out| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G33</font>  \\ +|G86|canned cycle: boring, spindle stop, rapid out| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>Lathe, motion synchronized to spindle</font>   \\ +|G87|canned cycle: back boring| 
-| +|G88|canned cycle: boring, spindle stop, manual out| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G38.2</font>  \\ +|G89|canned cycle: boring, dwell, feed out| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>straight probe</font>   \\ +|G90|absolute distance mode| 
-| +|G91|incremental distance mode| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G40</font>  \\ +|G92|offset coordinate systems and set parameters| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>cancel cutter radius compensation</font>   \\ +|G92.1|cancel offset coordinate systems and set parameters to zero| 
-| +|G92.2|cancel offset coordinate systems but do not reset parameters| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G41</font>  \\ +|G92.3|apply parameters to offset coordinate systems| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>start cutter radius compensation left</font>   \\ +|G93|inverse time feed rate mode| 
-| +|G94|units per minute feed rate mode| 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G42</font>  \\ +|G98|initial level return in canned cycles| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>start cutter radius compensation right</font>   \\ +|G99|R-point level return in canned cycles| 
-| + 
-| \\ <font 11pt/Calibri,sans-serif;;inherit;;inherit>G43</font>  \\ +=== Linear Motion at Feed Rate - G1 === 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>tool length offset (plus) , tool X offset for lathe</font>   \\ + 
-| +For linear motion at feed rate (for cutting or not), program G1 X… Y… Z… A…, where all the axis words are optional, except that at least one must be used.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G49</font>   \\ +The G1 is optional if the current motion mode is G1. This will produce coordinated linear motion to the destination point at the current feed rate (or slower if the machine will not go that fast).\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>cancel tool length offset</font>   \\ +It is an error if:\\ 
-| +• • All axis words are omitted. 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G53</font>   \\ + 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>motion in machine coordinate system</font>   \\ +=== Arc at Feed Rate - G2 and G3 === 
-| + 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G54</font>   \\ +A circular or helical arc is specified using either G2 (clockwise arc) or G3 (counterclockwise arc). The axis of the circle or helix must be parallel to the X, Y, or Z-axis of the machine coordinate system.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>use preset work coordinate system 1</font>   \\ +The axis (or, equivalently, the plane perpendicular to the axis) is selected with G17 (Z-axis, XY-plane), G18 (Y-axis, XZ-plane), or G19 (X-axis, YZ-plane). If the arc is circular, it lies in a plane parallel to the selected plane.\\ 
-| +If a line of RS274/NGC code makes an arc and includes rotational axis motion, the rotational axes turn at a constant rate so that the rotational motion starts and finishes when the XYZ motion starts and finishes. Lines of this sort are hardly ever programmed.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G55</font>   \\ +Two formats are allowed for specifying an arc. We will call these the center format and the radius format. In both formats the G2 or G3 is optional if it is the current motion mode. 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>use preset work coordinate system 2</font>   \\ + 
-| +== Radius format arc == 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G56</font>   \\ + 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>use preset work coordinate system 3</font>   \\ +In the radius format, the coordinates of the end point of the arc in the selected plane are specified along with the radius of the arc. Program G2 X… Y… Z… A… R… (or use G3 instead of G2). R is the radius.\\ 
-| +The axis words are all optional except that at least one of the two words for the axes in the selected plane must be used. The R number is the radius.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G57</font>   \\ +A positive radius indicates that the arc turns through 180 degrees or less, while a negative radius indicates a turn of 180 degrees to 359.999 degrees. If the arc is helical, the value of the end point of the arc on the coordinate axis parallel to the axis of the helix is also specified.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>use preset work coordinate system 4</font>   \\ +It is not good practice to program radius format arcs that are nearly full circles or are semicircles (or nearly semicircles) because a small change in the location of the end point will produce a much larger change in the location of the center of the circle (and, hence, the middle of the arc).\\ 
-| +The magnification effect is large enough that rounding error in a number can produce out-of-tolerance cuts. Nearly full circles are outrageously bad, semicircles (and nearly so) are only very bad. Other size arcs (in the range tiny to 165 degrees or 195 to 345 degrees) are OK.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G58</font>   \\ +Here is an example of a radius format command to mill an arc: **G17 G2 x 10 y 15 r 20 z 5.** \\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>use preset work coordinate system 5</font>   \\ +That means to make a clockwise (as viewed from the positive Z-axis) circular or helical arc whose axis is parallel to the Z-axis, ending where X=10, Y=15, and Z=5, with a radius of 20. If the starting value of Z is 5, this is an arc of a circle parallel to the XY-plane; otherwise it is a helical arc. 
-| + 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G59</font>   \\ +== Center format arc == 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>use preset work coordinate system 6</font>   \\ + 
-| +In the center format, the coordinates of the end point of the arc in the selected plane are specified along with the offsets of the center of the arc from the current location. In this format, it is OK if the end point of the arc is the same as the current point. It is an error if:\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G59.1</font>   \\ +• When the arc is projected on the selected plane, the distance from the current point to the center differs from the distance from the end point to the center by more than 0.0002 inch (if inches are being used) or 0.002 millimeter (if millimeters are being used).\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>use preset work coordinate system 7</font>   \\ +When the XY-plane is selected, program **G2 X… Y… Z… A… I… J…** (or use G3 instead of G2). The axis words are all optional except that at least one of X and Y must be used. I and J are the offsets from the current location (in the X and Y directions, respectively) of the center of the circle.\\ 
-| +I and J are optional except that at least one of the two must be used. It is an error if:\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G59.2</font>   \\ +* I and J are both omitted.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>use preset work coordinate system 8</font>   \\ +\\ 
-| +When the XZ-plane is selected, program **G2 X… Y… Z… A… I… K…** (or use G3 instead of G2). The axis words are all optional except that at least one of X and Z must be used. I and K are the offsets from the current location (in the X and Z directions, respectively) of the center of the circle.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G59.3</font>   \\ +I and K are optional except that at least one of the two must be used. It is an error if:\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>use preset work coordinate system 9</font>   \\ +* I and K are both omitted.\\ 
-| +\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G61</font>   \\ +When the YZ-plane is selected, program **G2 X… Y… Z… A… B… C… J… K…** (or use G3 instead of G2). The axis words are all optional except that at least one of Y and Z must be used. J and K are the offsets from the current location (in the Y and Z directions, respectively) of the center of the circle.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>set path control mode: exact path</font>   \\ +J and K are optional except that at least one of the two must be used. It is an error if:\\ 
-| +* J and K are both omitted.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G61.1</font>   \\ +\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>set path control mode: exact stop</font>   \\ +Here is an example of a center format command to mill an arc:\\ 
-| +**G17 G2 x10 y16 i3 j4 z9.** \\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G64</font>   \\ +\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>set path control mode: continuous</font>   \\ +That means to make a clockwise (as viewed from the positive z-axis) circular or helical arc whose axis is parallel to the Z-axis, ending where X=10, Y=16, and Z=9, with its center offset in the X direction by 3 units from the current X location and offset in the Y direction by 4 units from the current Y location.\\ 
-| +If the current location has X=7, Y=7 at the outset, the center will be at X=10, Y=11. If the starting value of Z is 9, this is a circular arc; otherwise it is a helical arc. The radius of this arc would be 5.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G68</font>   \\ +\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>XY rotation</font>   \\ +In the center format, the radius of the arc is not specified, but it may be found easily as the distance from the center of the circle to either the current point or the end point of the arc 
-| + 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G76</font>   \\ +=== Dwell - G4 === 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>Lathe, threading</font>   \\ + 
-| +For a dwell, program G4 P… . This will keep the axes unmoving for the period of time in seconds specified by the P number. It is an error if the P number is negative.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G80</font>   \\ +=== Length Units - G20/G21 and G70/G71 === 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>cancel motion mode (including any canned cycle)</font>   \\ + 
-| +Program G20 to use inches for length units. Program G21 to use millimeters.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G81</font>   \\ +It is usually a good idea to program either G20 or G21 near the beginning of a program before any motion occurs, and not to use either one anywhere else in the program.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>canned cycle: drilling</font>   \\ +It is the responsibility of the user to be sure all numbers are appropriate for use with the current length units. G70/G71 is added for CAM software compatibility.\\ 
-| +=== Return to Home - G28 and G30 === 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G82</font>   \\ + 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>canned cycle: drilling with dwell</font>   \\ +Two home positions are defined (by parameters 5161-5166 for G28 and parameters 5181-5186 for G30). The parameter values are in terms of the absolute coordinate system, but are in unspecified length units.\\ 
-| +To return to home position by way of the programmed position, program G28 X… Y… Z… A… (or use G30). All axis words are optional.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G83</font>   \\ +The path is made by a traverse move from the current position to the programmed position, followed by a traverse move to the home position.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>canned cycle: peck drilling</font>   \\ +If no axis words are programmed, the intermediate point is the current point, so only one move is made. The order of Z depends on its position, if the end position is higher as the current Z position Z will move first, otherwise Z will move last, this is to prevent collision.\\ 
-| +\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G84</font>   \\ +==== Input M codes ==== 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>canned cycle: right hand tapping</font>   \\ + 
-| +M codes of the RS274/NGC language are shown in the following table.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G85</font>   \\ +|M code|Meaning| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>canned cycle: boring, no dwell, feed out</font>   \\ +|M0|program stop| 
-| +|M1|optional program stop| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G86</font>   \\ +|M2|program end| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>canned cycle: boring, spindle stop, rapid out</font>   \\ +|M3|turn spindle clockwise| 
-| +|M4|turn spindle counterclockwise| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G87</font>   \\ +|M5|stop spindle turning| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>canned cycle: back boring</font>   \\ +|M6|tool change| 
-| +|M7|mist coolant on| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G88</font>   \\ +|M8|flood coolant on| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>canned cycle: boring, spindle stop, manual out</font>   \\ +|M9|mist and flood coolant off| 
-| +|M30|progrma end, spindle and coolants off and rewind.| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G89</font>   \\ +|M48|enable speed and feed overrides.| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>canned cycle: boring, dwell, feed out</font>   \\ +|M49|disable speed and feed overrides.| 
-| +|M90|standard head/spindle| 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G90</font>   \\ + 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>absolute distance mode</font>   \\ +== Program Stopping and Ending - M0, M1, M2, M30, M60 == 
-| +To halt a running program temporarily, program M0. If a program is stopped by an M0, pressing the cycle start button will restart the program at the following line, so the program will continue.\\  
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G91</font>   \\ +**M30** for next effects:\\  
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>incremental distance mode</font>   \\ +• Distance mode is set to MODE_ABSOLUTE (like G90).\\ 
-| +• Feed rate mode is set to UNITS_PER_MINUTE (like G94).\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G92</font>   \\ +• Feed and speed overrides are set to ON (like M48).\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>offset coordinate systems and set parameters</font>   \\ +• The spindle is stopped (like M5).\\ 
-| +• Coolants are turned off (like M9).\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G92.1</font>   \\ +• Program is re-winded to the first line, ready for next start.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>cancel offset coordinate systems and set parameters to zero</font>   \\ +\\ 
-| +Program **M60** instead of M30 if the spindle and coolants should remain ON.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G92.2</font>   \\ +\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>cancel offset coordinate systems but do not reset parameters</font>   \\ +== Spindle/Head Control - M3, M4, M5, M90-M97 ==  
-| +To start the spindle turning clockwise at the currently programmed speed, program M3.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G92.3</font>   \\ +To start the spindle turning counterclockwise at the currently programmed speed, program M4.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>apply parameters to offset coordinate systems</font>   \\ +To stop the spindle from turning, program M5.\\ 
-| +It is OK to use M3 or M4 if the spindle speed is set to zero. If this is done (or if the speed override switch is enabled and set to zero), the spindle will not start turning.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G93</font>   \\ +If, later, the spindle speed is set above zero (or the override switch is turned up), the spindle will start turning. It is OK to use M3 or M4 when the spindle is already turning or to use M5 when the spindle is already stopped.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>inverse time feed rate mode</font>   \\ +\\ 
-| +**__Note:__** It is not possible to make the spindle rotate counterclockwise in the Cyborg engravers. 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G94</font>   \\ +\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>units per minute feed rate mode</font>   \\ +== Coolant Control - M7, M8, M9 ==  
-| +To turn mist coolant on, program M7. To turn flood coolant on, program M8. To turn all coolant off, program M9. It is always OK to use any of these commands, regardless of what coolant is on or off.\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G98</font>   \\ +\\ 
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>initial level return in canned cycles</font>   \\ +
-| +
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>G99</font>   \\ +
-| \\ <font 11pt/Calibri,sans-serif;;black;;inherit>R-point level return in canned cycles</font>   \\ +
-|+
  
 **Continue to [[:en:x300:table_of_contents|the table of contents]].** **Continue to [[:en:x300:table_of_contents|the table of contents]].**
  
  
en/x300/g-code_and_m-code.1664357199.txt.gz · Last modified: 2022/09/28 11:26 by erik.ketele