最全3D打印机G-code代码详解

非凡 [FeiFan] 3D打印资源社区-3D打印模型免费下载,免费STL模型下载,3D打印教程,3D打印资源,3D打印文件下载

G0:快速移动

支持 五D 茶杯 短跑 运动员 枪鱼 重复版
??? 是的 是的 是的 是的

示例:G0 X12

这个命令会移动的距离 X = 12 mm. 事实上, 对于RepRap来说,这个命令的效果和G1 X12是一样的。(这条命令本来是为了让那些喜欢走折线路径的老机器走直线这个比较快的路径,所以叫做快速移动)

G1: 受控移动 可控移动

支持 五D 茶杯 短跑 运动员 枪鱼 重复版
是的 是的 是的 是的 是的

示例:G1 X90.6 Y13.8 E22.4

从当前的位置点(X, Y) 移动到目的点(90.6, 13.8), 并会在行进过程中挤出22.4mm的打印丝(注意,挤出命令是由E22.4控制的)

RepRap 对于进料速度很敏感.因此:

G1 F1500
G1 X90.6 Y13.8 E22.4

会先设置 1500毫米每分钟 的进料速度, 然后才会移动(X90.6 Y13.8)并且吐丝.
但是

G1 F1500
G1 X90.6 Y13.8 E22.4 F3000

这串代码却会先设置1500毫米每分钟 的进料速度,然后在移动的时候提升进料速度,直到3000毫米每分钟。

RepRap 可以通过E命令轻易对进料速度进行加/减速,就像对X,Y,Z,E命令一样,这样,机器才能在必要的点吐必要的丝。

提示: 不是所有的固件都支持这项功能(移动在改变进料速度), 例如: 当前的 Marlin 会从一开始就使用新的进料速度,而不会尝试在中途改变它。

第一个例子是在移动时保持固定进料速度,而第二个例子则是在移动中改变进料速度。 因此:

G1 F1500
G1 X90.6 Y13.8 E22.4 F3000
G1 X80 Y20 E36 F1500

这段代码会先先加速进料速度到3000毫米每分钟 减速到1500 毫米每分钟。

吸丝操作,通过反向转动挤出机马达,减少挤出机内部压力,避免在悬空移动时候的吐丝,可以有效减少打印过程中的毛刺现象,具体操作:发送G1 Ennn指令给RepRap 其中nnn的值应当小于当前的值

G28: 移至原点 移动到原点

支持 五D 茶杯 短跑 运动员 枪鱼 重复版
是的 是的 是的 是的 是的

示例:G28

该命令会是机器的挤出机复位到原点。准确的说,是一直朝着限位开关(endstops)的方向移动,直到触发限位开关,才会停止移动。需要注意,为了尽早复位,移动过程回不断加速,而到了限位开关之后,它会做一次大约1mm的往返移动,来保证复位操作的精确度。

如果你加上坐标值,那么,只有被加上的坐标值才会被复位 例如:“G28 X0 Y72.3”

只会复位X和Y方向,而不会对高度(Z方向)进行复位。(X和Y后面的数字会被忽略处理)

G29-G32: 床探测 加热床检查

G29 详细 Z 探针 详细检查

在3个不同位置对加热床进行检查

G30 单 Z 探头 单一检查

在当前的位置对加热床进行检查

G31 报告 当前探头状态 报告检查结果

报告是否触发了 Z 探针。

G32 探头 Z 并使用 FPU 进行校准

在3个不同位置对加热床进行检查并依据检查结果做出调整 并更新床位均衡补偿的转换矩阵。

G29-G30原文如下

  • G29 详细 Z 探针

在 3 点处探测床。

  • G30 单 Z 探头

探测当前 XY 位置的床。

  • G31 报告当前探头状态

报告是否触发了 Z 探针。 G32 探头 Z 并使用 FPU 进行校准 在 3 个点探测床,并更新用于床均衡补偿的变换矩阵。

即时G 命令

以下命令也可以被缓存, 但是直到所有之前缓存的命令被执行完,并且该命令执行后,才会给出应答。因此主机会等待命令执行完毕(才收到的应答).这些命令导致的短暂停顿不会影响机器的正常性能。

茶杯固件缓冲 G20、G21、G90 和 G91。

G4: 德优停顿

示例:G4 P200

停顿200毫秒。在停顿过程中机器仍可以被控制,如挤出头温度。

