標題: 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;