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