G10: 打印头偏移

实例: G10 P3 X17.8 Y-19.3 Z0.0 R140 S205

这条命令设置打印头3(参数P3)的X,Y,方向偏移。你也可以使用Z方向的非零偏移值,但是通常情况下,这不是一个好主意。因为除非打印头是用某种装置动态加载的,通常情况下机器上打印头安装位置应当是同样的高度。因为如果不设置特定的值,机器会使用上一次设置给出的值作为缺省,因此通常还是应当显式的设定Z0.0.

命令里面的 R 值用来指定待机时的温度,单位是摄氏度,S值是工作时的温度, 如果不想工作和待机时温度有区别,可以把两个值设为相同,可以参考T命令对应的说明。

NIST G-code 标准 提到了一个额外的 L 参数, 当前会自动忽略

该条命令目前 提出供讨论.

G20:将单位设置为英寸 使用英寸作为单位

示例:G20

从现在开始,使用英寸作为单位.

G21:将单位设置为毫米 使用毫米作为单位

示例:G21

从现在开始使用毫米作为单位 ( 这是RepRap的默认设置.)

G90:设置为绝对定位 设置成绝对定位

示例:G90

从现在开始,所有坐标都是相对于机器原点的绝对坐标。(这是 RepRap 的默认值。
所有坐标从现在开始变成绝对坐标,即与机器原始位置相对的…RepRap的默认…

G91:设置为相对定位 设置成相对定位

示例:G91

从现在开始的所有坐标都是相对于最后一个位置的 所有坐标从现在开始变成相对于当前位置
的相对坐标

G92: 设置位置 设置位置

示例:G92 X10 E90

可用来设定绝对0点,或者重置现在的位置到规定的坐标。例如设置机器的X坐标为10,喷头的坐标为90。不会发生物理运动

没有指定坐标的G92命令会重置所有轴到0

即时 的 M 和 T 命令

M0:停止停止

示例(例子): M0

RepRap 会终止任何动作, 然后关机。所有的马达和加热器都很被关掉,你需要点击reset按钮来重启主控制器 参见M1,M112。

M1: 睡眠睡眠

示例:M1

RepRap 会终止任何动作, 然后关机。所有的马达和加热器都很被关掉,你仍可以发送 G或 M 命令来唤醒它 参见 M0, M112.

M3:主轴开启,顺时针(CNC专用)

示例:M3 S4000

主轴以 4000 RPM 的速度打开。

M4:主轴开启,逆时针(CNC专用)

示例:M4 S4000

主轴以 4000 RPM 的速度打开。

M5:主轴关闭(数控专用)

示例:M5

主轴已关闭。

M7:喷雾冷却液开启(CNC专用)

示例:M7

气雾冷却系统开启 (如果有的话)

M8: Flood Coolant On (CNC specific)

Example: M8

水冷系统开启(如果有的话)

M9: Coolant Off 冷却系统关闭(CNC specific)

Example: M9

所有的冷却系统关闭。

M10: Vacuum On (CNC specific)

Example: M10

吸尘系统开启.

M11: Vacuum Off (CNC specific)

Example: M11

吸尘系统关闭.(CNC 专用)

M17: Enable/Power all stepper motors 启动所有步进马达

Example: M17

M18: Disable all stepper motors 关闭所有步进马达

Example: M18

关闭所有马达,这可能会导致某些方向上’自由移动’,(由于惯性或重力)

– Is this not the same as M84? — MrAlvin 05:53, 20 September 2012 (UTC)

M20: List SD card 读取SD卡

Example: M20

所有在SD卡根目录的文件夹都会被读取,并显示在Serial Port界面,结果像是这样子

ok Files: {SQUARE.G,SQCOM.G,}

‘,’符号是可选的. 注意到文件名是大写的, 但 – 如果是 M23 命令(below) 它们则会使小写的. This seems to be a function of the SD software. Go figure…

M21: Initialize SD card 初始化SD卡

Example: M21

初始化SD卡。如果在机器通电时插入SD卡,会默认初始化SD卡。开始其他SD卡功能时SD卡一定要初始化。

M22: Release SD card 弹出SD卡

Example: M22

SD卡已经弹出,可以真的被拔出来…

M23: Select SD file 选择SD卡的文件

Example: M23 filename.gco

SD卡上这个文件filename.gco (8.3 naming convention is supported)会被选中准备打印

M24: Start/resume SD print 开始SD卡的打印

Example: M24

机器打印M23选定的文件

M25: Pause SD print 暂停SD卡打印

Example: M25

机器在当前位置暂停打印M23选定的文件

M26: Set SD position

Example: M26

Set SD position in bytes (M26 S12345).

M27: Report SD print status

Example: M27

Report SD print status.

M28: Begin write to SD card

Example: M28 filename.gco

File specified by filename.gco is created (or overwritten if it exists) on the SD card and all subsequent commands sent to the machine are written to that file.

M29: Stop writing to SD card

Example: M29 filename.gco

File opened by M28 command is closed, and all subsequent commands sent to the machine are executed as normal.

M30: Delete a file on the SD card

Example: M30 filename.gco

filename.gco is deleted.

M40: Eject

If your RepRap machine can eject the parts it has built off the bed, this command executes the eject cycle. This usually involves cooling the bed and then performing a sequence of movements that remove the printed parts from it. The X, Y and Z position of the machine at the end of this cycle are undefined (though they can be found out using the M114 command, q.v.).

See also M240 and M241 below.

M41: Loop

Example: M41

If the RepRap machine was building a file from its own memory such as a local SD card (as opposed to a file being transmitted to it from a host computer) this goes back to the beginning of the file and runs it again. So, for example, if your RepRap is capable of ejecting parts from its build bed then you can set it printing in a loop and it will run and run. Use with caution – the only things that will stop it are:

  1. When you press the reset button,
  2. When the build material runs out (if your RepRap is set up to detect this), and
  3. When there’s an error (such as a heater failure).

M42: Stop on material exhausted / Switch I/O pin

M42 in ???

Example: M42

If your RepRap can detect when its material runs out, this decides the behaviour when that happens. The X and Y axes are zeroed (but not Z), and then the machine shuts all motors and heaters off. You have to press reset to reactivate the machine. In other words, it parks itself and then executes an M0 command (q.v.).

M42 in Marlin/Sprinter

Example: M42 P7 S255

M42 switches a general purpose I/O pin.

M42 in Teacup

Not needed. General purpose devices are handled like a heater, see M104.

M43: Stand by on material exhausted

Example: M43

If your RepRap can detect when its material runs out, this decides the behaviour when that happens. The X and Y axes are zeroed (but not Z), and then the machine shuts all motors and heaters off except the heated bed, the temperature of which is maintained. The machine will still respond to G and M code commands in this state.

M80: ATX Power On 打开ATX电源

Example: M80

Turns on the ATX power supply from standby mode to fully operational mode. No-op on electronics without standby mode.

Note: some firmwares, like Teacup, handle power on/off automatically, so this is redundant there.

M81: ATX Power Off 关闭ATX电源

Example: M81

关闭ATX电源支持. 与M80相反.

M82: 设置挤出机使用绝对坐标模式

Example: M82

makes the extruder interpret extrusion as absolute positions.

这是repetier的初始设置.

M83: 设置挤出机为相对坐标模式

Example: M83

makes the extruder interpret extrusion values as relative positions.

M84: Stop idle hold

Example: M84

Stop the idle hold on all axis and extruder. In some cases the idle hold causes annoying noises, which can be stopped by disabling the hold. Be aware that by disabling idle hold during printing, you will get quality issues. This is recommended only in between or after printjobs.

M92: 设置 axis_steps_per_unit 参数

Example: M92 X<newsteps> Sprinter和Marlin固件

允许重新设置steps per unit of axis ,可脱机保存. 在校准的时候非常有用

M98: 获取 axis_hysteresis_mm 参数

Example: M98

报告XYZ三个方向的当前的hysteresis值 .

用于 Marlin

M99: 设置 axis_hysteresis_mm 参数

Example: M99 X<mm> Y<mm> Z<mm> E<mm>

允许重新设置hysteresis值. 齿轮等机械结构,在转换方向时候都会有滞后现象。你可以测量在他们在转换方向的时候有多长的距离是丢失掉的,然后把它写入hysteresis值,这样之后的转向运动,机器将会进补偿运动,来弥补这些误差。(原文:Mechanical pulleys, gears and threads can have hysteresis when they change direction. That is, a certain number of steps occur before movement occurs. You can measure how many mm are lost to hysteresis and set their values with this command. Every time an axis changes direction, these extra mm will be added to compensate for the hysteresis.)

用于 Marlin

M101 正转挤出机1的操作方向 /撤销Extruder Retraction(挤出回缩)

M101 in Teacup firmware

If a DC extruder is present, turn that on. Else, undo filament retraction, which means, make the extruder ready for extrusion. Complement to M103.

M101 in other firmwares

Deprecated. Regarding filament retraction, see M227, M228, M229.

M102 反转挤出机1的操作方向

Deprecated.

M103 关闭所有挤出机 / Extruder Retraction (挤出回缩)

M103 in Teacup firmware

If a DC extruder is present, turn that off. Else, retract the filament in the hope to prevent nozzle drooling. Complement to M101.

M103 in other firmwares

Deprecated. Regarding extruder retraction, see M227, M228, M229.

M104:设置挤出机(热头)温度

Support FiveD Teacup Sprinter Marlin Repetier
yes yes yes yes yes

例如: M104 S190

将挤出机的温度设置为190oC 并将操作全归还给操作主机(控制PC) (i.e. before that temperature has been reached by the extruder). See also M109.

This is deprecated because temperatures should be set using the G10 and T commands (q.v.).

Deprecation is subject to discussion. —Traumflug 11:33, 19 July 2012 (UTC)

M104 in Teacup Firmware

In Teacup Firmware, M104 can be additionally used to handle all devices using a temperature sensor. It supports the additional P parameter, which is a zero-based index into the list of sensors in config.h. For devices without a temp sensor, see M106.

Example: M104 P1 S100

Set the temperature of the device attached to the second temperature sensor to 100 °C.

M105: 获取温度

Example: M105

请求当前温度(单位:℃),温度将立即返回到控制程序 (T:挤出机 B:加热床) 例如,输出候会得到这样的答复 ok T:201 B:117

M106: 打开风扇

Support FiveD Teacup Sprinter Marlin Repetier
yes yes yes

Example: M106 S127

打开风扇(半速)

‘S’表示 PWM值 (0-255). 可简单理解为 风扇有0-255级强度可选,其中 M106 S0 意味着风扇将被关掉。

M106 in Teacup Firmware

Additionally to the above, Teacup Firmware uses M106 to control general devices. It supports the additional P parameter, which is an zero-based index into the list of heaters/devices in config.h.

Example: M106 P2 S255

Turn on device #3 at full speed/wattage.

Note: When turning on a temperature sensor equipped heater with M106 and M104 at the same time, temperature control will override the value given in M106 quickly.

M107: 关闭风扇

不推荐. 请用M106 S0 代替.

M108: 设置挤出机速度

设置挤出机电机的转速 (不推荐,请使用 M113)

M109: 设置挤出机温度,并等待

Support FiveD Teacup Sprinter Marlin Repetier
 ??? not needed see text yes  ???
M109 in Teacup

Not needed. To mimic Marlin behaviour, use M104 followed by M116.

M109 in Marlin, Sprinter固件 (ATmega port)

设置挤出机温度,并等待.

Example: M109 S185

M109 in Sprinter (4pi port)

Parameters: S (optional), set target temperature value. If not specified, waits for the temperature set by M104R (optional), sets target temperature range maximum value.

Example: M109 S185 R240 //sets extruder temperature to 185 and waits for the temperature to be between 185 – 240.

If you have multiple extruders, use T or P parameter to specify which extruder you want to set/wait.

Another way to do this is to use G10.

M110: 设置当前的行码

Support FiveD Teacup Sprinter Marlin Repetier
 ??? not needed  ???  ???  ???

Example: M110 N123

设置当前行为第123行. 然后,接下来的那行命令会变成第124行命令.

M111: 设置Debug除错等级

Example: M111 S6

Set the level of debugging information transmitted back to the host to level 6. The level is the OR of three bits:

#define DEBUG_ECHO (1<<0)
#define DEBUG_INFO (1<<1)
#define DEBUG_ERRORS (1<<2)

Thus 6 means send information and errors, but don’t echo commands. (This is the RepRap default.)

Example: M253

Support FiveD Teacup Sprinter Marlin Repetier
Debug

M112: 紧急停止

Example: M112

所有进行中的动作都会被立即终止,然后关掉Reprap. 所有电机和加热器都会被关掉. 可以按Reset按钮(板上)以重启. See also M0 and M1.

M113: 设置挤出机的 PWM

Example: M113

Set the PWM for the currently-selected extruder. On its own this command sets RepRap to use the on-board potentiometer on the extruder controller board to set the PWM for the currently-selected extruder’s stepper power. With an S field:

M113 S0.7

it causes the PWM to be set to the S value (70% in this instance). M113 S0 turns the extruder off, until an M113 command other than M113 S0 is sent.

M114: 获取当前位置

Example: M114

This causes the RepRap machine to report its current X, Y, Z and E coordinates to the host.

For example, the machine returns a string such as:

ok C: X:0.00 Y:0.00 Z:0.00 E:0.00

M115: 获取固件信息

Example: M115

Request the Firmware Version and Capabilities of the current microcontroller The details are returned to the host computer as key:value pairs separated by spaces and terminated with a linefeed.

sample data from firmware:

ok PROTOCOL_VERSION:0.1 FIRMWARE_NAME:FiveD FIRMWARE_URL:http%3A//reprap.org MACHINE_TYPE:Mendel EXTRUDER_COUNT:1

This M115 code is inconsistently implemented, and should not be relied upon to exist, or output correctly in all cases. An initial implementation was committed to svn for the FiveD Reprap firmware on 11 Oct 2010. Work to more formally define protocol versions is currently (October 2010) being discussed. See M115_Keywords for one draft set of keywords and their meanings.

M116: 等待

Example: M116

等待所有温度,或者其他缓慢变化的值达到目标值 See also M109.

M117: Get Zero Position

Example: M117

This causes the RepRap machine to report the X, Y, Z and E coordinates in steps not mm to the host that it found when it last hit the zero stops for those axes. That is to say, when you zero X, the x coordinate of the machine when it hits the X endstop is recorded. This value should be 0, of course. But if the machine has drifted (for example by dropping steps) then it won’t be. This command allows you to measure and to diagnose such problems. (E is included for completeness. It doesn’t normally have an endstop.)

M117 in Marlin: 显示消息

Example: M117 Hello World

这命令能让消息显示在LCD显示屏上. 上述命令显示的是 Hello World.

M118: Negotiate Features

Example: M118 P42

This M-code is for future proofing. NO firmware or hostware supports this at the moment. It is used in conjunction with M115’s FEATURES keyword.

See Protocol_Feature_Negotiation for more info.

M119: Get Endstop Status

Support FiveD Teacup Sprinter Marlin Repetier
yes yes

Example: M119

Returns the current state of the configured X, Y, Z endstops. Takes into account any ‘inverted endstop’ settings, so one can confirm that the machine is interpreting the endstops correctly.

M120: Push

Push the state of the RepRap machine onto a stack. Exactly what variables get pushed depends on the implementation (as does the depth of the stack – a typical depth might be 5). A sensible minimum, however, might be

  1. Current feedrate, and
  2. Whether moves (and separately extrusion) are relative or absolute

M121: Pop

Recover the last state pushed onto the stack.

M126: Open Valve

Example: M126 P500

Open the extruder’s valve (if it has one) and wait 500 milliseconds for it to do so.

M127: Close Valve

Example: M127 P400

Close the extruder’s valve (if it has one) and wait 400 milliseconds for it to do so.

M128: Extruder Pressure PWM

Example: M128 S255

PWM value to control internal extruder pressure. S255 is full pressure.

M129: Extruder pressure off

Example: M129 P100

In addition to setting Extruder pressure to 0, you can turn the pressure off entirely. P400 will wait 100ms to do so.

M130: 设置 PID P 值

Support FiveD Teacup Sprinter Marlin Repetier
yes

Example: M130 P 0 S 8.0 # Sets heater 0 P factor to 8.0

M131: 设置 PID I 值

Support FiveD Teacup Sprinter Marlin Repetier
yes

Example: M130 P 1 S 0.5 # Sets heater 1 I factor to 0.5

M132: 设置 PID D 值

Support FiveD Teacup Sprinter Marlin Repetier
yes

Example: M130 P 0 S 24 # Sets heater 0 D factor to 24.0

M133: Set PID I limit value

Support FiveD Teacup Sprinter Marlin Repetier
yes

Example: M130 P 1 S 264 # Sets heater 0 I limit value to 264

M134: Write PID values to EEPROM

Support FiveD Teacup Sprinter Marlin Repetier
yes

Example: M134

M136: Print PID settings to host

Support FiveD Teacup Sprinter Marlin Repetier
Debug

Example: M136 P1 # print heater 0 PID parameters to host

M140: Bed Temperature (Fast)

Support FiveD Teacup Sprinter Marlin Repetier
yes yes yes yes

Example: M140 S55

Set the temperature of the build bed to 55oC and return control to the host immediately (i.e. before that temperature has been reached by the bed).

M141: Chamber Temperature (Fast)

Example: M141 S30

Set the temperature of the chamber to 30oC and return control to the host immediately (i.e. before that temperature has been reached by the chamber).

M142: Holding Pressure

Example: M142 S1

Set the holding pressure of the bed to 1 bar.

The holding pressure is in bar. For hardware which only has on/off holding, when the holding pressure is zero, turn off holding, when the holding pressure is greater than zero, turn on holding.

M143: 设置最大热头温度

Example: M143 S275

设置热头最大温度为 275℃

当机器达到这个温度, 将采取紧急措施, 例如 紧急停止.这是为了防止对热头的破坏.

M160:混合材料数量

示例:M160 S4

将当前挤出机可以处理的材料数量 N 设置为指定的数量。默认值为 1。

当 N >= 2 时,控制拉伸的 E 字段需要 N+1 个值,后面用空格分隔,如下所示:

M160 S4
G1 X90.6 Y13.8 E22.4 0.1 0.1 0.1 0.7
G1 X70.6 E42.4 0.0 0.0 0.0 1.0
G1 E42.4 1.0 0.0 0.0 0.0

第二条线直接移动到挤出90.6mm长丝的点(13.8,22.4)。移动结束时的混合比例为 0.1:0.1:0.1:0.7。

第三条生产线在X挤出20mm的长丝中向后移动20mm。随着移动,混合在 0.1:0.1:0.1:0.7.0 到 0:0:1:<> 之间线性变化。

第四条线没有物理效果,但将下一步开始的混合比例设置为 1:0:0:0。

M190:等待床温达到目标温度

支持 五D 茶杯 短跑 运动员 枪鱼 重复版
过时,见M116 是的 是的

示例:M190 S60

这将等到床温达到60度,每秒打印出热端和床的温度。

M200 – 设置灯丝直径/获取止动器状态

支持 五D 茶杯 短跑 运动员 枪鱼 重复版
是的

M200 设置线材的直径.

问题:固件对灯丝直径有什么作用?这是否会影响 E 命令对挤出机电机的移动程度?–Traumflug 11年34月14日 (UTC) 2012:<>

M201 – 设置最大打印加速度

单位/s^2 表示打印移动 (M201 X1000 Y1000)

M202 – 设置最大移动加速度

单位/s^2 用于行进移动 (M202 X1000 Y1000) 在马林鱼中未使用!!

M203 – 设置电机最大速度

这是你机器可以维持的最大速度 例如(M203 X200 Y200 Z300 E10000) 单位 毫米/分钟

注意:这应该以单位/分钟为单位,就像 F 代码一样。

M204 – 设置默认加速度

S 正常移动 T 灯丝仅移动 (M204 S3000 T7000) im mm/sec^2 还设置最小分段时间(以毫秒为单位) (B20000) 以防止缓冲液欠载和 M20 最小进给率

M205 – 高级设置

最小行程速度 S=打印时 T=仅行程,B=最小段时间 X=最大 xy 抖动,Z = 最大 Z 抖动,E = 最大 E 抖动

M206: 设置归位偏差

示例:M206 X10.0 Y10.0 Z-0.4

参照轴时,指定的值将添加到终点位置。G92在归位后立即可以实现相同的效果(G28,G161)。

使用Marlin固件,可以使用M500命令将此值保存到EEPROM。

类似的命令是 G10,将这两者对齐有待讨论

M207: 通过测量Z的最大活动范围 来 校准Z轴

示例:M207

将喷嘴尖端放置在您希望被视为 Z=0 的位置后,发出此命令以校准 Z 轴。它将执行 z 轴归位例程并计算在此过程中行进的距离。结果作为z_max_length存储在EEPROM中。为了使用这种校准方法,机器必须使用Z MAX止动器。

此过程通常比 Z MIN 端挡块的机械调整更可靠。

M208: 设置XYZ轴行程的限制

示例:M208 X250 Y210 Z180

此值设置在XYZ轴正方向行程的软件限制。 Marlin 固件,可以用M500命令被保存到EEPROM中。

指定的值设置轴在正方向上的行程的软件限制。

使用Marlin固件,可以使用M500命令将此值保存到EEPROM。

M209: 允许自动回丝 (缩回)

示例:M209 S1

此布尔值 S 1=true 或 0=false 启用自动退刀检测切片器是否支持 G10/11:每个正常的仅挤出移动都将根据方向归类为退刀。

M220:设置速度系数超控百分比

示例:M220 S80

S<系数百分比>- 设置速度系数覆盖百分比

M221:设置拉伸因子覆盖百分比

示例:M221 S70

S<factor in percent>- set extrude factor override percentage

M226:Gcode 启动暂停

示例:M226

启动暂停的方式与按下暂停按钮的方式相同。也就是说,程序执行停止,打印机等待用户交互。这与 NIST RS1NGC G 代码标准中的 M274 和 Marlin 固件中的 M0 的行为相匹配。

M227:启用自动反转和主用

示例:M227 P1600 S1600

P 和 S 是步骤。

“反向和灌注”是指挤出机长丝在不使用时缩回一段距离,并在再次投入使用之前向前推相同的量。这将有助于防止挤出机喷嘴流口水。茶杯固件通过 M101/M103 实现了这一点。

M228:禁用自动反转和主火

Example: M228

See also M227.

M229:启用自动反转和主用

示例:M229 P1.0 S1.0

P和S是挤出机螺杆旋转。另见M227。

M230:禁用/启用等待温度变化

示例:M230 S1

S1 禁用等待温度变化 S0 启用等待温度变化

M240:启动传送带电机/回声关闭

支持 五D 茶杯 短跑 运动员 枪鱼 重复版
调试:回显关闭

示例:M240

传送带允许开始批量生产带有重复的零件。

在某些固件中使用 M111 可以控制回声

M241:停止传送带电机/回声开启

支持 五D 茶杯 短跑 运动员 枪鱼 重复版
调试:回显开启

示例:M241

在某些固件中使用 M111 可以控制回声

M245: 打开风扇

示例:M245

用于打印后冷却零件/加热床,以便在打印后轻松取出零件

M246: 关闭风扇

示例:M246

M300: 播放提示音

用法:M300 S<频率赫兹>P<持续时间毫秒>

示例:M300 S300 P1000

在打印结束时播放提示音来提醒我们。 播放蜂鸣音,用于通知打印结束等重要事件。参见R2C2电子器件的工作示例

M301:设置 PID 参数 – 热端

支持 五D 茶杯 短跑 运动员 枪鱼 重复版
PID

示例:M301 P1 I2 D3 C5

设置热端的比例值、积分值和导数值,值 C 表示挤出速率。

替代实现

示例:M301 W125

M303:运行 PID 调整

支持 五D 茶杯 短跑 运动员 枪鱼 重复版
PID PID

外壳用法:M303 S<温度>C<周期> 床用法: M303 E-1 C<循环><温度> 示例:M303 C8 S175

为热端或床 (E-1) 生成比例、积分和导数值。发送适当的代码并等待输出更新固件。

M304:设置 PID 参数 – 床

支持 五D 茶杯 短跑 运动员 枪鱼 重复版
PID

示例:M304 P1 I2 D3

设置床的比例值、积分值和导数值

M420:将 RGB 颜色设置为 PWM

用法:M420 R<红色 PWM (0-255)> E<绿色 PWM (0-255)> B<蓝色 PWM (0-255)>

示例:M420 R255 E255 B255

设置连接到支持 PWM 的引脚的 RGB LED 的颜色。请注意,由于 G 代码是无法覆盖的主要代码,因此绿色由 E 值而不是 G 值控制。

版权声明:
本站所有3D图纸模型数据均由用户上传,如有侵权请联系平台管理员删除,谢谢;
在本站下载的素材,著作权归原作者所有;
未经授权,不得以任何形式发行、发布、传播、复制、出租、转售、汇编该素材;
该下载资源仅限个人用户基于测试学习之用,请勿用于商业目的。

非凡 [FeiFan] 3D打印资源社区 » 最全3D打印机G-code代码详解

发表回复

汇集3D打印新玩法 ▪ 提供优质资源集合

QQ交流群:914682474

立即加入