3D打印-控制系统简介

Marlin是一款开源3D打印控制系统固件,支持多种3D打印机。其核心功能包括驱动控制板、执行Gcode命令、控制步进电机及温度等。Marlin通过一系列配置文件和源代码实现对3D打印机的精确控制。

Marlin——开源固件,3D打印控制系统。本质是一个Gcode代码解释器,接收来自上位机的控制命令或者读取存储卡中的gcode文件。把程序(固件)烧录到主板,这块主板就相当于微型电脑一般,而控制系统就相当于操作系统(这是我以前接触这块的理解)。研究Marlin代码,我觉得最好是有一些电子方面的知识,容易理解(可惜我这方面知识很薄弱,只是略懂皮毛)。

控制系统,顾名思义,主要是用于控制主板各种行为。

1.驱动控制板;

2.执行队列中的命令;

3.控制步进电机;

4.温度控制和侦测(挤出头和热床的温度);

5.读写SD卡;

6.控制显示屏(LCD或触摸屏)

Configuration.h:主要是一些定义,如波特率,打印行程, 限位开关,PID等。ultralcd.h和ultralcd.cpp:显示屏界面。watchdog.h和watchdog.cpp:看门狗。

Marlin_main.cpp:setup()函数用于初始化工作。

/*
 * Marlin entry-point: Set up before the program loop
 *  - Set up the kill pin, filament runout, power hold
 *  - Start the serial port
 *  - Print startup messages and diagnostics
 *  - Get EEPROM or default settings
 *  - Initialize managers for:
 *     temperature
 *     planner
 *     watchdog
 *     stepper
 *     photo pin
 *     servos
 *     LCD controller
 *     Digipot I2C
 *     Z probe sled
 *     status LEDs
 */

             loop()函数:重复执行。

/**
 * The main Marlin program loop
 *
 *  - Save or log commands to SD
 *  - Process available commands (if not saving)
 *  - Call heater manager
 *  - Call inactivity manager
 *  - Call endstop manager
 *  - Call LCD update
 */

相关指令:

/* "G" Codes
 *
 * G0  -> G1
 * G1  - Coordinated Movement X Y Z E
 * G2  - CW ARC
 * G3  - CCW ARC
 * G4  - Dwell S<seconds> or P<milliseconds>
 * G5  - Cubic B-spline with XYZE destination and IJPQ offsets
 * G10 - Retract filament according to settings of M207
 * G11 - Retract recover filament according to settings of M208
 * G12 - Clean tool
 * G20 - Set input units to inches
 * G21 - Set input units to millimeters
 * G28 - Home one or more axes
 * G29 - Detailed Z probe, probes the bed at 3 or more points.  Will fail if you haven't homed yet.
 * G30 - Single Z probe, probes bed at X Y location (defaults to current XY location)
 * G31 - Dock sled (Z_PROBE_SLED only)
 * G32 - Undock sled (Z_PROBE_SLED only)
 * G38 - Probe target - similar to G28 except it uses the Z_MIN endstop for all three axes
 * G90 - Use Absolute Coordinates
 * G91 - Use Relative Coordinates
 * G92 - Set current position to coordinates given
 *
 * "M" Codes
 *
 * M0   - Unconditional stop - Wait for user to press a button on the LCD (Only i
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值