Ero sivun ”G-koodi” versioiden välillä
(16 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
Rivi 16: | Rivi 16: | ||
A CNC program that follows G-code syntax consists of low-level functions called blocks. Sentences, in turn, are built from words (code). The words are either "preparatory" G-codes or "Miscellaneous" M-codes. <br /> | A CNC program that follows G-code syntax consists of low-level functions called blocks. Sentences, in turn, are built from words (code). The words are either "preparatory" G-codes or "Miscellaneous" M-codes. <br /> | ||
The G-code syntax is almost unstructured because no program control controls are included in the language. A subroutine call using M codewords exists but little else. <br /> | The G-code syntax is almost unstructured because no program control controls are included in the language. A subroutine call using M codewords exists but little else. <br /> | ||
− | G-code is interpreted code in the sense that the code interpreter always parses one whole sentence at a time and optimizes the execution of the content before it is launched. | + | G-code is interpreted code in the sense that the code interpreter always parses one whole sentence at a time and optimizes the execution of the content before it is launched. Lotta's Fanuc controller works in such a way that the last of the conflicting command words in a sentence remains valid and executed. <br /> |
In particular, it should be noted that almost all G codewords are "modal", meaning that they remain in effect until another code belonging to the same modal group replaces them. Similarly, an argument that is missing from a sentence gets the value it last had in an earlier sentence. Therefore, the unchanged argument does not need to be repeated sentence by sentence. <br /> | In particular, it should be noted that almost all G codewords are "modal", meaning that they remain in effect until another code belonging to the same modal group replaces them. Similarly, an argument that is missing from a sentence gets the value it last had in an earlier sentence. Therefore, the unchanged argument does not need to be repeated sentence by sentence. <br /> | ||
|- | |- | ||
Rivi 84: | Rivi 84: | ||
Since most G codewords are modal, it is often sufficient to simply mention the arguments in the statement statement, in which case the valid modal statement is repeated with those arguments. A simple example of this above. | Since most G codewords are modal, it is often sufficient to simply mention the arguments in the statement statement, in which case the valid modal statement is repeated with those arguments. A simple example of this above. | ||
− | == G codeword arguments == | + | == G codeword arguments== |
{| class = "wikitable" | {| class = "wikitable" | ||
|- | |- | ||
Rivi 91: | Rivi 91: | ||
| '''P_''' || --- || Abbreviated position coordinate format. Same as X_ Y_ Z_ where _ is the numeric value of the coordinate. Also alternative coordinates such as IJK, UVW, etc. | | '''P_''' || --- || Abbreviated position coordinate format. Same as X_ Y_ Z_ where _ is the numeric value of the coordinate. Also alternative coordinates such as IJK, UVW, etc. | ||
|- | |- | ||
− | | '''X, Y, Z''' || Modal 01 codes Position coordinates for motion | + | | '''X, Y, Z''' || Modal 01 codes || Position coordinates for motion |
|- | |- | ||
− | | A, B, C || Modal 01 codes Angular coordinates for rotation about the X, Y, Z axes (4th axis) | + | | A, B, C || Modal 01 codes || Angular coordinates for rotation about the X, Y, Z axes (4th axis) |
|- | |- | ||
| '''I, J, K''' || G02, G03 || Relative position coordinates to position the center of the arc | | '''I, J, K''' || G02, G03 || Relative position coordinates to position the center of the arc | ||
|- | |- | ||
− | | U, V, W || Modal 01 codes Relative position coordinates along the X, Y, Z axes for motion | + | | U, V, W || Modal 01 codes || Relative position coordinates along the X, Y, Z axes for motion |
|- | |- | ||
| '''S''' || M03, M04 || Spindle speed setpoint | | '''S''' || M03, M04 || Spindle speed setpoint | ||
|- | |- | ||
− | | '''F''' || Modal 01 codes Feed speed mm / min | + | | '''F''' || Modal 01 codes || Feed speed mm / min |
|- | |- | ||
− | | '''H''' || Modal 01 codes Tool length and radius compensation | + | | '''H''' || Modal 01 codes || Tool length and radius compensation |
|- | |- | ||
| '''T''' || --- || Tool selection | | '''T''' || --- || Tool selection | ||
Rivi 112: | Rivi 112: | ||
Radius definition in circular interpolation | Radius definition in circular interpolation | ||
|- | |- | ||
− | | Q || Modal 09 codes Drilling step depth in break drilling, etc. | + | | Q || Modal 09 codes || Drilling step depth in break drilling, etc. |
|- | |- | ||
| P || G04 || Pause time ms | | P || G04 || Pause time ms | ||
Rivi 120: | Rivi 120: | ||
|- | |- | ||
| | | | ||
+ | |||
==Varsinaiset G-koodisanat== | ==Varsinaiset G-koodisanat== | ||
{| class="wikitable" | {| class="wikitable" | ||
Rivi 259: | Rivi 260: | ||
| '''[[G90]]''' || 03 || Absoluuttikoordinaattien valinta | | '''[[G90]]''' || 03 || Absoluuttikoordinaattien valinta | ||
|- | |- | ||
− | | '''[G90|G91]]''' || 03 || Suhteellisten koordinaattien valinta | + | | '''[[G90|G91]]''' || 03 || Suhteellisten koordinaattien valinta |
|- | |- | ||
| G92 || 00 || Absoluuttikoordinaatiston origon asetus | | G92 || 00 || Absoluuttikoordinaatiston origon asetus | ||
Rivi 276: | Rivi 277: | ||
|} | |} | ||
| | | | ||
− | == Actual G codewords == | + | |
+ | ==Actual G codewords== | ||
{| class = "wikitable" | {| class = "wikitable" | ||
|- | |- | ||
! G code !! Modal group !! Function | ! G code !! Modal group !! Function | ||
|- | |- | ||
− | | '''[[G00]]''' || 01 || Fast motion to the given coordinates | + | | '''[[G00_Engl|G00]]''' || 01 || Fast motion to the given coordinates |
|- | |- | ||
− | | '''[[G01]]''' || 01 || Coordinated motion at the machining speed to the given coordinates | + | | '''[[G01_Engl|G01]]''' || 01 || Coordinated motion at the machining speed to the given coordinates |
|- | |- | ||
− | | '''[[G02]]''' || 01 || [[G02 | Circular interpolation]] clockwise | + | | '''[[G02_Engl|G02]]''' || 01 || [[G02 | Circular interpolation]] clockwise |
|- | |- | ||
− | | '''[[ | + | | '''[[G02_Engl|G03]]''' || 01 || [[G02 | Circular interpolation]] counterclockwise |
|- | |- | ||
− | | [[G04]] || 00 || Break | + | | [[G04_Engl|G04]] || 00 || Break |
|- | |- | ||
− | | G05 || 00 || Machining with high speed cycle | + | | G05_Engl|G05 || 00 || Machining with high speed cycle |
|- | |- | ||
− | | G09 || 00 || Accurate positioning | + | | G09_Engl|G09 || 00 || Accurate positioning |
|- | |- | ||
− | | G15 || 17 || Canceling the polar coordinate mode | + | | G15_Engl|G15 || 17 || Canceling the polar coordinate mode |
|- | |- | ||
− | | G16 || 17 || Polar coordinate mode setting | + | | G02_Engl|G16 || 17 || Polar coordinate mode setting |
|- | |- | ||
− | | '''[[ | + | | '''[[G02_Engl| G17]]''' || 02 || XY plane setting for circular interpolation |
|- | |- | ||
− | | [[ | + | | [[G02_Engl|G18]] || 02 || ZX plane setting for circular interpolation |
|- | |- | ||
− | | [[ | + | | [[G02_Engl|G19]] || 02 || YZ level setting for circular interpolation |
|- | |- | ||
− | | [[G20]] || 06 || Units of measurement in inches | + | | [[G06_Engl|G20]] || 06 || Units of measurement in inches |
|- | |- | ||
− | | '''[[ | + | | '''[[G06_Engl | G21]]''' || 06 || Units of measurement in millis |
|- | |- | ||
− | | G22 || 00 || Example | + | | G22_Engl|G22 || 00 || Example |
|- | |- | ||
− | | G23 || 00 || Example | + | | G23_Engl|G23 || 00 || Example |
|- | |- | ||
− | | G27 || 00 || Home drive check | + | | G27_Engl|G27 || 00 || Home drive check |
|- | |- | ||
| '''[[G28]]''' || 00 || Driving to your home station | | '''[[G28]]''' || 00 || Driving to your home station | ||
Rivi 319: | Rivi 321: | ||
| [[G29]] || 00 || Return from home station | | [[G29]] || 00 || Return from home station | ||
|- | |- | ||
− | | G30 || 00 || Return to 2nd home station | + | | G30_Engl|G30 || 00 || Return to 2nd home station |
|- | |- | ||
− | | G31 || 00 || Bypass function | + | | G31_Engl|G31 || 00 || Bypass function |
|- | |- | ||
− | | G33 || 01 || Threading | + | | G33_Engl|G33 || 01 || Threading |
|- | |- | ||
− | | G39 || 00 || Angle rotation by circular interpolation | + | | G39_Engl|G39 || 00 || Angle rotation by circular interpolation |
|- | |- | ||
| [[G40]] || 07 || Cancel tool radius compensation | | [[G40]] || 07 || Cancel tool radius compensation | ||
Rivi 335: | Rivi 337: | ||
| '''[[G43]]''' || 08 || Tool length compensation by summing (+ direction) | | '''[[G43]]''' || 08 || Tool length compensation by summing (+ direction) | ||
|- | |- | ||
− | | G44 || 08 || Tool length compensation decreasing (- direction) | + | | G44_Engl|G44 || 08 || Tool length compensation decreasing (- direction) |
|- | |- | ||
− | | G45 || 00 || Tool offset breeding | + | | G45_Engl|G45 || 00 || Tool offset breeding |
|- | |- | ||
− | | G46 || 00 || Tool offset reduction | + | | G46_Engl|G46 || 00 || Tool offset reduction |
|- | |- | ||
− | | G47 || 00 || 2x increase in tool offset | + | | G47_Engl|G47 || 00 || 2x increase in tool offset |
|- | |- | ||
− | | G48 || 00 || 2x reduction of tool offset | + | | G48_Engl|G48 || 00 || 2x reduction of tool offset |
|- | |- | ||
| [[G49]] || 08 || Cancel tool length compensation | | [[G49]] || 08 || Cancel tool length compensation | ||
|- | |- | ||
− | | G50 || 11 || Cancel scaling | + | | G50_Engl|G50 || 11 || Cancel scaling |
|- | |- | ||
− | | G51 || 11 || Scaling setting | + | | G51_Engl|G51 || 11 || Scaling setting |
|- | |- | ||
− | | G52 || 00 || Transfer of work coordinate system | + | | G52_Engl|G52 || 00 || Transfer of work coordinate system |
|- | |- | ||
− | | G53 || 00 || Reference of motion to machine coordinates | + | | G53_Engl|G53 || 00 || Reference of motion to machine coordinates |
|- | |- | ||
| '''[[G54]]''' || 14 || Selection of work coordinate system 1 | | '''[[G54]]''' || 14 || Selection of work coordinate system 1 | ||
Rivi 369: | Rivi 371: | ||
| [[G60]] || 00 || One-way parking | | [[G60]] || 00 || One-way parking | ||
|- | |- | ||
− | | G61 || 15 || Exact stop mode | + | | G61_Engl|G61 || 15 || Exact stop mode |
|- | |- | ||
− | | G62 || 15 || Automatic corner bypass mode | + | | G62_Engl|G62 || 15 || Automatic corner bypass mode |
|- | |- | ||
− | | G63 || 15 || Threading mode | + | | G63_Engl|G63 || 15 || Threading mode |
|- | |- | ||
− | | G64 || 15 || Cutting machine mode | + | | G64_Engl|G64 || 15 || Cutting machine mode |
|- | |- | ||
− | | G65 || 12 || Macro instruction, macro call | + | | G65_Engl|G65 || 12 || Macro instruction, macro call |
|- | |- | ||
− | | G66 || 12 || Modal call to the custom macro | + | | G66_Engl|G66 || 12 || Modal call to the custom macro |
|- | |- | ||
− | | G67 || 12 || Cancel a modal call to a custom macro | + | | G67_Engl|G67 || 12 || Cancel a modal call to a custom macro |
|- | |- | ||
− | | G68 || 16 || Coordinate system rotation | + | | G68_Engl|G68 || 16 || Coordinate system rotation |
|- | |- | ||
− | | G69 || 16 || Canceling the coordinate system rotation | + | | G69_Engl|G69 || 16 || Canceling the coordinate system rotation |
|- | |- | ||
| [[G73]] || 09 || Intermittent drilling cycle 1 | | [[G73]] || 09 || Intermittent drilling cycle 1 | ||
Rivi 395: | Rivi 397: | ||
| [[G80]] || 09 || Cycle cancellation | | [[G80]] || 09 || Cycle cancellation | ||
|- | |- | ||
− | | G81 || 09 || Spot drilling cycle | + | | G81_Engl|G81 || 09 || Spot drilling cycle |
|- | |- | ||
− | | G82 || 09 || Counter-drilling cycle | + | | G82_Engl|G82 || 09 || Counter-drilling cycle |
|- | |- | ||
− | | G83 || 09 || Intermittent drilling cycle 2 | + | | G83_Engl|G83 || 09 || Intermittent drilling cycle 2 |
|- | |- | ||
− | | G84 || 09 || Threading cycle | + | | G84_Engl|G84 || 09 || Threading cycle |
|- | |- | ||
− | | G85 || 09 || Boring cycle | + | | G85_Engl|G85 || 09 || Boring cycle |
|- | |- | ||
− | | G86 || 09 || Boring cycle | + | | G86_Engl|G86 || 09 || Boring cycle |
|- | |- | ||
− | | G87 || 09 || Counter-reaming cycle | + | | G87_Engl|G87 || 09 || Counter-reaming cycle |
|- | |- | ||
− | | G88 || 09 || Boring cycle | + | | G88_Engl|G88 || 09 || Boring cycle |
|- | |- | ||
− | | G89 || 09 || Boring cycle | + | | G89_Engl|G89 || 09 || Boring cycle |
|- | |- | ||
| '''[[G90]]''' || 03 || Selection of absolute coordinates | | '''[[G90]]''' || 03 || Selection of absolute coordinates | ||
|- | |- | ||
− | | '''[G90 | G91]]''' || 03 || Selection of relative coordinates | + | | '''[[G90 | G91]]''' || 03 || Selection of relative coordinates |
|- | |- | ||
− | | G92 || 00 || Setting the origin of the absolute coordinate system | + | | G92_Engl|G92 || 00 || Setting the origin of the absolute coordinate system |
|- | |- | ||
− | | G94 || 05 || Input one / minute | + | | G94_Engl|G94 || 05 || Input one / minute |
|- | |- | ||
− | | G95 || 05 || Feed one / spindle revolution | + | | G95_Engl|G95 || 05 || Feed one / spindle revolution |
|- | |- | ||
− | | G96 || 13 || Constant surface speed control on | + | | G96_Engl|G96 || 13 || Constant surface speed control on |
|- | |- | ||
− | | G97 || 13 || Constant surface speed control off | + | | G97_Engl|G97 || 13 || Constant surface speed control off |
|- | |- | ||
| [[G98]] || 10 || In the cycle, a snippet returns to the starting point | | [[G98]] || 10 || In the cycle, a snippet returns to the starting point | ||
Rivi 433: | Rivi 435: | ||
|- | |- | ||
| | | | ||
+ | |||
==Lotan tunnistamat M-koodisanat== | ==Lotan tunnistamat M-koodisanat== | ||
{| class="wikitable" | {| class="wikitable" | ||
Rivi 477: | Rivi 480: | ||
|} | |} | ||
| | | | ||
− | == M-code words recognized by | + | ==M-code words recognized by Lotta== |
{| class = "wikitable" | {| class = "wikitable" | ||
|- | |- | ||
! M code !! Function | ! M code !! Function | ||
|- | |- | ||
− | | M00 || Mandatory break. The program stops here until the user presses [CYCLE START] at which point the program continues | + | | M00_Engl|M00 || Mandatory break. The program stops here until the user presses [CYCLE START] at which point the program continues |
|- | |- | ||
− | | M01 || Conditional break. Same as above, but only if panel [OPT STOP] is pressed active | + | | M01_Engl|M01 || Conditional break. Same as above, but only if panel [OPT STOP] is pressed active |
|- | |- | ||
− | | M02 || End of the program. Execution ends and the program is acknowledged as run. | + | | M02_Engl|M02 || End of the program. Execution ends and the program is acknowledged as run. |
|- | |- | ||
| '''M03''' || Spindle moved clockwise. The spindle starts rotating at the speed previously set by argument S. | | '''M03''' || Spindle moved clockwise. The spindle starts rotating at the speed previously set by argument S. | ||
Rivi 500: | Rivi 503: | ||
| '''M09''' || Cutting fluid off | | '''M09''' || Cutting fluid off | ||
|- | |- | ||
− | | M19 || Spindle orientation. Rotates the spindle to the position where the tool is changed. The same position is used e.g. counter-reaming, etc. | + | | M19_Engl|M19 || Spindle orientation. Rotates the spindle to the position where the tool is changed. The same position is used e.g. counter-reaming, etc. |
|- | |- | ||
− | | M29 || Rigid threading mode on | + | | M29_Engl|M29 || Rigid threading mode on |
|- | |- | ||
| '''M30''' || Ending the program and returning to the beginning | | '''M30''' || Ending the program and returning to the beginning | ||
|- | |- | ||
− | | M40 || 4th axle lock | + | | M40_Engl|M40 || 4th axle lock |
|- | |- | ||
− | | M41 || 4th shaft release | + | | M41_Engl|M41 || 4th shaft release |
|- | |- | ||
− | | M94 || Axis mirroring cancellation | + | | M94_Engl|M94 || Axis mirroring cancellation |
|- | |- | ||
− | | M95 || X-axis mirroring | + | | M95_Engl|M95 || X-axis mirroring |
|- | |- | ||
− | | M96 || Y-axis mirroring | + | | M96_Engl|M96 || Y-axis mirroring |
|- | |- | ||
− | | M98 || Subroutine call | + | | M98_Engl|M98 || Subroutine call |
|- | |- | ||
− | | M99 || Return from the subroutine | + | | M99_Engl|M99 || Return from the subroutine |
|} | |} | ||
|} | |} |
Nykyinen versio 12. helmikuuta 2021 kello 21.21
G-Code |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
G-koodisyntaksia noudattava CNC-ohjelma koostuu matalan tason toiminnoista joita kutsutaan lauseiksi (block). Lauseet puolestaan rakentuvat sanoista (code). Sanat ovat joko "valmistelevia" G-koodeja tai "sekalaisia" M-koodeja. |
A CNC program that follows G-code syntax consists of low-level functions called blocks. Sentences, in turn, are built from words (code). The words are either "preparatory" G-codes or "Miscellaneous" M-codes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Esimerkki yksinkertaisesta NC-lauseesta: |
Example of a simple NC block: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Lotan tunnistamat G-koodisanatUseimmat G-koodilauseet muodostuvat valmistelevasta G-koodista, sekä siihen liittyvistä yhdestä tai useammasta argumentista. Lauseissa käytetään myös "sekalaisia" M-koodisanoja ohjaamaan koneen toimintoja päälle ja pois. G-koodisanojen argumentit
|
G-code words recognized by LottaMost G-code statements consist of a preparatory G-code, and one or more arguments associated with it. The sentences also use "Miscellaneous" M-code words to control the machine functions on and off. G codeword arguments
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Varsinaiset G-koodisanat
|
Actual G codewords
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Lotan tunnistamat M-koodisanat
|
M-code words recognized by Lotta
|