|
本帖最后由 1五湖四海1 于 2016-8-21 00:09 編輯
3 _6 W. S: w5 w' W# F S N- ~5 ^7 M% n7 s0 b) k
以前制作過CNC雕刻機,是用MACH3作為上位機控制,硬件是采用PC接并口輸出脈沖和方向使能信號經過隔離驅動步進電機驅動器,步進電機驅動是采用TB6560芯片控制。最后就接到步進電機。機械是用鋁合金制作,主要部件有三個1605的滾珠絲杠,多個運動滑塊等制作。用這臺DIY CNC雕刻機可以雕刻木頭塑料等東西。當時沒有一直玩下去,現在發現網上有用單片機制作的雕刻機挺精巧的現在分享給大家。" ~0 M3 o$ c! D
GRBL CNC 3D打印機,這就是我說的可以用單片機來控制的3D打印機,我先照著百度科普下grbl,Grbl是性能高,成本低,基于并口運動控制,用于CNC雕刻。它可以運行在Vanilla Arduino (Duemillanove/Uno) 只要它配備了Atmega 328型芯片。 控制器由C編寫并優化,利用了AVR 芯片的每一個靈巧特性來實現精確時序和異步控制。它可以保持超過30kHz的穩定、無偏差的控制脈沖 它接受標準的G代碼而且通過了數個CAM工具的輸出測試。弧形、圓形和螺旋的運動都可以像其他一些基本G代碼命令一樣完美支持。函數和變量目前并不支持,但是會作為預處理器包含在將來發布的版本之中。 Grbl 包含完整的前瞻性加速度控制。它意味著控制器將提前16到20個運動來規劃運行速度,以實現平穩的加速和無沖擊的轉彎。Grbl是性能高,成本低,基于并口運動控制,用于CNC雕刻。它可以運行在Vanilla Arduino (Duemillanove/Uno) 只要它配備了Atmega 328型芯片。 控制器由C編寫并優化,利用了AVR 芯片的每一個靈巧特性來實現精確時序和異步控制。它可以保持超過30kHz的穩定、無偏差的控制脈沖 它接受標準的G代碼而且通過了數個CAM工具的輸出測試。弧形、圓形和螺旋的運動都可以像其他一些基本G代碼命令一樣完美支持。函數和變量目前并不支持,但是會作為預處理器包含在將來發布的版本之中。 Grbl 包含完整的前瞻性加速度控制。它意味著控制器將提前16到20個運動來規劃運行速度,以實現平穩的加速和無沖擊的轉彎。很棒吧!開始玩起。![]()
) @5 ^5 ]7 e8 N [4 c+ }7 [* p) s9 o 還沒有雕刻機的機械部分可以用廢舊光驅制作個微型雕刻機運動平臺。雕刻機最重要的是主控程序這次用 Arduino/AVR328單片機,價格在15元左右,主控程序是上面提到的目前很火的開源的GRBL,還有一種基于STM32平臺的開源主控程序Dlion也不錯可以替代grbl。如果從性能比較這兩個方案,顯然是stm32平臺運行速度更快畢竟他是32單片機呀!
! \" b- O9 s1 e/ m q3 l' ? \! F& n1 s- q* u! `
' I( r- S7 S; R6 \9 a7 w
下面介紹小這個些主控程序主要干的事,通過串口PC和主控板通訊,PC命令給控制板,控制板接收命令做不同的響應,PC可以發G代碼給主控板,接收完成后可以自動開始雕刻任務。
F% ]* o, p8 ]3 N2 ?! M# Z 在介紹下G代碼因為G代碼是雕刻機的核心部分
# r( l' K% H5 Z* y; h" \7 b4 @! E! YG代碼是數控程序中的指令。一般都稱為G指令。
. ~6 Y2 T+ i& p/ u8 h6 \G00------快速定位
! |. A# O& P( T G/ x, cG01------直線插補
; X1 l, p$ G% oG02------順時針方向圓弧插補8 [! p% E4 R9 h& r5 N
G03------逆時針方向圓弧插補/ Y g' v. E! x6 ?/ N7 I) c
G04------定時暫停2 J+ W7 b. q h
G05------通過中間點圓弧插補2 E6 s! w. K3 x8 Z
G06------拋物線插補
6 j3 n: b% t4 I5 i, fG07------Z 樣條曲線插補
}% b, P" z) t9 u1 l2 ~# qG08------進給加速4 Z) B& ]- Z3 M, e2 ?' A+ Y k$ Q* w
G09------進給減速
n8 z! a/ _3 W+ \* W6 hG10------數據設置4 g7 i: q9 P$ `" E/ D6 W
G16------極坐標編程% g+ M# L) S0 r; g9 p- l% C
G17------加工XY平面
) Y' a/ R$ e! sG18------加工XZ平面. u' K5 ~! t! Y4 Z$ j: {, n5 @
G19------加工YZ平面
; g2 M3 V8 w! a) V: I核心就是解析G代碼,完成步進電機驅動,和控制主軸開啟關閉,還有插補算法,直線插補,圓弧插補,還有一些步進電機的加減速算法。
* v% N( d1 o/ Z5 b& e下面對grbl主結構做介紹
0 \$ _2 W+ z0 U' V- \$ b wmain()主函數首先執行下面初始化函數
4 ~# Z4 |4 X% J$ Q2 Z serial_init(); // 設置串口波特率和中斷. ^9 g1 `, K$ h7 V% ?9 X' N
settings_init(); // 從ROM加載grbl設置
5 e% a& E7 E) u# {; y. D0 D$ a stepper_init(); // 配置步進方向和中斷定時器
% v) J. a7 \$ B: c( o system_init(); // 配置引腳分配別針和pin-change中斷
- Q2 H% Z' [: d! w) G: d memset(&sys, 0, sizeof(system_t)); // 清除所有系統變量- q4 {* y [ f9 L4 R6 O
sys.abort = true; // 中止標識位置位
6 Z5 V* t9 X8 o& n sei(); // 使能中斷
, g: P* {4 |: G #ifdef HOMING_INIT_LOCK // 宏運算(settings.flags & (1 << 4)) != 0結果flags等于執行sys.state = STATE_ALARM
- J$ W4 E8 |, N& x ~( ~ // 系統狀態賦值為報警狀態
7 o( x v0 M$ t. w if (bit_istrue(settings.flags,BITFLAG_HOMING_ENABLE)) { sys.state = STATE_ALARM; }
0 K0 S$ j8 q4 F& O9 Q5 Q) u #endif6 p3 M0 c! I+ Q" V# _0 _
_____________________________________________________________________________________________________________________________________
' e+ K, I7 ]! V$ W; [接下來是一些主要部分初始化1 {# N$ e. J1 O P7 i2 w5 Q
for(;;) {
: p) Q" K; m' ]( b5 D serial_reset_read_buffer(); //清除串口讀緩沖區
0 ^$ l. |* v9 p8 C3 W gc_init(); //初始化G代碼功能函數! q0 w( Q; \* L4 e) @1 x0 `3 L) l% ?3 `' B
spindle_init(); //主軸初始化
* g$ q' M- E0 P8 ~7 O coolant_init(); //冷卻液初始化5 _' }0 w3 y; B# l9 _
limits_init(); //極限開關初始化8 Y/ t8 C$ C; S! R2 w4 T
probe_init(); //探測部件初始化
6 D* o5 y6 [+ {2 E plan_reset(); //清除塊緩沖區和規劃師變量0 K% C7 S% \& z& [- o9 @+ [' |& e
st_reset(); //清除步進系統變量。: Z) r4 F) p/ d4 Z2 ?6 E! N
' E! z7 X+ o* y, U6 x M" v3 a7 r4 p9 v8 ~7 d
//下面兩行清除同步gcode和策劃師職位當前系統位置。
7 k5 ?! [* u _/ G& w plan_sync_position();/ P, e; U7 [6 p1 V
gc_sync_position();
# \" v0 E$ \8 J1 a
: O: w* d: `! U1 v' V4 n7 Y9 d9 ^5 v. U/ b0 r6 d
//復位系統變量
# u# J( \* R$ f w sys.abort = false; //系統中止標志
! h, p7 t% }& A. |; q& l sys_rt_exec_state = 0; //系統標志位變量狀態管理。看到EXEC位掩碼。: O/ E( S+ Z+ x
sys_rt_exec_alarm = 0; //系統標志位變量設置不同的警報。) a1 L$ v& _0 U6 K" C; P. M0 d
sys.suspend = false; //系統暫停標志位變量管理,取消,和安全保護。
) r" C. X4 M/ h. Z6 b: T1 s, m& K" l sys.soft_limit = false; //限位開關限制狀態機錯誤。(布爾)
- n3 _" s- P3 {. A# q4 O* ?& r! Z: p. {* g4 N: a+ F
/ Z' Q9 j I: N% u/ i1 m& I protocol_main_loop(); //主協議循環
( ]& L& ^. ?+ H' s$ |} //
1 L# M& l8 A+ _2 }/ i/ q: L_____________________________________________________________________________________________________________________________
5 D# G7 _. n/ V; ]% M. o$ T+ K' d進入void protocol_main_loop()函數" M. {9 ^2 q( n6 f+ A5 z- m; |
{" T8 i' j" s3 e. M% h; y
report_init_message(); // 打印歡迎信息
! c( Z: Z0 I6 w/ c7 m" J+ H+ q* @ //重啟后檢驗和報告報警狀態如果錯誤重啟初始化。
% y9 S9 C2 N; {9 V+ d7 z if (sys.state == STATE_ALARM) {! n5 x" d1 b* ?7 v
report_feedback_message(MESSAGE_ALARM_LOCK); //打印信息
) A0 }0 |3 ~# ] T6 h: D z } else {
. s7 C1 o/ w' G5 T2 y // 如果沒有報警說明一切正常!但還是要檢查安全門. 4 K% f( U0 c( P
if (system_check_safety_door_ajar()) {
/ K8 T1 [+ O' N; _* j9 k: S bit_true(sys_rt_exec_state, EXEC_SAFETY_DOOR);$ M1 I% T0 x7 g4 _) u
protocol_execute_realtime(); // 進入安全模式。應該返回空閑狀態。% ~! a( w6 B8 J# _
} else {9 e1 X' j* V# g b
sys.state = STATE_IDLE; // .設置系統做好準備。清除所有國家國旗。
7 u/ L8 D* [2 z* ?/ J. M) d$ _- |5 ~ }
; |& v/ q* _% W' M$ I# K system_execute_startup(line); //開始執行系統腳本
6 @/ B/ W8 _0 u: s* s) O }
- g& O9 G- m; l- X6 D* B
' x& C" c" @% z3 m8 A
2 [! h$ m5 K6 F8 u; v1 H // 這是主循環!在系統中止時這是出口回到主函數來重置系統。# b- P3 L$ O! g" N
// ---------------------------------------------------------------------------------
) W- Y2 P+ F3 {5 |( ^0 j0 m # A: j; E" Q+ E& E+ [- x* p
uint8_t comment = COMMENT_NONE;+ h$ u& k+ _+ X3 E! Y$ X6 N
uint8_t char_counter = 0;+ y$ U j0 ^1 Z4 S$ M
uint8_t c;
$ `" F5 @) ?7 [" Y_______________________________________________________________________________________________________________________________: L" D( R7 P& n6 Z
接下來進入for(;;)循環 //下面代碼是G代碼解析核心部分,程序中comment(注釋)變量會被賦不同值,代表發符號有‘(’‘)’‘;’! N6 ]) L9 L$ y5 S" c
{+ y7 C, v7 P2 [4 N2 l l8 z
//串行數據輸入一行的的過程,作為數據。執行一個7 w' [3 J0 s9 d5 @5 n& E
//所有數據初始過濾去除空格和注釋。 ' P4 X* _: n7 K: I
//注意:注釋,空格和程序段刪除(如果支持的話)處理技術# I) c; g4 D# o* I9 M! t8 k
//在G代碼解析器,它有助于壓縮到Grbl傳入的數據
/ `* |0 m: b( r! u//線緩沖區,這是有限的。刀位點標準實際上州一行不行: u; D$ N3 f& g6 ?6 o7 s# F
//不能超過256個字符,Arduino Uno沒有更多內存空間。
7 k3 p" n/ f% ^- R7 |//有更好的處理器,它會很容易把這個初步解析的
% N9 Y9 W% \* s& s//分離任務共享的刀位點解析器和Grbl系統命令。 , W7 O( \4 f1 O! d3 y
while((c = serial_read()) != SERIAL_NO_DATA) { //讀取串口數據,有數據執行下面代碼7 i8 N2 `1 D' k% S* J
if ((c == '\n') || (c == '\r')) { // End of line reached //如果數據是/r,/n代表一行結束
9 v0 z5 r2 @9 W2 C. h+ \/ w1 A O line[char_counter] = 0; // Set string termination character. //設置結束標志6 B# I0 w: `- V3 Z& h' P5 V
protocol_execute_line(line); // Line is complete. Execute it! //一行完成執行此函數
! H* n2 `. G% @0 M& j6 k& Z2 _0 g( R comment = COMMENT_NONE; //注釋清零! ~3 K7 q- Y* Y3 {) m
char_counter = 0; //字符計數清零4 b6 y. `; ]) p) G, z% C
* e5 b5 X( t2 O/ `
else {
0 D0 o7 _% ]$ K {& q9 \8 P if (comment != COMMENT_NONE) {$ W' b! s/ |- Y+ D& q& T
//扔掉所有注釋字符# K; `& _- H* s. e. g1 s
if (c == ')') {
! ]- \% L" O* a) i0 ? //最后注釋。重新開始。但是如果有分號類型的注釋。( T+ E {; a7 y& X
if (comment == COMMENT_TYPE_PARENTHESES) { comment = COMMENT_NONE; }
0 s5 m' n1 p. O }
0 ^3 i6 I' E. _, [# S3 g } else {, r8 c! [8 q5 u
if (c <= ' ') { : J2 Y& N7 H' S; j' H) H
//扔掉whitepace和控制字符
5 ?" m0 d% m1 k. b: u) p' U/ o } else if (c == '/') { ) a$ t. s3 K1 L" C4 \7 `0 U) c
//塊刪除不支持將忽略字符。' [. ^- ]% a, z) m( Z7 P
//注意:如果支持,只需要檢查系統是否啟用了塊刪除。
3 N- M3 v: Y4 v+ i4 P } else if (c == '(') {! a# z; M+ N; Y) x7 I: u2 ?
// Enable comments flag and ignore all characters until ')' or EOL.
3 i0 \2 ~- Z4 f6 b: l // NOTE: This doesn't follow the NIST definition exactly, but is good enough for now.
8 k5 s" H( V, H) }8 R" _/ o // In the future, we could simply remove the items within the comments, but retain the& g: ^2 Q, K+ O4 Z
// comment control characters, so that the g-code parser can error-check it.
' |2 p; O, W: X5 _4 C1 s comment = COMMENT_TYPE_PARENTHESES;
3 b$ v! R% N' |, I } else if (c == ';') {
) c; y, Y+ y' m% h. U1 V; H //注意:','注釋EOL LinuxCNC定義。沒有國家標準。! \: g% z& D# c4 f- a, B0 V
comment = COMMENT_TYPE_SEMICOLON;' z8 C1 t) D# D; m! b0 |. {
* }0 O1 ~" ]7 ~2 K) V {9 [
; d' i ~1 {3 [6 W% N_____________________________________________________________________________________________________________________________________
5 p4 q: J. Z( K6 ` d9 E7 r } else if (char_counter >= (LINE_BUFFER_SIZE-1)) { //串口接收數據大于80字符時+ h+ m4 U5 U7 ~6 g7 \0 b5 I
// Detect line buffer overflow. Report error and reset line buffer. 檢測緩沖區溢出。報告錯誤和復位線緩沖區。
% @2 C8 F* r6 |3 J+ e/ L. z! ` report_status_message(STATUS_OVERFLOW); //打印溢出信息
1 I) D+ Y! ~- D comment = COMMENT_NONE;- |+ C* S+ L1 w e. K! R! Z
char_counter = 0;
) i M7 y# }0 i2 v% X/ X j6 G } else if (c >= 'a' && c <= 'z') { // Upcase lowercase //小寫改大寫
0 j1 n" ]& h4 P7 w2 f/ E$ s line[char_counter++] = c-'a'+'A';
6 l1 f) f4 t& Z! q& u } else {
; Q1 D$ ^8 D. V; @ z3 f' B, c line[char_counter++] = c;9 h/ I) K* O6 _4 M
}2 k% V* i* r, J2 b2 O: J. F# C7 L0 E2 }
}5 A8 F! w: R# D6 H
}
6 g+ f |9 z1 I7 c/ `! `: A2 K+ |9 { }* W, ^. w& z) r& E8 ~$ ]
____________________________________________________________________________________________________________________________________
* j; K" k& B4 ]2 R //如果沒有其他字符在串行處理讀取緩沖區和執行,這表明以完成,自動啟動,如果啟用,任何隊列動作。
; H, O) q$ o9 L* x! P protocol_auto_cycle_start(); //自動開始協議循環
( e8 }2 K" E4 R# O* e4 L% T" }. i ; C# f% |4 |+ s( I
protocol_execute_realtime(); //運行實時命令。/ R+ l* r1 x+ F6 p; k" r- \; I( E
if (sys.abort) { return; } //中止標識置位程序循環重置系統。 $ u ^+ |) w/ l- T" p" O" W' z6 D
}
+ l1 J" O- B, h) L. }0 I7 x return; //一般程序不會執行到這里$ ^3 F4 S/ @% ?* s+ y$ Y
}
7 a2 s7 p# m; Q____________________________________________________________________________________________________________________________________2 \/ M3 y G7 j# P: t& k
正常情況下,讀取完G代碼程序會進入protocol_auto_cycle_start();//自動開始協議循環 函數下面介紹此函數
y# B/ l% y( U1 `// Auto-cycle start has two purposes: 1. Resumes a plan_synchronize() call from a function that* x; {* r4 u" L: b
// requires the planner buffer to empty (spindle enable, dwell, etc.) 2. As a user setting that
& W$ m0 C1 o% @$ z& p; X// automatically begins the cycle when a user enters a valid motion command manually. This is
& F# `2 ]/ T4 A3 t1 F$ G `// intended as a beginners feature to help new users to understand g-code. It can be disabled7 O' ^' r3 m6 }# k
// as a beginner tool, but (1.) still operates. If disabled, the operation of cycle start is
" j8 Y( F) S) h// manually issuing a cycle start command whenever the user is ready and there is a valid motion
1 E0 G6 N, Q" g- {) v4 i// command in the planner queue.
; f) M1 u5 _ ?5 Y, b9 E// NOTE: This function is called from the main loop, buffer sync, and mc_line() only and executes
! w# D, O U+ V" I: \// when one of these conditions exist respectively: There are no more blocks sent (i.e. streaming \, f/ n3 n% c7 O7 x6 a7 N1 r+ Z
// is finished, single commands), a command that needs to wait for the motions in the buffer to 9 B! K8 j4 Y% p/ ]
// execute calls a buffer sync, or the planner buffer is full and ready to go.0 N; b2 s4 l% H- l1 k% B
//自動開始有兩個目的:1。回復一個plan_synchronize()調用的函數
8 x! W2 @. a$ j m//需要規劃師緩沖區空(主軸啟用、住等)2。作為一個用戶設置
9 m) T- {; n* t# |* ?* l5 e" I- {//自動循環開始當一個用戶輸入一個有效的運動命令手動。這是# l" |: @$ L+ [( v) [! _
//作為一個初學者的特性來幫助新用戶了解刀位點。它可以被禁用
8 `4 l3 ?: W0 W( t//作為一個初學者工具,但(1)仍然運作。如果禁用,運行周期開始
; p5 {* z+ `, A2 }2 I5 C. m6 ?$ N- U, C6 o//手動發出一個周期開始命令每當用戶準備好,有一個有效的運動; l" u9 _8 A& `- @
//命令的規劃師隊列。5 T! c* P, c, @) o7 C6 f- E
//注意:這個函數被稱為從主循環緩沖區同步,mc_line只()并執行
0 {3 h$ Z! X; Y9 }8 @% }$ V+ r//當其中一個條件分別存在:沒有更多的塊(即流發送* K9 Z# h$ f" W* z2 U
//完成后,單一的命令),一個命令,需要等待緩沖的動作
4 ]- O, s- I( y( z, p& K$ a//執行調用一個緩沖區同步,或規劃師緩沖區滿了,準備好了。
4 [0 v' s `7 P+ H/ ]# Hvoid protocol_auto_cycle_start() { bit_true_atomic(sys_rt_exec_state, EXEC_CYCLE_START); } 4 j" m- \9 B0 _: i& X. J5 G8 W, S
_______________________________________________________________________________________________
+ P$ d7 e/ b( a0 e1 Y. n' a- Q接下來程序運行protocol_execute_realtime(); /運行實時命令。
1 n L }. g( j0 c( [. c+ ^// Executes run-time commands, when required. This is called from various check points in the main0 l9 |& D. U. N% S! B2 k9 ]3 U& o
// program, primarily where there may be a while loop waiting for a buffer to clear space or any9 G. Z$ P5 P4 {* `
// point where the execution time from the last check point may be more than a fraction of a second.
- e r6 I7 p9 C* G, ]# B' G// This is a way to execute realtime commands asynchronously (aka multitasking) with grbl's g-code
* [' i6 O$ q+ r h! \// parsing and planning functions. This function also serves as an interface for the interrupts to
. _" A$ c' H0 ~, R4 {// set the system realtime flags, where only the main program handles them, removing the need to& B J. `. j" `7 I+ k
// define more computationally-expensive volatile variables. This also provides a controlled way to 5 t! r& U8 Z/ l5 p6 n7 F( l
// execute certain tasks without having two or more instances of the same task, such as the planner
7 o; m5 Y0 b, R, |// recalculating the buffer upon a feedhold or override.3 }$ U( Y. z0 ^
// NOTE: The sys_rt_exec_state variable flags are set by any process, step or serial interrupts, pinouts,
& R# o D7 V# y8 f T9 y( b// limit switches, or the main program.
; o1 X; V x6 y0 V; lvoid protocol_execute_realtime()6 D5 f7 |: D, r/ t8 w: y
uint8_t rt_exec; // Temp variable to avoid calling volatile multiple times.臨時變量來避免多次調用不穩定。
# s( y$ D( m8 _/ I) z3 Q; o7 g就先分享到這吧!. C- U1 [( M( z. P! w4 ^
5 ]7 L; {1 t/ Q' ?
6 r, z- ~2 U0 @( h, I+ @9 K
- h" K9 N: o( q* y5 y& ~3 O5 U, h3 ^0 q
: j$ L N, Y0 o4 v* i" @" U$ O
* \$ Q! }# w9 }2 z9 e+ Z5 p7 K# ? O/ I# J8 J h$ E4 J3 @/ p
6 Q8 {1 b% N! Q( y
d$ B( k/ }$ [2 n9 ?7 e& M' P# ?4 _% K
5 I0 {$ c6 w; C G
' C2 x; Y5 f& s$ ]) m
, l* Q6 O- N% _' R
+ x3 Z' U* g0 Y$ @
* \+ E5 v, K$ K4 I: d
5 P8 g- [* n/ o% m5 o4 D
! Q r3 s# W2 E6 Z2 J3 g: u, e& ]% `5 t! A q, J. e/ `" i O) c$ P
, [- y; G1 k4 R4 Z% y2 F: Y4 J
2 }: l2 j+ l2 a0 r9 k8 V- r' v) a6 @
& N) E- g) m' I& n5 i1 f5 \; K( u9 }6 F* _& s
% z9 a- p4 N; h- g4 f補充內容 (2016-8-25 22:40):
5 T8 e, A) s* m1 n; M- a5 ]配置說明
9 x) [2 P6 T. B L& U//這個文件包含編譯時配置Grbl的內部系統。在大多數情況下,+ }% f+ ?) N# E& b# P
//用戶不需要直接修改這些,但是他們在這里為特定的需求,即。. j0 s6 R/ j* ? @! c7 y
//性能調優或適應非典型的機器。* E; x8 K/ }( J' d2 B
主要配置項:' q/ ]7 P* L3 {# ]% i" S3 C
1.#define DEFAULTS_GENERIC //在重置eepm時使用。在defaults.h改變想要的名字
4 O$ c# U( T6 |/ H/ L8 C6 ^5 g+ B2.#define BAUD_RATE 115200 //配置串口波特率115200! Z$ O8 w9 w4 Y+ s
3.#define CPU_MAP_ATMEGA328P // Arduino Uno CPU! k3 |8 [% g, e5 W/ t- U% L5 Q
4.#define CMD_STATUS_REPORT '?' //定義實時命令特殊字符8 M! q& G9 ?& H% t0 `
5.#define HOMING_INIT_LOCK //回原點保護鎖9 ?9 ~4 G% D; f- Z6 \
6.#define HOMING_CYCLE_0 (1<<Z_AXIS) // 第一步Z清除工作區。, _. a8 T; [+ o9 O
#define HOMING_CYCLE_1 ((1<<X_AXIS)|(1<<Y_AXIS)) // 然后X,Y在同一時間。
/ l) T/ g# W8 ~: Z7.#define N_HOMING_LOCATE_CYCLE 1 //回原點循環次數# @) M3 d4 n4 R& j
8.#define HOMING_FORCE_SET_ORIGIN //取消這定義迫使Grbl總是在這時候位置設置機器原點盡管開關方向。
3 A2 o! D7 j$ t2 I- b" o9.#define N_STARTUP_LINE 2 //塊Grbl啟動時執行的數量。
6 j$ D3 z* `3 t10.#define N_DECIMAL_COORDVALUE_INCH 4 // Coordinate or position value in inches 協調或位置價值英寸0 \. D4 s) |% b- O. W4 Q2 e
#define N_DECIMAL_COORDVALUE_MM 3 // Coordinate or position value in mm 協調在毫米或位置價值
; G9 Y* {4 Z G. c #define N_DECIMAL_RATEVALUE_INCH 1 // Rate or velocity value in in/min 率或/分鐘的速度值1 e! V. `- e9 d" {* E) o8 z
#define N_DECIMAL_RATEVALUE_MM 0 // Rate or velocity value in mm/min 速率或速度值在毫米/分鐘
0 o! n3 V' U5 ~. A6 E #define N_DECIMAL_SETTINGVALUE 3 // Decimals for floating point setting values 對浮點小數設置值
2 @; A. T3 a! B+ X1 R11.#define LIMITS_TWO_SWITCHES_ON_AXES //如果你的機器有兩個極限開關連接在平行于一個軸,您需要啟用這個特性
" Y+ P' V D% h! C. o# i12.#define USE_LINE_NUMBERS //允許GRBL跟蹤和報告gcode行號: }9 R& [! F1 p( D4 c b' P
13.#define REPORT_REALTIME_RATE //允許GRBL報告實時進給速率6 |0 Z2 L& r* L+ L; o
14.#define MESSAGE_PROBE_COORDINATES //坐標通過Grbl $ #的打印參數?8 a% n8 u/ O" O
15.#define SAFETY_DOOR_SPINDLE_DELAY 4000 //安全門主軸延時
. I: R! l6 l( Q1 `1 K16.#define SAFETY_DOOR_COOLANT_DELAY 1000 //安全門冷卻液延時
, M7 B& V: E+ ]7 S/ z17.#define HOMING_CYCLE_0 (1<<X_AXIS) and #define HOMING_CYCLE_1 (1<<Y_AXIS) //啟用CoreXY運動學。
) T3 \% ~6 D: N* p8 L, i# b# }18.#define COREXY // Default disabled. Uncomment to enable.改變X和Y軸的運動原理/ _" z& M3 e. f! B7 d3 ^* M* _
19.#define INVERT_CONTROL_PIN // Default disabled. Uncomment to enable.反轉針銷邏輯的控制命令
9 ]$ R; N+ c6 d1 G20.#define INVERT_SPINDLE_ENABLE_PIN // 反轉主軸使銷從low-disabled
- \8 E! J% ~4 ~6 ]; w7 Y% z21.#define REPORT_CONTROL_PIN_STATE //啟用控制銷狀態反饋狀態報告。* Z: k; L" B7 R0 M% u% N% O# e. L1 A+ U
22.#define FORCE_INITIALIZATION_ALARM //啟用和用戶安裝限位開關,Grbl將啟動報警狀態指示9 M1 l5 q" f( N3 U) j9 Y
23.#define REPORT_GUI_MODE // gui允許最小的報告反饋模式
1 u! v& Z5 J- K8 { y24.#define ACCELERATION_TICKS_PER_SECOND 100 //加速度的時間分辨率管理子系統。9 z1 x* r7 s! n' t
25.#define ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING //自適應多軸步平滑(積累)是一種先進的功能
) a$ I5 o8 O6 w+ m% l26.#define MAX_STEP_RATE_HZ 30000 //設置最大一步速率可以寫成Grbl設置! x+ ^& _3 f, e7 T4 K
27.#define DISABLE_LIMIT_PIN_PULL_UP //以下選項禁用內部上拉電阻( s; `% h6 }- d% _( X$ W
28.#define TOOL_LENGTH_OFFSET_AXIS Z_AXIS //設置哪個軸長度補償應用的工具。假設軸總是與選擇軸工具面向負方向% U# s" Y" L$ f
29.#define VARIABLE_SPINDLE //允許變量軸輸出電壓不同的轉速值。
% L0 J9 { l) N9 v1 r& S6 S30.#define SPINDLE_MAX_RPM 1000.0 // Max spindle RPM. This value is equal to 100% duty cycle on the PWM.
' x1 y/ v6 p4 Y9 ]/ V4 x #define SPINDLE_MIN_RPM 0.0 // Min spindle RPM. This value is equal to (1/256) duty cycle on the PWM." t$ z5 S# b; c* E- C6 z
31.#define MINIMUM_SPINDLE_PWM 5 //使用的變量軸輸出。這迫使PWM輸出最小占空比時啟用。
7 z) ~5 h% j% j: C$ s32.#define USE_SPINDLE_DIR_AS_ENABLE_PIN //主軸方向使能M4被刪除
5 v W+ D" T5 q* c33.#define REPORT_ECHO_LINE_RECEIVED //應該對所有正常線路送到Grbl
( P( ^, r1 g& T4 F: z: u3 [- W34.#define MINIMUM_JUNCTION_SPEED 0.0 // (mm/min) //最小規劃師結速度。設置默認最小連接速度規劃計劃$ @# F- |/ j9 c2 w6 o. @
35.#define MINIMUM_FEED_RATE 1.0 // (mm/min)//設置計劃將允許的最小進給速率
- d; J: w+ Y7 r, q36.#define N_ARC_CORRECTION 12 //弧生成迭代次數之前小角度近似精確的弧線軌跡 E8 ~; o! c3 X+ \* ]/ F
37.#define ARC_ANGULAR_TRAVEL_EPSILON 5E-7 // Float (radians)//定義值設置機器ε截止來確定電弧是一個原點了?0 F" a! F( z' _; j, A
38.#define DWELL_TIME_STEP 50 // Integer (1-255) (milliseconds) //延時增加表現在住。默認值設置為50毫秒
' M- H: f) r6 O* F! A39.#define STEP_PULSE_DELAY 10 // Step pulse delay in microseconds. Default disabled.
r3 U3 u' _ P40.#define BLOCK_BUFFER_SIZE 18 //線性運動規劃師緩沖區的數量在任何給出時間計劃
" P# H; T# Y1 W- e4 S# [41.#define SEGMENT_BUFFER_SIZE 6 //控制之間的中間段緩沖大小的步驟執行算法
2 Q) ~4 O& z q3 B; |% N42.#define LINE_BUFFER_SIZE 80 //行執行串行輸入流的緩沖區大小。
$ D1 [4 i: \& I, c! q43.define RX_BUFFER_SIZE 128 //串行發送和接收緩沖區大小
; i, o. o9 q( a* y2 f2 R6 v44.#define TX_BUFFER_SIZE 64. k) S6 r) Z6 @6 m) r" M
45.#define ENABLE_XONXOFF ////切換為串行通信發送流軟件流控制。
5 r# Y- R; q! L6 F( L46.#define ENABLE_SOFTWARE_DEBOUNCE //一個簡單的軟件消除抖動特性硬限位開關。
* ^: c$ }# e4 S+ Q+ ]2 n47.#define HARD_LIMIT_FORCE_STATE_CHECK //Grbl檢查硬限位開關的狀態
- J& l+ F- ^( O! w" u" u, u2 Q48.// COMPILE-TIME ERROR CHECKING OF DEFINE VALUES:編譯時錯誤檢查的定義值:
2 y3 A5 c2 |: k" o+ p/ B+ C! @! M9 v
___________________________________________________________________________________________________
4 O9 h% g- f3 H# H0 M% c/*
% a; C' ~/ _* N" C config.h - compile time configuration9 q" P; ]5 Z4 @$ K! w8 ^, k ^
Part of Grbl7 z0 x- ~9 E+ l
. h/ I7 S4 x# v* W8 P* d* y% _
Copyright (c) 2012-2015 Sungeun K. Jeon
" T* H/ G* v8 w5 L2 J* } Copyright (c) 2009-2011 Simen Svale Skogsrud7 K1 y) O; \6 W( _7 Q7 v, @( |
. v- V1 `/ R3 X+ p7 ?' \
Grbl is free software: you can redistribute it and/or modify# Z! u4 s2 n$ t6 K" H0 j5 j
it under the terms of the GNU General Public License as published by
2 d. _7 ~$ v" b9 G8 y the Free Software Foundation, either version 3 of the License, or: _4 d) [7 S6 V% y& |6 Z0 Z
(at your option) any later version.
6 E m, E8 [! c6 S( J9 K- O$ V* X" t! B
Grbl is distributed in the hope that it will be useful,6 n; d/ A5 `* n* A8 E" V! Z$ ? _& m" H7 [
but WITHOUT ANY WARRANTY; without even the implied warranty of; h; ] F1 ~5 H2 K4 q# Z% _
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the; y, x/ T8 w4 b% d6 |" j& }
GNU General Public License for more details.
: L1 y" X+ V6 ]! Q, k
, L% _1 f; p' F You should have received a copy of the GNU General Public License
. z( X% V3 o* U x8 U0 X along with Grbl. If not, see <http://www.gnu.org/licenses/>.9 \. v% [7 ]3 E; H$ m
config.h -編譯時配置,Grbl的一部分
9 G5 l- @3 G! D. O$ s! j
' ~# i" c9 F# A2 e) r. p版權(c)2012 - 2015 Sungeun K. Jeon2 p: T. S+ g6 z+ z; \$ \
版權(c)2009 - 2011 Simen Svale Skogsrud0 e/ o1 ~, ]& x3 G
, x5 U6 _& L4 F/ f8 G: i9 x
Grbl是免費軟件:可以重新分配和/或修改
7 k: N1 H+ m# ^: ]2 o& r0 w: ^GNU通用公共許可證的條款下發布的自由軟件基金會,版本3的許可,或(任您選)其后的版本。
8 ]1 x. f1 ~. }- p V7 \# u# S1 X2 o* `# }& q
Grbl分布,希望這將是有用的,但是沒有任何保證;沒有即使的默示保證適銷性或健身為特定目的。看到
# z# e2 O- j+ u; JGNU通用公共許可證的更多細節。
( d' Z1 B+ V, _ L: }# c
. f9 ^- m1 s0 y# ~% |( `你應該收到了GNU通用公共許可證的副本
9 A. A6 `' H5 u4 F0 x7 s連同Grbl。如果沒有,看< http://www.gnu.org/licenses/ >。
/ h! ?4 G# w; O4 R" X% L& x ) a+ ~9 P$ Q8 U. {
*/7 V: L2 O8 @& k, X) @# d$ g
! U; I8 H) j5 E4 p
// This file contains compile-time configurations for Grbl's internal system. For the most part,
; t+ R4 J! Q& c z- C% ~ D! G. v// users will not need to directly modify these, but they are here for specific needs, i.e.3 I3 q4 f, Q% {( N
// performance tuning or adjusting to non-typical machines.
j1 N0 c0 v- B8 ?0 o//這個文件包含編譯時配置Grbl的內部系統。在大多數情況下,
+ M0 V( M% E1 T0 ^/ u/ B//用戶不需要直接修改這些,但是他們在這里為特定的需求,即。
7 r h! B4 ]3 b( g9 B* n& p//性能調優或適應非典型的機器。
& b% H5 n4 m( T' t
# u3 B' B# N( t3 S% {* Z// IMPORTANT: Any changes here requires a full re-compiling of the source code to propagate them.
" g. _8 J/ r, d/ g: O, S//重要:任何變化需要一個完整的基于源代碼的傳播。
9 b0 c1 Q! [" b8 ^: g: U [; J, ] ~% F
#ifndef config_h
" e& m$ I9 W% u1 w/ X! n#define config_h
1 C! P7 U0 X4 L7 ^$ U#include "grbl.h" // For Arduino IDE compatibility.- E$ g$ M6 l& L3 h
; r7 h* B" W8 ^' t: M4 O
// Default settings. Used when resetting EEPROM. Change to desired name in defaults.h, h1 p: K/ B& O+ I6 n$ j& u& a0 ~
// 默認設置。在重置eepm時使用。在defaults.h改變想要的名字3 w, [' @( w5 I7 [
+ E; _" V+ |$ j- G( U% L#define DEFAULTS_GENERIC ^% `: R5 F3 e9 P# T X
0 b6 @) ^8 J/ q9 B
// Serial baud rate
7 G# H' T! g9 h7 Z#define BAUD_RATE 115200 //配置串口波特率115200
+ i+ S. k' M% @7 `* L, H, U( u) w! K) J. f2 A# O! I
// Default cpu mappings. Grbl officially supports the Arduino Uno only. Other processor types
; a% K( g# h+ V6 ]4 n @// may exist from user-supplied templates or directly user-defined in cpu_map.h1 B" z( z% G6 A1 m8 _1 f5 H5 o
//默認cpu映射。Grbl正式支持Arduino Uno。其他類型的處理器可能存在cpu_map.h直接從用戶提供的模板或用戶定義的5 W. h5 [8 m1 P0 l/ v# } [& @
0 y' H+ J' z8 W" [5 F#define CPU_MAP_ATMEGA328P // Arduino Uno CPU* Q0 u0 L, N+ T g5 f1 g
9 `! \% u4 Z, F2 R$ k& M
// Define realtime command special characters. These characters are 'picked-off' directly from the7 l% `; d6 j. k' p" D1 I
// serial read data stream and are not passed to the grbl line execution parser. Select characters' e, T9 I: c5 ?& C+ T6 `
// that do not and must not exist in the streamed g-code program. ASCII control characters may be , _: `0 v9 W2 u# F# X1 t1 u4 ?
// used, if they are available per user setup. Also, extended ASCII codes (>127), which are never in / S6 P7 {7 |# ^) Y& A5 ?
// g-code programs, maybe selected for interface programs. @* D" S0 K# S& `, S
// NOTE: If changed, manually update help message in report.c.
& m. C2 A; |7 W% L& A4 @, A0 R& T9 F; S6 f! u. x
//定義實時命令特殊字符。這些字符是直接從“各個擊破”串口讀取數據流并沒有傳遞到grbl行執行解析器。選擇角色
; r( X5 O- n) m0 j# A//不,不能存在于程序流刀位點。ASCII控制字符9 b {, n1 \0 U+ Y) Z
//使用,如果他們是可用的每個用戶設置。同時,擴展的ASCII碼(> 127),從來沒有
! T3 }6 P* J7 J; l" A4 V//刀位點的程序,也許選擇界面程序。
?/ P ~# ?" E//注意:如果改變,手動更新report.c幫助信息。8 ^& D( E3 @# I7 E% `4 Z( T, B
" \0 n& F- l5 y4 U: X
#define CMD_STATUS_REPORT '?'
2 E3 k7 W* k6 v: H% ?#define CMD_FEED_HOLD '!'
8 {4 `' L+ e- e8 C/ h0 q#define CMD_CYCLE_START '~'
. Q. D/ z6 I: d* X1 c4 U0 j, d#define CMD_RESET 0x18 // ctrl-x., k$ `" _) `% N
#define CMD_SAFETY_DOOR '@'& K, E# V/ W" `2 h6 b
% o0 b5 q# G/ L8 }( Y3 [9 U
// If homing is enabled, homing init lock sets Grbl into an alarm state upon power up. This forces" C7 `- G* k D
// the user to perform the homing cycle (or override the locks) before doing anything else. This is
# h0 K- |$ J+ s; t: Z6 H1 H3 K" |: Q// mainly a safety feature to remind the user to home, since position is unknown to Grbl.! ^& J, l' |' Z+ ]% f; l6 i( a$ A
6 w& X" E7 @% @
//如果啟用了回原點,導航初始化鎖集Grbl進入警報狀態啟動。這就迫使# \. F, b) S/ q% O6 r" O: |* ?
//用戶執行歸航周期(或覆蓋鎖)在做任何其他事情之前。這是3 ~& \% k/ I% U/ d/ x
//主要安全功能,提醒用戶家里,因為Grbl位置是未知的。) a! }' w+ B4 y4 b1 A( F
# P# H5 ?& E& H. e, J#define HOMING_INIT_LOCK // Comment to disable3 h7 {! L( E& S
6 I9 U1 ?3 U @. f# D// Define the homing cycle patterns with bitmasks. The homing cycle first performs a search mode
. u3 L! s+ ]2 R t// to quickly engage the limit switches, followed by a slower locate mode, and finished by a short
: G \. k0 y) {1 s* P' k; u1 Q* x// pull-off motion to disengage the limit switches. The following HOMING_CYCLE_x defines are executed 9 T. w3 [7 ^& n# f2 u
// in order starting with suffix 0 and completes the homing routine for the specified-axes only. If1 B7 M% R" K; v3 b# B
// an axis is omitted from the defines, it will not home, nor will the system update its position.7 [6 K0 P! c# |+ A( ~0 O
// Meaning that this allows for users with non-standard cartesian machines, such as a lathe (x then z,
/ ]+ K& k6 i+ V' O1 o. }7 P// with no y), to configure the homing cycle behavior to their needs. - C1 M' N) ]9 Z$ t9 O- K/ Q- e
// NOTE: The homing cycle is designed to allow sharing of limit pins, if the axes are not in the same0 B. M5 I3 { J( K
// cycle, but this requires some pin settings changes in cpu_map.h file. For example, the default homing
2 Z6 U2 f# K) m3 ~) _// cycle can share the Z limit pin with either X or Y limit pins, since they are on different cycles.
$ {4 v. g! H' O# ?// By sharing a pin, this frees up a precious IO pin for other purposes. In theory, all axes limit pins
) r7 s$ o, _" N5 Q" n Y; G// may be reduced to one pin, if all axes are homed with seperate cycles, or vice versa, all three axes" ^# \& }, d C' c. R
// on separate pin, but homed in one cycle. Also, it should be noted that the function of hard limits 5 N6 u7 Y4 e% c( P. w# k. K) c
// will not be affected by pin sharing.0 @+ ?/ @* A& H4 X. a" C* Q# q5 e- Q
//定義導航循環模式的位掩碼。歸航周期首先執行一個搜索模式1 q n9 O9 o& Q# z* N
//快速進行限位開關,其次是較慢的定位模式,完成了由一個短" o/ l2 b5 V% t, J% @6 k7 j
//拖出運動脫離限位開關。以下HOMING_CYCLE_x定義執行
* J' Y8 f3 k* E8 E; a//為了與后綴0開始并完成specified-axes只尋的例程。如果, w" i3 S' w" ?5 t
//定義省略一個軸,它會不在家,也不會系統更新它的位置。
) p2 l3 C3 V8 l//意義,這允許用戶與非標準笛卡爾的機器,比如車床(x,z,) l8 Q7 M6 {; r1 p2 e8 t1 o
//沒有y),配置導航循環行為對他們的需求。; G2 ]- _1 K7 f+ l7 j
//注意:歸航周期允許共享限制針,如果軸不相同1 B s2 J7 j9 U- T8 e; k
//循環,但這需要一些銷設置cpu_map的變化。h文件。例如,默認的導航
4 u: s) |" t( H; a* H3 ~/ F% o//循環可以分享Z限位銷X或Y限制針,因為它們是在不同的周期。
! a) V) V n$ Q; ~* n+ s8 a//通過共享一個銷,這騰出寶貴的IO銷用于其他目的。從理論上講,所有軸限制別針5 h, W- i \( L* e$ r4 m8 C
//可能會減少到一個銷,如果所有軸與分離周期居住的地方,反之亦然,所有三個軸
7 Y, y5 M3 ^* f2 z) J+ g//在不同銷,但這時候一個周期。同時,應該注意的是,硬限制的功能8 F* T3 H2 x, r
//將不會影響銷共享。2 r* S/ ~; O4 n
//注意:默認設置為一個傳統的硬件數控機器。z軸首次明確,其次是X和Y。( E& `4 k0 l4 \5 D5 w2 M
' _# G9 s2 V; R// NOTE: Defaults are set for a traditional 3-axis CNC machine. Z-axis first to clear, followed by X & Y.& L5 j+ a( @4 u0 e3 F$ y
#define HOMING_CYCLE_0 (1<<Z_AXIS) // REQUIRED: First move Z to clear workspace. 第一步Z清除工作區。( b+ [) K4 f* J0 e+ X
#define HOMING_CYCLE_1 ((1<<X_AXIS)|(1<<Y_AXIS)) // OPTIONAL: Then move X,Y at the same time.然后X,Y在同一時間。
+ z) Y* }! O4 q; ?( u6 O* g// #define HOMING_CYCLE_2 // OPTIONAL: Uncomment and add axes mask to enable4 f- e& t- Z! k4 y& F8 l2 j
$ ~& W1 N% }; a5 P# J
// Number of homing cycles performed after when the machine initially jogs to limit switches.
2 r! A4 A2 f) i) }! n* t1 w// This help in preventing overshoot and should improve repeatability. This value should be one or
0 U5 ~- D% T4 X! ] G9 C$ D// greater.
( `7 ]/ `& v/ X, d. `' b$ [//執行回原點循環次數后,當機器最初慢跑限位開關。這個幫助防止過度,應該提高重復性。這個值應該是一個或大。% z9 H7 {% K2 h8 ~5 P+ q
) G, O- i' L( R" \& B6 z
#define N_HOMING_LOCATE_CYCLE 1 // Integer (1-128)% O: b. r$ Y7 n
* X. h* H; T; p3 y) K! w! O// After homing, Grbl will set by default the entire machine space into negative space, as is typical
; a5 R: H. ^' C, [# W8 B0 ?// for professional CNC machines, regardless of where the limit switches are located. Uncomment this 5 q: F+ n) W( K( m' z+ o9 w) T: H
// define to force Grbl to always set the machine origin at the homed location despite switch orientation.- i$ B2 I7 @! S; n7 d
: R, @% r1 e: a. j//導航后,默認Grbl將整個機器空間留白,是典型的專業數控機器,不管限位開關所在的地方。# F! F* P9 y c: I
//取消這定義迫使Grbl總是在這時候位置設置機器原點盡管開關方向。
" Y8 ?, f$ k" o" c( T5 t& E" O$ z1 g0 ?. k4 }8 i4 n
// #define HOMING_FORCE_SET_ORIGIN // Uncomment to enable.
8 w+ E& x0 P6 Q$ W9 O
" R% l9 u4 D% ~: P. C8 E
) _0 |" Q$ H' h. p% \, z// Number of blocks Grbl executes upon startup. These blocks are stored in EEPROM, where the size
/ M2 l* k" y+ K// and addresses are defined in settings.h. With the current settings, up to 2 startup blocks may4 C' n6 Z$ U0 [0 j% L. t
// be stored and executed in order. These startup blocks would typically be used to set the g-code
% l5 ?6 D( e+ L. V# y// parser state depending on user preferences.
" d c! l, D- b; H, M
; C% |( [. o: l; X5 j9 q0 _//塊Grbl啟動時執行的數量。這些塊存儲在eepm,大小
9 Y+ t: ~/ I4 z8 O0 H6 ?6 d( y//和地址在settings.h中定義。與當前設置,可能2啟動塊
+ y9 b" X& m; M% J3 M c//存儲和執行。這些啟動塊通常被用來設置刀位點
Z; `. N- K! A//解析器的狀態取決于用戶首選項。
7 C7 U6 m3 f- O" {/ x
4 A- @$ R, M- _. L#define N_STARTUP_LINE 2 // Integer (1-2)6 K; i1 N+ _6 O: n* n
. D& S) i8 f ]2 q: y& W// Number of floating decimal points printed by Grbl for certain value types. These settings are
1 P8 F$ l1 Y7 ^* F9 f& F// determined by realistic and commonly observed values in CNC machines. For example, position
2 }- r Q* h d+ Z! g! n# d// values cannot be less than 0.001mm or 0.0001in, because machines can not be physically more4 A$ W8 [( Q+ P8 i2 o+ {7 Z
// precise this. So, there is likely no need to change these, but you can if you need to here.; r3 X8 c0 ]" W: W
// NOTE: Must be an integer value from 0 to ~4. More than 4 may exhibit round-off errors.
: ?' T X* E5 G# X' u9 N
8 j5 z9 M9 Z" z* T4 E- o, }# z `' n// Grbl浮動小數點的數字印刷的特定的值類型。這些設置是$ q V# g) M! B# R1 s6 `
//一般由現實和觀測值在數控機器。例如,位置6 M1 q6 i& m( K* g _! b
//值不能小于0.001毫米或0.0001,因為機器不能身體更多
" a* t) E" U1 B+ L1 b//精確。因此,有可能不需要改變這些,但你可以在這里如果你需要。" s7 J) z. {/ } s0 a) G) p
//注意:必須是一個整數值從0 ~ 4。超過4可能出現舍入錯誤。$ s1 {, u7 k+ A& D! J
8 z) Y; S2 E2 y6 B#define N_DECIMAL_COORDVALUE_INCH 4 // Coordinate or position value in inches 協調或位置價值英寸5 _8 S' E8 d1 t. L
#define N_DECIMAL_COORDVALUE_MM 3 // Coordinate or position value in mm 協調在毫米或位置價值
0 [" Z' w. u5 F( u#define N_DECIMAL_RATEVALUE_INCH 1 // Rate or velocity value in in/min 率或/分鐘的速度值
3 D6 v1 J! N4 w#define N_DECIMAL_RATEVALUE_MM 0 // Rate or velocity value in mm/min 速率或速度值在毫米/分鐘
: r0 g- \7 y% l1 F) u" u#define N_DECIMAL_SETTINGVALUE 3 // Decimals for floating point setting values 對浮點小數設置值; R: r9 p: b+ P- d& j
6 E3 i, s( j( @+ Y// If your machine has two limits switches wired in parallel to one axis, you will need to enable6 d( g6 [ g5 C, P; K% ~- G
// this feature. Since the two switches are sharing a single pin, there is no way for Grbl to tell
: l: y( ]- ]2 K// which one is enabled. This option only effects homing, where if a limit is engaged, Grbl will
6 c2 _# S1 ]1 i7 t" I% k// alarm out and force the user to manually disengage the limit switch. Otherwise, if you have one) j$ \5 R: z+ G$ ^$ |
// limit switch for each axis, don't enable this option. By keeping it disabled, you can perform a
$ u3 n1 R. }2 W& H" ~1 [0 X// homing cycle while on the limit switch and not have to move the machine off of it.
' L3 j& Q1 a. ?2 v! D
# M+ q9 a1 C! P//如果你的機器有兩個極限開關連接在平行于一個軸,您需要啟用
* f& j4 j# m# C( a# t//這個特性。自從兩個交換機共享一個銷,沒有辦法Grbl告訴, c8 `* Q+ y! f; r* v4 |# }- ^
//啟用哪一個。此選項僅影響歸航,如果限制,Grbl意志
0 e6 `: N$ n9 D# k. T$ K8 s9 ^//報警,迫使用戶手動松開限位開關。否則,如果你有一個1 X: C2 I3 f& w. n: P+ w
//為每個軸限位開關,不啟用該選項。通過保持禁用,您可以執行
: z& H U! n4 }) Z//導航循環在限位開關并沒有將這臺機器。+ k1 C, e1 q4 @. @
! u( a% L; v; |# a; ~// #define LIMITS_TWO_SWITCHES_ON_AXES
& l# J% k0 o4 [4 V' n
9 l R5 F1 e2 z// Allows GRBL to track and report gcode line numbers. Enabling this means that the planning buffer
V4 {" Z( l% C' M& o// goes from 18 or 16 to make room for the additional line number data in the plan_block_t struct' @4 W7 p+ ^! }3 V# d+ j
' [+ Y( R+ H0 w6 J2 o//允許GRBL跟蹤和報告gcode行號。使這意味著計劃緩沖從18歲或16歲,為額外的行號plan_block_t結構中的數據: t3 I, a, g% X. a; ?9 h- J
1 B( Z- Q+ ^: r- c( y' D! `5 q N// #define USE_LINE_NUMBERS // Disabled by default. Uncomment to enable.2 f" J; c, b# @5 x z
) J5 v6 h3 f4 e+ \1 j4 x
// Allows GRBL to report the real-time feed rate. Enabling this means that GRBL will be reporting more
9 R# P. O& W( f. X5 e+ Y* B/ l/ I// data with each status update.) i, v% H/ _! b7 O! `7 N, o3 V; X
// NOTE: This is experimental and doesn't quite work 100%. Maybe fixed or refactored later.( Q4 M/ t" i! a3 t5 f
//允許GRBL報告實時進給速率。使這意味著GRBL將報告數據和狀態更新。
5 G' l5 }3 f4 M; D/ U* z6 Q//注意:這是實驗和100%沒有工作。也許以后固定或重構。& o+ a# r" t8 o& K% S3 k5 G
; E6 ]& K/ j2 j- H2 k+ g2 Y4 X// #define REPORT_REALTIME_RATE // Disabled by default. Uncomment to enable.
3 f$ ^0 f) G4 m- D
" d/ f# U' B$ l; T// Upon a successful probe cycle, this option provides immediately feedback of the probe coordinates
6 ~7 [' R4 m1 f% Y// through an automatically generated message. If disabled, users can still access the last probe4 e. A: w3 Z% G: Z
// coordinates through Grbl '$#' print parameters.
" i* g4 r, U4 t+ o! I& W) F G! V* X, Y//在一個成功的調查周期,這個選項提供立即反饋的探測器坐標% I. s& m5 U* _6 f
//通過一個自動生成的消息。如果禁用,用戶仍然能夠訪問調查
$ S, L7 P3 T4 q' t//坐標通過Grbl $ #的打印參數。
" H8 Z. G* M0 ]
3 u* ]+ O7 E' Z/ M- M' [#define MESSAGE_PROBE_COORDINATES // Enabled by default. Comment to disable.1 d2 t2 |' `6 r) _& |# u
H3 {- f$ F% f, W
// Enables a second coolant control pin via the mist coolant g-code command M7 on the Arduino Uno) u# i/ T [9 l. T" p
// analog pin 5. Only use this option if you require a second coolant control pin.: v- F4 n' [# ~& j
// NOTE: The M8 flood coolant control pin on analog pin 4 will still be functional regardless.
; [ N7 k) ~: ]; N// #define ENABLE_M7 // Disabled by default. Uncomment to enable.
* s) @/ _5 ]# L% u* z. ^8 ^6 s7 Y! ~4 e# J# _: `1 z M- J. {
// This option causes the feed hold input to act as a safety door switch. A safety door, when triggered,
" h4 L+ b3 P7 y1 x5 k X// immediately forces a feed hold and then safely de-energizes the machine. Resuming is blocked until
7 R) I( @8 B. i% H7 y// the safety door is re-engaged. When it is, Grbl will re-energize the machine and then resume on the
. l5 v6 ]! N' a// previous tool path, as if nothing happened.
4 R3 [; z! e' Z% F& H% p: c$ X3 }; W// #define ENABLE_SAFETY_DOOR_INPUT_PIN // Default disabled. Uncomment to enable.
, L$ p) {* I8 Y4 v" }7 \* z- S0 d1 P& z% T6 J! l$ @2 a
// After the safety door switch has been toggled and restored, this setting sets the power-up delay
4 q: h. f" q2 @// between restoring the spindle and coolant and resuming the cycle./ P- i8 N0 d0 a" a0 p- p
// NOTE: Delay value is defined in milliseconds from zero to 65,535. T% k1 L* j' ? g2 z$ R; M
9 P9 m% J9 ~( S/ D
//定義導航循環模式的位掩碼。歸航周期首先執行一個搜索模式
2 V3 Q, y# k4 u3 a6 _//快速進行限位開關,其次是較慢的定位模式,完成了由一個短
% Y. f% h0 X) }/ d+ s8 f1 t- x//拖出運動脫離限位開關。以下HOMING_CYCLE_x定義執行
8 b' m6 m) n/ ^# f l# y; o# v//為了與后綴0開始并完成specified-axes只尋的例程。如果0 S0 y" g, c$ L+ G! E- U; T
//定義省略一個軸,它會不在家,也不會系統更新它的位置。7 A8 I" g7 [6 N- Z% c
//意義,這允許用戶與非標準笛卡爾的機器,比如車床(x,z,
/ E! B, @$ I9 x) }# B$ T* _! Z//沒有y),配置導航循環行為對他們的需求。; u8 ~" H# F2 ~3 f `( M0 H- S8 k
//注意:歸航周期允許共享限制針,如果軸不相同
: j& e }1 Z" ^1 k8 A: t//循環,但這需要一些銷設置cpu_map的變化。h文件。例如,默認的導航! e* b/ J4 y- x$ x) O, R
//循環可以分享Z限位銷X或Y限制針,因為它們是在不同的周期。- C" ` A1 I3 y H# X8 k1 h6 k
//通過共享一個銷,這騰出寶貴的IO銷用于其他目的。從理論上講,所有軸限制別針 ^4 r% O. ^& q/ Y( B
//可能會減少到一個銷,如果所有軸與分離周期居住的地方,反之亦然,所有三個軸
+ m3 b# t) [1 T# n$ N5 A//在不同銷,但這時候一個周期。同時,應該注意的是,硬限制的功能
! X" { ?9 v' Z9 k6 V l7 M//將不會影響銷共享。
) c$ v* S7 n$ n8 q' k }* X//注意:默認設置為一個傳統的硬件數控機器。z軸首次明確,其次是X和Y。
/ W4 T! d4 u5 V5 [, @ t+ O
% T' P0 K) K; \) g0 b h& B/ ]( B+ {# [
#define SAFETY_DOOR_SPINDLE_DELAY 4000
2 m; o! ]7 @ ~+ g8 J n#define SAFETY_DOOR_COOLANT_DELAY 1000
, C8 q5 m' m0 G6 B+ b* t( E$ l, ]+ @: k, s2 m
// Enable CoreXY kinematics. Use ONLY with CoreXY machines. ! k, V# F- v: l5 D* a% y$ L
// IMPORTANT: If homing is enabled, you must reconfigure the homing cycle #defines above to
- ^) f/ n6 i7 Z5 z- y3 X8 I1 `//啟用CoreXY運動學。只使用與CoreXY機器。
l) T2 L% C+ H4 l& l! t) v//重要:如果啟用了自動尋的,你必須重新配置導航循環#定義上面7 T4 t& ^. y+ j9 p& e* X
5 s) S1 [$ m" t: ?# {0 N// #define HOMING_CYCLE_0 (1<<X_AXIS) and #define HOMING_CYCLE_1 (1<<Y_AXIS)9 }" q% {: _3 R- W# k7 x
) G$ N. h0 ~; Z4 e$ c! ?6 C" d9 ~
// NOTE: This configuration option alters the motion of the X and Y axes to principle of operation5 N- b9 Y0 X2 \* \7 g
// defined at (http://corexy.com/theory.html). Motors are assumed to positioned and wired exactly as
3 F3 @* v0 w% F+ V* r. l. l// described, if not, motions may move in strange directions. Grbl assumes the CoreXY A and B motors6 T) f4 F: E! _& w5 x% [$ Q
// have the same steps per mm internally.
( j; [9 n9 x$ M3 a, k& I//注意:這種配置選項改變X和Y軸的運動原理,操作
K# j1 i. l" |% p//定義(http://corexy.com/theory.html)。汽車被認為定位和連接一樣
) K/ i, D4 w! z) Z//描述,如果沒有,運動可能會奇怪的方向移動。A和B Grbl假設CoreXY馬達
8 U3 D- N' Q7 s//每毫米內部有相同的步驟。
- e% p) f/ h3 T5 l0 ?: W1 K+ u" z1 X3 g$ a+ N1 x0 U4 C8 o, U! `
// #define COREXY // Default disabled. Uncomment to enable., H. V1 M5 o$ g( j3 Q
* D$ |2 K+ e; k+ |( v1 r; P8 ]
// Inverts pin logic of the control command pins. This essentially means when this option is enabled4 t# [& o9 u2 F1 R6 H, E
// you can use normally-closed switches, rather than the default normally-open switches.
# V' c1 W$ B; D2 s3 R- o// NOTE: Will eventually be added to Grbl settings in v1.0.& v5 o. ]7 ]; e* \
//反轉針銷邏輯的控制命令。這實質上意味著當啟用這個選項
# Z4 [/ o) G0 B3 `2 J- H( d//可以使用閉合開關,而不是默認的常開開關。
+ E5 Y2 W7 X9 ~! s//注意:最終將被添加到在v1.0 Grbl設置。
% V% u2 Q9 \4 f# P4 N* U6 K4 P& @% D9 G! x i9 [( T! _" X
// #define INVERT_CONTROL_PIN // Default disabled. Uncomment to enable.
8 w% j- N1 a( U/ V! k+ g; Y% ?) w' K' C5 ^5 M
// Inverts the spindle enable pin from low-disabled/high-enabled to low-enabled/high-disabled. Useful- [- @( s9 T1 }/ K. U4 f- c
// for some pre-built electronic boards.
& O" {6 }3 _* Z; ~1 @// NOTE: If VARIABLE_SPINDLE is enabled(default), this option has no effect as the PWM output and $ r3 i. T( }+ S9 o f
// spindle enable are combined to one pin. If you need both this option and spindle speed PWM, $ a' o/ T, c2 l# Z
// uncomment the config option USE_SPINDLE_DIR_AS_ENABLE_PIN below., Y* i* r0 Z8 x( k4 J& u1 B
//反轉主軸使銷從low-disabled / high-enabled low-enabled / high-disabled。有用的 G3 P z$ o5 ~
//預構建的電子板。
) w$ i- A) n% n. \/ g2 q! Q) Z5 N& B# B//注意:如果啟用了VARIABLE_SPINDLE(默認),這個選項作為PWM輸出并沒有影響 T5 O2 P- X" K2 Q) K. t: Z5 T
//銷軸使結合。如果你需要這個選項和主軸轉速PWM,; o G: U d+ g8 T- f( J
//取消注釋以下配置選項USE_SPINDLE_DIR_AS_ENABLE_PIN
* @* U3 C* s$ y0 S
1 c; }6 h' w" w9 v1 c// #define INVERT_SPINDLE_ENABLE_PIN // Default disabled. Uncomment to enable.- }! u2 ?6 k( \$ x# d
9 _! U0 \. a1 {! ?. O
// Enable control pin states feedback in status reports. The data is presented as simple binary of6 i! \$ c2 _% j0 ?5 K4 c
// the control pin port (0 (low) or 1(high)), masked to show only the input pins. Non-control pins on the 8 ]6 \3 o8 q$ m* Z! K
// port will always show a 0 value. See cpu_map.h for the pin bitmap. As with the limit pin reporting,
. ]7 O2 _; h' `0 [3 s q// we do not recommend keeping this option enabled. Try to only use this for setting up a new CNC.
1 o( f& M2 F9 b. [5 b8 \/ Y; w//啟用控制銷狀態反饋狀態報告。作為簡單的二進制數據
7 z: |7 }, U! b$ A, t$ ]//控制針端口(0(低)或1(高)),蒙面,只顯示輸入插腳。非控制性針上5 {& k6 a/ D( Y
//端口總是顯示0值。看到cpu_map。針位圖h。與限制銷報告,
; c R: s _; i9 W1 Y( W* V! F//我們不推薦保持啟用這個選項。盡量只使用這個設置一個新的數控。
* Q- @# y3 L" {* I8 `# h" g X; p, O0 s- g2 e% E/ X W* ^1 x8 ^
// #define REPORT_CONTROL_PIN_STATE // Default disabled. Uncomment to enable.
4 H! H3 s& h+ ]0 k& l7 X. J8 X% l V+ z9 j; N
// When Grbl powers-cycles or is hard reset with the Arduino reset button, Grbl boots up with no ALARM
$ s3 ~% S# d Y0 I" p! B8 [// by default. This is to make it as simple as possible for new users to start using Grbl. When homing
/ V$ M9 l! G; G, [. D$ e) e* d// is enabled and a user has installed limit switches, Grbl will boot up in an ALARM state to indicate 3 j6 z3 G7 {! g
// Grbl doesn't know its position and to force the user to home before proceeding. This option forces% t) W3 d6 M, N* h- u& _" D
// Grbl to always initialize into an ALARM state regardless of homing or not. This option is more for/ j' |: ^. R* k: ^' a* m
// OEMs and LinuxCNC users that would like this power-cycle behavior.
5 E' Y& j! A; d//當Grbl powers-cycles還是硬重置Arduino復位按鈕,Grbl啟動沒有報警
( `$ u7 p* ^. o//默認情況下。這是為了讓新用戶盡可能簡單使用Grbl開始。當歸航
4 ?5 E' W# B1 P. x- }//啟用和用戶安裝限位開關,Grbl將啟動報警狀態指示! C3 D! X" f+ f5 C
// Grbl不知道它的位置,迫使用戶在繼續之前回家。這個選項部隊
+ i( e8 A4 p( \) g) |+ w7 q// Grbl總是初始化進入警報狀態不管歸航。這個選項是更多
. t5 N' W( q3 w& z//原始設備制造商和LinuxCNC用戶這樣的控制行為。, {4 W$ b2 [6 o, g9 A" r: d! G
% L8 W" M: J% J: c
// #define FORCE_INITIALIZATION_ALARM // Default disabled. Uncomment to enable.4 P; v. e. v @6 e
& x* r+ C6 p% ~# C. K0 F5 P" D! x
// ---------------------------------------------------------------------------------------
7 N1 |4 {# s5 }' N// ADVANCED CONFIGURATION OPTIONS://高級配置選項:
) N, r* B$ k9 a" @( \; M' ^2 o1 z& p7 g# N) s8 l. E6 H
// Enables minimal reporting feedback mode for GUIs, where human-readable strings are not as important.( k- z" S5 n7 G& `. z* P& a& X
// This saves nearly 2KB of flash space and may allow enough space to install other/future features.
# P Y1 r+ M6 q' `, K/ t// GUIs will need to install a look-up table for the error-codes that Grbl sends back in their place.
1 g/ \) v; u/ k3 K& N# O// NOTE: This feature is new and experimental. Make sure the GUI you are using supports this mode.
/ v; N$ N# F, M. f# j q) b6 G& U- V7 R; x+ N: z
// gui允許最小的報告反饋模式,人類可讀的字符串在哪里不重要。' T4 ]/ s/ C5 Z& _! c
//這個節省近2 kb的閃存空間,允許足夠的空間來安裝其他/未來的功能。' _$ r9 u, q! `3 ^& K e" ?
// gui需要安裝一個查找表的錯誤代碼Grbl發回。2 f( f _: |7 H* q( b. q# }
//注意:此功能是新的和實驗。確保您使用的GUI支持這種模式。
* u$ ?: E/ L/ n2 J4 ~' Q
' [6 D% }! C3 x2 X7 M4 P: v// #define REPORT_GUI_MODE // Default disabled. Uncomment to enable.* F) [8 c8 ~/ x9 \- e
$ v [' g) i/ Y8 |% Y// The temporal resolution of the acceleration management subsystem. A higher number gives smoother
1 e- Y3 l. B+ `0 w// acceleration, particularly noticeable on machines that run at very high feedrates, but may negatively, h% T- R. u) Q
// impact performance. The correct value for this parameter is machine dependent, so it's advised to
+ O; Q7 G2 k: U9 O// set this only as high as needed. Approximate successful values can widely range from 50 to 200 or more.
# J6 T% H4 N+ _3 [4 t// NOTE: Changing this value also changes the execution time of a segment in the step segment buffer.
! C9 J- I4 W* E* Q9 S, m// When increasing this value, this stores less overall time in the segment buffer and vice versa. Make, t- g# H& @! ] W3 L- t; G
// certain the step segment buffer is increased/decreased to account for these changes.
$ x* [/ L5 v# Z3 Q; a//加速度的時間分辨率管理子系統。更多更平穩3 {9 g* m, ^9 u
//加速度,特別明顯的機器上,運行在非常高的進料速度,但可能負面
4 H# g; [1 _6 A- g+ c2 K& `% l1 w//影響性能。正確的值為這個參數是依賴于機器的,所以建議
5 B+ p1 T2 ]% g//這只設置為高。近似成功的價值觀可以廣泛的范圍從50到200或者更多。$ y( g. A6 J! l2 {8 k
//注意:改變這個值也變化的部分步驟的執行時間緩沖。; r7 @ R5 E' ^ [6 m) i
//增加這個值時,這個商店部分緩沖區的總時間減少,反之亦然。使. ~' z' I8 e" n: i' X9 W
//特定步驟段緩沖是考慮這些變化增加/減少。
7 Z( j. Q* E7 b) Y8 O! o- g* ]- F" U. u( ~( u
#define ACCELERATION_TICKS_PER_SECOND 100 //加速度的時間分辨率管理子系統。更多更平穩
4 i' Z3 R. `& L7 Q- m/ i4 I, t8 V& [7 J0 s$ i; Y
// Adaptive Multi-Axis Step Smoothing (AMASS) is an advanced feature that does what its name implies,
* e4 D0 l$ l. D" [& q; y// smoothing the stepping of multi-axis motions. This feature smooths motion particularly at low step* J' p# w) J# x& _
// frequencies below 10kHz, where the aliasing between axes of multi-axis motions can cause audible
5 ~% }7 U6 x; l8 d// noise and shake your machine. At even lower step frequencies, AMASS adapts and provides even better
+ R; x, f0 T8 T7 T( ]. N5 o+ F8 ]7 g// step smoothing. See stepper.c for more details on the AMASS system works.0 }+ z1 `: v" f
//自適應多軸步平滑(積累)是一種先進的功能,它的名字所暗示的那樣,9 @% _ N3 X$ z0 x% p! K0 h! i; [
//平滑的多軸步進運動。這個特性平滑運動尤其是在低一步4 H0 M6 D& e2 Z* Z, Q+ j( I
//頻率低于10 khz,軸之間的混疊的多軸運動可能導致音響
( y# [: H. v* O1 I- i5 o. `' {//噪音和震動你的機器。在更低的頻率步,積累適應并提供更好+ {( [6 O9 l: d
//步驟平滑。看到步進。c更多細節的積累系統的工作原理。5 f. Q3 v% Q! H
" a5 e1 D2 x- K0 J- M( p; n
#define ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING // Default enabled. Comment to disable.//自適應多軸步平滑2 m( o6 \( x2 U; Y6 ?8 w6 N
- t o: N. ?* ]4 q
// Sets the maximum step rate allowed to be written as a Grbl setting. This option enables an error
5 `% }$ h R& Q! A# w) f// check in the settings module to prevent settings values that will exceed this limitation. The maximum S* l+ y" ?* I7 b+ w- \; j+ I+ P* ~
// step rate is strictly limited by the CPU speed and will change if something other than an AVR running' R6 _+ G: V2 ] `% X4 r3 L6 a( {5 ~% K: Z
// at 16MHz is used.
' _# v5 v- J2 C1 d' h% i8 `// NOTE: For now disabled, will enable if flash space permits.
/ p' U/ D0 W+ q$ W, ]! P//設置最大一步速率可以寫成Grbl設置。這個選項可以使一個錯誤
) L3 f+ v3 Y- ]6 v/ I) l//設置模塊中檢查,防止設置值將超過這個限制。的最大& Q2 e3 T1 s5 ?1 l( u4 l
//步驟嚴格限制的CPU速度也會改變如果是其他AVR運行. Q9 o$ g: r$ q) A- t( h+ S
//使用16兆赫。
6 k+ a( P, W- b q//注意:現在殘疾,將使如果flash空間許可。, ^: d4 A( l) n) {" A
B n! |( L+ I' T5 D
// #define MAX_STEP_RATE_HZ 30000 // Hz 設置最大一步速率2 u1 N4 }( Q' z
3 G3 a4 [% X) y; i# n/ b// By default, Grbl sets all input pins to normal-high operation with their internal pull-up resistors1 F/ |, ~3 w/ c. ~
// enabled. This simplifies the wiring for users by requiring only a switch connected to ground,
7 D0 |0 R0 X3 w2 \( R// although its recommended that users take the extra step of wiring in low-pass filter to reduce( K0 a% ~# J! _1 Y; H
// electrical noise detected by the pin. If the user inverts the pin in Grbl settings, this just flips1 V+ U. ^# \9 S8 r1 {; q
// which high or low reading indicates an active signal. In normal operation, this means the user 3 a2 u% b* @$ I: R
// needs to connect a normal-open switch, but if inverted, this means the user should connect a ; g* m6 O' L d' `8 B* J
// normal-closed switch. . y: P$ w$ G+ x4 Y* c9 s1 C$ H
// The following options disable the internal pull-up resistors, sets the pins to a normal-low
1 D3 C( M/ C3 \# A+ ?// operation, and switches must be now connect to Vcc instead of ground. This also flips the meaning / n+ v' A& _) Y9 Q) I+ Y) E7 C) U
// of the invert pin Grbl setting, where an inverted setting now means the user should connect a 2 G* K7 z9 f: t/ C, k1 F
// normal-open switch and vice versa.
& C+ {8 B/ D/ i$ I) I// NOTE: All pins associated with the feature are disabled, i.e. XYZ limit pins, not individual axes.' {! w6 Z& l0 n
// WARNING: When the pull-ups are disabled, this requires additional wiring with pull-down resistors!
* G$ o# [1 K( M( I3 [, e- e) V//默認情況下,Grbl所有輸入引腳設置為正常高操作的內部上拉電阻
' h' M6 o: d8 w! R$ ]4 R//啟用。這簡化了布線為用戶只需要一個開關連接到地面,) V$ Q. D; ?: S6 O8 b t- G
//雖然其建議用戶采取額外的步驟,在低通濾波器來減少布線
o( s9 Q: p C0 v" X6 {7 S//電噪音檢測銷。如果用戶反轉的銷Grbl設置,這只是翻轉 [; P- x" e" f+ m; J
//讀高或低表明一個積極的信號。在正常操作中,這意味著用戶
6 M1 }. g0 q$ X% r//需要連接一個常開開關,但如果倒,這意味著用戶應該連接) O7 o. w: @ K1 k- h f: T% A4 }, Q
// normal-closed開關。5 r* w9 U/ \2 W0 h9 m
//以下選項禁用內部上拉電阻,一般低設置別針8 m1 L) W/ O4 c) j P- D" M& ~! c
//操作,現在開關必須連接到Vcc代替地面。這也掀的意思
/ I6 j0 @9 T( p4 e" ^8 g1 |# F//反銷Grbl設置,一個倒置的設置現在意味著用戶應該連接4 [( H. R+ F. G4 p0 ^# ` e k
//常開開關,反之亦然。
& M( c5 Y/ _/ b" p l) x( {//注意:所有針與功能被禁用,例如XYZ限制針,而不是單獨的軸。" q3 n) B& a' n: k- P, g
//警告:引體向上被禁用時,這需要額外的布線與下拉電阻!+ ~5 U3 _% {7 |# a; y
( c& |; j* s1 Q//#define DISABLE_LIMIT_PIN_PULL_UP //以下選項禁用內部上拉電阻
% [' r- l. m6 X: J: Y. o/ m//#define DISABLE_PROBE_PIN_PULL_UP5 e. ^6 g( r$ r
//#define DISABLE_CONTROL_PIN_PULL_UP
, k2 m, ^" k0 n7 Q6 C
' P% ^. l8 V j$ \// Sets which axis the tool length offset is applied. Assumes the spindle is always parallel with
. b) o4 a# ]" m5 N9 G1 q( ]8 r// the selected axis with the tool oriented toward the negative direction. In other words, a positive7 l9 \5 d6 ~6 O0 s) x0 j9 Q
// tool length offset value is subtracted from the current location.7 ^% k7 C0 U+ o7 N
//設置哪個軸長度補償應用的工具。假設軸總是與. @) J) n, k% d9 q3 m
//選擇軸工具面向負方向。換句話說,一個積極的
2 D2 { {3 T- [# ~( W. S- i( G z//工具長度偏移值減去從當前位置。1 `6 ~3 t$ l5 J+ p
+ R! ~% W4 v' m& y7 `
#define TOOL_LENGTH_OFFSET_AXIS Z_AXIS // Default z-axis. Valid values are X_AXIS, Y_AXIS, or Z_AXIS.設置哪個軸長度補償應用的工具
; w" V4 P. E7 N0 k1 U7 S# h4 O. v6 p3 u. p
// Enables variable spindle output voltage for different RPM values. On the Arduino Uno, the spindle
# k/ g5 d, q& _5 n// enable pin will output 5V for maximum RPM with 256 intermediate levels and 0V when disabled.
+ q% `2 Y; R( x( x0 y3 r// NOTE: IMPORTANT for Arduino Unos! When enabled, the Z-limit pin D11 and spindle enable pin D12 switch!* c7 d9 p. e( a/ R$ Q5 I2 ]/ t
// The hardware PWM output on pin D11 is required for variable spindle output voltages.
+ r% H* r0 ]$ x* q$ p//允許變量軸輸出電壓不同的轉速值。Arduino Uno,主軸+ B/ o0 x) g8 Q) }; ^( r `8 k! I8 X
//啟用銷將輸出5 v的最高轉速256中級水平和0 v時禁用。
0 u; {7 k# |5 Y//注意:重要Arduino凱澤本人!當啟用時,Z-limit銷這里和軸銷D12開關!
1 s1 v8 t1 S0 }2 z; I6 F//硬件PWM輸出銷這里需要變量軸輸出電壓。: Y; @5 L0 ^% q# w( n9 I, |
7 k+ _8 U/ E9 I& e2 F0 e
#define VARIABLE_SPINDLE // Default enabled. Comment to disable.//允許主軸輸出電壓不同的轉速值
e" [4 \ q$ M T( |6 ?6 W( v) ^9 R( g! R# K
// Used by the variable spindle output only. These parameters set the maximum and minimum spindle speed
" C: R. `, F: ~6 B// "S" g-code values to correspond to the maximum and minimum pin voltages. There are 256 discrete and
4 Z: ~/ y5 \; @7 k7 f3 Q1 T) e4 _- k// equally divided voltage bins between the maximum and minimum spindle speeds. So for a 5V pin, 1000+ L2 O4 o; U1 i" a; o
// max rpm, and 250 min rpm, the spindle output voltage would be set for the following "S" commands: * a6 g; X) J/ s
// "S1000" @ 5V, "S250" @ 0.02V, and "S625" @ 2.5V (mid-range). The pin outputs 0V when disabled.
1 G/ l4 U0 E4 b# _* _' z0 ~//使用的變量軸輸出。這些參數設置最大和最小軸轉速
4 x- e1 d8 {% m% K//“S”刀位點值對應于銷電壓的最大值和最小值。有256個離散和4 n" K5 U4 w+ W; v* K! D m
//電壓平均分配箱主軸速度的最大值和最小值之間。所以對于一個5 v銷,1000. d: C A% O* e+ Z9 c
// max rpm,250分鐘rpm,主軸輸出電壓將為以下“S”命令:
7 | P& H6 @+ b t# V9 U% I// @“S1000 5 v,“S250”@ 0.02 v,“S625”@ 2.5 v(中檔)。銷輸出0 v時禁用。
! A' x$ F5 _4 e" o4 x+ y! v/ ?% f9 y6 J- l+ v! K6 `" B( K- T6 v
#define SPINDLE_MAX_RPM 1000.0 // Max spindle RPM. This value is equal to 100% duty cycle on the PWM.
6 N5 U$ G4 s) p- z- m/ r) i% l8 w#define SPINDLE_MIN_RPM 0.0 // Min spindle RPM. This value is equal to (1/256) duty cycle on the PWM." U" E0 {' m8 J J2 D
6 C3 j8 j2 [' Q- T+ {% X3 ^9 n// Used by variable spindle output only. This forces the PWM output to a minimum duty cycle when enabled.. `1 {! M; e: S: ?; d( H6 D
// When disabled, the PWM pin will still read 0V. Most users will not need this option, but it may be & H/ ~6 R& G4 j: y4 s4 F6 l
// useful in certain scenarios. This setting does not update the minimum spindle RPM calculations. Any
% ~1 R0 C* Y/ M. m// spindle RPM output lower than this value will be set to this value.% b6 |* q, Y4 u% H/ Y" @
//使用的變量軸輸出。這迫使PWM輸出最小占空比時啟用。
- A+ I& i% `' x/ l) R' b; I3 U//當禁用,PWM銷仍讀0 v。大多數用戶不需要這個選項,但是它可能是
# B8 j8 r2 f) v//在某些情況下很有用。這個設置不會更新最小主軸轉速計算。任何
3 P. X6 {. \7 a+ h1 O7 \0 u- ]//輸出軸轉速低于這個值將被設置為這個值。
" s: e. c9 `8 W# r9 p) q
* _- h5 G: w5 c; Q, z9 O// #define MINIMUM_SPINDLE_PWM 5 // Default disabled. Uncomment to enable. Integer (0-255)6 x+ F% T3 E& T) [7 ?
) C( s9 L+ ]" k2 ^+ g. u. {1 {// By default on a 328p(Uno), Grbl combines the variable spindle PWM and the enable into one pin to help 1 U0 ^8 x7 S7 M
// preserve I/O pins. For certain setups, these may need to be separate pins. This configure option uses$ T2 `/ m& P* Q$ C9 r
// the spindle direction pin(D13) as a separate spindle enable pin along with spindle speed PWM on pin D11.
7 p7 v8 w- o4 c1 U1 b2 i0 J2 l// NOTE: This configure option only works with VARIABLE_SPINDLE enabled and a 328p processor (Uno). ; N: r( N; J1 e, ^+ E: L! U% }
// NOTE: With no direction pin, the spindle clockwise M4 g-code command will be removed. M3 and M5 still work.
7 I7 d& J6 g9 f- A( ^( g// NOTE: BEWARE! The Arduino bootloader toggles the D13 pin when it powers up. If you flash Grbl with \3 I' J( S O' g# Q
// a programmer (you can use a spare Arduino as "Arduino as ISP". Search the web on how to wire this.),
& K% ~9 K& K; k5 }// this D13 LED toggling should go away. We haven't tested this though. Please report how it goes!
0 ^3 V$ N0 S2 }- b, {/ E3 `6 \//默認ATmega328 p(Uno),Grbl結合變量軸PWM和使到一個銷的幫助4 e( x5 h- S% ~& e! s6 s
//保存I / O管腳。對于某些設置,這些可能需要單獨的別針。這個配置選項使用8 q" K! E: O8 P6 `
//方向軸銷(D13)作為一個單獨的軸銷上啟用銷以及主軸轉速PWM這里。
% E5 w2 | i" x# Y//注意:該配置選項僅適用于VARIABLE_SPINDLE啟用和328 p處理器(Uno)。; o* h1 y* q2 m' x: Z
//注意:沒有方向銷,主軸順時針M4刀位點命令將被刪除。M3和M5仍然工作。
4 S7 O5 j/ J& u9 k/ W//注意:小心!Arduino引導裝載程序切換D13銷的權力。如果flash Grbl0 A* G5 c0 i! e; s/ T a
//程序員(您可以使用一個備用Arduino“Arduino ISP”。搜索網絡如何線),
/ d2 Y7 L6 m2 y: n//這D13導致切換應該消失。我們還沒有測試這個。請報告將會怎樣!7 W0 L' e8 @0 f. B9 b
# G# U2 b9 `* e& q; C// #define USE_SPINDLE_DIR_AS_ENABLE_PIN // Default disabled. Uncomment to enable.. Z$ r& {! O! q' L, _7 X4 u
, Y x {- R: i+ G1 w// With this enabled, Grbl sends back an echo of the line it has received, which has been pre-parsed (spaces
' h2 p' P) K4 F. P! x! h" F2 X// removed, capitalized letters, no comments) and is to be immediately executed by Grbl. Echoes will not be ' d: X1 [# X" ]% P' k
// sent upon a line buffer overflow, but should for all normal lines sent to Grbl. For example, if a user 5 k2 u- f! x5 i
// sendss the line 'g1 x1.032 y2.45 (test comment)', Grbl will echo back in the form '[echo: G1X1.032Y2.45]'.% _$ I V% p( K/ r
// NOTE: Only use this for debugging purposes!! When echoing, this takes up valuable resources and can effect1 U/ Y6 x( N9 L
// performance. If absolutely needed for normal operation, the serial write buffer should be greatly increased
- d1 t9 ?" k2 T3 G, G3 Z+ G// to help minimize transmission waiting within the serial write protocol.
, ^% |1 s: a# R/ E; x* G# d
4 A5 p) }5 ^* B# c; a& c; Z//啟用,Grbl發回的回聲線已收到,已預編譯(空間
7 {; `' @ ~) i: N5 g//移除,大寫字母,沒有評論),由Grbl立即執行。回聲將不會/ L0 L& g/ g, Z3 m3 |5 P
//發送一個線緩沖區溢位,但應該對所有正常線路送到Grbl。例如,如果一個用戶
4 l. U! _/ S9 g) d! j/ J//發送線的g1 x1.032 y2.45(測試評論)形式”,Grbl將回聲”(回聲:G1X1.032Y2.45]”。# i: R$ d$ W% z- Q% j( A
//注意:只使用這個調試! !當呼應,這占用了寶貴的資源,可以影響* Q1 M3 f7 d- T- ^- @0 S' E
//性能。如果正常運行所需的絕對,串行寫入緩沖器應該大大增加. O! i9 S! b6 F1 z: Q% t
//幫助最小化傳輸等系列內寫協議。& } Y2 O; F4 S/ L3 A
l( l( J0 F V0 V& u/ @// #define REPORT_ECHO_LINE_RECEIVED // Default disabled. Uncomment to enable.
* n* E0 D: h, k: p6 a: P1 }3 K% g4 n* C, R
// Minimum planner junction speed. Sets the default minimum junction speed the planner plans to at( A" C. [0 m" B) h' z8 H @
// every buffer block junction, except for starting from rest and end of the buffer, which are always. Q$ G! e* e6 F( h" e) Y
// zero. This value controls how fast the machine moves through junctions with no regard for acceleration
* E1 O' q" u$ ~6 L; d, t* D0 V$ X9 a// limits or angle between neighboring block line move directions. This is useful for machines that can't
$ d! f3 V U8 c& k// tolerate the tool dwelling for a split second, i.e. 3d printers or laser cutters. If used, this value
3 R$ I8 g! M" ^// should not be much greater than zero or to the minimum value necessary for the machine to work.' Y. o2 M5 v; {+ H0 T
4 p6 S" Y b9 Q
//最小規劃師結速度。設置默認最小連接速度規劃計劃$ Q' Z) @: h N4 h7 v
//每一個緩沖塊接頭,除了從結束休息和緩沖區,它總是4 p5 ~8 Q, M g: S, [1 s6 [
// 0。這個值控制機器的速度穿過路口,沒有考慮加速度* o7 R4 x+ j& n H
//限制或相鄰塊之間的角線方向移動。這是有用的機器,不能 {& {: @2 V% H8 a
//容忍工具居住某一剎那,即3 d打印機或激光切割機。如果使用這個值, H0 P$ J! q* `- v/ D
//不應大于零或機器工作所需的最小值。
; W1 J) W( Y8 v5 k( p' ^
( k. N! A' h0 t) T#define MINIMUM_JUNCTION_SPEED 0.0 // (mm/min)
) E3 ?' {8 p3 Y, V. W
" {- l# _2 ^' v0 c: u" m' n* K1 @// Sets the minimum feed rate the planner will allow. Any value below it will be set to this minimum
0 y" _ m% R8 B# P% j/ A) P// value. This also ensures that a planned motion always completes and accounts for any floating-point, S) N" _. \" b3 p9 j( C& X
// round-off errors. Although not recommended, a lower value than 1.0 mm/min will likely work in smaller
7 }1 K5 P7 g w+ q! J// machines, perhaps to 0.1mm/min, but your success may vary based on multiple factors.
4 }4 j; y1 n0 @0 f' u K//設置計劃將允許的最小進給速率。任何價值低于它將被設置為最低值。這也保證了運動計劃總是完成,占任何浮點7 y1 E' v+ `* ]/ }$ v& d
//舍入錯誤。雖然不推薦,價值低于1.0毫米/分鐘可能會在較小的工作% T$ v" j" M1 d# T p/ ?
//機器,也許到0.1毫米/分鐘,但你的成功基于多種因素可能會有所不同。! k) e3 @% E+ A& a9 r
% Z6 r, w4 j) ^7 V8 B
#define MINIMUM_FEED_RATE 1.0 // (mm/min)//設置計劃將允許的最小進給速率" u6 x/ R) P& K, m
& I1 s) i1 T. _- X; ~
// Number of arc generation iterations by small angle approximation before exact arc trajectory ; D* q% i% c5 R: Y, |5 v# _
// correction with expensive sin() and cos() calcualtions. This parameter maybe decreased if there : a& `/ P1 H" ], a' o: P
// are issues with the accuracy of the arc generations, or increased if arc execution is getting0 M- `9 q$ a; D" i$ b/ b7 M6 M* T
// bogged down by too many trig calculations. ( Z8 f, N6 ?! `& c E* s6 B
//弧生成迭代次數之前小角度近似精確的弧線軌跡8 G7 F/ {; N+ z4 [ W
//修正與昂貴的sin()和cos()calcualtions。如果有這個參數可能減少$ ~5 c) b0 X5 e* ?2 a, I) |* d6 y9 [
//與弧一代又一代的準確性問題,或如果電弧執行得到增加
9 F1 g8 u3 X+ t M( m! R//太多的三角計算的泥潭。9 o4 [' W0 `" ?9 E' F
, w% H. Z; T1 I, L" r x. g6 S#define N_ARC_CORRECTION 12 // Integer (1-255)
2 l! @ i5 V* }( x# [+ s7 p" B1 C' q
// The arc G2/3 g-code standard is problematic by definition. Radius-based arcs have horrible numerical 8 ?. N# g# v0 [7 y' b7 i
// errors when arc at semi-circles(pi) or full-circles(2*pi). Offset-based arcs are much more accurate
3 t: T& p& \8 z* I' w* v. b9 I" W* m// but still have a problem when arcs are full-circles (2*pi). This define accounts for the floating # }8 E! A& X: X" h7 o3 Y1 v
// point issues when offset-based arcs are commanded as full circles, but get interpreted as extremely! m; v2 z$ d0 X. g$ ^
// small arcs with around machine epsilon (1.2e-7rad) due to numerical round-off and precision issues.
3 \+ Q* ~0 i/ ~# u7 t// This define value sets the machine epsilon cutoff to determine if the arc is a full-circle or not.) p/ y9 M4 c9 g) {, }$ u z* [4 [6 j
// NOTE: Be very careful when adjusting this value. It should always be greater than 1.2e-7 but not too" {6 J% D7 w9 s" e+ k7 t
// much greater than this. The default setting should capture most, if not all, full arc error situations.
" A1 Y/ k# X8 F. U" k+ t; g//弧G2/3刀位點的標準定義是有問題的。Radius-based弧有可怕的數值
3 S5 z3 X7 S- K; d! A- i% ?6 X& ~//錯誤當電弧在半圓(π)或原點(2 *π)。Offset-based弧更準確
5 q/ ]. N0 ?& {% b L& W$ j( ]9 \//但仍有一個問題當弧原點(2 *π)。這個定義占浮動0 c, w+ H2 ~+ d* A3 J G1 f
//當offset-based弧吩咐點問題完整的圓,但解釋為極9 S3 X& N% P+ @. c8 @2 c8 A
//小弧機周圍ε(1.2 e-7rad)由于數字舍入和精度問題。
2 P ` B- a1 b7 z# ~//定義值設置機器ε截止來確定電弧是一個原點了。2 `: ]. F$ z& H. Q: t$ o. b' X
//注意:調整這個值時非常小心。它應該總是大于1.2 e -但不要太
Y; Z4 ^8 f* X9 c2 o' P//比這大得多。默認設置應該捕獲大部分,如果不是全部,全部錯誤的情況。
5 c7 P% b0 ]" ^- ^' T! _ P+ X5 \3 b* ^6 `
#define ARC_ANGULAR_TRAVEL_EPSILON 5E-7 // Float (radians)
) g5 f% d ~" f3 i! b+ A8 l0 b) e7 h: c5 R9 @5 `
// Time delay increments performed during a dwell. The default value is set at 50ms, which provides+ L N$ l7 T- |& c7 C" K* C, a
// a maximum time delay of roughly 55 minutes, more than enough for most any application. Increasing
% d5 b5 K7 z# r/ c// this delay will increase the maximum dwell time linearly, but also reduces the responsiveness of
t8 E( H8 n) {/ P8 a// run-time command executions, like status reports, since these are performed between each dwell
! N n, N, E; x% c// time step. Also, keep in mind that the Arduino delay timer is not very accurate for long delays.
! J+ o/ {# H5 D" f- X! M//延時增加表現在住。默認值設置為50毫秒,它提供了
: v8 N' v/ I+ q2 }//最大延時約55分鐘,足夠對大多數任何應用程序。增加
9 J; d6 P# Q! y//這種延遲將增加線性最大停留時間,也減少了響應能力
4 F4 H* c. E0 j2 ^ x9 C$ x6 V4 e/ i//運行命令執行狀態報告一樣,因為這些每個住之間執行& X' Y; n) M* G
//時間步。還有,記住,Arduino延遲計時器不是很準確的長時間延誤。
/ z; e, E' i0 q8 K$ e! r
0 Y4 T2 d3 D- [ ?#define DWELL_TIME_STEP 50 // Integer (1-255) (milliseconds): g0 Z1 ~4 P9 b# g( E
" r8 E! ?& Z( K: b// Creates a delay between the direction pin setting and corresponding step pulse by creating, P% n+ h. `- T" u( |+ [7 o
// another interrupt (Timer2 compare) to manage it. The main Grbl interrupt (Timer1 compare)
6 P/ Q# \; D" N9 U1 c6 k. \// sets the direction pins, and does not immediately set the stepper pins, as it would in 4 s+ p N2 z3 G6 o# z9 _: p8 f* E: ]( ]
// normal operation. The Timer2 compare fires next to set the stepper pins after the step
; G& O0 |6 s3 P3 Y// pulse delay time, and Timer2 overflow will complete the step pulse, except now delayed
2 S) L( L% t2 N3 ]+ J3 h9 K// by the step pulse time plus the step pulse delay. (Thanks langwadt for the idea!)! I! a6 M7 ~( ] O% [
// NOTE: Uncomment to enable. The recommended delay must be > 3us, and, when added with the
" M8 D2 H( z6 x% E1 F// user-supplied step pulse time, the total time must not exceed 127us. Reported successful
' n3 m8 K2 u. G2 X3 n// values for certain setups have ranged from 5 to 20us.
! f0 q9 T- @" {4 q//創建一個方向銷之間的延遲脈沖通過創建設置和相應的步驟
- M4 x0 W" H3 F7 [( M+ L5 X' T//另一個中斷(Timer2比較)來管理它。主要Grbl中斷(Timer1比較)
6 J3 ^# t! z, Y/ x//設置方向針,不立即設置步進針,因為它會在
0 q4 Q- ]' p& Q% ^1 m0 ^3 E( T' Z( L* z//正常操作。Timer2比較火旁邊設置步進針后一步
8 |( O' e7 B6 G f9 e//脈沖延遲時間,Timer2溢出脈沖將完成的步驟,現在延遲除外2 T2 R3 u; k/ n; c
//脈沖時間加上的一步一步脈沖延遲。(感謝langwadt主意!)
& N) E, w& I3 y. N) P- b+ G8 y1 b, G//注意:取消啟用。必須> 3,建議延遲,當添加的+ a5 e3 u# p" z, j) I8 P8 T
//用戶提供的步驟脈沖時間,總時間不得超過127美元。成功的報道
( u6 H9 G! j! s4 J5 X6 \//值對某些設置范圍從5到20。
4 @2 l! v, V9 Z0 i: P( u/ D% s5 r6 V. W# y' C8 T0 d( Z
// #define STEP_PULSE_DELAY 10 // Step pulse delay in microseconds. Default disabled.
% P5 b! C9 m$ N' O( y! M2 O
) G9 Z+ k! h: n- S1 g, l" P// The number of linear motions in the planner buffer to be planned at any give time. The vast
! p v5 ]3 b# \1 U6 B// majority of RAM that Grbl uses is based on this buffer size. Only increase if there is extra 0 h# `# S+ n) p' X
// available RAM, like when re-compiling for a Mega or Sanguino. Or decrease if the Arduino
& l4 s0 @. b5 f7 B" }// begins to crash due to the lack of available RAM or if the CPU is having trouble keeping
% I% v! G& V8 f; j// up with planning new incoming motions as they are executed. $ `% r* p, \0 d$ o: G: ]
//線性運動規劃師緩沖區的數量在任何給出時間計劃。絕大
, K$ H; M: ?- Y1 Y+ ^//多數RAM Grbl使用基于這個緩沖區的大小。如果有額外的只會增加
5 I4 @3 D/ c/ a//可用內存,比如當基于大型或Sanguino。如果Arduino或減少
, v9 X: b: V! |$ w! [//開始崩潰由于缺乏可用的RAM或者CPU是難以保持: ~6 b" l7 q! }; j* h/ W
//與規劃新傳入的動作執行。
& Y$ Z3 j( z* C$ e$ K3 h( c, R0 l2 A' k3 ?. Y5 W
// #define BLOCK_BUFFER_SIZE 18 // Uncomment to override default in planner.h.
n% w; p* A% @( ]% N% L* ~2 n, c7 K$ Q
// Governs the size of the intermediary step segment buffer between the step execution algorithm/ q( P' Z6 v. d4 e+ [( x1 J
// and the planner blocks. Each segment is set of steps executed at a constant velocity over a
7 u+ g3 S7 m0 g( n1 L z# W7 x// fixed time defined by ACCELERATION_TICKS_PER_SECOND. They are computed such that the planner
; X: r _7 B1 W" L$ J" K// block velocity profile is traced exactly. The size of this buffer governs how much step
* v& \, s; M! \! Q$ i0 ^// execution lead time there is for other Grbl processes have to compute and do their thing 3 S+ X e) b+ t! d! q0 ]% L
// before having to come back and refill this buffer, currently at ~50msec of step moves.
. |5 `# }8 X, r//控制之間的中間段緩沖大小的步驟執行算法
. d$ T3 r7 C: [9 } \7 g; o* d//和規劃師塊。每一部分的步驟執行在一個恒定的速度
: t3 C, t7 n" v- d# G/ n//固定的時間由ACCELERATION_TICKS_PER_SECOND定義的。他們計算的計劃9 }+ s; ^: E9 ?% }# B! j
//塊速度剖面追蹤到底。這個緩沖區的大小控制多少步驟& x1 }+ ~, S0 p* k1 S8 I" c
//執行時間有其他Grbl過程需要計算和做他們的事情
6 a1 \" u' A" e7 k//之前必須回來重新填充這個緩沖區,目前移動~ 50毫秒的一步。4 \) F4 h$ B- R5 M: {, p
, ]3 [6 Y; _6 X! U" c// #define SEGMENT_BUFFER_SIZE 6 // Uncomment to override default in stepper.h.0 x5 H4 U, {, m3 O7 A
7 J5 K4 k, {/ ~6 k
// Line buffer size from the serial input stream to be executed. Also, governs the size of " C' Q- o6 N0 C% k5 R% @5 n
// each of the startup blocks, as they are each stored as a string of this size. Make sure8 ? }; Z7 P; p2 F* H
// to account for the available EEPROM at the defined memory address in settings.h and for
9 k9 ]" ?9 m$ X' R// the number of desired startup blocks.
6 _7 Q1 K; \# p$ y" k, }// NOTE: 80 characters is not a problem except for extreme cases, but the line buffer size 6 e* m- C6 z- `# T
// can be too small and g-code blocks can get truncated. Officially, the g-code standards
. P! G5 W& g+ \1 z K// support up to 256 characters. In future versions, this default will be increased, when
' [! Q5 `( y0 j2 E ^// we know how much extra memory space we can re-invest into this.9 Z W6 _, | Y; O }' x
//行執行串行輸入流的緩沖區大小。同時,大小的控制
# H6 p# V* M- r" m" |* j//每個啟動模塊,它們分別存儲為字符串的大小。確保3 u# ~; y' S8 D* r& ]
//占可用eepm定義內存地址的設置。h和
1 [; c& p9 c) D, d8 y' d//需要啟動塊的數量。
& _1 ~7 d! x5 @2 U5 g//注意:80個字符不是一個問題,除了極端的情況下,但線緩沖區大小% U( ?1 C9 Q+ V# i
//可以太小和刀位點塊可以截斷。正式,刀位點標準
9 X: B2 F' F& M6 A" W. A% V//支持多達256個字符。在未來的版本中,這個違約將會增加,當- c, D2 O% y; j' D7 X6 c# K
//我們知道多少額外內存空間的時候我們可以再投資。
\/ ^7 R" z' ?5 U" c6 M0 g1 L7 \$ m( G) S# x- Z) N
// #define LINE_BUFFER_SIZE 80 // Uncomment to override default in protocol.h
& s$ G& t& F6 G; n! K3 @
2 V0 t- U: s( h' @' G- W1 j// Serial send and receive buffer size. The receive buffer is often used as another streaming! y9 Z, z$ s& A+ S, [& u. s
// buffer to store incoming blocks to be processed by Grbl when its ready. Most streaming( c: [( e+ f+ ]
// interfaces will character count and track each block send to each block response. So,
! @. ^3 Z! q0 t9 u5 X+ j( J( A; s! Q// increase the receive buffer if a deeper receive buffer is needed for streaming and avaiable
$ V, V, X$ O" V1 L// memory allows. The send buffer primarily handles messages in Grbl. Only increase if large; p" q$ s D8 I7 t' J* X& M
// messages are sent and Grbl begins to stall, waiting to send the rest of the message.
- z+ e; @' i6 m t1 r8 p1 |// NOTE: Buffer size values must be greater than zero and less than 256.
0 I- J) v" D3 e+ k/ S// #define RX_BUFFER_SIZE 128 // Uncomment to override defaults in serial.h
" v% K1 ]' l% J+ u//串行發送和接收緩沖區大小。接收緩沖區通常用作另一個流4 X; {: d$ p0 b$ p9 c( z0 x4 J
//緩沖存儲傳入的塊來處理Grbl當它準備好了。最流
3 `& I6 a5 _+ @+ a) T* o# r! \* J//接口將字符計數和跟蹤每一塊發送給每個塊的回應。所以,* v y j ]5 v+ E
//增加接收緩沖區如果需要更深層次的接收緩沖區為流,、
r4 y2 J- N1 p2 Z+ J. ?8 ~//內存允許。Grbl發送緩沖主要處理消息。只會增加如果大1 i: _. W" b; _9 k3 |0 Z
//消息發送和Grbl開始停滯,等待發送其余的消息。
# C6 x4 s B/ ]' ?. X' t5 f//注意:緩沖區大小值必須大于零,小于256。9 c% b5 f7 K& E$ P1 Z1 z
// # define RX_BUFFER_SIZE 128 / /取消serial.h覆蓋默認值/ B, _4 W& e. Y* R; J
& P9 K( A; m4 r+ T( r
1 Y1 j( i6 C) T8 Q( l) M// #define TX_BUFFER_SIZE 64
0 u" c8 u' i: P" N' d$ M% T
2 ?/ u! X- D/ q1 ]8 k& W9 d8 y. q9 x// Toggles XON/XOFF software flow control for serial communications. Not officially supported# ^6 {/ e+ l; h0 ]3 b _6 Y
// due to problems involving the Atmega8U2 USB-to-serial chips on current Arduinos. The firmware
5 j3 p' d, P1 ^0 A// on these chips do not support XON/XOFF flow control characters and the intermediate buffer
& O7 A% J* A" e" Q// in the chips cause latency and overflow problems with standard terminal programs. However,
M+ F7 y" F3 Z6 i( V// using specifically-programmed UI's to manage this latency problem has been confirmed to work./ ]9 a9 Q. h3 N2 B0 N
// As well as, older FTDI FT232RL-based Arduinos(Duemilanove) are known to work with standard7 A* |' _. W1 |: i( _3 f
// terminal programs since their firmware correctly manage these XON/XOFF characters. In any
& a6 `9 h9 L8 {' U( @, ` [! d// case, please report any successes to grbl administrators!
7 f8 i# F- N" L2 l- Z" f//切換為串行通信發送樸通/發送葡開軟件流控制。不是官方支持
# ]* g) c' K1 i% {3 e7 t8 O+ x//由于問題涉及Atmega8U2 USB-to-serial當前arduino芯片。固件4 L: S0 e$ u( W! s
//在這些芯片不支持發送樸通/發送葡開流控制字符和中間緩沖區
5 v: {: K0 ]' K5 Z% W//芯片導致延遲和溢出問題的標準終端程序。然而,3 U- X5 m: E5 Z: {6 n5 J) a- F" f
//使用specifically-programmed UI的管理這個延遲問題已經確認工作。
' c0 J* ]" [* x3 ]9 N, u//以及老FTDI FT232RL-based arduino(Duemilanove)是已知的標準
" b- {# x& Z9 ?- F9 ]//終端程序因為他們正確的固件管理這些發送樸通/發送葡開的角色。在任何$ K- z1 a N6 T# N! {( d; [
//情況,請報告任何成功grbl管理員!# |9 u4 e6 Y/ t# |4 p6 v, n
% `' u) a, A. V% E- R }
// #define ENABLE_XONXOFF // Default disabled. Uncomment to enable.
4 S/ M3 Q/ t) N8 n+ J0 S7 x: y6 E S2 m6 f
// A simple software debouncing feature for hard limit switches. When enabled, the interrupt
& y% i" P5 K6 V) g* y" y# V// monitoring the hard limit switch pins will enable the Arduino's watchdog timer to re-check 7 x& T4 z' ?/ W B3 A& F1 P
// the limit pin state after a delay of about 32msec. This can help with CNC machines with 9 b7 e( Q+ S+ y: J% ^9 q5 |
// problematic false triggering of their hard limit switches, but it WILL NOT fix issues with v, F1 l% l, l- D. X3 |0 L- H' l
// electrical interference on the signal cables from external sources. It's recommended to first4 E1 n3 P' E$ K4 R* V
// use shielded signal cables with their shielding connected to ground (old USB/computer cables / j( `$ r6 u/ D6 R! y4 R+ {& i
// work well and are cheap to find) and wire in a low-pass circuit into each limit pin.9 q6 K5 y" T5 C. z" l
//一個簡單的軟件消除抖動特性硬限位開關。當啟用時,中斷5 C1 F: i- c0 F& }2 j0 N
//監控硬限位開關針將使Arduino的看門狗定時器重新審視: Y; q' n1 a- Z/ J0 M9 k; u
//銷的極限狀態后約32毫秒的延遲。這可以幫助與數控機器
& H( z- j; a/ ^7 C//問題錯誤引發的硬限位開關,但是它不會解決問題$ b5 A$ w/ U, j7 q7 A) @3 D3 ]# n( j
//電干擾信號電纜從外部來源。首先它的建議1 y: I; {& n; l: W2 b
//使用屏蔽信號電纜的屏蔽連接到地面(老USB /計算機電纜
8 D# ]/ k }4 U7 E+ O" T" P//工作得很好,很便宜)和線低通電路到每個限位銷。: p+ c' O. S- l
/ q: a4 R$ x8 D// #define ENABLE_SOFTWARE_DEBOUNCE // Default disabled. Uncomment to enable. r& {/ {1 J1 q
+ h7 s7 J3 Z3 }// Force Grbl to check the state of the hard limit switches when the processor detects a pin, B6 p/ p) k/ S9 a: v
// change inside the hard limit ISR routine. By default, Grbl will trigger the hard limits6 m+ j" @4 s2 T' J) W1 I# w
// alarm upon any pin change, since bouncing switches can cause a state check like this to
' y! J" w( R* c8 u/ D// misread the pin. When hard limits are triggered, they should be 100% reliable, which is the
% l( q* @ F) r& I// reason that this option is disabled by default. Only if your system/electronics can guarantee6 U3 B( J" T' U5 p
// that the switches don't bounce, we recommend enabling this option. This will help prevent. u0 {3 e( H" ?9 s
// triggering a hard limit when the machine disengages from the switch. j* I n! O* ]# {2 a+ H5 b
// NOTE: This option has no effect if SOFTWARE_DEBOUNCE is enabled.) N1 i. \0 g2 Y5 b
//力Grbl檢查硬限位開關的狀態,當處理器檢測到一個銷
' r: a6 a- E( R% t3 `//改變內部硬限制ISR例行公事。默認情況下,Grbl將觸發硬限制
$ o/ D( m" b; k5 ~) f//報警在任何銷更改,因為跳開關可以導致這樣的狀態檢查
0 a6 ~) u) E* l2 t$ N//誤讀了銷。硬限制觸發時,他們應該100%可靠,這是7 M$ ?( v1 P! {. ]
//原因,這個選項默認是禁用的。只有在你的系統/電子產品可以保證
7 U9 M8 @: w, F, |( O( s0 q+ D//開關不反彈,我們建議啟用這個選項。這將有助于防止
0 m1 x O t: W//觸發機退出時硬限制開關。
3 K2 g9 `* Q: }9 ^) P. g1 H8 Z H//注意:這個選項如果啟用了SOFTWARE_DEBOUNCE沒有影響。! S% ]3 s4 p3 r9 C+ h
) \3 h% m$ \8 X& ^9 e( }0 g// #define HARD_LIMIT_FORCE_STATE_CHECK // Default disabled. Uncomment to enable.
- G7 Q" y* x! K: Y+ t+ v
3 e7 ], L) H2 y+ H# B
9 L: I0 e) x& {/ ]; D* Q/ A! p; Z9 Z// ---------------------------------------------------------------------------------------
* f1 Z) y# s' f: K6 H2 O, Z0 }// COMPILE-TIME ERROR CHECKING OF DEFINE VALUES:編譯時錯誤檢查的定義值:
& }# p+ a: G7 P+ U4 [5 z7 h# p- ~8 z7 k
#ifndef HOMING_CYCLE_0( b% ~# ?: ]) t( ?9 ~5 X+ E: o
#error "Required HOMING_CYCLE_0 not defined."
! v% }1 R6 ^/ m" [% J/ G#endif" D7 G- B# F5 G5 g, x
" Q3 q) [$ N0 A# f% [, t2 ]#if defined(USE_SPINDLE_DIR_AS_ENABLE_PIN) && !defined(VARIABLE_SPINDLE)
0 g# O. d7 l( t$ e) a5 W #error "USE_SPINDLE_DIR_AS_ENABLE_PIN may only be used with VARIABLE_SPINDLE enabled", }9 S8 ^, l& r/ V5 |. z6 e: k
#endif
7 a) \8 G5 O, O! M7 q6 f' z$ U7 V. C( p: ~& v( S; I2 V7 r
#if defined(USE_SPINDLE_DIR_AS_ENABLE_PIN) && !defined(CPU_MAP_ATMEGA328P)
. g3 A" P$ `2 [ m& T: u, O #error "USE_SPINDLE_DIR_AS_ENABLE_PIN may only be used with a 328p processor"& n/ j* \ [/ f9 Y2 a# L$ G( h0 s4 S: `! k
#endif
G* G! g$ y7 p- a; e+ z
- h/ H2 C* ^ w3 \// ---------------------------------------------------------------------------------------
) r2 v7 Z+ u+ T" `0 D% ?9 O2 R% W8 d) d, b/ ?! |2 J; y# F
1 z# Q/ ?0 P/ {/ \#endif# {6 c3 c1 v4 N
* \0 V5 C5 H# F/ Z
- I& h5 @. o" [9 B4 i, e! t
; e4 g9 z4 P: }2 N# |
7 {* d k! r9 r6 S9 b: F0 I u8 X8 }9 G- g
; _) f! f+ E+ b5 k! H1 J3 w* }9 t
, l' \) e% U" d+ Z; g. K% i9 q" B0 j5 a% N k
/ O% H5 v* X3 J4 I& M8 Y
2 y7 C: q0 `+ e+ e3 L5 J6 d
( a: A& @$ e9 u D! s, K4 e. _
3 @1 J; F. j1 z( H9 @. Q( x \/ C/ J" k
, g) \/ x% e- p) f
# z# x3 N, `2 I, O" M1 E3 \& n2 |/ Z+ \" u& k) g) t" e$ F0 S
|
本帖子中包含更多資源
您需要 登錄 才可以下載或查看,沒有帳號?注冊會員
x
評分
-
查看全部評分
|