很多小伙伴期望对Marlin(马林)固件有更深入的了解,于是我对马林固件的配置文件做了一些中文注释,希望能够和大家一起交流。 整个头文件比较长,大家可以配合config.h,遇到不懂的搜索查看,还是以Marlin-1.1.0-RC7为例。 1、基本信息/*头文件只引入一次的宏定义,这个相信大家都知道*/ #ifndef CONFIGURATION_H #define CONFIGURATION_H
/*这里说如果对文件做了任何增加和删除需要更新下边的版本号,一般只有开发者才会修改,我们还是忽略吧,看看就好了*/ #define CONFIGURATION_H_VERSION 010100
/*下边就是真正的开始了,中间有很多注释说明,我就跳过了,大家有兴趣的可以自己看*/
/*首先是打印机基本信息设置,其实这里一般不用修改,因为是否修改不影响打印机的真正功能,如果想让大家知道打印机估计是谁制作的可以修改这个宏STRING_CONFIG_H_AUTHOR*/ #define STRING_CONFIG_H_AUTHOR "(none, www.log4cpp.com)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2
/*据说修改下边的这个宏可以添加用户自定义的启动图片,我没有研究过,有兴趣的可以自己去研究一下*/ //#define SHOW_CUSTOM_BOOTSCREEN
2、主控配置/*下边到了真正的机器配置部分了,这里小伙伴们一定要仔细了*/
/*使用哪个串口端口和电脑连接,这个不用说了,大家基本上都是0号端口*/ #define SERIAL_PORT 0
/*串口波特率默认是250000,但是我感觉改成115200要稳定一些,而且串口指令发送也不会造成打印的瓶颈,如果你的打印机遇到莫名其妙的无法连接或者无故断链的情况,尝试把这个值改小一些*/ #define BAUDRATE 115200
/*这里是可以通过蓝牙来连接,没有搞过,暂时不理*/ //#define BLUETOOTH
/*Arduino扩展版的型号,这个可以找商家问具体型号,也可以查看boards里的配置来推测自己板子的型号,不过某宝买的基本上都是BOARD_RAMPS_14_EFB*/ #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif
/*如果想给打印机起一个有意思的名字可以该下边的宏,不过我没改觉得没实际意义*/ //#define CUSTOM_MACHINE_NAME "3D Printer"
/*这个是给打印机定义一个唯一的ID,如果你一台电脑同时连多个3D打印机,该这个值就很有意义了,不过那都是壕才有的烦恼,本屌只有一台小破机,所以没有这个烦恼*/ //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
/*打印机有几个挤出机?我只有一个,貌似最多可以支持4个,4个挤出头一定很高端吧。。。。*/ #define EXTRUDERS 1
/*多挤出机相关的配置,我是一个挤出机,下边的几行都是多挤出机相关的配置,没有实践过也不具有发言权,先忽略*/ //#define SINGLENOZZLE
// A dual extruder that uses a single stepper motor // Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) #define SWITCHING_EXTRUDER_SERVO_NR 0 #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 //#define HOTEND_OFFSET_Z {0.0, 0.0} #endif
/** * "Mixing Extruder" * - Adds a new code, M165, to set the current mix factors. * - Extends the stepping routines to move multiple steppers in proportion to the mix. * - Optional support for Repetier Host M163, M164, and virtual extruder. * - This implementation supports only a single extruder. * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation */ //#define MIXING_EXTRUDER #if ENABLED(MIXING_EXTRUDER) #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands #endif
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. //#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis //#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
/*供电模式选择,一般都是ATX接口的*/ // :{1:'ATX',2:'X-Box 360'} #define POWER_SUPPLY 1
/*如果启用下边的宏,Arduino主板启动的时候会关闭12V供电,不懂的还是别启用了*/ //#define PS_DEFAULT_OFF
3、温度相关配置/*温度相关设置*/ // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 /*温度传感器,也就是我们买的那个很小的热敏电阻,热敏电阻的型号非常多,不过对于国内某宝买的小伙伴不要过分纠结,因为无论价格高低基本上买到的都是同一种热敏电阻,大家只需要问商家或者在宝贝的详情页看看热敏电阻的beta值就好了,基本上都是3950,所以这里通过查注释(原版注释太长,我已经删除只保留了60对应的说明)就可以确定3950对应的热敏电阻配置为60,一般应该只有一个加热头和一个热床,所以只把两个配置为60,其余的配置为0*/ #define TEMP_SENSOR_0 60 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_BED 60
/*支持把温度传感器1和0做冗余配置,如果两个传感器温度相差超过下边定义的范围就停止加热,不知道有没有这样玩的小伙伴*/ //#define TEMP_SENSOR_1_AS_REDUNDANT #define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
/*下边的配置保持默认就好了,如果M109命令不返回成功就一直不加热,最多等待10秒*/ #define TEMP_RESIDENCY_TIME 10 // (seconds) #define TEMP_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one #define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early.
/*下边的配置保持默认就好了,如果M190命令不返回成功,热床不加热,最多等待10秒*/ #define TEMP_BED_RESIDENCY_TIME 10 // (seconds) #define TEMP_BED_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one #define TEMP_BED_WINDOW 1 // (degC) Window around target to start the residency timer x degC early.
/*温度低于下边设置的温度,加热设备就禁止了,对于北方温度低的小伙伴要根据自己的室温设置了,我在南方所以可以忽略,前提是你的温度传感器正常并且连线也没问题*/ #define HEATER_0_MINTEMP 5 #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 #define BED_MINTEMP 5
/*与上边相反,这个定义了最高温度,超过了温度就停止加热,同样也需要温度传感器正常,连线也没有问题才有效果*/ #define HEATER_0_MAXTEMP 275 #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150
/*温度相关的PID配置,我感觉使用默认参数就已经很不错了,如果觉得不够好的可以调整一下下边的配置*/ //=========================================================================== //============================= PID Settings ================================ //===========================================================================
// Comment the following line to disable PID and enable bang-bang. #define PIDTEMP #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID
// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker #define DEFAULT_Kp 22.2 #define DEFAULT_Ki 1.08 #define DEFAULT_Kd 114
// MakerGear //#define DEFAULT_Kp 7.0 //#define DEFAULT_Ki 0.1 //#define DEFAULT_Kd 12
// Mendel Parts V9 on 12V //#define DEFAULT_Kp 63.0 //#define DEFAULT_Ki 2.25 //#define DEFAULT_Kd 440
#endif // PIDTEMP
//=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. // If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably // shouldn't use bed PID until someone else verifies your hardware works. // If this is enabled, find your own PID constants below. //#define PIDTEMPBED
//#define BED_LIMIT_SWITCHING
// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option. // all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis) // setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did, // so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED) #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
#if ENABLED(PIDTEMPBED)
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) #define DEFAULT_bedKp 10.00 #define DEFAULT_bedKi .023 #define DEFAULT_bedKd 305.4
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) //from pidautotune //#define DEFAULT_bedKp 97.1 //#define DEFAULT_bedKi 1.41 //#define DEFAULT_bedKd 1675.16
// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. #endif // PIDTEMPBED
4、挤出机配置/*挤出机设置*/ /*启用下边的宏是启用挤出机保护,防止挤出机做一些危险的动作*/ #define PREVENT_DANGEROUS_EXTRUDE #define PREVENT_LENGTHY_EXTRUDE /*挤出机开始挤出的最低温度*/ #define EXTRUDE_MINTEMP 170 /*挤出机一次可以挤出的最大长度*/ #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH)
//=========================================================================== //======================== Thermal Runaway Protection ======================= //===========================================================================
/** 下边这两个宏是用来保护打印机不发生自燃的,例如热敏电阻或者温度传感器失效了或者坏了,打印机就没有办法感知真实的温度,就会一直加热,很容易导致自燃。 */
#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
5、打印机机械设置 /*机器框架设置*/
/*这三个配置是给CoreXY、CoreXZ、CoreYZ机型用的,不用理会*/ //#define COREXY //#define COREXZ //#define COREYZ
/*这个是给东芝的步进电机用的,不知道有什么区别*/ //#define CONFIG_STEPPERS_TOSHIBA
/*限位开关设置*/
/*一般打印机都会为每个轴配一个限位开关,有的每个轴支持两个用来限定每个轴上最大的活动范围,我只用了3个,用来限定打印机归零的位置,最大活动范围通过上位机软件或者后边的行程来配置*/ #define USE_XMIN_PLUG #define USE_YMIN_PLUG #define USE_ZMIN_PLUG //#define USE_XMAX_PLUG //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG
/*限位开关的上拉电阻配置,感觉用上拉电阻要好一些,所以保持默认开启*/ #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors #if DISABLED(ENDSTOPPULLUPS) // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX //#define ENDSTOPPULLUP_XMIN //#define ENDSTOPPULLUP_YMIN //#define ENDSTOPPULLUP_ZMIN //#define ENDSTOPPULLUP_ZMIN_PROBE #endif
/*这个是配置限位开关的触发方式,如果使用COM通过低电平来触发,或者通过电平信号变化来触犯这里配置成fase,其实这个如果不知道怎么配置就烧录进实际的打印机实验一下,看看各个轴碰到了限位开关会不会停止,如果不停止就是有问题,要检查一下*/ // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). #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 endstop.
//=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== /*Z轴探测相关的配置,我的打印机木有这么先进的功能,所以同样跳过*/ // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. // // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. // You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. // // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. //
// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. // For example an inductive probe, or a setup that uses the nozzle to probe. // An inductive probe must be deactivated to go below // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE
// The BLTouch probe emulates a servo probe. //#define BLTOUCH
// Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
// Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // // In the following example the X and Y offsets are both positive: // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // // +-- BACK ---+ // | | // L | (+) P | R <-- probe (20,20) // E | | I // F | (-) N (+) | G <-- nozzle (10,10) // T | | H // | (-) | T // | | // O-- FRONT --+ // (0,0) #define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
// X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // Use double touch for probing //#define PROBE_DOUBLE_TOUCH
// // Allen Key Probe is defined in the Delta example configurations. //
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. // With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. // // *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** // // To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. // Example: To park the head outside the bed area when homing with G28. // // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including // NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. // - Otherwise connect: // - normally-closed switches to GND and D32. // - normally-open switches to 5V and D32. // // Normally-closed switches are advised and are the default. // // The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) // Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the // default pin for all RAMPS-based boards. Some other boards map differently. // To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. // // WARNING: // Setting the wrong pin may have unexpected and potentially disastrous consequences. // Use with caution and do your homework. // //#define Z_MIN_PROBE_ENDSTOP
// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. // The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
// To use a probe you must enable one of the two options above!
// This option disables the use of the Z_MIN_PROBE_PIN // To enable the Z probe pin but disable its use, uncomment the line below. This only affects a // Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP
// Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST
// // Probe Raise options provide clearance for the probe to deploy, stow, and travel. // #define Z_PROBE_DEPLOY_HEIGHT 15 // Raise to make room for the probe to deploy / stow #define Z_PROBE_TRAVEL_HEIGHT 5 // Raise between probing points.
// // For M851 give a range for adjusting the Z probe offset // #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 #define Y_ENABLE_ON 0 #define Z_ENABLE_ON 0 #define E_ENABLE_ON 0 // For all extruders
// Disables axis stepper immediately when it's not being used. // WARNING: When motors turn off there is a chance of losing position accuracy! #define DISABLE_X false #define DISABLE_Y false #define DISABLE_Z false // Warn on display about possibly reduced accuracy //#define DISABLE_REDUCED_ACCURACY_WARNING
/*禁用所有的挤出机,当然是不禁用了*/ #define DISABLE_E false // For all extruders /*禁用不活动的挤出机,这个可以有,反正就一个,配置成什么也都无所谓*/ #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled
/*反转各个轴的方向,如果你的打印机运行的方向与预期的相反,那么你就需要改步进电机的连线或者修改这里的值,无论什么方式,改一个地方就可以了*/ #define INVERT_X_DIR false #define INVERT_Y_DIR true #define INVERT_Z_DIR false
/*如果是齿轮驱动的挤出机配置成false,可是还有什么方式驱动的呢?不理解*/ #define INVERT_E0_DIR false #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false
/*归零时z轴上升的距离,单位是mm,这个是防止喷嘴在归零时碰到热床上的东西,我没有配,貌似有个默认值,归零时z轴自己会上升一段距离*/ //#define Z_HOMING_HEIGHT 4
// ENDSTOP SETTINGS: /*限位开关是限制最大距离还是最小距离(归零的那一边),1是最大距离,-1是最小距离,根据自己的安装方式来设置*/ // :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1
/*如果各个轴的运行距离在打印机的行程之外,是否允许运行,这个当然是不允许了,光轴和丝杆就那么长,再运行也没地方了,设置为true就是不允许超出运行范围*/ #define min_software_endstops true #define max_software_endstops true
/*打印机的行程,根据自己的铝框架尺寸来设置,宁愿小也不要打,太大了会损坏步进电机或者同步带*/ #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 #define X_MAX_POS 165 #define Y_MAX_POS 165 #define Z_MAX_POS 140
/*进料传感器*/ /*我的打印机没这功能,跳过*/ //=========================================================================== //========================= Filament Runout Sensor ========================== //=========================================================================== //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif
/*热床自动找平*/ /*我的打印机没这功能,跳过*/ //=========================================================================== //============================ Mesh Bed Leveling ============================ //===========================================================================
//#define MESH_BED_LEVELING // Enable mesh bed leveling.
#if ENABLED(MESH_BED_LEVELING) #define MESH_INSET 10 // Mesh inset margin on print area #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0.
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
//#define MANUAL_BED_LEVELING // Add display menu option for bed leveling.
#if ENABLED(MANUAL_BED_LEVELING) #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis. #endif // MANUAL_BED_LEVELING
#endif // MESH_BED_LEVELING
//=========================================================================== //============================ Bed Auto Leveling ============================ //===========================================================================
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
// Enable this feature to get detailed logging of G28, G29, M48, etc. // Logging is off by default. Enable this logging feature with 'M111 S32'. // NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
// There are 2 different ways to specify probing locations: // // - "grid" mode // Probe several points in a rectangular grid. // You specify the rectangle and the density of sample points. // This mode is preferred because there are more measurements. // // - "3-point" mode // Probe 3 arbitrary points on the bed (that aren't collinear) // You specify the XY coordinates of all 3 points.
// Enable this to sample the bed in a grid (least squares solution). // Note: this feature generates 10KB extra code size. #define AUTO_BED_LEVELING_GRID
#if ENABLED(AUTO_BED_LEVELING_GRID)
#define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 #define FRONT_PROBE_BED_POSITION 20 #define BACK_PROBE_BED_POSITION 170
#define MIN_PROBE_EDGE 10 // The Z probe minimum square sides can be no smaller than this.
// Set the number of grid points per dimension. // You probably don't need more than 3 (squared=9). #define AUTO_BED_LEVELING_GRID_POINTS 2
#else // !AUTO_BED_LEVELING_GRID
// Arbitrary points to probe. // A simple cross-product is used to estimate the plane of the bed. #define ABL_PROBE_PT_1_X 15 #define ABL_PROBE_PT_1_Y 180 #define ABL_PROBE_PT_2_X 15 #define ABL_PROBE_PT_2_Y 20 #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20
#endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe.
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below!
#endif // AUTO_BED_LEVELING_FEATURE
/*自定义热床的中点坐标*/ //#define BED_CENTER_AT_0_0
/*自定义0点位置*/ //#define MANUAL_X_HOME_POS 0 //#define MANUAL_Y_HOME_POS 0 //#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
/*Z轴归零保护,需要z轴探测传感器支持,防止挤出机超出热床对应的范围*/ //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif
6、步进电机设置 /*打印机归零速度(mm/m)*/ #define HOMING_FEEDRATE_XY (10*60) #define HOMING_FEEDRATE_Z (4*60)
/*各个轴移动相关设置*/ #define DEFAULT_AXIS_STEPS_PER_UNIT {100,100,1600,92.64} // default steps per unit for Ultimaker #define DEFAULT_MAX_FEEDRATE {300, 300, 5, 25} // (mm/sec) #define DEFAULT_MAX_ACCELERATION {1500,1500,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration in mm/s^2 for printing moves #define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) #define DEFAULT_XYJERK 20.0 // (mm/sec) #define DEFAULT_ZJERK 0.4 // (mm/sec) #define DEFAULT_EJERK 5.0 // (mm/sec)
7、附加特性//============================================================================= //============================= Additional Features =========================== //=============================================================================
// @section extras
/*通过arduino的EEPROM保存挤出机设置*/ //#define EEPROM_SETTINGS
#if ENABLED(EEPROM_SETTINGS) // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: #define EEPROM_CHITCHAT // Please keep turned on if you can. #endif
/*如果打印机正在处理命令,允许打印机每2秒发送一个消息给host,告诉host打印机正在忙碌*/ #define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages #define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
/*调试相关*/ //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
/*G20/G21 支持英寸*/ //#define INCH_MODE_SUPPORT
/*M149支持设置时间单位*/ //#define TEMPERATURE_UNITS_SUPPORT
// @section temperature
/*预加热的温度*/ #define PREHEAT_1_TEMP_HOTEND 180 #define PREHEAT_1_TEMP_BED 70 #define PREHEAT_1_FAN_SPEED 100 // Value from 0 to 255
#define PREHEAT_2_TEMP_HOTEND 240 #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255
/*当喷嘴空闲或者收到G27命令,喷嘴在打印机中停靠的位置*/ //#define NOZZLE_PARK_FEATURE
#if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z } #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } #endif
// /*喷嘴清洗相关的配置,不启用,感觉用处不大*/ //#define NOZZLE_CLEAN_FEATURE
#if ENABLED(NOZZLE_CLEAN_FEATURE) // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12
// Specify positions as { X, Y, Z } #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
// Moves the nozzle to the initial position #define NOZZLE_CLEAN_GOBACK #endif
/*打印任务的定时器设置*/ #define PRINTJOB_TIMER_AUTOSTART
/*统计打印机打印的次数*/ //#define PRINTCOUNTER
8、LCD和SD卡设置//============================================================================= //============================= LCD and SD support ============================ //=============================================================================
// @section lcd
/*LCD语言选择*/ #define LCD_LANGUAGE en
/*字符集选择*/ #define DISPLAY_CHARSET_HD44780 JAPANESE
/*LCD的类型*/ //#define ULTRA_LCD // Character based //#define DOGLCD // Full graphics display
/*是否使用SD卡,默认不支持*/ //#define SDSUPPORT
/*SD卡的SPI命令速度*/ //#define SPI_SPEED SPI_HALF_SPEED //#define SPI_SPEED SPI_QUARTER_SPEED //#define SPI_SPEED SPI_EIGHTH_SPEED
/*SD卡数据的CRC校验*/ //#define SD_CHECK_AND_RETRY
/*编码器设置*/ //#define ENCODER_PULSES_PER_STEP 1
/*上一个和下一个菜单切换需要旋转编码器多少个脉冲*/ //#define ENCODER_STEPS_PER_MENU_ITEM 5
/*编码器的选装方向反转*// //#define REVERSE_ENCODER_DIRECTION
/*菜单切换顺序与编码器的选装方向相反*/ //#define REVERSE_MENU_DIRECTION
/*打印机归零时在LED菜单中显示*/ //#define INDIVIDUAL_AXIS_HOMING_MENU
/*是否支持扬声器或者蜂鸣器*/ //#define SPEAKER
/*操作菜单时的提示音*/ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 //#define LCD_FEEDBACK_FREQUENCY_HZ 1000
/*控制器类型,下边的都是控制器相关的设置,这里不再一一介绍,根据自己的需要去配置就可以了*/ //#define ULTIMAKERCONTROLLER
// // ULTIPANEL as seen on Thingiverse. // //#define ULTIPANEL
// // Cartesio UI // //#define CARTESIO_UI
// // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // //#define PANEL_ONE
// // MaKr3d Makr-Panel with graphic controller and SD support. // //#define MAKRPANEL
// // ReprapWorld Graphical LCD // //#define REPRAPWORLD_GRAPHICAL_LCD
// // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD // //#define VIKI2 //#define miniVIKI
// // Adafruit ST7565 Full Graphic Controller. // //#define ELB_FULL_GRAPHIC_CONTROLLER
// // RepRapDiscount Smart Controller. // // Note: Usually sold with a white PCB. // //#define REPRAP_DISCOUNT_SMART_CONTROLLER
// // GADGETS3D G3D LCD/SD Controller // // Note: Usually sold with a blue PCB. // //#define G3D_PANEL
// // RepRapDiscount FULL GRAPHIC Smart Controller // //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
// // MakerLab Mini Panel with graphic // //#define MINIPANEL
// // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // // REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD //#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
// // RigidBot Panel V1.0 // //#define RIGIDBOT_PANEL
// // BQ LCD Smart Controller shipped by // default with the BQ Hephestos 2 and Witbox 2. // //#define BQ_LCD_SMART_CONTROLLER
// // CONTROLLER TYPE: I2C // // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C //
// // Elefu RA Board Control Panel // //#define RA_CONTROL_PANEL
// // Sainsmart YW Robot (LCM1602) LCD Display // //#define LCD_I2C_SAINSMART_YWROBOT
// // Generic LCM1602 LCD adapter // //#define LCM1602
// // PANELOLU2 LCD with status LEDs, // separate encoder and click inputs. // // Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. // // Note: The PANELOLU2 encoder click input can either be directly connected to // a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). // //#define LCD_I2C_PANELOLU2
// // Panucatt VIKI LCD with status LEDs, // integrated click & L/R/U/D buttons, separate encoder inputs. // //#define LCD_I2C_VIKI
// // SSD1306 OLED full graphics generic display // //#define U8GLIB_SSD1306
// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules // //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 #define U8GLIB_SH1106 #endif
// // CONTROLLER TYPE: Shift register panels // // //#define SAV_3DLCD
9、额外特性//============================================================================= //=============================== Extra Features ============================== //=============================================================================
// @section extras
/*增加散热风扇的PWM频率*/ //#define FAST_PWM_FAN
/*使用软件PWM控制风扇,如果速度太慢,增加SOFT_PWM_SCALE的值*/ //#define FAN_SOFT_PWM
/*0~1划分成128个档位控制软件的PWM频率,值越大影响越大,1表示PWM频率翻倍*/ #define SOFT_PWM_SCALE 0
/*通过LED的颜色来标识温度*/ //#define TEMP_STAT_LEDS
// M240 Triggers a camera by emulating a Canon RC-1 Remote //#define PHOTOGRAPH_PIN 23
// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure //#define SF_ARC_FIX
// Support for the BariCUDA Paste Extruder. //#define BARICUDA
//define BlinkM/CyzRgb Support //#define BLINKM
10、舵机/*我的打印机不支持,跳过*/ /*********************************************************************\ * R/C SERVO support * Sponsored by TrinityLabs, Reworked by codexmas **********************************************************************/
// Number of servos // // If you select a configuration below, this will receive a default value and does not need to be set manually // set it manually if you have more servos than extruders and wish to manually control some // leaving it undefined or defining as 0 will disable the servo subsystem // If unsure, leave commented / disabled // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY 300
// Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE
11、打印材料直径传感器/*我的打印机不支持,跳过*/ /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) * Single extruder only at this point (extruder 0) * * Motherboards * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E) * 301 - Rambo - uses Analog input 3 * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable //#define FILAMENT_WIDTH_SENSOR
#define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation
#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel
#define MEASURED_UPPER_LIMIT 3.30 //upper limit factor used for sensor reading validation in mm #define MEASURED_LOWER_LIMIT 1.90 //lower limit factor for sensor reading validation in mm #define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM)
#define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially
//When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec. //#define FILAMENT_LCD_DISPLAY #endif
#endif // CONFIGURATION_H
|