Marlin固件全中文解析 联系客服

发布时间 : 星期四 文章Marlin固件全中文解析更新完毕开始阅读90a209cdba1aa8114531d93c

reduce the

// average current. The value should be an integer and the heat bed will be turned on for 1 interval of

// HEATER_BED_DUTY_CYCLE_DIVIDER intervals. //#define HEATER_BED_DUTY_CYCLE_DIVIDER 4

//////////该配置是为了防止热床电阻太小,长时间加热容易烧mos管,增加这个数字,可以防止mos管过热,但加热时间会增长

// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS

//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=I^2/R //#define BED_WATTS (12.0*12.0/1.1) // P=I^2/R

//////////如果你希望用M105命令实时查看挤出机和热床功率,请将这两行取消注释(即去掉代码前的//)

//////////PID温控配置,PID参数设置,需要根据系统情况设置,可以通过 M303 代码调用PID_autotune函数获得基本PID参数,然后参照修改下面的DEFAULT_Kp、DEFAULT_Ki、DEFAULT_Kd,例如:M303 E0 C8 S190,表示获取打印头0(第一个打印头)、目标温度190度、循环调用PID_autotune8次后的相应的PID参数。系统自动生成的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 255 // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current #ifdef PIDTEMP

//#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 PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature

// is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.

#define PID_INTEGRAL_DRIVE_MAX 255 //limit for the integral term #define K1 0.95 //smoothing factor within the PID

#define PID_dT ((OVERSAMPLENR * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine

// 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

// 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 above 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

#ifdef PIDTEMPBED

//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: \cycles.

#endif // PIDTEMPBED

//this prevents dangerous Extruder moves, i.e. if the temperature is under the limit //can be software-disabled for whatever purposes by #define PREVENT_DANGEROUS_EXTRUDE

//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.

#define PREVENT_LENGTHY_EXTRUDE

#define EXTRUDE_MINTEMP 170

//////////该值防止挤出头温度未达到设定目标温度而进行挤出操作时的潜在风险

#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.

//////////该值限制挤出的最大长度,超过该长度,挤出机不动作

//===========================================================================

//=============================Mechanical Settings===========================

//===========================================================================

// Uncomment the following line to enable CoreXY kinematics // #define COREXY

// coarse Endstop Settings

#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors

//////////限位开关上拉电阻配置,如果你使用的是机械式的限位开关,请保留此部分

//////////机械式限位开关请保持该处不动

#ifndef 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 #endif

#ifdef ENDSTOPPULLUPS //////////配置限位开关上拉电阻时,限位开关上拉电阻细分控制

#define ENDSTOPPULLUP_XMAX #define ENDSTOPPULLUP_YMAX #define ENDSTOPPULLUP_ZMAX

#define ENDSTOPPULLUP_XMIN #define ENDSTOPPULLUP_YMIN #define ENDSTOPPULLUP_ZMIN #endif

//////////机械限位开关通常会把连线连在NC端,这就会有个一个数字信号1输入到主板中。如果你的机械限位开关的连线是连在NO端,这就需要ENDSTOP_INVERTING采用ture从而使数字信号0反向变为1。对于光学开关来说,则一般不用进行调整。 你应该在电脑控制软件中实际试验一下限位开关的方向是否与你的预期相符,如果轴运动时触动限位开关就停止则说明,该项设置正常。如果没有停止,则应相应修改该值。注意!!!在做此测试时,应该给各个轴留出足够的运动反应空间。以免损坏机器

// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.

const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.

const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.

const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.

const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.

const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.

const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.

//#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS

// Disable max endstops for compatibility with endstop checking routine #if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS) #define DISABLE_MAX_ENDSTOPS #endif

// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1

#define X_ENABLE_ON 0 #define Y_ENABLE_ON 0 #define Z_ENABLE_ON 0

#define E_ENABLE_ON 0 // For all extruders

//////////通常情况下上面的代码是不改动的,所有轴都是选择false的。然而,如果你的3d打印机z轴有手动调整的部件,可以在#define DISABLE_Z 行改为true ,这样在打印机打印时,可以手动调整z轴

// Disables axis when it's not being used. #define DISABLE_X false #define DISABLE_Y false #define DISABLE_Z false

#define DISABLE_E false // For all extruders