如何干扰有线网??室友半夜不睡觉等着猝死啊打游戏,说了不好使,本人会一些单片机技术,电气工程专业。如何能干扰

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

我要回帖

更多关于 半夜不睡觉等着猝死啊 的文章

 

随机推荐