|
本帖最后由 1五湖四海1 于 2016-8-21 00:09 编辑
& ~# f0 @4 O, m5 n3 I( }* v& t6 A( n" L4 F2 }
以前制作过CNC雕刻机,是用MACH3作为上位机控制,硬件是采用PC接并口输出脉冲和方向使能信号经过隔离驱动步进电机驱动器,步进电机驱动是采用TB6560芯片控制。最后就接到步进电机。机械是用铝合金制作,主要部件有三个1605的滚珠丝杠,多个运动滑块等制作。用这台DIY CNC雕刻机可以雕刻木头塑料等东西。当时没有一直玩下去,现在发现网上有用单片机制作的雕刻机挺精巧的现在分享给大家。
( O6 C) e& o& Q9 `+ }, l, p+ j 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个运动来规划运行速度,以实现平稳的加速和无冲击的转弯。很棒吧!开始玩起。 . G z! A; O% [1 W# Z/ A i
还没有雕刻机的机械部分可以用废旧光驱制作个微型雕刻机运动平台。雕刻机最重要的是主控程序这次用 Arduino/AVR328单片机,价格在15元左右,主控程序是上面提到的目前很火的开源的GRBL,还有一种基于STM32平台的开源主控程序Dlion也不错可以替代grbl。如果从性能比较这两个方案,显然是stm32平台运行速度更快毕竟他是32单片机呀!
) `7 H" X* J/ Y5 X, e7 M
% Z" f4 _' Q/ p' l9 u
& u# d5 \) @# H 下面介绍小这个些主控程序主要干的事,通过串口PC和主控板通讯,PC命令给控制板,控制板接收命令做不同的响应,PC可以发G代码给主控板,接收完成后可以自动开始雕刻任务。* d4 O9 Y3 }- G( Y8 p/ ?6 q# i0 {
在介绍下G代码因为G代码是雕刻机的核心部分
; Z' t0 J% e7 Z8 ~G代码是数控程序中的指令。一般都称为G指令。
2 s& T0 P. i3 UG00------快速定位5 ]2 [1 u* z) p1 s
G01------直线插补
# m5 P% F, C+ |: o* H% yG02------顺时针方向圆弧插补" d* J2 P. _" F0 A- }+ ^
G03------逆时针方向圆弧插补' J/ r P8 L8 h8 ?; }9 a
G04------定时暂停0 M& m: {" O- V2 x! K0 M
G05------通过中间点圆弧插补
% l) g0 X5 y$ q" |% ?% O7 UG06------抛物线插补
, _- b# h9 K A% a: l) S2 [/ I+ [G07------Z 样条曲线插补
8 d* s4 ~& @& j5 a ?/ I1 DG08------进给加速
, C+ L" Y" ]0 k9 D7 L' rG09------进给减速3 n; I. s7 n, C! |/ J# Q; ] ]
G10------数据设置
0 M$ ^# k, r0 |/ c/ Y6 [G16------极坐标编程
4 F3 v9 O. m$ k$ h+ k1 |" A$ [/ J9 vG17------加工XY平面
6 F) x* E+ {5 x% I! O0 b+ oG18------加工XZ平面* A) y0 M7 V7 E$ @1 C- R
G19------加工YZ平面5 R) _& W7 {" X9 i
核心就是解析G代码,完成步进电机驱动,和控制主轴开启关闭,还有插补算法,直线插补,圆弧插补,还有一些步进电机的加减速算法。9 I _, ^$ Z2 m0 ]+ w& h1 k# v
下面对grbl主结构做介绍4 p% W! y6 k5 x! E) K" F* F; Z% P
main()主函数首先执行下面初始化函数: }& u/ h, _+ b, \' U9 W, L' v
serial_init(); // 设置串口波特率和中断
2 A1 w) I1 a0 Z: r0 E8 Q settings_init(); // 从ROM加载grbl设置3 w1 t3 a: Q4 L( m( L
stepper_init(); // 配置步进方向和中断定时器
9 d5 A, ?8 I: W9 V system_init(); // 配置引脚分配别针和pin-change中断
+ P& n; D3 Y6 d( w. w4 r memset(&sys, 0, sizeof(system_t)); // 清除所有系统变量
" O0 H0 A7 x& z* A) E) \ sys.abort = true; // 中止标识位置位# S3 {4 `- }% V/ u _: y
sei(); // 使能中断
- ?4 f# H' Q5 h# g$ Q #ifdef HOMING_INIT_LOCK // 宏运算(settings.flags & (1 << 4)) != 0结果flags等于执行sys.state = STATE_ALARM
/ t8 U" }- J' `9 v& @ // 系统状态赋值为报警状态
. @: Z+ R" X; r, J if (bit_istrue(settings.flags,BITFLAG_HOMING_ENABLE)) { sys.state = STATE_ALARM; }
. T: l/ C$ |4 Y: o; E0 ^( W #endif
. w2 G" ]# q$ I, K_____________________________________________________________________________________________________________________________________
0 z3 s/ g5 f! |( Z, ?接下来是一些主要部分初始化+ c& z2 f! j! X2 I0 a- T8 q `
for(;;) {
9 P& l( j: P! E5 a! m) n serial_reset_read_buffer(); //清除串口读缓冲区: `" o$ p; t( p
gc_init(); //初始化G代码功能函数$ F! w) x8 n6 z
spindle_init(); //主轴初始化: r1 t- Z$ p; z, O+ M5 [
coolant_init(); //冷却液初始化
( q- D: K( A/ _( u9 M limits_init(); //极限开关初始化$ O- K0 k1 ~: d8 {
probe_init(); //探测部件初始化
$ k: r d9 ~9 H# y# ]. H; Z' ^ plan_reset(); //清除块缓冲区和规划师变量
/ [1 j9 V2 t) V4 E st_reset(); //清除步进系统变量。
, `6 a' h: \: \4 w. E
5 L) H- J/ I' y$ I" V$ K$ }. Z, j, [9 S# Y" Y( R/ f+ E, n% y
//下面两行清除同步gcode和策划师职位当前系统位置。) k6 m& z W" O0 h1 c0 Q
plan_sync_position();% Y% d C G! ~% w6 `
gc_sync_position();
9 b* v) k; m& s$ n- c* g& b# M3 \2 `/ k. I& Z' v" F3 q
$ P' M: ^% o) q0 w& ^6 O
//复位系统变量
4 c- S j3 v7 D sys.abort = false; //系统中止标志
* D! F1 e# ~. J4 K: G sys_rt_exec_state = 0; //系统标志位变量状态管理。看到EXEC位掩码。
9 N" u! h( l8 m8 P3 z2 D sys_rt_exec_alarm = 0; //系统标志位变量设置不同的警报。4 [# Q: V7 T0 g) ]$ n7 U) n
sys.suspend = false; //系统暂停标志位变量管理,取消,和安全保护。
3 P$ ?$ B. L$ t O: R2 }' N7 m sys.soft_limit = false; //限位开关限制状态机错误。(布尔)
! z. _$ p2 w) F8 T$ v. i6 L
2 f5 ^/ {" ]/ y3 p# v% W
! ?- }. l8 S" a' M( h protocol_main_loop(); //主协议循环
1 y9 r! P6 \7 Y% O7 r0 n J) \7 ~} //+ A7 z( n0 D Y5 j; ~( b, M7 p+ Y
_____________________________________________________________________________________________________________________________2 V) }1 S0 ^9 C7 S
进入void protocol_main_loop()函数2 a* _+ B& b1 l4 r
{
; K# {& w* K/ @9 i( y: e3 n1 C report_init_message(); // 打印欢迎信息
2 ?( H. ^0 S# P g+ i //重启后检验和报告报警状态如果错误重启初始化。4 b& f' y/ b& P# k: `
if (sys.state == STATE_ALARM) {: p) {* f9 _* E0 w2 N; A% D5 E
report_feedback_message(MESSAGE_ALARM_LOCK); //打印信息+ X. u% e& r) b5 s7 ^/ \: n
} else {: u% f* ]# g7 }2 ~% Q
// 如果没有报警说明一切正常!但还是要检查安全门.
% X' d1 F) A+ b8 ? if (system_check_safety_door_ajar()) {
3 Z6 Y, o; A' e( ~$ }* `0 | bit_true(sys_rt_exec_state, EXEC_SAFETY_DOOR);- M! C, s4 J9 J9 B
protocol_execute_realtime(); // 进入安全模式。应该返回空闲状态。
- @9 ]: F, z: y4 y3 g/ `* V3 U- n } else {8 i5 m9 }, z, S, A+ L+ G4 g
sys.state = STATE_IDLE; // .设置系统做好准备。清除所有国家国旗。
5 _% Q" f) n9 \- ? }
2 V0 K' m7 R/ h9 C0 w+ A$ k; D& q2 v/ S system_execute_startup(line); //开始执行系统脚本. N5 K% C/ p b; x
} 7 Z+ b3 ], K! j0 q, q+ e
0 w' p& e* t- \$ F" Q
G& u5 A7 `' O' n/ S1 o- ~
// 这是主循环!在系统中止时这是出口回到主函数来重置系统。
* L q. `+ D6 I9 ? // ---------------------------------------------------------------------------------
/ H; n: A% V! b( q9 c7 l/ E, D - ~& x, S; T3 l( W1 g: @4 [" m1 D
uint8_t comment = COMMENT_NONE;* t2 z& L. C+ h9 ^# B& O
uint8_t char_counter = 0;
5 w( E% j& ~& J4 q uint8_t c;
& @: v n9 z( j. j' D: d4 E_______________________________________________________________________________________________________________________________" O! X5 u( F9 L1 x# }$ G$ ~
接下来进入for(;;)循环 //下面代码是G代码解析核心部分,程序中comment(注释)变量会被赋不同值,代表发符号有‘(’‘)’‘;’
& Q% i+ ?/ T4 H! k1 \{
% o/ z) I* R, M2 S: w//串行数据输入一行的的过程,作为数据。执行一个
" q0 U/ ?$ a4 {) l* U+ P: y. g* O3 }//所有数据初始过滤去除空格和注释。 & d" r* J2 K' d* F
//注意:注释,空格和程序段删除(如果支持的话)处理技术) S: ?0 \7 }3 T& A9 M2 h/ E
//在G代码解析器,它有助于压缩到Grbl传入的数据
1 S$ B* s0 F$ m//线缓冲区,这是有限的。刀位点标准实际上州一行不行
3 U5 M. I( p7 o% @) I, s//不能超过256个字符,Arduino Uno没有更多内存空间。
: \% Y, C" E* }" B//有更好的处理器,它会很容易把这个初步解析的
! l: |( s! @; O6 D! w//分离任务共享的刀位点解析器和Grbl系统命令。
& A9 m$ P5 B: @4 M while((c = serial_read()) != SERIAL_NO_DATA) { //读取串口数据,有数据执行下面代码' h/ j. O ^9 l1 M
if ((c == '\n') || (c == '\r')) { // End of line reached //如果数据是/r,/n代表一行结束 Y4 S+ Z* K, h
line[char_counter] = 0; // Set string termination character. //设置结束标志7 z0 F/ v0 g1 s0 b2 x; ~3 c
protocol_execute_line(line); // Line is complete. Execute it! //一行完成执行此函数
) _' X0 {3 p- ^+ N comment = COMMENT_NONE; //注释清零
$ Z2 A% Z! _. I- ]7 e char_counter = 0; //字符计数清零
4 b |- v) n$ c5 e- k3 p k3 G
4 ?: l0 U$ A6 H- }- _) l* y, S else {
* Q9 C; @! W. x) T; c" e if (comment != COMMENT_NONE) {
0 D! f1 W {7 B //扔掉所有注释字符
b8 r2 j/ z8 W% E ^8 i if (c == ')') {
! G. @* j E/ ~7 D //最后注释。重新开始。但是如果有分号类型的注释。* M( E; \( y6 m! y% A8 u# ~/ ]* b
if (comment == COMMENT_TYPE_PARENTHESES) { comment = COMMENT_NONE; }
* Q: M+ N# c+ E( k }+ H4 H; A U. D! v. N
} else {% {7 b4 T9 R5 U0 H/ M+ ~
if (c <= ' ') { 2 x4 |& ^; i% q) k8 m, x6 i
//扔掉whitepace和控制字符
% M$ O1 A6 U0 P& `3 F } else if (c == '/') { $ K. C: O" n6 E! y# o) T
//块删除不支持将忽略字符。1 z0 K( e2 `+ D
//注意:如果支持,只需要检查系统是否启用了块删除。: R6 _6 ~4 y0 a4 U& r2 D
} else if (c == '(') {
1 b0 [' M( u0 o; j# w6 _ // Enable comments flag and ignore all characters until ')' or EOL.
' P5 r' A; Z, N; c // NOTE: This doesn't follow the NIST definition exactly, but is good enough for now., I/ s9 P0 A( K7 t$ h# E
// In the future, we could simply remove the items within the comments, but retain the
5 r- k! Y: B9 a2 N // comment control characters, so that the g-code parser can error-check it.
5 N6 |9 h" S. C$ t7 P: k. s, L comment = COMMENT_TYPE_PARENTHESES;+ E j9 l& e& s( y2 X" i) E: F
} else if (c == ';') {" {5 w, E- x% ]0 s& b- C
//注意:','注释EOL LinuxCNC定义。没有国家标准。
, p% d' n, V/ }6 w comment = COMMENT_TYPE_SEMICOLON;' E$ _1 g, t0 w, c
8 c4 W- A" Y2 h; l" j( ~5 f# A, z" [$ L4 u2 H& n# q, B, c; U
_____________________________________________________________________________________________________________________________________
. _2 y% h4 M& f" z" W } else if (char_counter >= (LINE_BUFFER_SIZE-1)) { //串口接收数据大于80字符时
, k+ H/ x- i; o& _, U% S T3 | // Detect line buffer overflow. Report error and reset line buffer. 检测缓冲区溢出。报告错误和复位线缓冲区。
0 H/ |0 c. n9 X9 y report_status_message(STATUS_OVERFLOW); //打印溢出信息
. z5 A! d5 _# V1 @) a# M+ Y' r comment = COMMENT_NONE;
' p0 @6 H! O) A7 `/ @$ x( Y char_counter = 0;0 U7 }8 T e- g/ o
} else if (c >= 'a' && c <= 'z') { // Upcase lowercase //小写改大写1 ?- g8 E5 A& N0 B& B1 h% C, l
line[char_counter++] = c-'a'+'A';
/ Y& p* E, ]2 A; q } else {2 G5 e$ _9 j6 [" c/ n9 E+ O2 w
line[char_counter++] = c;9 ?, `6 q4 I% X: p6 [$ v: Z1 u9 p
}
1 h" ?9 W8 @* _* Z f }
: b. K5 [7 m, C1 z }
% K, v7 j! `: ~, z/ P: R+ a2 z# X5 ^ }# T% S) W& P [8 y$ @4 x
____________________________________________________________________________________________________________________________________
/ d4 L2 j! G0 |" o2 h //如果没有其他字符在串行处理读取缓冲区和执行,这表明以完成,自动启动,如果启用,任何队列动作。! F2 `( V/ S( D2 i' i+ {" C7 ?
protocol_auto_cycle_start(); //自动开始协议循环5 o8 w7 M" p# R5 C j: s8 |+ c6 t/ k
/ e: K: s/ L0 @0 o: m+ E1 }" t4 }
protocol_execute_realtime(); //运行实时命令。
4 P& j* M Z3 H0 Q6 ` if (sys.abort) { return; } //中止标识置位程序循环重置系统。
0 `$ `' O) Z# E0 l } 8 }- |( t. a$ p' `
return; //一般程序不会执行到这里2 d2 t& u6 r, }1 g6 C
}
5 o7 \$ f( p# L6 v. t____________________________________________________________________________________________________________________________________
4 O5 K: H3 t4 i3 N3 o% ~正常情况下,读取完G代码程序会进入protocol_auto_cycle_start();//自动开始协议循环 函数下面介绍此函数: |+ E1 l' v- m
// Auto-cycle start has two purposes: 1. Resumes a plan_synchronize() call from a function that5 O2 r, a5 e) n, p' s
// requires the planner buffer to empty (spindle enable, dwell, etc.) 2. As a user setting that / G% f4 g3 J9 b
// automatically begins the cycle when a user enters a valid motion command manually. This is 2 B! g/ l+ g# S4 R& u
// intended as a beginners feature to help new users to understand g-code. It can be disabled
9 t' N3 g1 R7 o: \5 y// as a beginner tool, but (1.) still operates. If disabled, the operation of cycle start is
) h7 b+ m; N) \/ r' ]// manually issuing a cycle start command whenever the user is ready and there is a valid motion
4 }3 V! l- M+ d9 j: \9 s- }// command in the planner queue.
! j# C, j' g; X8 M// NOTE: This function is called from the main loop, buffer sync, and mc_line() only and executes
% E( _$ {9 `" |$ r// when one of these conditions exist respectively: There are no more blocks sent (i.e. streaming 4 N* \1 s+ ^- m% G
// is finished, single commands), a command that needs to wait for the motions in the buffer to
8 D+ f: c3 J& M. W9 @+ J) H// execute calls a buffer sync, or the planner buffer is full and ready to go.6 [. ^( o1 k% J7 A2 G4 j
//自动开始有两个目的:1。回复一个plan_synchronize()调用的函数 S0 r2 J) R! P" w ~8 V
//需要规划师缓冲区空(主轴启用、住等)2。作为一个用户设置
% q' m; c) l ~ K- @5 ~//自动循环开始当一个用户输入一个有效的运动命令手动。这是
/ ]0 E; M7 W: u' m//作为一个初学者的特性来帮助新用户了解刀位点。它可以被禁用! B* } h0 U8 |& G% m) ~
//作为一个初学者工具,但(1)仍然运作。如果禁用,运行周期开始4 }) }' w6 p: N
//手动发出一个周期开始命令每当用户准备好,有一个有效的运动3 V2 Q6 E6 H: } D0 L
//命令的规划师队列。; P$ t+ h! Q& M0 O/ e( Q
//注意:这个函数被称为从主循环缓冲区同步,mc_line只()并执行
- g5 B$ K& o: r( w3 M6 n//当其中一个条件分别存在:没有更多的块(即流发送
9 ^. D2 E) s$ W" o6 o//完成后,单一的命令),一个命令,需要等待缓冲的动作
+ S9 v }6 u1 r+ v9 E+ C5 j//执行调用一个缓冲区同步,或规划师缓冲区满了,准备好了。
& C- j1 K% K4 O2 H! z1 Ovoid protocol_auto_cycle_start() { bit_true_atomic(sys_rt_exec_state, EXEC_CYCLE_START); } 9 b% z* i G" m7 i( c! e4 p/ A: q' b4 p
_______________________________________________________________________________________________
' j# N" y, f- b8 i7 ~- I" |) k" @接下来程序运行protocol_execute_realtime(); /运行实时命令。
5 H3 L5 f1 O" E9 S# c// Executes run-time commands, when required. This is called from various check points in the main' G8 Q/ e. F% ^/ G7 D4 d9 n0 `
// program, primarily where there may be a while loop waiting for a buffer to clear space or any ~/ r% c8 p) e" M3 h$ p- N
// point where the execution time from the last check point may be more than a fraction of a second.! X) d& M7 m- @
// This is a way to execute realtime commands asynchronously (aka multitasking) with grbl's g-code
$ P$ }( P/ y/ F, r5 I# ]1 n& y// parsing and planning functions. This function also serves as an interface for the interrupts to
- y; ^# x5 Q# ]/ j5 t// set the system realtime flags, where only the main program handles them, removing the need to$ X5 |+ k$ B+ ]+ S( [2 |9 x
// define more computationally-expensive volatile variables. This also provides a controlled way to , \! h# F( r7 G. A+ E- w3 ~9 ~/ L
// execute certain tasks without having two or more instances of the same task, such as the planner. t8 e( [0 b/ ^: ]& O
// recalculating the buffer upon a feedhold or override.
8 Q/ U' B8 _3 X// NOTE: The sys_rt_exec_state variable flags are set by any process, step or serial interrupts, pinouts,
" L" D, z" y! e- M4 d// limit switches, or the main program.( P6 z/ T/ N% t3 r0 S, E* I
void protocol_execute_realtime()
& h o, k1 u4 e+ {3 P U$ c6 z8 T; A uint8_t rt_exec; // Temp variable to avoid calling volatile multiple times.临时变量来避免多次调用不稳定。, o' Y/ O9 J! Y$ n; s
就先分享到这吧!
; Q1 m! t& [4 j0 y" c6 J! G/ l. i, U5 q+ k! l# P s
3 p& I+ _ z! k- L
2 i9 z* l6 Z: |' z* B# r% s+ l" c5 K
& p' i& I- \: p/ s
) L( l% r( m, I9 }; m/ m- D
+ `2 ~8 u9 p" M5 l0 G( R- q6 F( ]0 {& _4 V' h% G7 I
$ q4 I( _2 t, u; a$ g
1 U3 F) ?1 n+ q7 p2 E* n' O+ d) v
1 u+ F. `" o& E/ s
$ X# R/ J* L, b" c8 e0 Y- {& V0 ]/ \ x" x1 r$ }
, p# g: I% @6 ~, \$ t1 F* I& x6 a! W
( T6 h; A- E* V0 x' x0 H( X
$ G) R, E7 {) B- b3 S; a. X
# Q+ s; F$ R* u- I- s
e6 M+ T s* Y: w+ I! l5 q3 U
* O4 S6 o8 L$ L8 u( H' D+ K7 ?7 f. V, h& k/ n5 B* I& `
" Z$ _' n- a" A# B/ }* t% |; r. {: r% J z% e
补充内容 (2016-8-25 22:40):
/ z" f! g J$ s$ n) o配置说明
8 L# G$ i, U5 j3 B//这个文件包含编译时配置Grbl的内部系统。在大多数情况下,) d4 v) S0 C2 U! U# k6 U3 P3 O+ w
//用户不需要直接修改这些,但是他们在这里为特定的需求,即。
4 Y4 L# m" L# s/ B; G//性能调优或适应非典型的机器。
* n. @( |, ]% E$ R主要配置项:2 O. E( m5 @( C* y" ~1 j
1.#define DEFAULTS_GENERIC //在重置eepm时使用。在defaults.h改变想要的名字
1 d5 S r. N2 a7 R3 v. y2.#define BAUD_RATE 115200 //配置串口波特率115200
9 y! H5 Z, X& [: y; {3.#define CPU_MAP_ATMEGA328P // Arduino Uno CPU3 x# z- b4 v% q. A% b3 _
4.#define CMD_STATUS_REPORT '?' //定义实时命令特殊字符9 V! J; E+ N B" s
5.#define HOMING_INIT_LOCK //回原点保护锁) v( Q. i8 C% @5 G/ I8 M! \" J
6.#define HOMING_CYCLE_0 (1<<Z_AXIS) // 第一步Z清除工作区。 G, k( ]( ?/ F8 M) }3 H; |
#define HOMING_CYCLE_1 ((1<<X_AXIS)|(1<<Y_AXIS)) // 然后X,Y在同一时间。
) Y+ V: y1 _" ^) h+ t4 K7.#define N_HOMING_LOCATE_CYCLE 1 //回原点循环次数
7 v' ^' K' n& a( F# k7 I& c2 B8.#define HOMING_FORCE_SET_ORIGIN //取消这定义迫使Grbl总是在这时候位置设置机器原点尽管开关方向。
! d" l6 J4 c6 X6 z- X& E1 b$ p+ b. F! c9.#define N_STARTUP_LINE 2 //块Grbl启动时执行的数量。* e% G% R8 Y6 Z. L7 g
10.#define N_DECIMAL_COORDVALUE_INCH 4 // Coordinate or position value in inches 协调或位置价值英寸
3 ?4 }' Q+ f; k$ s% A2 e. @ #define N_DECIMAL_COORDVALUE_MM 3 // Coordinate or position value in mm 协调在毫米或位置价值1 `5 {2 {7 n' W4 `% v# i( j
#define N_DECIMAL_RATEVALUE_INCH 1 // Rate or velocity value in in/min 率或/分钟的速度值+ L7 z! {- J- B/ ^, K" q4 w
#define N_DECIMAL_RATEVALUE_MM 0 // Rate or velocity value in mm/min 速率或速度值在毫米/分钟5 d5 U- {" c6 R& \6 _6 |' b
#define N_DECIMAL_SETTINGVALUE 3 // Decimals for floating point setting values 对浮点小数设置值( ?8 O1 a8 ]$ N
11.#define LIMITS_TWO_SWITCHES_ON_AXES //如果你的机器有两个极限开关连接在平行于一个轴,您需要启用这个特性
. s4 y6 B0 D! [" r; t6 w, ?, S12.#define USE_LINE_NUMBERS //允许GRBL跟踪和报告gcode行号
$ x" Q' c+ z, x4 X0 l) Z ?13.#define REPORT_REALTIME_RATE //允许GRBL报告实时进给速率
1 U% W8 {" M. Y6 y14.#define MESSAGE_PROBE_COORDINATES //坐标通过Grbl $ #的打印参数?+ o, v% c3 R: a3 e; E' m
15.#define SAFETY_DOOR_SPINDLE_DELAY 4000 //安全门主轴延时; ^/ X) T' l% Z, C
16.#define SAFETY_DOOR_COOLANT_DELAY 1000 //安全门冷却液延时
3 @( k- O& \* S17.#define HOMING_CYCLE_0 (1<<X_AXIS) and #define HOMING_CYCLE_1 (1<<Y_AXIS) //启用CoreXY运动学。0 e) B9 o% ?) I% t! T
18.#define COREXY // Default disabled. Uncomment to enable.改变X和Y轴的运动原理
5 D8 S3 @; G; {. y0 j19.#define INVERT_CONTROL_PIN // Default disabled. Uncomment to enable.反转针销逻辑的控制命令
2 E# K' `- Y* _' r20.#define INVERT_SPINDLE_ENABLE_PIN // 反转主轴使销从low-disabled7 |$ z6 f6 I! E; @& P$ b
21.#define REPORT_CONTROL_PIN_STATE //启用控制销状态反馈状态报告。8 L! e* _; T# Y9 P& Q G
22.#define FORCE_INITIALIZATION_ALARM //启用和用户安装限位开关,Grbl将启动报警状态指示% ~" S, d( b: k/ c3 @
23.#define REPORT_GUI_MODE // gui允许最小的报告反馈模式
! U$ a- `6 f1 t$ o24.#define ACCELERATION_TICKS_PER_SECOND 100 //加速度的时间分辨率管理子系统。% ]( C( Y9 x8 H/ R6 J9 s$ I' Q7 E
25.#define ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING //自适应多轴步平滑(积累)是一种先进的功能 : x9 S; i2 t5 e5 d
26.#define MAX_STEP_RATE_HZ 30000 //设置最大一步速率可以写成Grbl设置; X/ B2 c8 G% V5 ~$ m
27.#define DISABLE_LIMIT_PIN_PULL_UP //以下选项禁用内部上拉电阻5 r: g( ^ Y8 K# p1 {- W4 u
28.#define TOOL_LENGTH_OFFSET_AXIS Z_AXIS //设置哪个轴长度补偿应用的工具。假设轴总是与选择轴工具面向负方向# s9 d x$ W" o! M
29.#define VARIABLE_SPINDLE //允许变量轴输出电压不同的转速值。
7 U6 }% I" w( L30.#define SPINDLE_MAX_RPM 1000.0 // Max spindle RPM. This value is equal to 100% duty cycle on the PWM.% `% `, x) Y9 `1 r
#define SPINDLE_MIN_RPM 0.0 // Min spindle RPM. This value is equal to (1/256) duty cycle on the PWM.3 Q2 A+ S. T% T9 L# C# u% R
31.#define MINIMUM_SPINDLE_PWM 5 //使用的变量轴输出。这迫使PWM输出最小占空比时启用。& m: J6 ]6 g4 J( k/ ^8 o
32.#define USE_SPINDLE_DIR_AS_ENABLE_PIN //主轴方向使能M4被删除 e C! U9 P* _6 o& E3 a
33.#define REPORT_ECHO_LINE_RECEIVED //应该对所有正常线路送到Grbl& X9 `. W9 w/ n( j
34.#define MINIMUM_JUNCTION_SPEED 0.0 // (mm/min) //最小规划师结速度。设置默认最小连接速度规划计划. e( e/ f5 ]- C% o! y
35.#define MINIMUM_FEED_RATE 1.0 // (mm/min)//设置计划将允许的最小进给速率# v7 t. Y" M) `" c. Q" h
36.#define N_ARC_CORRECTION 12 //弧生成迭代次数之前小角度近似精确的弧线轨迹3 c S& t* F9 H0 V
37.#define ARC_ANGULAR_TRAVEL_EPSILON 5E-7 // Float (radians)//定义值设置机器ε截止来确定电弧是一个原点了?
" m; E: n$ L+ w y% I2 e38.#define DWELL_TIME_STEP 50 // Integer (1-255) (milliseconds) //延时增加表现在住。默认值设置为50毫秒
9 x$ J( n v) M) P( [2 J39.#define STEP_PULSE_DELAY 10 // Step pulse delay in microseconds. Default disabled. D1 c" v) }+ Q. f# Y. A
40.#define BLOCK_BUFFER_SIZE 18 //线性运动规划师缓冲区的数量在任何给出时间计划
+ L0 c! X8 F g: x3 m% Z41.#define SEGMENT_BUFFER_SIZE 6 //控制之间的中间段缓冲大小的步骤执行算法 q! c$ U$ y! C2 @8 j! W" s8 x
42.#define LINE_BUFFER_SIZE 80 //行执行串行输入流的缓冲区大小。
& c" q8 B! U0 X P: Q1 R43.define RX_BUFFER_SIZE 128 //串行发送和接收缓冲区大小
, x/ P# }3 o# x: I- k) v7 _% d44.#define TX_BUFFER_SIZE 64
# R4 x5 [! v- A4 c% R: \, D45.#define ENABLE_XONXOFF ////切换为串行通信发送流软件流控制。& D6 |' n( f* s
46.#define ENABLE_SOFTWARE_DEBOUNCE //一个简单的软件消除抖动特性硬限位开关。$ T! Z+ f! l! p' m
47.#define HARD_LIMIT_FORCE_STATE_CHECK //Grbl检查硬限位开关的状态
8 u) X4 z5 u% v; h* I4 k$ A48.// COMPILE-TIME ERROR CHECKING OF DEFINE VALUES:编译时错误检查的定义值:" \' B' T! G% H0 Z- @- e7 Q9 p
' P- |% T, @7 x. D$ O3 f& f
___________________________________________________________________________________________________
5 z2 j& G- @( y1 w/ |' m1 {+ z1 e/*. X/ r6 M' x0 y! l1 S. c2 v: m
config.h - compile time configuration- o: F! Q& A8 O9 g/ d- T/ V
Part of Grbl) @8 b/ i0 q8 }8 O# B( Z) o
1 l9 T* W5 @2 n2 c$ v$ { Copyright (c) 2012-2015 Sungeun K. Jeon' g9 ^5 T, X5 l+ T9 W
Copyright (c) 2009-2011 Simen Svale Skogsrud, A7 w5 I; q* D8 I, H: ]
3 \9 ^' v5 r& K# l' t) A
Grbl is free software: you can redistribute it and/or modify
+ b' ]( V3 @8 A( C it under the terms of the GNU General Public License as published by
0 l2 Z* F7 ?' x: e the Free Software Foundation, either version 3 of the License, or
" ?" f+ a. b9 n9 I3 e( y1 X (at your option) any later version.
3 F2 H! {! I7 y! r$ a" d% ?5 u
/ j. p6 Y( l) d5 O! `* ] Grbl is distributed in the hope that it will be useful,! b3 {0 j1 \( r$ [3 ^* I
but WITHOUT ANY WARRANTY; without even the implied warranty of9 d' O' b8 s4 @' ~3 B4 [' E7 {
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Q; F- O) O c; |7 ]2 L/ G GNU General Public License for more details.- e% _) S! U8 x- ~' S9 ^
: r# p9 e- G2 o You should have received a copy of the GNU General Public License
0 h; W8 x Y3 ^ k) `3 f along with Grbl. If not, see <http://www.gnu.org/licenses/>.
8 m7 u" s% y) O. _config.h -编译时配置,Grbl的一部分
2 D% p: l8 ~! E9 s g) i. J, {# h2 w) v
版权(c)2012 - 2015 Sungeun K. Jeon
3 Z: {8 x; b$ `: z5 `. a& i! {版权(c)2009 - 2011 Simen Svale Skogsrud3 B4 g+ T4 W# `- W$ K. X4 N2 [( \! X
) S3 x/ Y' V+ ~' p$ t6 I& rGrbl是免费软件:可以重新分配和/或修改
2 n {. c. y3 @* ~GNU通用公共许可证的条款下发布的自由软件基金会,版本3的许可,或(任您选)其后的版本。2 x; p) A6 v( p$ E% q& g
( n, M3 ]/ d' ] u2 A
Grbl分布,希望这将是有用的,但是没有任何保证;没有即使的默示保证适销性或健身为特定目的。看到0 L" B( k# N& ^! k
GNU通用公共许可证的更多细节。
. a. V4 v2 l" s5 K3 ^2 u* V( v* a9 C
你应该收到了GNU通用公共许可证的副本
% v- b* `& _1 o4 ^ x/ |/ [: z% K连同Grbl。如果没有,看< http://www.gnu.org/licenses/ >。
+ |3 M/ I M" n- B2 L 3 j5 B9 ?6 l; |& `( { B. |- E
*/* S- p1 H4 L- j
7 C! q0 s+ j5 c3 ~
// This file contains compile-time configurations for Grbl's internal system. For the most part,
7 y9 T8 ?! R, l# D) p1 q) h4 S# i// users will not need to directly modify these, but they are here for specific needs, i.e.) @5 j: g6 r: p3 O+ t
// performance tuning or adjusting to non-typical machines.
% _# F, N* @7 \. i ~# v* {//这个文件包含编译时配置Grbl的内部系统。在大多数情况下,. a9 e5 Y. s7 x$ R4 x; N
//用户不需要直接修改这些,但是他们在这里为特定的需求,即。
2 n, N$ c! P% T3 c3 S( ?//性能调优或适应非典型的机器。! G: n/ `! ^# v+ k1 I4 p( c7 k
% o8 L9 a8 @" r// IMPORTANT: Any changes here requires a full re-compiling of the source code to propagate them.
! S+ G. H( i+ j& s3 R//重要:任何变化需要一个完整的基于源代码的传播。
* [$ y) o0 B# b ^- R' A6 V: h6 R" R1 o" o x8 h; Y
#ifndef config_h0 U; z6 Z9 t7 F+ C$ Q; r
#define config_h
6 G9 l; k, f% s0 W/ ^) _: {1 q#include "grbl.h" // For Arduino IDE compatibility.& u5 D( R+ m* r& ]" M D
7 n2 u( o# m$ b) f+ J7 Y// Default settings. Used when resetting EEPROM. Change to desired name in defaults.h' Q# h' h9 k2 S- O
// 默认设置。在重置eepm时使用。在defaults.h改变想要的名字6 F; c( Z) v# ^* Q
$ ^1 u0 P |5 X& g- w! V6 g#define DEFAULTS_GENERIC" _1 g% [7 u5 h% \' t
8 V* l- r% \" `/ s// Serial baud rate, N) E5 D5 R% f9 N& t
#define BAUD_RATE 115200 //配置串口波特率1152005 ^# P. Z& P. D
( T5 A: R; m( g+ m& O+ _
// Default cpu mappings. Grbl officially supports the Arduino Uno only. Other processor types5 a1 _. N0 t; n' Y4 Y/ R1 H$ n
// may exist from user-supplied templates or directly user-defined in cpu_map.h
1 u6 {0 \' c1 n$ j0 o7 w//默认cpu映射。Grbl正式支持Arduino Uno。其他类型的处理器可能存在cpu_map.h直接从用户提供的模板或用户定义的
7 |8 ]0 q. D# g& t4 i! P6 F1 h, C( A- @/ J* l5 |! [; o1 K0 @6 S; k
#define CPU_MAP_ATMEGA328P // Arduino Uno CPU
/ y( j2 r; }5 n+ X# h1 ~: X2 J
6 Z# w4 h% Z9 h$ }// Define realtime command special characters. These characters are 'picked-off' directly from the
6 u! w4 T. |0 P! z// serial read data stream and are not passed to the grbl line execution parser. Select characters
. M; v( X( v& w5 d/ n( A! |// that do not and must not exist in the streamed g-code program. ASCII control characters may be 5 a2 Q- C: ]8 C9 C& {0 L9 a! N
// used, if they are available per user setup. Also, extended ASCII codes (>127), which are never in
: T2 q8 Z$ ?! I" \( E% e6 w! ]5 C// g-code programs, maybe selected for interface programs.% l0 T0 }, ]3 S+ K& Z: z3 T
// NOTE: If changed, manually update help message in report.c.: X' K# p# z! Y2 D
; O8 y* ?9 w2 ]- c+ n6 z
//定义实时命令特殊字符。这些字符是直接从“各个击破”串口读取数据流并没有传递到grbl行执行解析器。选择角色
7 S* u+ V3 w1 G& m9 R8 E! C//不,不能存在于程序流刀位点。ASCII控制字符
0 R4 u' [( v# f% g% X$ B1 V//使用,如果他们是可用的每个用户设置。同时,扩展的ASCII码(> 127),从来没有
: o8 ~3 Z, M+ P% c5 Q# i6 _//刀位点的程序,也许选择界面程序。2 u1 L* |# @. H+ a% P1 `5 p
//注意:如果改变,手动更新report.c帮助信息。- S: S Z: K& B5 I! Y: D
3 W+ y- k( G* S9 o
#define CMD_STATUS_REPORT '?') ]1 B; o, U; n/ T% l D$ s& Y
#define CMD_FEED_HOLD '!'
/ q2 c' C5 T) q3 D6 l9 q" ]#define CMD_CYCLE_START '~'8 b, z! b4 _! W: H
#define CMD_RESET 0x18 // ctrl-x.
2 Y e) l$ [9 B" z& V" F#define CMD_SAFETY_DOOR '@'' r. E' `3 G y$ `
5 _7 k$ s( c2 G: m) d
// If homing is enabled, homing init lock sets Grbl into an alarm state upon power up. This forces
( r+ X! `0 f3 x* J% w// the user to perform the homing cycle (or override the locks) before doing anything else. This is
2 } @0 ^2 ~2 m( r, u }. G( L// mainly a safety feature to remind the user to home, since position is unknown to Grbl.
6 G/ ?- Z2 ^6 u8 {: T
% \# I! N/ Y9 }, y& F! v//如果启用了回原点,导航初始化锁集Grbl进入警报状态启动。这就迫使5 q! y. P* r1 d; E/ S
//用户执行归航周期(或覆盖锁)在做任何其他事情之前。这是
; u4 d* _6 D8 V- D' V; [//主要安全功能,提醒用户家里,因为Grbl位置是未知的。8 c; v' A7 [9 e) l# Y# G! o" l7 r
5 g2 G% E$ B5 e, X
#define HOMING_INIT_LOCK // Comment to disable
6 q# j+ L" F3 `0 [# w: H( y* D7 c- H) y4 ?4 D
// Define the homing cycle patterns with bitmasks. The homing cycle first performs a search mode
_8 w+ w$ D: T& K) e' V2 n( t// to quickly engage the limit switches, followed by a slower locate mode, and finished by a short
5 H J* |0 ?9 T, c& |4 M) [// pull-off motion to disengage the limit switches. The following HOMING_CYCLE_x defines are executed
9 s# r: T' u7 h1 c# X. s4 m) F, R// in order starting with suffix 0 and completes the homing routine for the specified-axes only. If
. `1 [: L: l4 s7 K4 o// an axis is omitted from the defines, it will not home, nor will the system update its position.7 D1 R5 f1 ]: ?
// Meaning that this allows for users with non-standard cartesian machines, such as a lathe (x then z,. y4 |0 M# M: t# w6 d
// with no y), to configure the homing cycle behavior to their needs. ; c+ e) ], {' F4 f+ O# ]
// NOTE: The homing cycle is designed to allow sharing of limit pins, if the axes are not in the same
1 n( O4 D# Z& r$ @6 f9 o0 W% ^/ E) y. s// cycle, but this requires some pin settings changes in cpu_map.h file. For example, the default homing
! i9 V8 K: [4 j6 ^, D// cycle can share the Z limit pin with either X or Y limit pins, since they are on different cycles.
5 o" m# B k+ t# L7 M4 p) A// By sharing a pin, this frees up a precious IO pin for other purposes. In theory, all axes limit pins
7 ] {4 i* G3 L' a- ^2 c// may be reduced to one pin, if all axes are homed with seperate cycles, or vice versa, all three axes
7 L$ w* l' S9 @4 j// on separate pin, but homed in one cycle. Also, it should be noted that the function of hard limits . E" U0 M; ~: Q& n
// will not be affected by pin sharing.* v3 M5 @- n2 G
//定义导航循环模式的位掩码。归航周期首先执行一个搜索模式 |2 I; U% I5 e: \" W h
//快速进行限位开关,其次是较慢的定位模式,完成了由一个短4 Z3 R1 m& c3 B& I5 o4 e9 j
//拖出运动脱离限位开关。以下HOMING_CYCLE_x定义执行: X/ h# I& b8 p L; z$ ?" y
//为了与后缀0开始并完成specified-axes只寻的例程。如果( W8 n" E; n6 Q3 s# i
//定义省略一个轴,它会不在家,也不会系统更新它的位置。
, L/ Z& `; @% I& ?2 T2 J//意义,这允许用户与非标准笛卡尔的机器,比如车床(x,z,
6 J. X0 P$ Z2 H//没有y),配置导航循环行为对他们的需求。+ q t/ f# A& f7 x% R
//注意:归航周期允许共享限制针,如果轴不相同
8 H1 C& |3 e! N2 p//循环,但这需要一些销设置cpu_map的变化。h文件。例如,默认的导航! } Z+ w* g1 n& _! i
//循环可以分享Z限位销X或Y限制针,因为它们是在不同的周期。6 J$ d( r9 j+ F- T- |1 ~
//通过共享一个销,这腾出宝贵的IO销用于其他目的。从理论上讲,所有轴限制别针4 {# x/ b& i! K! l3 w+ H! X
//可能会减少到一个销,如果所有轴与分离周期居住的地方,反之亦然,所有三个轴
+ C/ ?7 ~, I0 n# F2 y6 f//在不同销,但这时候一个周期。同时,应该注意的是,硬限制的功能
+ H4 S. h6 ]7 o//将不会影响销共享。) X0 f2 n6 Z2 A5 \. _. i3 M
//注意:默认设置为一个传统的硬件数控机器。z轴首次明确,其次是X和Y。( l* o# W* u. G
8 h' {% [8 i0 ~: p// NOTE: Defaults are set for a traditional 3-axis CNC machine. Z-axis first to clear, followed by X & Y.
# b2 s* M/ k8 y) I1 c#define HOMING_CYCLE_0 (1<<Z_AXIS) // REQUIRED: First move Z to clear workspace. 第一步Z清除工作区。% q% y' q2 W/ f3 c5 }
#define HOMING_CYCLE_1 ((1<<X_AXIS)|(1<<Y_AXIS)) // OPTIONAL: Then move X,Y at the same time.然后X,Y在同一时间。0 M3 R. ^" k' s7 \: T' x9 V7 \4 z
// #define HOMING_CYCLE_2 // OPTIONAL: Uncomment and add axes mask to enable
( C. I- W2 \8 q9 m1 V
. c- p2 u( Z5 S; u// Number of homing cycles performed after when the machine initially jogs to limit switches.. A0 v; ?4 `5 _0 A/ l# H9 s8 H/ Z
// This help in preventing overshoot and should improve repeatability. This value should be one or ' `4 b, W& i W6 X: K
// greater.+ h: R+ H8 |% `/ c# d% r7 @3 B
//执行回原点循环次数后,当机器最初慢跑限位开关。这个帮助防止过度,应该提高重复性。这个值应该是一个或大。
5 a. N V5 i! B: ^
8 o$ K1 m) ^! d2 \0 i#define N_HOMING_LOCATE_CYCLE 1 // Integer (1-128)
3 P5 s* Y# j2 I3 [& Y& ^ F; w" f$ O" `& V% { i3 z
// After homing, Grbl will set by default the entire machine space into negative space, as is typical
4 h& Z7 B8 V( S9 g6 l) n// for professional CNC machines, regardless of where the limit switches are located. Uncomment this
& O3 W O, Q( m$ M/ |/ }// define to force Grbl to always set the machine origin at the homed location despite switch orientation., f6 k9 L9 W' _7 \
: B( [( ~7 I6 E//导航后,默认Grbl将整个机器空间留白,是典型的专业数控机器,不管限位开关所在的地方。7 t" u6 ]# `$ H* d
//取消这定义迫使Grbl总是在这时候位置设置机器原点尽管开关方向。
6 m1 b/ _) i( o: T) x- t$ C) U9 m' @7 k+ |; F
// #define HOMING_FORCE_SET_ORIGIN // Uncomment to enable.* w5 j! @& X; W! {0 C& U+ L
+ F8 D6 `4 _( P6 e! L4 Y
G( d0 R# M3 L) r1 \// Number of blocks Grbl executes upon startup. These blocks are stored in EEPROM, where the size# T9 W: Y7 W; u/ [# J' X2 L
// and addresses are defined in settings.h. With the current settings, up to 2 startup blocks may
) y* ]" x7 v. W. M3 i// be stored and executed in order. These startup blocks would typically be used to set the g-code
1 ?0 ]6 a+ U/ y0 c' N6 b* u# g// parser state depending on user preferences.
' F, |7 y0 |" i
% y" c: v# Y2 n/ J//块Grbl启动时执行的数量。这些块存储在eepm,大小5 `3 [3 i S8 s5 l+ O! S8 m; } Z( K. O
//和地址在settings.h中定义。与当前设置,可能2启动块
, }" }6 h' W: E//存储和执行。这些启动块通常被用来设置刀位点- ]* s* s* I% x0 G( v6 o
//解析器的状态取决于用户首选项。
, y6 E/ A# c7 r& A. @& s* ^$ w/ g& C7 _
#define N_STARTUP_LINE 2 // Integer (1-2)+ {& O+ {$ I& j5 F
6 r B% p% j# v& F% V0 i4 m// Number of floating decimal points printed by Grbl for certain value types. These settings are 7 b& d6 k J( h- S s4 Z
// determined by realistic and commonly observed values in CNC machines. For example, position
/ w) k: y. |1 p: U: h// values cannot be less than 0.001mm or 0.0001in, because machines can not be physically more9 |9 E$ `$ V; f; v: \
// precise this. So, there is likely no need to change these, but you can if you need to here.
% j Q @' P4 z. \" k// NOTE: Must be an integer value from 0 to ~4. More than 4 may exhibit round-off errors.
7 s: j* F& ~% D8 Y) C
2 ~3 h; ]1 J( C$ `4 ^5 ?( m// Grbl浮动小数点的数字印刷的特定的值类型。这些设置是# Y9 n: s0 B1 G# P5 o
//一般由现实和观测值在数控机器。例如,位置
* l H/ c0 @: ]; e; e4 O+ ~//值不能小于0.001毫米或0.0001,因为机器不能身体更多
" `% N w: v( b1 D- ], q//精确。因此,有可能不需要改变这些,但你可以在这里如果你需要。: _$ u$ z, _. [: J2 b, U
//注意:必须是一个整数值从0 ~ 4。超过4可能出现舍入错误。 N' X* x0 v" Y- d5 M
/ y6 z8 n, A; }( ~- A* ?, p
#define N_DECIMAL_COORDVALUE_INCH 4 // Coordinate or position value in inches 协调或位置价值英寸
" ~/ s. y1 O4 n; H+ O#define N_DECIMAL_COORDVALUE_MM 3 // Coordinate or position value in mm 协调在毫米或位置价值0 q: ], k( _9 I* P) r! ~* m
#define N_DECIMAL_RATEVALUE_INCH 1 // Rate or velocity value in in/min 率或/分钟的速度值$ D. O: y9 V4 L$ v2 E0 x
#define N_DECIMAL_RATEVALUE_MM 0 // Rate or velocity value in mm/min 速率或速度值在毫米/分钟8 C Z8 y( X3 T" \- G l: D
#define N_DECIMAL_SETTINGVALUE 3 // Decimals for floating point setting values 对浮点小数设置值$ N- Q6 q# \! D6 \6 @( N7 v
1 ?" \) k5 j" K$ A' Q; I// If your machine has two limits switches wired in parallel to one axis, you will need to enable
: M6 S* E! b% W; h, W// this feature. Since the two switches are sharing a single pin, there is no way for Grbl to tell7 y8 A9 G3 M7 X
// which one is enabled. This option only effects homing, where if a limit is engaged, Grbl will
: X8 |( O8 o$ }! ^// alarm out and force the user to manually disengage the limit switch. Otherwise, if you have one
9 q3 `1 |! b% q& k0 h7 J$ ~// limit switch for each axis, don't enable this option. By keeping it disabled, you can perform a
; r4 @5 {8 T( u$ G// homing cycle while on the limit switch and not have to move the machine off of it.
8 ^2 p2 _% U2 x' T) ~' T- e. Y, B+ b; @7 m$ ]6 R! @
//如果你的机器有两个极限开关连接在平行于一个轴,您需要启用
, z/ @( k* _. ]# C2 f1 j//这个特性。自从两个交换机共享一个销,没有办法Grbl告诉
' a5 ] N6 r/ J+ S9 _2 V+ @//启用哪一个。此选项仅影响归航,如果限制,Grbl意志
* ^! Y4 b; n2 x1 J//报警,迫使用户手动松开限位开关。否则,如果你有一个
; p! y1 F; ~6 I4 r3 D//为每个轴限位开关,不启用该选项。通过保持禁用,您可以执行: o# ]1 [+ H7 u0 c0 W
//导航循环在限位开关并没有将这台机器。5 [& k' O, p5 p' [2 P% S9 ~
% X# \; }2 @2 h5 {: Z* i% c' s
// #define LIMITS_TWO_SWITCHES_ON_AXES( U9 ~7 M+ ]( |' O$ E
7 s% {, F+ C. \3 W8 K* ~// Allows GRBL to track and report gcode line numbers. Enabling this means that the planning buffer5 A1 j3 Z7 c. j' W$ v4 E; s: d
// goes from 18 or 16 to make room for the additional line number data in the plan_block_t struct
6 \, A% j! ]% {7 b8 Q5 b" x( V* m( S5 Z i0 J
//允许GRBL跟踪和报告gcode行号。使这意味着计划缓冲从18岁或16岁,为额外的行号plan_block_t结构中的数据7 [$ J( U" X' l( M, @' B
4 d# p2 H$ i0 v+ ]2 {
// #define USE_LINE_NUMBERS // Disabled by default. Uncomment to enable.
5 e, E; x$ a( |, S8 R' }5 E" {* p4 H! S+ F
// Allows GRBL to report the real-time feed rate. Enabling this means that GRBL will be reporting more
; ^) S! g3 `2 J) s* h. S// data with each status update.
# a" W6 I) t% [* }& }! c// NOTE: This is experimental and doesn't quite work 100%. Maybe fixed or refactored later.2 t: G! w* V, c
//允许GRBL报告实时进给速率。使这意味着GRBL将报告数据和状态更新。
8 r% P( a# y$ S& L9 z* I//注意:这是实验和100%没有工作。也许以后固定或重构。* g: ~6 ~5 z. G) f6 C+ _
2 o8 J% m4 O9 C3 w; ~! d- R7 ~// #define REPORT_REALTIME_RATE // Disabled by default. Uncomment to enable.
5 D* `# _3 b- L& I+ M: Z
* F( c) W% W/ {5 j// Upon a successful probe cycle, this option provides immediately feedback of the probe coordinates9 W" L; i7 W! H8 F( J2 t, H
// through an automatically generated message. If disabled, users can still access the last probe; ?& b3 B$ z/ j# C8 |
// coordinates through Grbl '$#' print parameters. Z% R3 b z8 }8 C+ G
//在一个成功的调查周期,这个选项提供立即反馈的探测器坐标5 }8 a8 E: d, S
//通过一个自动生成的消息。如果禁用,用户仍然能够访问调查
1 n0 a- ], g o//坐标通过Grbl $ #的打印参数。
2 |) e9 Q% F* Q8 v9 F+ \
0 L& u' K4 W! M/ k: S% N4 Q/ R! F#define MESSAGE_PROBE_COORDINATES // Enabled by default. Comment to disable.
. C9 d# g5 y6 T j* j* L% m
$ h* |. h7 W/ m% y( z& \+ P' S// Enables a second coolant control pin via the mist coolant g-code command M7 on the Arduino Uno- }: D6 e9 n; {+ o% n" `$ O
// analog pin 5. Only use this option if you require a second coolant control pin.* K" T# N. B# i9 s4 d
// NOTE: The M8 flood coolant control pin on analog pin 4 will still be functional regardless.
' m" R5 e. ^; u. }( Z// #define ENABLE_M7 // Disabled by default. Uncomment to enable.
* Q4 k' n9 {! g4 i" A4 Y. r m* W7 |6 e
// This option causes the feed hold input to act as a safety door switch. A safety door, when triggered,! p7 T8 c4 u% T' G0 k: ]/ g' Q
// immediately forces a feed hold and then safely de-energizes the machine. Resuming is blocked until
) ^1 l/ l' _: n1 f1 L// the safety door is re-engaged. When it is, Grbl will re-energize the machine and then resume on the* I [+ U3 }4 U2 M$ L. [, p0 _
// previous tool path, as if nothing happened.
8 q6 ^1 E/ K; H+ h# {) Q// #define ENABLE_SAFETY_DOOR_INPUT_PIN // Default disabled. Uncomment to enable.
( o) W% o/ p+ i. k; o# }
9 g" v1 s' e! [& Z// After the safety door switch has been toggled and restored, this setting sets the power-up delay
$ ?: b$ A- M" m: S// between restoring the spindle and coolant and resuming the cycle.' \ P, g% k1 R9 [3 C/ S
// NOTE: Delay value is defined in milliseconds from zero to 65,535. 9 f! J$ o7 q2 x, F# y
6 B" }# E- X$ t. z" n! M
//定义导航循环模式的位掩码。归航周期首先执行一个搜索模式2 ], x# ?$ G* F* T
//快速进行限位开关,其次是较慢的定位模式,完成了由一个短
' s/ Q; o$ h5 p, c. L! U O5 D//拖出运动脱离限位开关。以下HOMING_CYCLE_x定义执行
8 o* Z6 q3 Y$ e7 n5 U& b, k//为了与后缀0开始并完成specified-axes只寻的例程。如果 ]# L- f) t5 p- F- c6 b# l/ a- {
//定义省略一个轴,它会不在家,也不会系统更新它的位置。
% L" K- M" h: r2 i//意义,这允许用户与非标准笛卡尔的机器,比如车床(x,z,
! a* [8 i: Z& g$ d- H2 L//没有y),配置导航循环行为对他们的需求。
: y" s' E0 T" Q8 E6 x) F//注意:归航周期允许共享限制针,如果轴不相同( G. F- o) X/ l. V
//循环,但这需要一些销设置cpu_map的变化。h文件。例如,默认的导航
# Q% d* q6 I- v5 ?. w! H//循环可以分享Z限位销X或Y限制针,因为它们是在不同的周期。3 @' L6 v+ s5 {" o3 ^0 g% g6 e
//通过共享一个销,这腾出宝贵的IO销用于其他目的。从理论上讲,所有轴限制别针
* N1 x4 U) @5 ]$ [" t9 ]% q//可能会减少到一个销,如果所有轴与分离周期居住的地方,反之亦然,所有三个轴# Z4 H# S5 b) X) W6 V/ @1 f% M0 y
//在不同销,但这时候一个周期。同时,应该注意的是,硬限制的功能
- _ ~0 [9 k1 u# N3 O$ n$ g//将不会影响销共享。( T% c0 q% g. C) u1 l
//注意:默认设置为一个传统的硬件数控机器。z轴首次明确,其次是X和Y。1 ]" K! M/ I( K C( _
?. n4 j' Z/ M/ |1 `
; @; K C/ Y( }9 V#define SAFETY_DOOR_SPINDLE_DELAY 4000
( D* ^6 b ]1 ~1 x1 S" r#define SAFETY_DOOR_COOLANT_DELAY 1000
6 Q$ M/ ?7 v! Z- S) t; c1 X( f7 f
- G( n6 L) T/ o. v n9 g& O( m- k3 @// Enable CoreXY kinematics. Use ONLY with CoreXY machines. " h8 G3 h ]+ h/ S6 P' z: S
// IMPORTANT: If homing is enabled, you must reconfigure the homing cycle #defines above to
$ r" t6 @3 |- ?% v7 I8 E, ^//启用CoreXY运动学。只使用与CoreXY机器。' u, s( t0 h- }; A9 J* a; H
//重要:如果启用了自动寻的,你必须重新配置导航循环#定义上面! X( V& q3 [/ F+ {
: G& T+ _" O5 o/ t" }" w
// #define HOMING_CYCLE_0 (1<<X_AXIS) and #define HOMING_CYCLE_1 (1<<Y_AXIS): C/ y) V0 }3 R: g* c
/ a- ~7 [0 [: O! x2 r# y. G& O. V// NOTE: This configuration option alters the motion of the X and Y axes to principle of operation
% V, ]* \- |' X! X0 Q: j9 ~// defined at (http://corexy.com/theory.html). Motors are assumed to positioned and wired exactly as. t7 X& ]0 l7 ?$ N0 R* P0 ^
// described, if not, motions may move in strange directions. Grbl assumes the CoreXY A and B motors
- R8 l6 w0 l/ b! R* D// have the same steps per mm internally.
& ]/ S8 V0 P/ E! x' H//注意:这种配置选项改变X和Y轴的运动原理,操作
( Y& v: e7 Q* A8 r4 ?//定义(http://corexy.com/theory.html)。汽车被认为定位和连接一样2 x6 G! R8 t# I l
//描述,如果没有,运动可能会奇怪的方向移动。A和B Grbl假设CoreXY马达
, ~. R% P/ W3 G//每毫米内部有相同的步骤。
2 k; ^: J3 S- M% E, `& {+ o6 Z, C! i* x' t# d2 g
// #define COREXY // Default disabled. Uncomment to enable.+ t" x! [7 E$ L* K; D
( `. m4 K$ b( q$ l: S" r5 F1 F1 R
// Inverts pin logic of the control command pins. This essentially means when this option is enabled8 a+ ?6 N: j5 z6 i0 Z$ p* }% Z
// you can use normally-closed switches, rather than the default normally-open switches.
0 @! Y( u+ h3 Z( n// NOTE: Will eventually be added to Grbl settings in v1.0.
8 W2 U) F( l3 ]4 c6 W# p//反转针销逻辑的控制命令。这实质上意味着当启用这个选项 g$ D2 `# A* e0 R; C
//可以使用闭合开关,而不是默认的常开开关。8 p, j# P G) L1 |2 e) \& R3 C
//注意:最终将被添加到在v1.0 Grbl设置。2 C: U2 F/ T$ z. R- Y
. J5 H& W- ~6 w5 b3 \3 r
// #define INVERT_CONTROL_PIN // Default disabled. Uncomment to enable.
) j8 a) }: n2 s% r. D" n/ e. p! Y3 B2 Y }
// Inverts the spindle enable pin from low-disabled/high-enabled to low-enabled/high-disabled. Useful+ p% X. d7 f; v% N
// for some pre-built electronic boards. \) I2 q7 f& \! Z
// NOTE: If VARIABLE_SPINDLE is enabled(default), this option has no effect as the PWM output and % b% X f& P7 |0 i
// spindle enable are combined to one pin. If you need both this option and spindle speed PWM, , n9 Y' e: V% Y4 ?8 O; f1 t0 X2 h
// uncomment the config option USE_SPINDLE_DIR_AS_ENABLE_PIN below.
# ~- p' b2 w$ t8 d//反转主轴使销从low-disabled / high-enabled low-enabled / high-disabled。有用的/ V! H3 y& y, R% m3 V/ R2 w
//预构建的电子板。( ^& w! c* X" X2 n5 S
//注意:如果启用了VARIABLE_SPINDLE(默认),这个选项作为PWM输出并没有影响4 d$ I# M5 Z6 }# X' m$ k3 Y
//销轴使结合。如果你需要这个选项和主轴转速PWM,
+ f8 z2 V9 e7 a/ ]//取消注释以下配置选项USE_SPINDLE_DIR_AS_ENABLE_PIN
6 s( O1 Y% \5 n: l7 Q
4 G* R* _8 e' t$ p: f, ^// #define INVERT_SPINDLE_ENABLE_PIN // Default disabled. Uncomment to enable.
. E* m( W6 b% Z: L* c7 z. K; b) {3 F% q' n6 g/ p5 S, ?4 W
// Enable control pin states feedback in status reports. The data is presented as simple binary of6 y0 W& D% u" A" V% F" }2 Q
// the control pin port (0 (low) or 1(high)), masked to show only the input pins. Non-control pins on the
1 s/ q8 o- x8 O7 o// port will always show a 0 value. See cpu_map.h for the pin bitmap. As with the limit pin reporting,
% s) o: Y2 Z7 N6 ^// we do not recommend keeping this option enabled. Try to only use this for setting up a new CNC.
4 ?3 T# q) T# a8 l& k5 ~) b//启用控制销状态反馈状态报告。作为简单的二进制数据. o$ @2 ^' ]" Z1 m7 L. Z* a
//控制针端口(0(低)或1(高)),蒙面,只显示输入插脚。非控制性针上
% Y; }( J1 g- |. i7 t$ Z//端口总是显示0值。看到cpu_map。针位图h。与限制销报告,& {/ v5 H/ L3 c3 d( f
//我们不推荐保持启用这个选项。尽量只使用这个设置一个新的数控。
. N( Q3 o- E6 L, w! v1 Y3 d
6 ?$ ~7 [+ W" ~3 g6 a// #define REPORT_CONTROL_PIN_STATE // Default disabled. Uncomment to enable.
, b% Y. M" Y! `# Z; [6 T8 R$ M% H; l4 |, B0 t
// When Grbl powers-cycles or is hard reset with the Arduino reset button, Grbl boots up with no ALARM8 q7 c+ }1 y$ L; }3 Q8 L! Q
// by default. This is to make it as simple as possible for new users to start using Grbl. When homing5 W0 @" y5 g3 ?8 l, m/ I D
// is enabled and a user has installed limit switches, Grbl will boot up in an ALARM state to indicate
# i* m1 X$ J6 E// Grbl doesn't know its position and to force the user to home before proceeding. This option forces
) l) D9 i5 P( X! m" x H// Grbl to always initialize into an ALARM state regardless of homing or not. This option is more for
, W/ p! f; M% f// OEMs and LinuxCNC users that would like this power-cycle behavior.
1 m) F& o3 l0 n* `3 s//当Grbl powers-cycles还是硬重置Arduino复位按钮,Grbl启动没有报警, [0 i1 V @" E2 S* q3 G0 O, X
//默认情况下。这是为了让新用户尽可能简单使用Grbl开始。当归航
) x9 ?% Y# C! F' A//启用和用户安装限位开关,Grbl将启动报警状态指示3 T/ {1 t6 f1 k9 C1 W; X4 e3 A
// Grbl不知道它的位置,迫使用户在继续之前回家。这个选项部队 E4 _' [8 } l2 V" q' d" Y
// Grbl总是初始化进入警报状态不管归航。这个选项是更多% j/ G* K& G9 \( l- [( Y
//原始设备制造商和LinuxCNC用户这样的控制行为。
; Q% r3 j, E4 C# A
4 |+ U3 p/ s2 Q0 q9 E4 r; Y6 f" T// #define FORCE_INITIALIZATION_ALARM // Default disabled. Uncomment to enable.
' n7 x( D4 x& T5 n7 N7 X' U4 n* X! T
, K" w" Y( K4 E# A0 t- r( h' @* t// ---------------------------------------------------------------------------------------, M" h) Y: a8 V2 o/ j1 N0 S
// ADVANCED CONFIGURATION OPTIONS://高级配置选项:
( Z) A) ?) D) `% }. ]4 v. n' W: |
/ `/ z3 K5 f; {+ S/ I) m// Enables minimal reporting feedback mode for GUIs, where human-readable strings are not as important.
7 c, i8 ? \( ?& n r1 C// This saves nearly 2KB of flash space and may allow enough space to install other/future features.
+ h. `- q5 o+ ]) ]5 M; U8 W// GUIs will need to install a look-up table for the error-codes that Grbl sends back in their place.- P. i; f. V- w1 ?- k' b& S
// NOTE: This feature is new and experimental. Make sure the GUI you are using supports this mode.
: b5 d' v/ C Q! j
3 [. Z8 x7 ?$ X( Z. s) F: L// gui允许最小的报告反馈模式,人类可读的字符串在哪里不重要。
{$ B5 f1 G) U' Y2 e% f0 \//这个节省近2 kb的闪存空间,允许足够的空间来安装其他/未来的功能。5 ~/ \' _+ O/ V2 }
// gui需要安装一个查找表的错误代码Grbl发回。
+ V- ~& K* v9 i7 r//注意:此功能是新的和实验。确保您使用的GUI支持这种模式。
* m8 J! [$ m$ Q+ |% \' N: V
$ F" Y6 z# C# s4 o- ^) G0 @// #define REPORT_GUI_MODE // Default disabled. Uncomment to enable.% c$ `. \0 [! d$ G2 X2 |
% o9 h6 W7 v A
// The temporal resolution of the acceleration management subsystem. A higher number gives smoother
6 Z" D, c" y9 G4 `% N2 f( T1 N// acceleration, particularly noticeable on machines that run at very high feedrates, but may negatively
2 `2 @9 p; Q$ a3 E// impact performance. The correct value for this parameter is machine dependent, so it's advised to
1 S# w5 `/ ]" i% Y1 E# k8 M" \9 P! _// set this only as high as needed. Approximate successful values can widely range from 50 to 200 or more.
2 M' ~. [9 [4 {$ r// NOTE: Changing this value also changes the execution time of a segment in the step segment buffer.
+ P, ~" V) R8 s/ K// When increasing this value, this stores less overall time in the segment buffer and vice versa. Make: g6 Y! J1 X9 R5 w, l
// certain the step segment buffer is increased/decreased to account for these changes.7 k# q& j8 {2 Y0 W7 S# ]
//加速度的时间分辨率管理子系统。更多更平稳
5 g; S0 q* }$ h5 x9 r//加速度,特别明显的机器上,运行在非常高的进料速度,但可能负面
/ E8 [) q. ]) A% x8 k, N7 Y//影响性能。正确的值为这个参数是依赖于机器的,所以建议) D8 g1 |* ~% C" G/ |
//这只设置为高。近似成功的价值观可以广泛的范围从50到200或者更多。
8 S& S6 j- r$ H# ~//注意:改变这个值也变化的部分步骤的执行时间缓冲。
5 z+ e0 k1 {* I8 w2 ]7 S//增加这个值时,这个商店部分缓冲区的总时间减少,反之亦然。使
( j( o8 F- m9 x% B& V# w//特定步骤段缓冲是考虑这些变化增加/减少。0 a$ @" _' ~; n2 z
" C7 J: ?% _% @# B8 e/ ?% j9 J#define ACCELERATION_TICKS_PER_SECOND 100 //加速度的时间分辨率管理子系统。更多更平稳
; c, C0 X2 i$ h; J! W
2 O0 f% M; T" [0 U// Adaptive Multi-Axis Step Smoothing (AMASS) is an advanced feature that does what its name implies,
3 x* w- n6 H( M2 |, g// smoothing the stepping of multi-axis motions. This feature smooths motion particularly at low step) k9 F+ t! A1 t5 l' Z, |: c
// frequencies below 10kHz, where the aliasing between axes of multi-axis motions can cause audible % b7 f1 \3 Z" J' b
// noise and shake your machine. At even lower step frequencies, AMASS adapts and provides even better. O. h% i; P( V- u0 t
// step smoothing. See stepper.c for more details on the AMASS system works.3 g9 x: X; J, D6 q z
//自适应多轴步平滑(积累)是一种先进的功能,它的名字所暗示的那样,
/ P7 m; D# _( K//平滑的多轴步进运动。这个特性平滑运动尤其是在低一步8 G* h4 a( ^( j/ _! g. B1 s
//频率低于10 khz,轴之间的混叠的多轴运动可能导致音响
, H2 g, K: o" B* e! V, w//噪音和震动你的机器。在更低的频率步,积累适应并提供更好# r$ L9 g! w% A
//步骤平滑。看到步进。c更多细节的积累系统的工作原理。( g4 P& q3 I$ O# `) w# a4 {/ W8 T
; ?1 M9 ]# }, @& `$ y) u
#define ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING // Default enabled. Comment to disable.//自适应多轴步平滑+ H1 `- ?0 T. I( l/ h- J2 t
k* s( r1 L3 H8 b4 A* ^$ p
// Sets the maximum step rate allowed to be written as a Grbl setting. This option enables an error
5 }! K4 G( m: g$ w5 x, Q; E7 ?( G1 H// check in the settings module to prevent settings values that will exceed this limitation. The maximum- k6 I2 Z8 ^* O- @# B6 M# |5 m
// step rate is strictly limited by the CPU speed and will change if something other than an AVR running- G" g+ V, b; t/ I& }
// at 16MHz is used.9 D2 N U" _( ^' ?2 F
// NOTE: For now disabled, will enable if flash space permits.
) C {; E' p7 }% |/ j' y7 \//设置最大一步速率可以写成Grbl设置。这个选项可以使一个错误* K7 [2 i* L K u
//设置模块中检查,防止设置值将超过这个限制。的最大
* c& R/ o; t" E) |1 b' j. Y//步骤严格限制的CPU速度也会改变如果是其他AVR运行, I2 p! d8 B- A& @% [3 k5 ?& ?
//使用16兆赫。& t! m0 D8 J8 w2 W! X6 J1 {' K
//注意:现在残疾,将使如果flash空间许可。, ?! l/ |/ A% s% k
5 z o$ d- w6 i$ Q4 D// #define MAX_STEP_RATE_HZ 30000 // Hz 设置最大一步速率
* ? i$ i- a4 @3 L: D; F# D2 k$ D# `% }3 J4 f
// By default, Grbl sets all input pins to normal-high operation with their internal pull-up resistors& A- [' S% @$ @: T8 [0 w
// enabled. This simplifies the wiring for users by requiring only a switch connected to ground, & L1 s5 s# Z: y
// although its recommended that users take the extra step of wiring in low-pass filter to reduce9 G- ?; q$ w$ F( q" s
// electrical noise detected by the pin. If the user inverts the pin in Grbl settings, this just flips
7 ~( x+ w, L, d7 ]' b6 D# ]// which high or low reading indicates an active signal. In normal operation, this means the user 4 ?2 y, g, T6 x3 N \
// needs to connect a normal-open switch, but if inverted, this means the user should connect a
. w% q# N* a0 D% W2 u5 J, W// normal-closed switch. $ X: e/ x9 Y% r* I& E8 w2 D
// The following options disable the internal pull-up resistors, sets the pins to a normal-low 6 g- l* L$ t0 T$ U$ Q
// operation, and switches must be now connect to Vcc instead of ground. This also flips the meaning
# J' y# o' {5 R- Q// of the invert pin Grbl setting, where an inverted setting now means the user should connect a
8 q" M( P7 U; i* n2 ?1 ]4 J// normal-open switch and vice versa.
: n! A) ~: ~3 m' F// NOTE: All pins associated with the feature are disabled, i.e. XYZ limit pins, not individual axes.
# S, g, P; E9 h) J- M, z8 e// WARNING: When the pull-ups are disabled, this requires additional wiring with pull-down resistors!/ s4 K3 d( @6 }& E4 }1 p( i2 C" x
//默认情况下,Grbl所有输入引脚设置为正常高操作的内部上拉电阻1 Z0 r6 Y9 n C4 H' |, j6 w. W! K9 _
//启用。这简化了布线为用户只需要一个开关连接到地面,0 s' x! X8 X3 N; T. M! W4 ?' n* s
//虽然其建议用户采取额外的步骤,在低通滤波器来减少布线
# P' a6 n/ R8 T' h' u//电噪音检测销。如果用户反转的销Grbl设置,这只是翻转3 J4 ]1 v4 {' d, p
//读高或低表明一个积极的信号。在正常操作中,这意味着用户; o) ^: t4 `3 f! }# a
//需要连接一个常开开关,但如果倒,这意味着用户应该连接
, o: _3 z- r4 J. s// normal-closed开关。0 d q/ T3 |1 G7 H( z; Y1 n% T
//以下选项禁用内部上拉电阻,一般低设置别针# i& C/ S0 j1 ?3 O9 N! a7 x
//操作,现在开关必须连接到Vcc代替地面。这也掀的意思
5 V# q. t( J0 g4 ~: ~//反销Grbl设置,一个倒置的设置现在意味着用户应该连接9 q7 P8 a# v6 E) r- Z( Z
//常开开关,反之亦然。
- a2 Q/ l7 Y% E+ ^& n//注意:所有针与功能被禁用,例如XYZ限制针,而不是单独的轴。
7 V( R0 W f& W/ A( C+ Y2 I. k/ u//警告:引体向上被禁用时,这需要额外的布线与下拉电阻!7 u4 z' J9 C% H9 M4 G
V) w# r& N4 V4 _//#define DISABLE_LIMIT_PIN_PULL_UP //以下选项禁用内部上拉电阻* f+ @+ O8 p0 f8 w
//#define DISABLE_PROBE_PIN_PULL_UP
$ X: ~) \/ U, Q1 |- F9 z4 `0 u* D//#define DISABLE_CONTROL_PIN_PULL_UP
+ Z3 {. a5 T; o! h6 a( T
" p' P% J5 ?; b" l+ N5 l, w5 F// Sets which axis the tool length offset is applied. Assumes the spindle is always parallel with
) _; e% J( p. L) f9 x' b2 P// the selected axis with the tool oriented toward the negative direction. In other words, a positive
1 e/ C* B8 S. X/ O// tool length offset value is subtracted from the current location.
" V6 @2 ]: H+ Y. b/ L! e6 c//设置哪个轴长度补偿应用的工具。假设轴总是与1 |, K0 F3 x+ n2 q& A
//选择轴工具面向负方向。换句话说,一个积极的
5 h- s0 \# k5 d% w; X//工具长度偏移值减去从当前位置。
6 a, D( X) y. Q' ^$ A! e6 O$ m" C! |( C
- K0 Y) F0 u+ F2 w0 J# C& S0 W3 O#define TOOL_LENGTH_OFFSET_AXIS Z_AXIS // Default z-axis. Valid values are X_AXIS, Y_AXIS, or Z_AXIS.设置哪个轴长度补偿应用的工具
, R3 q$ ]& C9 X* j3 m; [1 a6 O z* Q: b2 i
// Enables variable spindle output voltage for different RPM values. On the Arduino Uno, the spindle; P$ r/ S+ Y; Y* Z0 s% E. E9 u
// enable pin will output 5V for maximum RPM with 256 intermediate levels and 0V when disabled.; w( l; }) l0 A B3 j+ @, u* _
// NOTE: IMPORTANT for Arduino Unos! When enabled, the Z-limit pin D11 and spindle enable pin D12 switch!
$ d0 s* X5 j- j// The hardware PWM output on pin D11 is required for variable spindle output voltages.
6 J$ x+ W$ H2 |4 j//允许变量轴输出电压不同的转速值。Arduino Uno,主轴5 _! P$ |+ r s2 S
//启用销将输出5 v的最高转速256中级水平和0 v时禁用。4 Q; Y, P" H2 e+ x& Z5 U
//注意:重要Arduino凯泽本人!当启用时,Z-limit销这里和轴销D12开关!
- c) l5 B; p+ O7 Y//硬件PWM输出销这里需要变量轴输出电压。& m( _& u% f8 V# u1 b
2 ?8 M! O# O. n, r
#define VARIABLE_SPINDLE // Default enabled. Comment to disable.//允许主轴输出电压不同的转速值
) l* R: L" W. i
* A( r) m: p" M! k* Z& g# _; B: N# |// Used by the variable spindle output only. These parameters set the maximum and minimum spindle speed
; r4 N' n* Q/ A: o// "S" g-code values to correspond to the maximum and minimum pin voltages. There are 256 discrete and 6 g R( x6 a# T5 v
// equally divided voltage bins between the maximum and minimum spindle speeds. So for a 5V pin, 1000
, {5 q+ B6 `6 p// max rpm, and 250 min rpm, the spindle output voltage would be set for the following "S" commands: . L% ?" m- L; g: `
// "S1000" @ 5V, "S250" @ 0.02V, and "S625" @ 2.5V (mid-range). The pin outputs 0V when disabled.- r- I4 F* ]5 y9 l, Q
//使用的变量轴输出。这些参数设置最大和最小轴转速
0 j) G) V% R" o1 }. s- s' d//“S”刀位点值对应于销电压的最大值和最小值。有256个离散和, Y$ q0 Y: Q7 n, w8 `' c
//电压平均分配箱主轴速度的最大值和最小值之间。所以对于一个5 v销,1000
( t% i1 l* O* v6 X& P; @// max rpm,250分钟rpm,主轴输出电压将为以下“S”命令:* ^4 A3 }5 T; C9 I, F5 W
// @“S1000 5 v,“S250”@ 0.02 v,“S625”@ 2.5 v(中档)。销输出0 v时禁用。
: A5 h* j( y8 v8 T
% q0 x, `2 O1 u# B" }) }) Y#define SPINDLE_MAX_RPM 1000.0 // Max spindle RPM. This value is equal to 100% duty cycle on the PWM.
" I8 K& k; }; o6 K#define SPINDLE_MIN_RPM 0.0 // Min spindle RPM. This value is equal to (1/256) duty cycle on the PWM.
: Y3 V! K8 q6 U
) w2 q' o+ M7 t9 I; m* s// Used by variable spindle output only. This forces the PWM output to a minimum duty cycle when enabled.5 F4 W* l6 r6 [) X( T9 A3 @% E9 a
// When disabled, the PWM pin will still read 0V. Most users will not need this option, but it may be
& U) P! k4 ]/ u/ ]0 ?// useful in certain scenarios. This setting does not update the minimum spindle RPM calculations. Any
& X$ C( d$ ^1 C4 S// spindle RPM output lower than this value will be set to this value.
1 [0 b2 T" o8 S+ Z3 }//使用的变量轴输出。这迫使PWM输出最小占空比时启用。
: E- X: N& A' `: x2 d! F$ S//当禁用,PWM销仍读0 v。大多数用户不需要这个选项,但是它可能是
3 z; f! m2 \' I/ f5 J& X2 ~& @//在某些情况下很有用。这个设置不会更新最小主轴转速计算。任何
' T9 n) w9 I# u& G y7 a//输出轴转速低于这个值将被设置为这个值。
5 B- o: {4 N8 t
' J3 Q, {7 |6 G! w) p% q// #define MINIMUM_SPINDLE_PWM 5 // Default disabled. Uncomment to enable. Integer (0-255)' L) w. Y8 k P- q+ K& [- f/ K5 x
: q& u4 M$ ^+ [0 X9 D4 t7 }// By default on a 328p(Uno), Grbl combines the variable spindle PWM and the enable into one pin to help 5 l6 f8 [) x l6 `8 |4 D$ t
// preserve I/O pins. For certain setups, these may need to be separate pins. This configure option uses
7 a; F7 B7 d$ h// the spindle direction pin(D13) as a separate spindle enable pin along with spindle speed PWM on pin D11. + x* x4 y3 `- w) J2 C/ n. J' V
// NOTE: This configure option only works with VARIABLE_SPINDLE enabled and a 328p processor (Uno). 8 x( f* m5 s- @! u9 Y$ E6 ]& g1 l
// NOTE: With no direction pin, the spindle clockwise M4 g-code command will be removed. M3 and M5 still work.
3 f3 Y2 W9 D5 w1 |// NOTE: BEWARE! The Arduino bootloader toggles the D13 pin when it powers up. If you flash Grbl with
0 }( v! F0 y+ z3 o+ ?3 C. v$ V( X8 ?// a programmer (you can use a spare Arduino as "Arduino as ISP". Search the web on how to wire this.),
1 h. X4 L, d; ?, K% T// this D13 LED toggling should go away. We haven't tested this though. Please report how it goes!1 @0 X- x, X S* T- N) g0 y
//默认ATmega328 p(Uno),Grbl结合变量轴PWM和使到一个销的帮助
6 _0 `$ j1 f& r& d//保存I / O管脚。对于某些设置,这些可能需要单独的别针。这个配置选项使用: {* O' ]) ^- a" V! k
//方向轴销(D13)作为一个单独的轴销上启用销以及主轴转速PWM这里。# u# d- y; \4 ]% B$ F
//注意:该配置选项仅适用于VARIABLE_SPINDLE启用和328 p处理器(Uno)。
; a3 f1 c" h0 ?% f+ X# G0 x/ b//注意:没有方向销,主轴顺时针M4刀位点命令将被删除。M3和M5仍然工作。5 C- A! B) Y/ j+ b0 Z
//注意:小心!Arduino引导装载程序切换D13销的权力。如果flash Grbl
( w' G+ [/ U5 g0 y2 A* U, |//程序员(您可以使用一个备用Arduino“Arduino ISP”。搜索网络如何线),
8 @! G, o' z7 S. _7 R; h4 w//这D13导致切换应该消失。我们还没有测试这个。请报告将会怎样!2 p& a; ?* z& ^; s$ C5 I! y
! F+ w* c7 `6 h3 |- l( ]
// #define USE_SPINDLE_DIR_AS_ENABLE_PIN // Default disabled. Uncomment to enable. v. y% G* [' {, r1 N# A
" }, r; o* q ^6 P
// With this enabled, Grbl sends back an echo of the line it has received, which has been pre-parsed (spaces
5 q5 p; l: h( {% B/ a! e! |// removed, capitalized letters, no comments) and is to be immediately executed by Grbl. Echoes will not be 9 o; {7 I5 ]" T
// sent upon a line buffer overflow, but should for all normal lines sent to Grbl. For example, if a user . n' R& r5 D; O" [! I" N7 A: T8 j
// sendss the line 'g1 x1.032 y2.45 (test comment)', Grbl will echo back in the form '[echo: G1X1.032Y2.45]'.
5 U- M. ~0 g1 e// NOTE: Only use this for debugging purposes!! When echoing, this takes up valuable resources and can effect
) \. P! L0 K; X4 U// performance. If absolutely needed for normal operation, the serial write buffer should be greatly increased5 Z; ^+ t/ }, r( s' M8 t) A
// to help minimize transmission waiting within the serial write protocol.
/ k5 A9 w" K, D& T% {. b5 f/ \
( o) u/ E$ o/ P, L0 D+ o- p//启用,Grbl发回的回声线已收到,已预编译(空间
& i1 l; D6 }+ X+ q3 S" K//移除,大写字母,没有评论),由Grbl立即执行。回声将不会
+ s8 t6 r5 ~( F//发送一个线缓冲区溢位,但应该对所有正常线路送到Grbl。例如,如果一个用户
) U% E# R8 n$ d( A" Z" g O: c//发送线的g1 x1.032 y2.45(测试评论)形式”,Grbl将回声”(回声:G1X1.032Y2.45]”。# S$ a/ A k& N
//注意:只使用这个调试! !当呼应,这占用了宝贵的资源,可以影响
S: u" p$ [ C0 e1 ~/ `' R' R& g//性能。如果正常运行所需的绝对,串行写入缓冲器应该大大增加) L6 C* ]3 T# g2 y: I% ^( O& G% x0 ]
//帮助最小化传输等系列内写协议。
7 D7 z( D7 B- j( C" ]
3 k3 K; M- {+ @8 O! [6 Z* k// #define REPORT_ECHO_LINE_RECEIVED // Default disabled. Uncomment to enable.
9 i( p. K# g) E' w3 p L& G; [* s1 I
$ ` W8 m& g/ G$ k2 p/ a0 e// Minimum planner junction speed. Sets the default minimum junction speed the planner plans to at; B% E. \. |2 l7 k& n$ i% J+ y
// every buffer block junction, except for starting from rest and end of the buffer, which are always' b: [$ O& K" O! h% D% x6 H
// zero. This value controls how fast the machine moves through junctions with no regard for acceleration
- z8 h- K" p4 X) i. x// limits or angle between neighboring block line move directions. This is useful for machines that can't
" m# o4 a* J% ^" |' N// tolerate the tool dwelling for a split second, i.e. 3d printers or laser cutters. If used, this value2 L" \3 V' }$ Q& R
// should not be much greater than zero or to the minimum value necessary for the machine to work.4 d: I: @, K+ g' R- o5 G3 F* y% F
" W1 P" q+ d6 @3 R0 W//最小规划师结速度。设置默认最小连接速度规划计划/ `3 z: q/ Z# s: P( h. @
//每一个缓冲块接头,除了从结束休息和缓冲区,它总是1 S) G2 S& n& ]/ t5 @
// 0。这个值控制机器的速度穿过路口,没有考虑加速度
' ~! Q, ^5 q/ l1 G- z//限制或相邻块之间的角线方向移动。这是有用的机器,不能
9 V, d3 |% V" q//容忍工具居住某一刹那,即3 d打印机或激光切割机。如果使用这个值
: F% P# n3 d0 |$ h//不应大于零或机器工作所需的最小值。6 b" Z r. U1 b m* A! h
c/ T( L! O$ F/ l#define MINIMUM_JUNCTION_SPEED 0.0 // (mm/min)
& q9 m7 k8 Y3 g; G- M M9 H5 E1 v9 B8 {5 k- O! [. m
// Sets the minimum feed rate the planner will allow. Any value below it will be set to this minimum
" @6 I% v+ l8 x// value. This also ensures that a planned motion always completes and accounts for any floating-point! k7 F* R& z0 K/ z+ V' e) n! k
// round-off errors. Although not recommended, a lower value than 1.0 mm/min will likely work in smaller" K2 h% _& I3 Z% a
// machines, perhaps to 0.1mm/min, but your success may vary based on multiple factors.: Z. H' P u+ z/ N/ V( u6 Z
//设置计划将允许的最小进给速率。任何价值低于它将被设置为最低值。这也保证了运动计划总是完成,占任何浮点
+ U% c3 ~$ a- {2 N( V" u//舍入错误。虽然不推荐,价值低于1.0毫米/分钟可能会在较小的工作
; L" @9 I3 Z7 T2 z& S//机器,也许到0.1毫米/分钟,但你的成功基于多种因素可能会有所不同。
1 D# _( w$ W) L2 c# K
, L( Z6 `# y. \- C#define MINIMUM_FEED_RATE 1.0 // (mm/min)//设置计划将允许的最小进给速率$ a6 w$ Q' X" \6 t1 D
" O& O' _7 z0 u* `// Number of arc generation iterations by small angle approximation before exact arc trajectory " w3 m* |, z) u% k' q: [9 J% w, K
// correction with expensive sin() and cos() calcualtions. This parameter maybe decreased if there
4 x" d ` I# m, b+ g// are issues with the accuracy of the arc generations, or increased if arc execution is getting
: ?0 b3 {7 h9 q! z6 ?; Q p9 q ~; V// bogged down by too many trig calculations.
& M6 L7 I, i: Y) z( j, e/ \, s, {//弧生成迭代次数之前小角度近似精确的弧线轨迹! s0 E0 b/ v* P0 [5 K. a
//修正与昂贵的sin()和cos()calcualtions。如果有这个参数可能减少5 { L& n. `3 j% d) T
//与弧一代又一代的准确性问题,或如果电弧执行得到增加; i1 B) C4 X3 P2 t
//太多的三角计算的泥潭。
3 s) G K$ t$ o% `! g6 e% v4 S! B8 |+ Z
#define N_ARC_CORRECTION 12 // Integer (1-255)
$ i7 z. f8 C5 {) n- C* W/ Y+ }: S% w4 B% w T5 `2 q9 Z) n
// The arc G2/3 g-code standard is problematic by definition. Radius-based arcs have horrible numerical
. y6 x% R) P1 p) ], V( u* K// errors when arc at semi-circles(pi) or full-circles(2*pi). Offset-based arcs are much more accurate
. Y [8 ]1 n* Q// but still have a problem when arcs are full-circles (2*pi). This define accounts for the floating
/ M0 b" q) S8 G6 k// point issues when offset-based arcs are commanded as full circles, but get interpreted as extremely5 k) Z! x) O; I6 O
// small arcs with around machine epsilon (1.2e-7rad) due to numerical round-off and precision issues.
7 c# X# D; ?$ L. d// This define value sets the machine epsilon cutoff to determine if the arc is a full-circle or not.
, }4 ?" c8 E, F- |1 ^7 i' q5 ]// NOTE: Be very careful when adjusting this value. It should always be greater than 1.2e-7 but not too
" E$ D5 ~0 V9 ]9 l6 p0 p// much greater than this. The default setting should capture most, if not all, full arc error situations.
" K0 l* U" d! \! R" q3 ]3 Y1 |& {4 S//弧G2/3刀位点的标准定义是有问题的。Radius-based弧有可怕的数值
. ]; X% c U1 ]" C4 @//错误当电弧在半圆(π)或原点(2 *π)。Offset-based弧更准确
( M) ^( w" X- C" m, |+ J8 \//但仍有一个问题当弧原点(2 *π)。这个定义占浮动4 N7 @# d& r$ s3 q* ?& Q; C$ C. w
//当offset-based弧吩咐点问题完整的圆,但解释为极1 z$ j* ?4 S: t* K+ p
//小弧机周围ε(1.2 e-7rad)由于数字舍入和精度问题。
9 F( G2 Z; `& l) c5 _" t//定义值设置机器ε截止来确定电弧是一个原点了。8 O J# T& }( Y* K' z
//注意:调整这个值时非常小心。它应该总是大于1.2 e -但不要太! Y& I: n# R' K# \7 g( z
//比这大得多。默认设置应该捕获大部分,如果不是全部,全部错误的情况。3 H$ q" S! Y3 m9 S, y3 c1 ?
- U# l$ R: d% M0 x3 G O; g
#define ARC_ANGULAR_TRAVEL_EPSILON 5E-7 // Float (radians)
K* a( u; v- \9 w) g2 i3 w9 Y0 e; Y' [* t
// Time delay increments performed during a dwell. The default value is set at 50ms, which provides; `8 e* c, L# U9 [8 W
// a maximum time delay of roughly 55 minutes, more than enough for most any application. Increasing
2 x- d# N, W% m0 Q// this delay will increase the maximum dwell time linearly, but also reduces the responsiveness of ! c) U9 _2 k9 Q. |9 N N8 l8 c* j
// run-time command executions, like status reports, since these are performed between each dwell 7 T. @5 T" U* Y, }
// time step. Also, keep in mind that the Arduino delay timer is not very accurate for long delays.6 V% i& f% h. [
//延时增加表现在住。默认值设置为50毫秒,它提供了
7 B. [; ^7 H, G; g//最大延时约55分钟,足够对大多数任何应用程序。增加% ?0 `" ^* L3 i& ?
//这种延迟将增加线性最大停留时间,也减少了响应能力+ d- V5 _8 F! s
//运行命令执行状态报告一样,因为这些每个住之间执行$ ]$ N* X4 M& i
//时间步。还有,记住,Arduino延迟计时器不是很准确的长时间延误。+ i- g* l! Y) l/ ~9 D) @& Q
. A! w/ A& c2 s
#define DWELL_TIME_STEP 50 // Integer (1-255) (milliseconds)* f; S1 d# T% Y; g( w) f
) V% P9 ? ^! O* d# S4 K
// Creates a delay between the direction pin setting and corresponding step pulse by creating
1 e! F, u& V/ t/ O; \5 v- {0 K// another interrupt (Timer2 compare) to manage it. The main Grbl interrupt (Timer1 compare) + o6 G' X" P$ Z; {) C# E
// sets the direction pins, and does not immediately set the stepper pins, as it would in
0 O7 b. `7 o' F' O) Q* ^// normal operation. The Timer2 compare fires next to set the stepper pins after the step 1 z* @3 l. \' d
// pulse delay time, and Timer2 overflow will complete the step pulse, except now delayed $ P) f, D1 j" R0 G) n
// by the step pulse time plus the step pulse delay. (Thanks langwadt for the idea!)$ R5 E8 i" E' F# F
// NOTE: Uncomment to enable. The recommended delay must be > 3us, and, when added with the( W9 P" Q6 t* m6 Z5 @! y
// user-supplied step pulse time, the total time must not exceed 127us. Reported successful. K% k+ w, Q, n, ^6 _8 t+ K
// values for certain setups have ranged from 5 to 20us./ J# Q+ _* |0 d+ d" @( a
//创建一个方向销之间的延迟脉冲通过创建设置和相应的步骤2 k% u9 z: r* l7 e3 X
//另一个中断(Timer2比较)来管理它。主要Grbl中断(Timer1比较)
+ L3 o2 w; r% _& }, W//设置方向针,不立即设置步进针,因为它会在* c) N F. O/ X3 w# D) Z
//正常操作。Timer2比较火旁边设置步进针后一步6 W* B/ }0 w- b$ z
//脉冲延迟时间,Timer2溢出脉冲将完成的步骤,现在延迟除外2 k+ Q& K; j$ }& O' X s7 d
//脉冲时间加上的一步一步脉冲延迟。(感谢langwadt主意!)/ y5 Q' c" K1 ~' b* |8 [1 d
//注意:取消启用。必须> 3,建议延迟,当添加的
8 |1 @! S- ]4 U7 ^1 D& _//用户提供的步骤脉冲时间,总时间不得超过127美元。成功的报道' \9 J. u3 [/ d9 r6 U6 X! U* ~
//值对某些设置范围从5到20。6 y$ l: p9 Y5 m: E5 |! N( k
T, X/ V8 w2 t6 g+ H% y. l# y4 r! N// #define STEP_PULSE_DELAY 10 // Step pulse delay in microseconds. Default disabled.' r D# \* E3 }, f' |" A5 p
& d, |. ]7 ], R% d+ y6 I// The number of linear motions in the planner buffer to be planned at any give time. The vast
. S8 s6 m' S! h0 _7 O2 L// majority of RAM that Grbl uses is based on this buffer size. Only increase if there is extra
" y: _# q6 G6 f; |4 f// available RAM, like when re-compiling for a Mega or Sanguino. Or decrease if the Arduino! q; r9 o T b0 ^2 s Y/ n4 U+ q
// begins to crash due to the lack of available RAM or if the CPU is having trouble keeping
' C9 b( ]' z! A. }- Y// up with planning new incoming motions as they are executed.
6 z* Q7 z& c; p& X//线性运动规划师缓冲区的数量在任何给出时间计划。绝大# {% u/ x3 a" K
//多数RAM Grbl使用基于这个缓冲区的大小。如果有额外的只会增加
( H9 `: f- w6 G//可用内存,比如当基于大型或Sanguino。如果Arduino或减少
, t# F( k8 z' }# w1 r//开始崩溃由于缺乏可用的RAM或者CPU是难以保持4 V& ^% _3 o4 v, l3 e4 W: A! C8 P
//与规划新传入的动作执行。- C) B! Q6 J8 _ J1 D8 r
0 U' t$ ^; p& a9 U- W
// #define BLOCK_BUFFER_SIZE 18 // Uncomment to override default in planner.h.
2 I' s; ]# ?9 d
: O& Q6 }9 z& E// Governs the size of the intermediary step segment buffer between the step execution algorithm
, ?4 E, l' Y0 o// and the planner blocks. Each segment is set of steps executed at a constant velocity over a
! ]1 Q! r# F2 ]& m// fixed time defined by ACCELERATION_TICKS_PER_SECOND. They are computed such that the planner
$ a# t/ H3 F( w6 f0 M+ q// block velocity profile is traced exactly. The size of this buffer governs how much step . h0 S; A4 ?4 ?( Y1 o# K
// execution lead time there is for other Grbl processes have to compute and do their thing
( v9 _8 |* w9 M+ v: l// before having to come back and refill this buffer, currently at ~50msec of step moves.) ^' c/ G- M# ^* U; @! |
//控制之间的中间段缓冲大小的步骤执行算法
; k% X9 K6 A. n- B q1 X//和规划师块。每一部分的步骤执行在一个恒定的速度6 c! U9 z0 `4 Y$ H- J
//固定的时间由ACCELERATION_TICKS_PER_SECOND定义的。他们计算的计划
% o" m3 H- j# ]# P//块速度剖面追踪到底。这个缓冲区的大小控制多少步骤, F! q0 H) j' u" `( F# H
//执行时间有其他Grbl过程需要计算和做他们的事情
: K! a' ~7 m; K, f( M//之前必须回来重新填充这个缓冲区,目前移动~ 50毫秒的一步。; |5 y; D2 \: ?/ U q
# U* `3 f# n5 q; A// #define SEGMENT_BUFFER_SIZE 6 // Uncomment to override default in stepper.h.
. [: D8 W2 B* @" J( e2 q9 \8 f
3 F' P- a. S7 [; L// Line buffer size from the serial input stream to be executed. Also, governs the size of 8 k& d6 _) j6 T% k* E
// each of the startup blocks, as they are each stored as a string of this size. Make sure! I) {% v5 m/ M6 v' ~9 i; |
// to account for the available EEPROM at the defined memory address in settings.h and for
2 T- |. v. J( K" j2 O, ^. J; `// the number of desired startup blocks.
% d% x1 l& L! @% m3 p4 f& s( _$ s// NOTE: 80 characters is not a problem except for extreme cases, but the line buffer size
! `+ x0 v, L. h$ Z$ z% w// can be too small and g-code blocks can get truncated. Officially, the g-code standards
4 W" F, G. f* l+ ], C: u// support up to 256 characters. In future versions, this default will be increased, when
& v$ T0 A0 @+ P// we know how much extra memory space we can re-invest into this.
1 b0 Z. i4 j* N- @, Q//行执行串行输入流的缓冲区大小。同时,大小的控制
% J: w, \, ~ x8 p6 ~1 o$ J' w//每个启动模块,它们分别存储为字符串的大小。确保
+ X5 r# U- @ X/ g7 G3 c//占可用eepm定义内存地址的设置。h和. Q; |9 v& j9 D% ?. y8 \
//需要启动块的数量。
. d! d, e# G5 L+ o& e, d6 r% B//注意:80个字符不是一个问题,除了极端的情况下,但线缓冲区大小
* W" g D6 Y T//可以太小和刀位点块可以截断。正式,刀位点标准
: ]3 V7 m; X8 Q$ d' a/ C//支持多达256个字符。在未来的版本中,这个违约将会增加,当3 ]8 c- w/ m" u+ J) C. c; C, |
//我们知道多少额外内存空间的时候我们可以再投资。+ R; @# j j) c) m9 w* K; O
6 p& n% L9 _# ?5 r// #define LINE_BUFFER_SIZE 80 // Uncomment to override default in protocol.h
7 M. K4 l' z, V2 y - _% t0 `. _7 ^, O
// Serial send and receive buffer size. The receive buffer is often used as another streaming, u% m$ w, I {( H/ @3 |
// buffer to store incoming blocks to be processed by Grbl when its ready. Most streaming0 V* l3 {2 ^5 f# r3 D6 D
// interfaces will character count and track each block send to each block response. So, . J1 b$ I7 ~0 q; [7 s. }/ r
// increase the receive buffer if a deeper receive buffer is needed for streaming and avaiable
3 }/ o a; d' c$ W2 C' D: e// memory allows. The send buffer primarily handles messages in Grbl. Only increase if large
# n, h9 F6 B1 R; ?; Z// messages are sent and Grbl begins to stall, waiting to send the rest of the message.
) ]# Y! n; A9 Q# a: h' z// NOTE: Buffer size values must be greater than zero and less than 256.
) _! G* l7 t! g// #define RX_BUFFER_SIZE 128 // Uncomment to override defaults in serial.h9 I( f. d6 p' x4 ~+ s) [, X f
//串行发送和接收缓冲区大小。接收缓冲区通常用作另一个流' p4 f1 y# U+ G1 x! |2 u' U7 F' d7 [& k
//缓冲存储传入的块来处理Grbl当它准备好了。最流
4 t6 k( k" H% `//接口将字符计数和跟踪每一块发送给每个块的回应。所以,4 |2 I u3 ^% |' ~: M/ {
//增加接收缓冲区如果需要更深层次的接收缓冲区为流,、
' r* E: J; g- C3 l2 ^//内存允许。Grbl发送缓冲主要处理消息。只会增加如果大8 Z- J3 w6 Y: B
//消息发送和Grbl开始停滞,等待发送其余的消息。0 x. v U8 V% h4 Z
//注意:缓冲区大小值必须大于零,小于256。
4 }$ B5 ^* k* d+ n- S' L// # define RX_BUFFER_SIZE 128 / /取消serial.h覆盖默认值
: i7 h% F# ~) c, U+ D
/ v: G ~* I8 D% K
9 G E6 w8 m3 ~" g* w1 a; Q$ R/ t( Z// #define TX_BUFFER_SIZE 64
" x6 n5 i1 y9 H! M" | : o: S t, q) T3 @
// Toggles XON/XOFF software flow control for serial communications. Not officially supported. U5 @( ~& j, X7 \" S
// due to problems involving the Atmega8U2 USB-to-serial chips on current Arduinos. The firmware
; _: t3 y% C- N9 B/ p4 t// on these chips do not support XON/XOFF flow control characters and the intermediate buffer
. m; c6 ^7 x0 U1 p% N. n// in the chips cause latency and overflow problems with standard terminal programs. However, * h }2 T/ W' K# V
// using specifically-programmed UI's to manage this latency problem has been confirmed to work.9 s; b e1 f- A& e4 y6 o7 V
// As well as, older FTDI FT232RL-based Arduinos(Duemilanove) are known to work with standard* |- S' K/ s0 @3 X5 a' n
// terminal programs since their firmware correctly manage these XON/XOFF characters. In any
8 N% e. {& g) f// case, please report any successes to grbl administrators!/ Z0 T* d& Y6 H% o! q4 l
//切换为串行通信发送朴通/发送葡开软件流控制。不是官方支持
+ f b6 b. F' O$ X//由于问题涉及Atmega8U2 USB-to-serial当前arduino芯片。固件
% m. h* B2 u( ]) R D& n4 t: B0 a//在这些芯片不支持发送朴通/发送葡开流控制字符和中间缓冲区* y, |5 {/ j) h+ l3 h( |5 L8 g
//芯片导致延迟和溢出问题的标准终端程序。然而,
; \! L) ~6 D3 [- k9 D6 D( ^- K//使用specifically-programmed UI的管理这个延迟问题已经确认工作。
* t# Q( f$ H5 o//以及老FTDI FT232RL-based arduino(Duemilanove)是已知的标准
! l: I% L% }* N& S7 E% P//终端程序因为他们正确的固件管理这些发送朴通/发送葡开的角色。在任何
; {% ^$ l3 [) g3 b' b# P//情况,请报告任何成功grbl管理员!) o+ U. s: b+ i* g# E5 d" N: ?& q
8 s- O4 a( I4 _2 E// #define ENABLE_XONXOFF // Default disabled. Uncomment to enable./ u3 J$ j8 {( b* c, h; p0 [" f
4 p. V0 `2 K i/ p// A simple software debouncing feature for hard limit switches. When enabled, the interrupt
4 @- I; ^. b% F+ l8 Q// monitoring the hard limit switch pins will enable the Arduino's watchdog timer to re-check
& x7 G# |% O; `' {4 g& S// the limit pin state after a delay of about 32msec. This can help with CNC machines with , j; N7 ~7 q& Y. I! V9 Y% D: o
// problematic false triggering of their hard limit switches, but it WILL NOT fix issues with 9 C) H# }2 z' d/ A2 e' F/ x9 |% j
// electrical interference on the signal cables from external sources. It's recommended to first! e/ g6 G+ s' v
// use shielded signal cables with their shielding connected to ground (old USB/computer cables % x# r k* |# Q# R
// work well and are cheap to find) and wire in a low-pass circuit into each limit pin.
' T" k& \8 Z2 H# \5 o2 ]$ {//一个简单的软件消除抖动特性硬限位开关。当启用时,中断8 i0 I. \) o! [1 N
//监控硬限位开关针将使Arduino的看门狗定时器重新审视/ p+ H5 K2 a# F% U8 g1 _& ]% p+ `5 u$ Z6 u
//销的极限状态后约32毫秒的延迟。这可以帮助与数控机器
8 M3 `$ U- V: C0 n7 Y4 d//问题错误引发的硬限位开关,但是它不会解决问题: ^, |. n7 v6 ?; m+ w
//电干扰信号电缆从外部来源。首先它的建议
) [" w8 x9 \; g8 \/ ]9 v//使用屏蔽信号电缆的屏蔽连接到地面(老USB /计算机电缆# a0 b# C/ \2 Q1 d; q! t
//工作得很好,很便宜)和线低通电路到每个限位销。
% m: ?1 w" {3 j' X# W. R3 B/ m1 m4 R9 ? |! B
// #define ENABLE_SOFTWARE_DEBOUNCE // Default disabled. Uncomment to enable.# g9 f. ^- W! K
, \6 B( L: F0 O2 C! o0 z// Force Grbl to check the state of the hard limit switches when the processor detects a pin1 }6 p( e* E0 R1 r9 P$ `* S1 l! z! j; j$ g& P
// change inside the hard limit ISR routine. By default, Grbl will trigger the hard limits
, D: {* l5 l _, h5 ] z. D- m+ ]. X// alarm upon any pin change, since bouncing switches can cause a state check like this to ' r* z* T: u, h- d
// misread the pin. When hard limits are triggered, they should be 100% reliable, which is the
4 n$ x# w: N; f// reason that this option is disabled by default. Only if your system/electronics can guarantee5 J* m& Q! }% j; ]. K) r
// that the switches don't bounce, we recommend enabling this option. This will help prevent5 n. v; I+ W0 ?. d7 a0 s
// triggering a hard limit when the machine disengages from the switch.) _7 c4 g. B1 X% q ?2 O
// NOTE: This option has no effect if SOFTWARE_DEBOUNCE is enabled.: E6 T ^# h. c+ |9 V; Y
//力Grbl检查硬限位开关的状态,当处理器检测到一个销
5 l! `4 B6 B1 s//改变内部硬限制ISR例行公事。默认情况下,Grbl将触发硬限制/ E! L' c+ {: P1 `% P
//报警在任何销更改,因为跳开关可以导致这样的状态检查' l3 W# S8 c' j' ~% X" k& g- F
//误读了销。硬限制触发时,他们应该100%可靠,这是
u, W9 S. \+ w, H//原因,这个选项默认是禁用的。只有在你的系统/电子产品可以保证
v2 h9 Y! `9 h" r3 r+ v T* K//开关不反弹,我们建议启用这个选项。这将有助于防止: _2 `8 R; }7 x, _+ \) H6 Y+ V
//触发机退出时硬限制开关。
/ [$ _9 C# F" G0 p5 ?; A4 |: y//注意:这个选项如果启用了SOFTWARE_DEBOUNCE没有影响。
8 P" v$ n# |, O$ n
5 D/ t, X4 A. J; q5 D& H// #define HARD_LIMIT_FORCE_STATE_CHECK // Default disabled. Uncomment to enable., M2 Q- ~: V" Y
1 K) O+ t! i I" o* V8 R
) F& J% x$ u# d& }' P! b// ---------------------------------------------------------------------------------------
. O4 @- E4 Z b; Z// COMPILE-TIME ERROR CHECKING OF DEFINE VALUES:编译时错误检查的定义值:
$ d- u" I( R( X+ o4 |
$ P2 ?+ F0 n: D/ t#ifndef HOMING_CYCLE_0
# t6 P7 Z' G y' x; W #error "Required HOMING_CYCLE_0 not defined.", ]+ Q) R, @3 {1 l
#endif: G+ b. U9 | Q9 v9 {- w
, J* _1 p3 f2 T6 }#if defined(USE_SPINDLE_DIR_AS_ENABLE_PIN) && !defined(VARIABLE_SPINDLE)
2 L* w; G7 f& B( ?2 I" z1 A y I #error "USE_SPINDLE_DIR_AS_ENABLE_PIN may only be used with VARIABLE_SPINDLE enabled"
' L* f- H/ H3 i/ ~2 o) r- H2 t; D#endif, T7 v% [: k1 n0 _0 }" d
6 ?: I4 r: v3 n3 I# k#if defined(USE_SPINDLE_DIR_AS_ENABLE_PIN) && !defined(CPU_MAP_ATMEGA328P)3 Y! p% [- X. p& _4 x; c t' n0 C2 L
#error "USE_SPINDLE_DIR_AS_ENABLE_PIN may only be used with a 328p processor"* B2 v$ u2 l! s* [3 V
#endif- d2 ^$ o2 @* T( T
1 o" N0 g# N( M' d// ---------------------------------------------------------------------------------------; Y2 L- n% |6 E) r# O0 m# g" \" Y$ x
( V Z) @% u: K7 J7 `; O, N. r7 b7 {+ m
#endif
e" `: Z# y1 u6 |# [5 d6 B5 N0 v" I+ c( w V' _
# c! g/ w/ p/ o; B) M& H. e( r; S: B' `+ Y3 q S3 v* s: |# \" @5 S
, m& }. Q6 m: @6 h1 C. {$ k7 L( c, K O$ k+ D0 A% g
3 R S% Y1 S4 D' t
. }7 M3 r0 R* r$ \6 v0 _+ X2 Q B& L' [1 p
' \: E/ X# V0 \& {' v
+ A1 }8 V* U d, B; s& t
; B# f4 w& {9 h& `) [1 C' ^
$ r8 b7 l6 r. \$ f5 f$ M9 M
' l# y; K( F' D% l7 J
* N% X" Z; t+ d8 F
0 l5 c% k1 w* O
% I6 K% u1 w$ Y& j( u5 p |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
评分
-
查看全部评分
|