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