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