# G代码

| G代码                                                                                         | 功能                                                                                                                                                          | 示例                      |
| ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| [G0](https://smoothieware.org/g0)                                                           | 快速移动。 **F** 开启 **G0** 仅适用于该行；如果没有 **F**，快速移动将使用已配置的 [默认寻位速度](/docs/stable/zh/gu-jian/supported-commands/gcodes/g0-default-rapid-feed.md) （不是上一个 **G1** 进给）。 | G0 X10 Y5 F100          |
| [G1](https://smoothieware.org/g1)                                                           | 按进给速度直线移动 **F** （在 **G94**中为 mm/min；参见 [**G93**/**G94**](/docs/stable/zh/gu-jian/supported-commands/gcodes/inverse-time-feed-g93-g94.md)).                  | G1 X20 Y2.3 F200        |
| [G2](https://smoothieware.org/g2)                                                           | 顺时针圆弧运动：在绕相对坐标 IJ 的点旋转的同时移动到坐标 XYZ 的点                                                                                                                       | G2 X10 J5               |
| [G3](https://smoothieware.org/g3)                                                           | 逆时针运动：见上                                                                                                                                                    | G3 Y5 X10 I2            |
| [G4](https://smoothieware.org/g4)                                                           | 暂停 P<秒>                                                                                                                                                     | G4 P1                   |
| G10                                                                                         | 设置工作区坐标 <http://linuxcnc.org/docs/html/gcode/coordinates.html> 以及 <http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g10-l2>                            | G10 L2 P1 X0            |
| [G17](https://smoothieware.org/g17)                                                         | 选择 XYZ 平面（该命令为模态）                                                                                                                                           | G17                     |
| [G18](https://smoothieware.org/g18)                                                         | 选择 XZY 平面（该命令为模态）                                                                                                                                           | G18                     |
| [G19](https://smoothieware.org/g19)                                                         | 选择 YZX 平面（该命令为模态）                                                                                                                                           | G19                     |
| G20                                                                                         | 英寸模式。由于 [已知问题](https://github.com/Carvera-Community/Carvera_Community_Firmware/issues/209).                                                                 | G20                     |
| [G21](https://smoothieware.org/g21)                                                         | 毫米模式（默认）：传入坐标将被视为毫米                                                                                                                                         | G21                     |
| G23                                                                                         | 选择文件                                                                                                                                                        | 未使用                     |
| G24                                                                                         | 开始打印                                                                                                                                                        | 未使用                     |
| G25                                                                                         | 暂停打印                                                                                                                                                        | 未使用                     |
| G26                                                                                         | 重置打印                                                                                                                                                        | 未使用                     |
| G27                                                                                         | 报告打印进度                                                                                                                                                      |                         |
|                                                                                             |                                                                                                                                                             |                         |
| [G28](https://smoothieware.org/g28)                                                         | G28 表示在 Carvera 上回到安全位置                                                                                                                                     | G28                     |
| G29                                                                                         | 等待队列清空。需进一步研究                                                                                                                                               |                         |
| G30                                                                                         | 简单 Z 探测                                                                                                                                                     |                         |
| G31                                                                                         | 与 G32 相同，忽略                                                                                                                                                 |                         |
| G32                                                                                         | G32 会探测网格并开启补偿，此效果将一直保持，直到重置或执行 M370；X 和 Y 为起始位置，A 和 B 为宽度和长度，I 和 J 为网格尺寸，H 为高度。                                                                            | G32 R1 X0 Y0 A10 B10 H2 |
| [G33](/docs/stable/zh/gu-jian/features/flex-compensation-system.md#record-flex-profile-g33) | 记录 X 轴柔性轮廓                                                                                                                                                  | G33 X303 Y10 I30        |
| G38                                                                                         | [按文档实现的标准探测命令 ](http://linuxcnc.org/docs/2.6/html/gcode/gcode.html#sec:G38-probe)[这里](http://linuxcnc.org/docs/2.6/html/gcode/gcode.html#sec:G38-probe)     | G38.2 Z-10              |
| G38.2                                                                                       | 向工件探测，接触时停止，失败则报告错误                                                                                                                                         |                         |
| G38.3                                                                                       | 向工件探测，接触时停止                                                                                                                                                 |                         |
| G38.4                                                                                       | 远离工件探测，在失去接触时停止，失败则报告错误                                                                                                                                     |                         |
| G38.5                                                                                       | 远离工件探测，在失去接触时停止，                                                                                                                                            |                         |
| G38.6                                                                                       | 校准 z，功能不明确，需进一步测试。固件中已强制禁用                                                                                                                                  |                         |
| [G53](broken://pages/9e14e4a2a44cb2a219d739a11d43b437b49dfa5a)                              | 必须单独占一行，或者作为一行中的第一个 G 代码；其后直接跟随的 G0/G1 将以 MCS 坐标执行                                                                                                          | G53 G0 X0 Y0            |
| G54                                                                                         | 使用工作区坐标 <http://linuxcnc.org/docs/html/gcode/coordinates.html> 以及 <http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g54-g59.3>                         | G54                     |
| G55-59                                                                                      | 与 G54 相同                                                                                                                                                    |                         |
| [G90](https://smoothieware.org/g90)                                                         | 绝对模式（默认）（命令为模态）                                                                                                                                             | G90                     |
| [G91](https://smoothieware.org/g91)                                                         | 相对模式（命令为模态）                                                                                                                                                 | G91                     |
| [G93](/docs/stable/zh/gu-jian/supported-commands/gcodes/inverse-time-feed-g93-g94.md)       | 倒数时间进给模式（**F** 解释为倒数时间；社区固件）。见链接页面。                                                                                                                         | G93                     |
| [G94](/docs/stable/zh/gu-jian/supported-commands/gcodes/inverse-time-feed-g93-g94.md)       | 每分钟进给速率模式（正常 **F** 单位为 mm/min）。默认相对于 **G93**.                                                                                                               | G94                     |
| [G92](https://smoothieware.org/g92)                                                         | [将全局工作区坐标系设置为指定坐标 ](http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g92)<http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g92>                   | G92 X0 Y0 Z0            |
| G92.1                                                                                       | 清除 G92 偏移                                                                                                                                                   | G92.1                   |
| G92.4                                                                                       | 手动设置 XYZ 的回零（MCS）                                                                                                                                           | G92.4 X0 Y0 Z0          |
| G92.4 A0 S0                                                                                 | 将 a 轴缩回到 0-360 范围内，可用于连续旋转加工                                                                                                                                |                         |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://carvera-community.gitbook.io/docs/stable/zh/gu-jian/supported-commands/gcodes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
