Ero sivun ”G-koodi” versioiden välillä
(24 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
Rivi 2: | Rivi 2: | ||
|- | |- | ||
| width="500" | | | width="500" | | ||
− | + | __TOC__ | |
| width="500" | | | width="500" | | ||
− | + | G-Code | |
| | | | ||
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 38: | Rivi 38: | ||
'''X510.''' <br /> | '''X510.''' <br /> | ||
'''X520.''' <br /> | '''X520.''' <br /> | ||
− | Coordinated movement at machining speed to coordinates 500/60/0, then 510/60/0 and 520/60/0 because G01 is modal. <br /> | + | Coordinated movement at machining speed to coordinates 500/60/0, then 510/60/0 and 520/60/0 because G01 is modal.<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 274: | Rivi 275: | ||
|- | |- | ||
| [[G98|G99]] || 10 || Työkierrossa välipaluu R-koordinaatin tasalle | | [[G98|G99]] || 10 || Työkierrossa välipaluu R-koordinaatin tasalle | ||
− | |||
|} | |} | ||
+ | | | ||
− | + | ==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 |
− | | - | + | |- |
| [[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 | ||
− | | - | + | |- |
| [[G41]] || 07 || Tool radius compensation to the left | | [[G41]] || 07 || Tool radius compensation to the left | ||
− | | - | + | |- |
| [[G41 | G42]] || 07 || Tool radius compensation to the right | | [[G41 | G42]] || 07 || Tool radius compensation to the right | ||
− | | - | + | |- |
− | | '' '[[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_Engl|G50 || 11 || Cancel scaling | ||
+ | |- | ||
+ | | G51_Engl|G51 || 11 || Scaling setting | ||
+ | |- | ||
+ | | G52_Engl|G52 || 00 || Transfer of work coordinate system | ||
+ | |- | ||
+ | | G53_Engl|G53 || 00 || Reference of motion to machine coordinates | ||
+ | |- | ||
+ | | '''[[G54]]''' || 14 || Selection of work coordinate system 1 | ||
+ | |- | ||
+ | | '''[[G54 | G55]]''' || 14 || Selection of work coordinate system 2 | ||
+ | |- | ||
+ | | '''[[G54 | G56]]''' || 14 || Selection of work coordinate system 3 | ||
+ | |- | ||
+ | | '''[[G54 | G57]]''' || 14 || Selection of work coordinate system 4 | ||
+ | |- | ||
+ | | '''[[G54 | G58]] ''' || 14 || Selection of work coordinate system 5 | ||
+ | |- | ||
+ | | '''[[G54 | G59]]''' || 14 || Selection of work coordinate system 6 | ||
+ | |- | ||
+ | | [[G60]] || 00 || One-way parking | ||
+ | |- | ||
+ | | G61_Engl|G61 || 15 || Exact stop mode | ||
+ | |- | ||
+ | | G62_Engl|G62 || 15 || Automatic corner bypass mode | ||
+ | |- | ||
+ | | G63_Engl|G63 || 15 || Threading mode | ||
+ | |- | ||
+ | | G64_Engl|G64 || 15 || Cutting machine mode | ||
+ | |- | ||
+ | | G65_Engl|G65 || 12 || Macro instruction, macro call | ||
+ | |- | ||
+ | | G66_Engl|G66 || 12 || Modal call to the custom macro | ||
+ | |- | ||
+ | | G67_Engl|G67 || 12 || Cancel a modal call to a custom macro | ||
+ | |- | ||
+ | | G68_Engl|G68 || 16 || Coordinate system rotation | ||
+ | |- | ||
+ | | G69_Engl|G69 || 16 || Canceling the coordinate system rotation | ||
+ | |- | ||
+ | | [[G73]] || 09 || Intermittent drilling cycle 1 | ||
+ | |- | ||
+ | | G74 || 09 || Counter-threading cycle | ||
+ | |- | ||
+ | | G76 || 09 || Precision armature | ||
+ | |- | ||
+ | | [[G80]] || 09 || Cycle cancellation | ||
+ | |- | ||
+ | | G81_Engl|G81 || 09 || Spot drilling cycle | ||
+ | |- | ||
+ | | G82_Engl|G82 || 09 || Counter-drilling cycle | ||
+ | |- | ||
+ | | G83_Engl|G83 || 09 || Intermittent drilling cycle 2 | ||
+ | |- | ||
+ | | G84_Engl|G84 || 09 || Threading cycle | ||
+ | |- | ||
+ | | G85_Engl|G85 || 09 || Boring cycle | ||
+ | |- | ||
+ | | G86_Engl|G86 || 09 || Boring cycle | ||
+ | |- | ||
+ | | G87_Engl|G87 || 09 || Counter-reaming cycle | ||
+ | |- | ||
+ | | G88_Engl|G88 || 09 || Boring cycle | ||
+ | |- | ||
+ | | G89_Engl|G89 || 09 || Boring cycle | ||
+ | |- | ||
+ | | '''[[G90]]''' || 03 || Selection of absolute coordinates | ||
+ | |- | ||
+ | | '''[[G90 | G91]]''' || 03 || Selection of relative coordinates | ||
+ | |- | ||
+ | | G92_Engl|G92 || 00 || Setting the origin of the absolute coordinate system | ||
+ | |- | ||
+ | | G94_Engl|G94 || 05 || Input one / minute | ||
+ | |- | ||
+ | | G95_Engl|G95 || 05 || Feed one / spindle revolution | ||
+ | |- | ||
+ | | G96_Engl|G96 || 13 || Constant surface speed control on | ||
+ | |- | ||
+ | | G97_Engl|G97 || 13 || Constant surface speed control off | ||
+ | |- | ||
+ | | [[G98]] || 10 || In the cycle, a snippet returns to the starting point | ||
+ | |- | ||
+ | | [[G98 | G99]] || 10 || In the cycle, return to the R coordinate | ||
+ | |} | ||
+ | |- | ||
+ | | | ||
+ | |||
==Lotan tunnistamat M-koodisanat== | ==Lotan tunnistamat M-koodisanat== | ||
{| class="wikitable" | {| class="wikitable" | ||
Rivi 391: | Rivi 479: | ||
| M99 || Aliohjelmasta paluu | | M99 || Aliohjelmasta paluu | ||
|} | |} | ||
− | + | | | |
+ | ==M-code words recognized by Lotta== | ||
+ | {| class = "wikitable" | ||
+ | |- | ||
+ | ! M code !! Function | ||
+ | |- | ||
+ | | M00_Engl|M00 || Mandatory break. The program stops here until the user presses [CYCLE START] at which point the program continues | ||
+ | |- | ||
+ | | M01_Engl|M01 || Conditional break. Same as above, but only if panel [OPT STOP] is pressed active | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | | '''M04''' || Spindle moved counterclockwise. | ||
+ | |- | ||
+ | | '''M05''' || Kara stand. | ||
+ | |- | ||
+ | | '''M06''' || Tool change - execution command. The pre-selection using the command word T is performed with this function. | ||
+ | |- | ||
+ | | '''M08''' || Cutting fluid on. Requires (COOLANT) [CLNT AUTO] to be selected as active on the panel | ||
+ | |- | ||
+ | | '''M09''' || Cutting fluid off | ||
+ | |- | ||
+ | | 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_Engl|M29 || Rigid threading mode on | ||
+ | |- | ||
+ | | '''M30''' || Ending the program and returning to the beginning | ||
+ | |- | ||
+ | | M40_Engl|M40 || 4th axle lock | ||
+ | |- | ||
+ | | M41_Engl|M41 || 4th shaft release | ||
+ | |- | ||
+ | | M94_Engl|M94 || Axis mirroring cancellation | ||
+ | |- | ||
+ | | M95_Engl|M95 || X-axis mirroring | ||
+ | |- | ||
+ | | M96_Engl|M96 || Y-axis mirroring | ||
+ | |- | ||
+ | | M98_Engl|M98 || Subroutine call | ||
+ | |- | ||
+ | | M99_Engl|M99 || Return from the subroutine | ||
+ | |} | ||
+ | |} | ||
<br clear=all> | <br clear=all> | ||
---- | ---- |
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
|