Mendel auto bed leveling with an inductive sensor (No.4) : Marlin setting
auto bed leveling with an inductive sensorのためのMarlin Developmentの設定。
気前よく、プログラムを公開している、The current Marlin dev team consists of:Erik van der Zalm (@ErikZalm), @daid にとても感謝。
環境
- 3dプリンター:RepRap Mendel
- プリンターのマザーボード:Arduino Mega 2560 + RAMPS 1.4
- Extruder:MK7,0.4MMのコピー
- パソコン:Windows 7,
- ファームウェアー:Marlin.
- Auto bed leveling sensor:NPN inductive sensor
before start!
You need to measure dx, dy, dz for this setting. Where dx is the distance between the extruder and the inductive sensor tips along x-axis. And dy is the same but along y-axis. The dz is the distance between the extruder tip and the heated bed when the z endstop is triggered. The other ward, the printer move this dz distance deeper to the heated bed when printing.
Well I hope the following figure make sense to you. It is noted that the direction x or y or both are not important and it is not necessary to match with yours.
My case, dx = 33.5mm, dy = 0mm, dz=0.5mm.
はじまり
Marlinをダウンロードしたら、Configuration.hを開いて,以下の箇所を自分のプリンターに合う数値などに設定し、Arduino Megaに書き込む.以下は一例です。
54行目(大体の目安です)
// This determines the communication speed of the printer #define BAUDRATE 115200 //<---
61行目
#ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_13_EFB //<--- // RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed) #endif
123行目
#define TEMP_SENSOR_0 1 //<--- #define TEMP_SENSOR_1 0 //<--- #define TEMP_SENSOR_2 0 //<--- #define TEMP_SENSOR_BED 1 //<---
148行目
#define HEATER_0_MAXTEMP 260 //<--- #define HEATER_1_MAXTEMP 260 //<--- #define HEATER_2_MAXTEMP 260 //<--- #define BED_MAXTEMP 140 //<---
317行目(うまくいかない場合は、trueをfalseへ)
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. //<---
324行目
#define DISABLE_MAX_ENDSTOPS //<---コメントを外す。 //#define DISABLE_MIN_ENDSTOPS
345行目
#define INVERT_X_DIR true //<--- // for Mendel set to false, for Orca set to true #define INVERT_Y_DIR true //<--- // for Mendel set to true, for Orca set to false #define INVERT_Z_DIR true //<--- // for Mendel set to false, for Orca set to true #define INVERT_E0_DIR true //<--- // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
358行目
#define min_software_endstops false //<--- // If true, axis won't move to coordinates less than HOME_POS. #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below.
361行目
// Travel limits after homing (units are in mm) #define X_MAX_POS 190 //<--- #define X_MIN_POS 0 #define Y_MAX_POS 190 //<--- #define Y_MIN_POS 0 #define Z_MAX_POS 190 //<--- #define Z_MIN_POS 0
378行目
#define ENABLE_AUTO_BED_LEVELING //<--- // Delete the comment to enable (remove // at the start of the line) //#define Z_PROBE_REPEATABILITY_TEST //<---コメントへ。 // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
402行目(私の場合、dx=30, dy=0, dz=0.5なので)
// set the rectangle in which to probe #define LEFT_PROBE_BED_POSITION 10 //<--- can be crosser => 0 #define RIGHT_PROBE_BED_POSITION 145 //<--- 190(heated bed width)-10(margin)-dx => 146.5 #define BACK_PROBE_BED_POSITION 180 //<--- 190(heated bed width)-10(margin)-dy => 180 #define FRONT_PROBE_BED_POSITION 10 //<--- can be crosser => 0
427行目(私の場合、dx=30, dy=0, dz=0.5なので)
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe) // X and Y offsets must be integers #define X_PROBE_OFFSET_FROM_EXTRUDER 33.5 //<--- dx #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 //<--- dy #define Z_PROBE_OFFSET_FROM_EXTRUDER -0.5 //<--- -dz,,,,,,adjust after several print #define Z_RAISE_BEFORE_HOMING 10 //<--- // (in mm) Raise Z before homing (G28) for Probe Clearance. // Be sure you have this distance over your Z_MAX_POS in case #define XY_TRAVEL_SPEED 20*60 //<--- // X and Y axis travel speed between probes, in mm/min #define Z_RAISE_BEFORE_PROBING 5 //<--- //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points
454行目
// #define Z_SAFE_HOMING //<---コメントへ // This feature is meant to avoid Z homing with probe outside the bed area.
505行目 (つぶやき:pulleyは28 teethの方がステップが細かい。)
//// MOVEMENT SETTINGS #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E #define HOMING_FEEDRATE {50/2*60, 50/2*60, 4*60, 0} //<--- // set the homing speeds (mm/min) // default settings #define DEFAULT_AXIS_STEPS_PER_UNIT {57.142, 57.142, 3200/1.25, 100.15} // default steps per unit for Ultimaker #define DEFAULT_MAX_FEEDRATE {500/2, 500/2, 5/2, 25} // (mm/sec) #define DEFAULT_MAX_ACCELERATION {9000/3,9000/3,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/3 // X, Y, Z and E max acceleration in mm/s^2 for printing moves #define DEFAULT_RETRACT_ACCELERATION 3000/3 // X, Y, Z and E max acceleration in mm/s^2 for retracts // 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 EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis // #define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis // The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) #define DEFAULT_XYJERK 15.0 //<---もう少し小さくするかも。 // (mm/sec) #define DEFAULT_ZJERK 0.4 // (mm/sec) #define DEFAULT_EJERK 5.0 // (mm/sec)
788行目(サーボを機能をコメントにする)
//#define NUM_SERVOS 3 //<--- // Servo index starts with 0 for M280 command // 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. // //#define SERVO_ENDSTOPS {-1, -1, 0} //<--- // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 30,110} //<--- // X,Y,Z Axis Extend and Retract angles
468行目(もし、PROBE_OFFSETの設定が変ですよ〜というエラーでてコンパイルできない場合は、以下をコメントする。)
// #if X_PROBE_OFFSET_FROM_EXTRUDER < 0 // #if (-(X_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION)) // #error "The X axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS" // #endif // #else // #if ((X_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION)) // #error "The X axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS" // #endif // #endif // #if Y_PROBE_OFFSET_FROM_EXTRUDER < 0 // #if (-(Y_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION)) // #error "The Y axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS" // #endif // #else // #if ((Y_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION)) // #error "The Y axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS" // #endif // #endif
以上、誤字脱字の心配をよそに、
By the way, I bought a PNP type sensor so I gonna replace the NPN type to it. That case I do not need 12V to the sensor....