Marlin 2.0.x 配置
300x300x360 3D打印机固件与配置
基于固件代码Marlin-2.0.x.zip
环境安装Installing Marlin - VSCode
基本配置
硬件配置
1. 主板类型
#ifndef MOTHERBOARD
#define MOTHERBOARD BOARD_MKS_GEN_L
#endif
2. 挤出头个数
#define EXTRUDERS 1
3. 温度传感器类型
挤出头与热床共两个温度传感器
1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_BED 1
当温度与目标温度相差WINDOW度时开始计时,从此刻开始,温度与目标温度持续接近_RESIDENCY_TIME秒钟,则完成加热。 接近温度为与目标温度相关不超过_HYSTERESIS度。
#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109
#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer
#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target
#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190
#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer
#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target
安全温度区间
#define HEATER_0_MINTEMP5
#define BED_MINTEMP5
#define HEATER_0_MAXTEMP 275
#define BED_MAXTEMP 150
4. 冷挤出温度设置
#define PREVENT_COLD_EXTRUSION
#define EXTRUDE_MINTEMP 170
长度限制
#define PREVENT_LENGTHY_EXTRUDE
#define EXTRUDE_MAXLENGTH 200
5. 限位开关配置
XYZ三个0点限位开关
#define USE_XMIN_PLUG
#define USE_YMIN_PLUG
#define USE_ZMIN_PLUG
上拉电阻限位开关,默认高电平
#define ENDSTOPPULLUPS
限位开关逻辑
#define X_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Y_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Z_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the probe.
6. 步进电机配置
步进电控制器类型 X,Y,Z三轴与挤出机共四个步进电机控制器
#define X_DRIVER_TYPE TMC2208_STANDALONE
#define Y_DRIVER_TYPE TMC2208_STANDALONE
#define Z_DRIVER_TYPE TMC2208_STANDALONE
#define E0_DRIVER_TYPE TMC2208_STANDALONE
轴频数(steps/mm)X, Y, Z, E0 [, E1[, E2…]]
( 360 / 电机步距角 * 细分数 ) / (同步带齿距 * 齿数)
#define DEFAULT_AXIS_STEPS_PER_UNIT{ 80, 80, 400, 92 }
最大进给速度(mm/s)
#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 }
默认最大加速度 (mm/s)
#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 }
默认加速度 (mm/s)
#define DEFAULT_ACCELERATION 1000// X, Y, Z and E acceleration for printing moves
#define DEFAULT_RETRACT_ACCELERATION 1000// E acceleration for retracts
#define DEFAULT_TRAVEL_ACCELERATION1000// X, Y, Z acceleration for travel (non printing) moves
急动设置 (无需加速距离)
#define CLASSIC_JERK
#if ENABLED(CLASSIC_JERK)
#define DEFAULT_XJERK 10.0
#define DEFAULT_YJERK 10.0
#define DEFAULT_ZJERK 0.3
//#define TRAVEL_EXTRA_XYJERK 0.0 // Additional jerk allowance for all travel moves
//#define LIMITED_JERK_EDITING// Limit edit via M205 or LCD to DEFAULT_aJERK * 2
#if ENABLED(LIMITED_JERK_EDITING)
#define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits
#endif
#endif
#define DEFAULT_EJERK5.0 // May be used by Linear Advance
运动方向 因接线不同等原因,需根据实际测试来确定。XYZE共4个步进电机都是。
#define INVERT_X_DIR true
#define INVERT_Y_DIR true
#define INVERT_Z_DIR true
#define INVERT_E0_DIR true
初始(Home)位置 0,0,0(最小值)
#define X_HOME_DIR -1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1
结构配置
1. 机型结构
2. 机型尺寸
#define X_MIN_POS 0
#define Y_MIN_POS 0
#define Z_MIN_POS 0
#define X_MAX_POS X_BED_SIZE
#define Y_MAX_POS Y_BED_SIZE
#define Z_MAX_POS 360
热床尺寸
#define X_BED_SIZE 300
#define Y_BED_SIZE 300
参数配置
1. 串口通讯比特率
#define SERIAL_PORT 0
#define BAUDRATE 250000
2. 原料线径
#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75
3. 复位(Home)速度
#define HOMING_FEEDRATE_XY (50*60)
#define HOMING_FEEDRATE_Z (4*60)
其它
1. 名称标识
#define STRING_CONFIG_H_AUTHOR "wfeii.com"
2. 开启EEPROM配置功能
#define EEPROM_SETTINGS
错误处理
1. echo:EEPROM version mismatch (EEPROM=? Marlin=V82)
我的解决办法是把以下功能打开
#define EEPROM_AUTO_INIT
由系统检测出错误后自动初始化EEPRON,然后这个问题就没有了。 然后可以再把这个功能去掉
2. 打印时散热风扇不转
追查问题发现切片生成的指令(M106 S255 P1)不起作用,而(M106 S255 P0)可以使风扇转 原因接线图中是D9接风扇,而Marlin中MKS_GEN_L定义的是D7口
pins_MKS_GEN_L.h
#define MOSFET_D_PIN 7
两种解决方案,1改线风扇接到D7口,2改代码到D9口。根据主板上的接口类型我选择改线接D7。