以下关于自动调平功能的解析由MakerLab所做,感谢其无私的分享。
这里只说明与自动调平有关的参数。(Marlin固件)
舵机相关如果你需要舵机来收起、放下调平探针(Z-min限位开关),那么舵机相关的参数是必须要配置的。如果你的板子是Mega Controller(我们的合体板子),将舵机连接在Servos接口,标记30的位置。
还记得上一部分讲到的通过发送命令来获得放下和收起调平探针的角度吗?我的角度分别是:
放下:125度;
收起:42度;
每个人的数据都不太可能一样,一定要用自己的数据,得到这两个数据后,修改固件配置文件的: ============================================================================ // Servo Endstops
//
// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
//自动调平探针安装的哪个轴,-1表示关闭,0标识在此轴上,分别上XYZ,将下面两行代码原有的“//”删除,如下
#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 125,42} // X,Y,Z Axis Extend and Retract angles
//定义xyz三个轴上舵机放下和收起后的角度。将之前获得的角度数据填在Z轴对应的位置,即第5(放下角度)和第6(收起角度)个数据。
==========================================================================
改完上面的参数后,舵机相关的参数就配置完成了。
自动调平功能开启及相关参数上面已经配置好了舵机的相关参数,但是要想实现自动调平,还需要配置下面这段区域的参数: //============================= Bed Auto Leveling ===========================
//是否开启自动调平功能,如果开启,删除前面的//
//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
//下面开始是针对自动调平功能的具体设置
#ifdef ENABLE_AUTO_BED_LEVELING
// these are the positions on the bed to do the probing
//自动调平时的4个位置,为了防止测试时挤出机超出XY轴的范围,可以适当调整下面参数,让这几个参数都靠近打印平台中心位置的坐标
#define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 135
#define BACK_PROBE_BED_POSITION 160
#define FRONT_PROBE_BED_POSITION 20
// these are the offsets to the prob relative to the extruder tip (Hotend - Probe)
//调平传感器与挤出头的坐标偏移,加热头坐标-调平探针坐标,这里的参数可以不调整,因为手动测量这几个数据精确性实在太差,暂时保留之前的默认值即可。下面的参数是我调出来的,大家不要用我的参数。
#define X_PROBE_OFFSET_FROM_EXTRUDER -34
#define Y_PROBE_OFFSET_FROM_EXTRUDER 8
#define Z_PROBE_OFFSET_FROM_EXTRUDER -14.3
#define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance.
// Be sure you have this distance over your Z_MAX_POS in case
//回原点前,z轴升起的距离,放置太低,调平探针无法放下
#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min
//调平时,XY轴的运行速度
#define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point.
//运行到第一个调平点前,Z轴升起的距离
#define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points
//运行到下一个调平点前,Z轴升起的距离
//If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
//The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
// You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile.
//舵机关闭延时,为了防止抖动,建议开启这个功能。否则舵机会抖动。后面的参数保持默认只即可。
#define PROBE_SERVO_DEACTIVATION_DELAY 300
//If you have enabled the Bed Auto Levelling and are using the same Z Probe for Z Homing,
//it is highly recommended you let this Z_SAFE_HOMING enabled!!!
//Z轴安全回零配置。开启后,Z轴回零前,XY必须先回零才可以
#define Z_SAFE_HOMING // This feature is meant to avoid Z homing with probe outside the bed area.
// When defined, it will:
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled
// - If stepper drivers timeout, it will need X and Y homing again before Z homing
// - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
// - Block Z homing only when the probe is outside bed area.
#ifdef Z_SAFE_HOMING
#define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28)
#define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28)
#endif
// with accurate bed leveling, the bed is sampled in a ACCURATE_BED_LEVELING_POINTSxACCURATE_BED_LEVELING_POINTS grid and least squares solution is calculated
// Note: this feature occupies 10'206 byte
#define ACCURATE_BED_LEVELING
#ifdef ACCURATE_BED_LEVELING
// I wouldn't see a reason to go above 3 (=9 probing points on the bed)
#define ACCURATE_BED_LEVELING_POINTS 2
#endif
#endif
==========================================================================
调平相关的固件配置也已经完成,但里面有几个关键参数还需要再次确定,否则得到的数据将不正确,暂时还不需要上传,下面的参数配置后再上传。请参考下一部分。
|