Gcode G代码详解(48页).doc
《Gcode G代码详解(48页).doc》由会员分享,可在线阅读,更多相关《Gcode G代码详解(48页).doc(50页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。
1、-reprap wiki上面的Gcode说明G-codeFrom RepRapWiki(Redirected from Gcode)Jump to: navigation, searchContents hide1 Introduction2 RepRap G Code Fields3 Comments4 Individual commands 4.1 Checking 4.1.1 N and *4.2 Buffered G Commands 4.2.1 G0: Rapid move4.2.2 G1: Controlled move4.2.3 G28: Move to Origin4.3 Un
2、buffered G commands 4.3.1 G4: Dwell4.3.2 G20: Set Units to Inches4.3.3 G21: Set Units to Millimeters4.3.4 G90: Set to Absolute Positioning4.3.5 G91: Set to Relative Positioning4.3.6 G92: Set Position4.4 Unbuffered M and T commands 4.4.1 M0: Stop4.4.2 M17: Enable/Power all stepper motors4.4.3 M18: Di
3、sable all stepper motors4.4.4 M20: List SD card4.4.5 M21: Initialise SD card4.4.6 M22: Release SD card4.4.7 M23: Select SD file4.4.8 M24: Start/resume SD print4.4.9 M25: Pause SD print4.4.10 M26: Set SD position4.4.11 M27: Report SD print status4.4.12 M28: Begin write to SD card4.4.13 M29: Stop writ
4、ing to SD card4.4.14 M40: Eject4.4.15 M41: Loop4.4.16 M42: Stop on material exhausted4.4.17 M43: Stand by on material exhausted4.4.18 M80: ATX Power On4.4.19 M81: ATX Power Off4.4.20 M84: Stop idle hold4.4.21 M92: Set axis_steps_per_unit4.4.22 M101 Turn extruder 1 on Forward4.4.23 M102 Turn extruder
5、 1 on Reverse4.4.24 M103 Turn all extruders off4.4.25 M104: Set Extruder Temperature (Fast)4.4.26 M105: Get Extruder Temperature4.4.27 M106: Fan On4.4.28 M107: Fan Off4.4.29 M108: Set Extruder Speed4.4.30 M109: Set Extruder Temperature4.4.31 M110: Set Current Line Number4.4.32 M111: Set Debug Level4
6、.4.33 M112: Emergency Stop4.4.34 M113: Set Extruder PWM4.4.35 M114: Get Current Position4.4.36 M115: Get Firmware Version and Capabilities4.4.37 M116: Wait4.4.38 M117: Get Zero Position4.4.39 M118: Negotiate Features4.4.40 M119: Get Endstop Status4.4.41 M126: Open Valve4.4.42 M127: Close Valve4.4.43
7、 M128: Extruder Pressure PWM4.4.44 M129: Extruder pressure off4.4.45 M140: Bed Temperature (Fast)4.4.46 M141: Chamber Temperature (Fast)4.4.47 M142: Holding Pressure4.4.48 M143: Maximum hot-end temperature4.4.49 M160: Number of mixed materials4.4.50 M203: Record Z adjustment4.4.51 M226: Gcode Initia
8、ted Pause4.4.52 M227: Enable Automatic Reverse and Prime4.4.53 M228: Disable Automatic Reverse and Prime4.4.54 M229: Enable Automatic Reverse and Prime4.4.55 M230: Disable / Enable Wait for Temperature Change4.4.56 M240: Start conveyor belt motor4.4.57 M241: Stop conveyor belt motor4.4.58 M245: Star
9、t cooler4.4.59 M246: Stop cooler4.4.60 M300: Play beep sound4.4.61 T: Select Tool5 Proposed EEPROM configuration codes6 Replies from the RepRap machine to the host computer7 Proposal for sending multiple lines of G-code 7.1 Problem to solveIntroduction This page describes the G Codes that the RepRap
10、 firmware uses and how they work. The list of what can be done is extensible. But check this page first, and add your extension here first before you implement it. A typical piece of GCode as sent to a RepRap machine might look like this: N3 T0*57N4 G92 E0*67N5 G28*22N6 G1 F1500.0*82N7 G1 X2.0 Y2.0
11、F3000.0*85N8 G1 X3.0 Y3.0*33The meaning of all those symbols and numbers (and more) is explained below. TO find out which specific gcode/s are implemented in any given firmware, please see the Firmware_features page. (For the technically minded, the end of line is marked by both a and a . If you wan
12、t to manually enter GCodes in your reprap using the Arduino Serial interface, make sure to select Both NL & CR on the bottom of the screen.) This isnt accurate, firmware accepts single as well as single , or combinations thereof. Hosts should accepts all four combinations as well. -Traumflug 09:34,
13、20 April 2011 (UTC) RepRap G Code Fields This section explains the letter-preceded fields. The numbers in the fields are represented by nnn. Numbers can be integers, or can contain a decimal point, depending on context. For example an X coordinate can be integer (X175) or fractional (X17.62), wherea
14、s trying to select extruder number 2.76 would make no sense. Letter Meaning Gnnn Standard GCode command, such as move to a point Mnnn RepRap-defined command, such as turn on a cooling fan Tnnn Select tool nnn. In RepRap, tools are extruders Snnn Command parameter, such as the voltage to send to a mo
15、tor Pnnn Command parameter, such as a time in milliseconds Xnnn An X coordinate, usually to move to Ynnn A Y coordinate, usually to move to Znnn A Z coordinate, usually to move to Innn Parameter - not currently used Jnnn Parameter - not currently used Fnnn Feedrate in mm per minute. (Speed of print
16、head movement) Rnnn Parameter - not currently used Qnnn Parameter - not currently used Ennn Length of extrudate in mm. This is exactly like X, Y and Z, but for the length of filament to extrude. It is common for newer stepper based systems to interpret . Better: Skeinforge 40 and up interprets this
17、as the absolute length of input filament to consume, rather than the length of the extruded output. Nnnn Line number. Used to request repeat transmission in the case of communications errors. *nnn Checksum. Used to check for communications errors. Comments G Code comments: N3 T0*57 ;This is a commen
18、tN4 G92 E0*67; So is thisN5 G28*22Will be ignored by RepRap, as will blank lines. But its better to strip these out in the host computer before the lines are sent. This saves bandwidth. Individual commands Checking N and * Example: N123 .G Code in here. *71 These are the line number and the checksum
19、. The RepRap firmware checks the checksum against a locally-computed value and, if they differ, requests a repeat transmission of the line of the given number. You can leave both of these out - RepRap will still work, but it wont do checking. You have to have both or neither though. The checksum cs
20、for a GCode string cmd (including its line number) is computed by exor-ing the bytes in the string up to and not including the * character as follows: int cs = 0;for(i = 0; cmdi != * & cmdi != NULL; i+) cs = cs cmdi;cs &= 0xff; / Defensive programming.and the value is appended as a decimal integer t
21、o the command after the * character. The RepRap firmware expects line numbers to increase by 1 each line, and if that doesnt happen it is flagged as an error. But you can reset the count using M110 (see below). Buffered G Commands The RepRap firmware stores these commands in a ring buffer internally
22、 for execution. This means that there is no (appreciable) delay while a command is acknowledged and the next transmitted. In turn, this means that sequences of line segments can be plotted without a dwell between one and the next. As soon as one of these buffered commands is received it is acknowled
23、ged and stored locally. If the local buffer is full, then the acknowledgment is delayed until space for storage in the buffer is available. This is how flow control is achieved. G0: Rapid move Example: G0 X12 In this case move rapidly to X = 12 mm. In fact, the RepRap firmware uses exactly the same
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Gcode G代码详解48页 代码 详解 48
限制150内