Let's try mendel auto bed leveling with a PNP inductive sensor (No.4)

Marlin Firmware の設定
前提条件

Marlin.inoをArduino softwareで開き、Configuration.hファイルを編集。

// This determines the communication speed of the printer
#define BAUDRATE 115200 //<---
// The following define selects which electronics board you have.
// Please choose the name from boards.h that matches your setup
#ifndef MOTHERBOARD
  #define MOTHERBOARD BOARD_RAMPS_13_EFB // <----- RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
#endif
#define TEMP_SENSOR_0 1 // <-----
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
#define TEMP_SENSOR_BED 1 // <-----

もし12Vの電源出力なら、BANG_MAX 255/3をBANG_MAX 255のままでOKかと、、、数字が小さいほど出力も小さいのです。

// PID settings:
// Comment the following line to disable PID and enable bang-bang.
#define PIDTEMP // <-----
#define BANG_MAX 255/3 // limits current to nozzle while in bang-bang mode; 255=full current // <-----

とりあえず、Ultimaker用の設定でもOKでした。

// Ultimaker
    #define  DEFAULT_Kp 22.2 // <-----
    #define  DEFAULT_Ki 1.08 // <-----
    #define  DEFAULT_Kd 114 // <-----
//#define PIDTEMPBED

以下は各自の設定で少しずつ違う。

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

// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. // <-----
const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. // <-----
const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. // <-----
const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Z_MAX_ENDSTOP_INVERTING = false; // 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

// 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
#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled

#define INVERT_X_DIR false    // 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 false     // for Mendel set to false, for Orca set to true // <-----
#define INVERT_E0_DIR false   // 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

// ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN
#define X_HOME_DIR -1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1

#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.

// Travel limits after homing
#define X_MAX_POS 200 // <-----
#define X_MIN_POS 0 // <-----
#define Y_MAX_POS 200 // <-----
#define Y_MIN_POS 0 // <-----
#define Z_MAX_POS 150 // <-----
#define Z_MIN_POS 0 // <-----

#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)

Auto Bed Leveling なんで設定する。

#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.
    // set the rectangle in which to probe
    #define LEFT_PROBE_BED_POSITION 0 // <---- my case, dX>=0なので0でもOK
    #define RIGHT_PROBE_BED_POSITION 150 // <----
    #define BACK_PROBE_BED_POSITION 145 // <----
    #define FRONT_PROBE_BED_POSITION 0 // <----my casae, dY>=0なので0でもOK

前回を参照
あと、ExtruderがdXやdYだけ移動し、そこがX=0,Y=0になるので、プリント面積が減ることがある。X,Yステージの移動幅がHeated Bedの幅よりも十分大きくとれると減らないけど(絵で書くといいのだけど、、、、)。

 // 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 // <-----dX
  #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // <-----
  #define Z_PROBE_OFFSET_FROM_EXTRUDER -0.5 // <-----でもテストプリントで調整したら、-1.1がベストだったので後ほど変更。

どちらでもいいと思います。

//  #define Z_SAFE_HOMING   // This feature is meant to avoid Z homing with probe outside the bed area. // <-----

私のMendelでは、以下の設定。

//// 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*28/20, 57.142*28/20, 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/2,10000/3}    // 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                20.0/2    // (mm/sec)
#define DEFAULT_ZJERK                 0.4     // (mm/sec)
#define DEFAULT_EJERK                 5.0    // (mm/sec)
// Custom M code points
#define CUSTOM_M_CODES
#ifdef CUSTOM_M_CODES
  #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
  #define Z_PROBE_OFFSET_RANGE_MIN -15
  #define Z_PROBE_OFFSET_RANGE_MAX 10 // <-----
#endif

ながながと、しかもわかりにくくてすみません。
最終回Cureの設定につづく。