标题: Arduino机械学习笔记06(CNC编程 G code) [打印本页] 作者: 51黑dd 时间: 2016-4-9 23:51 标题: Arduino机械学习笔记06(CNC编程 G code) *****************************
G code
CNC 的语言
*****************************
在学习 GRBL 过程中,遇到了很多新知识,CNC 编程对我来说也是需要补充学习的。
首先,坐标系统,
G90: Set to Absolute Positioning 设置成绝对定位
Example: G90
All coordinates from now on are absolute relative to the origin of the machine. (This is the RepRap default.)
所有坐标从现在开始变成绝对坐标,即与机器原始位置相对的..
G91: Set to Relative Positioning 设置成相对定位
Example: G91
All coordinates from now on are relative to the last position
所有坐标从现在开始变成相对于当前位置的相对坐标
G92: Set Position 设置位置
For rapid linear motion, program G0 X… Y… Z… A… B… C…, where all the axis words are
optional, except that at least one must be used. The G0 is optional if the current motion mode is
G0. This will produce coordinated linear motion to the destination point at the current traverse
rate (or slower if the machine will not go that fast). It is expected that cutting will not take place
when a G0 command is executing.
Program G80 to ensure no axis motion will occur. It is an error if:
• Axis words are programmed when G80 is active, unless a modal group 0 G code is programmed which uses axis words.
// float seek_rate; // Millimeters/min. Will be used in v0.9 when axis independence is installed
float position[3]; // Where the interpreter considers the tool to be at this point in the code
uint8_t tool;
// uint16_t spindle_speed; // RPM/100
uint8_t plane_axis_0,
plane_axis_1,
plane_axis_2; // The axes of the selected plane
uint8_t coord_select; // Active work coordinate system number. Default: 0=G54.
float coord_system[N_AXIS]; // Current work coordinate system (G54+). Stores offset from absolute machine
// position in mm. Loaded from EEPROM when called.
float coord_offset[N_AXIS]; // Retains the G92 coordinate offset (work coordinates) relative to
// machine zero in mm. Non-persistent. Cleared upon reset and boot.
} parser_state_t;