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