TXQDM 发表于 2017-7-8 13:27

GRBL四:GRBL框架解析

                                 GRBL四:GRBL框架解析GRBL0.8版本中有个doc文件夹,下面是关于GRBL大致的框架介绍
1.commands.txt介绍GRBL命令
2.pinmapping.txt介绍GRBL引脚映射
3.resources.txt介绍GRBL用到资源
4.structure.txt介绍GRBL框架
4.1英文如下
The general structure of Grbl
=============================
4.1.1The main processing stack:
http://blog.csdn.net/zhangjikuan/article/details/46697257
http://img.blog.csdn.net/20160108211526823?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

1.'protocol'      : Accepts command lines from the serial port and passes them to 'gcode' for execution.
                  Provides status responses for each command. Also manages run-time commands set by
                  the serial interrupt.
                  接收串口命令传递给gcode执行,给命令提供应答,通过串口中断管理程序命令
                  
2.'gcode'         : Recieves gcode from 'protocol', parses it according to the current state
                  of the parser and issues commands via '..._control' modules
                  从1接收G代码,解析G代码
3.'spindle_control' : Commands for controlling the spindle.
                               主轴控制,雕刻机的主轴带刀的轴,与XYZ无关,M3,4,5有关于主轴正反转停止命令
4.'motion_control': Accepts motion commands from 'gcode' and passes them to the 'planner'. This module
                  represents the public interface of the planner/stepper duo.
                      从2接收运动命令将其传递给5,相当于一个发出命令的高层接口

5.'planner'         : Receives linear motion commands from 'motion_control' and adds them to the plan of
                  prepared motions. It takes care of continuously optimizing the acceleration profile
                  as motions are added.
                  从4接收线性运动的命令,并将其添加到准备运动计划中(计算的数据写入唤醒缓冲区)
                  随着运动不断被添加负责优化计算加速度分布图

6.'stepper'         : Executes the motions by stepping the steppers according to the plan.
                        执行动作,用两个定时器来控制三个轴完成相应的动作

4.1.2Supporting files:


'config.h'      : Compile time user settings
                        一些全局变量的宏定义,例如MINIMUM_STEPS_PER_MINUTE最低每分钟跳动多少下,也就是最低
                        频率就在这里声明的

'settings'      : Maintains the run time settings record in eeprom and makes it available
                  to all modules.
                  全局中主要的参数设置,$$命令打印出来的参数都是这里设置的
                  上电读取EEPROM的值,如果读取失败调用default值,都在这里

'eeprom'          : A library from Atmel that provides methods for reading and writing the eeprom with
                  a small addition from us that read and write binary streams with check sums used
                  to verify validity of the settings record.
                  存放参数的作用,有关于EPROM的读写函数
'nuts_bolts.h'    : A collection of global variable definitions, useful constants, and macros used everywhere
                      一些全局变量的定义

'serial'          : Low level serial communications and picks off run-time commands real-time for asynchronous
                  control.
                  串口控制台

'print'         : Functions to print strings of different formats (using serial)

                   打印不同格式的字符串函数在这里定义的
大致框架如下所示
http://img.blog.csdn.net/20160108211733995?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

页: [1]
查看完整版本: GRBL四:GRBL框架解析