Commit 920a6718 authored by MagoKimbra's avatar MagoKimbra

Change AUTO_BED_LEVELING with AUTO_BED_COMPENSATION

parent a06a7f4d
...@@ -74,7 +74,7 @@ void Config_StoreSettings() ...@@ -74,7 +74,7 @@ void Config_StoreSettings()
EEPROM_WRITE_VAR(i,tower_adj); EEPROM_WRITE_VAR(i,tower_adj);
EEPROM_WRITE_VAR(i,z_probe_offset); EEPROM_WRITE_VAR(i,z_probe_offset);
#endif #endif
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
EEPROM_WRITE_VAR(i,zprobe_zoffset); EEPROM_WRITE_VAR(i,zprobe_zoffset);
#endif #endif
#ifndef ULTIPANEL #ifndef ULTIPANEL
...@@ -239,11 +239,11 @@ void Config_PrintSettings() ...@@ -239,11 +239,11 @@ void Config_PrintSettings()
*/ */
#endif // DELTA #endif // DELTA
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPAIR("Z Probe offset (mm):" ,zprobe_zoffset); SERIAL_ECHOPAIR("Z Probe offset (mm):" ,zprobe_zoffset);
SERIAL_ECHOLN(""); SERIAL_ECHOLN("");
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_COMPENSATION
#ifdef PIDTEMP #ifdef PIDTEMP
SERIAL_ECHO_START; SERIAL_ECHO_START;
...@@ -297,7 +297,7 @@ void Config_RetrieveSettings() ...@@ -297,7 +297,7 @@ void Config_RetrieveSettings()
// Update delta constants for updated delta_radius & tower_adj values // Update delta constants for updated delta_radius & tower_adj values
set_delta_constants(); set_delta_constants();
#endif #endif
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
EEPROM_READ_VAR(i,zprobe_zoffset); EEPROM_READ_VAR(i,zprobe_zoffset);
#endif #endif
#ifndef ULTIPANEL #ifndef ULTIPANEL
...@@ -357,7 +357,7 @@ void Config_ResetDefault() ...@@ -357,7 +357,7 @@ void Config_ResetDefault()
float tmp6[]=DEFAULT_Ki; float tmp6[]=DEFAULT_Ki;
float tmp7[]=DEFAULT_Kd; float tmp7[]=DEFAULT_Kd;
for (short i=0;i<7;i++) for (short i=0;i<NUM_AXIS;i++)
{ {
axis_steps_per_unit[i]=tmp1[i]; axis_steps_per_unit[i]=tmp1[i];
max_feedrate[i]=tmp2[i]; max_feedrate[i]=tmp2[i];
...@@ -404,7 +404,7 @@ void Config_ResetDefault() ...@@ -404,7 +404,7 @@ void Config_ResetDefault()
gumPreheatHPBTemp = GUM_PREHEAT_HPB_TEMP; gumPreheatHPBTemp = GUM_PREHEAT_HPB_TEMP;
gumPreheatFanSpeed = GUM_PREHEAT_FAN_SPEED; gumPreheatFanSpeed = GUM_PREHEAT_FAN_SPEED;
#endif #endif
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER; zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER;
#endif #endif
#ifdef DOGLCD #ifdef DOGLCD
......
...@@ -89,9 +89,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -89,9 +89,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS) #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
//============================= Bed Leveling =========================== //============================= Bed Auto Compensation ===========================
//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable //#define ENABLE_AUTO_BED_COMPENSATION // Delete the comment to enable
//#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable //#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable
// set the rectangle in which to probe in manual or automatic // set the rectangle in which to probe in manual or automatic
...@@ -102,7 +102,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -102,7 +102,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
// There are 2 different ways to pick the X and Y locations to probe: // There are 2 different ways to pick the X and Y locations to probe:
...@@ -116,17 +116,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -116,17 +116,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
// Probe 3 arbitrary points on the bed (that aren't colinear) // Probe 3 arbitrary points on the bed (that aren't colinear)
// You must specify the X & Y coordinates of all 3 points // You must specify the X & Y coordinates of all 3 points
#define AUTO_BED_LEVELING_GRID #define AUTO_BED_COMPENSATION_GRID
// with AUTO_BED_LEVELING_GRID, the bed is sampled in a // with AUTO_BED_COMPENSATION_GRID, the bed is sampled in a
// AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid // AUTO_BED_COMPENSATION_GRID_POINTSxAUTO_BED_COMPENSATION_GRID_POINTS grid
// and least squares solution is calculated // and least squares solution is calculated
// Note: this feature occupies 10'206 byte // Note: this feature occupies 10'206 byte
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_COMPENSATION_GRID
// set the number of grid points per dimension // set the number of grid points per dimension
// I wouldn't see a reason to go above 3 (=9 probing points on the bed) // I wouldn't see a reason to go above 3 (=9 probing points on the bed)
#define AUTO_BED_LEVELING_GRID_POINTS 2 #define AUTO_BED_COMPENSATION_GRID_POINTS 2
#else // not AUTO_BED_LEVELING_GRID #else // not AUTO_BED_COMPENSATION_GRID
// with no grid, just probe 3 arbitrary points. A simple cross-product // with no grid, just probe 3 arbitrary points. A simple cross-product
// is used to esimate the plane of the print bed // is used to esimate the plane of the print bed
...@@ -137,7 +137,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -137,7 +137,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20 #define ABL_PROBE_PT_3_Y 20
#endif // AUTO_BED_LEVELING_GRID #endif // AUTO_BED_COMPENSATION_GRID
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe) // these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
...@@ -178,7 +178,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -178,7 +178,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#endif #endif
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_COMPENSATION
// The position of the homing switches // The position of the homing switches
......
...@@ -94,9 +94,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -94,9 +94,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS) #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
//============================= Bed Leveling =========================== //============================= Bed Auto Compensation ===========================
//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable //#define ENABLE_AUTO_BED_COMPENSATION // Delete the comment to enable
//#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable //#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable
// set the rectangle in which to probe in manual or automatic // set the rectangle in which to probe in manual or automatic
...@@ -107,7 +107,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -107,7 +107,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
// There are 2 different ways to pick the X and Y locations to probe: // There are 2 different ways to pick the X and Y locations to probe:
...@@ -121,17 +121,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -121,17 +121,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
// Probe 3 arbitrary points on the bed (that aren't colinear) // Probe 3 arbitrary points on the bed (that aren't colinear)
// You must specify the X & Y coordinates of all 3 points // You must specify the X & Y coordinates of all 3 points
#define AUTO_BED_LEVELING_GRID #define AUTO_BED_COMPENSATION_GRID
// with AUTO_BED_LEVELING_GRID, the bed is sampled in a // with AUTO_BED_COMPENSATION_GRID, the bed is sampled in a
// AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid // AUTO_BED_COMPENSATION_GRID_POINTSxAUTO_BED_COMPENSATION_GRID_POINTS grid
// and least squares solution is calculated // and least squares solution is calculated
// Note: this feature occupies 10'206 byte // Note: this feature occupies 10'206 byte
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_COMPENSATION_GRID
// set the number of grid points per dimension // set the number of grid points per dimension
// I wouldn't see a reason to go above 3 (=9 probing points on the bed) // I wouldn't see a reason to go above 3 (=9 probing points on the bed)
#define AUTO_BED_LEVELING_GRID_POINTS 2 #define AUTO_BED_COMPENSATION_GRID_POINTS 2
#else // not AUTO_BED_LEVELING_GRID #else // not AUTO_BED_COMPENSATION_GRID
// with no grid, just probe 3 arbitrary points. A simple cross-product // with no grid, just probe 3 arbitrary points. A simple cross-product
// is used to esimate the plane of the print bed // is used to esimate the plane of the print bed
...@@ -142,7 +142,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -142,7 +142,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20 #define ABL_PROBE_PT_3_Y 20
#endif // AUTO_BED_LEVELING_GRID #endif // AUTO_BED_COMPENSATION_GRID
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe) // these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
...@@ -183,7 +183,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -183,7 +183,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#endif #endif
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_COMPENSATION
// The position of the homing switches // The position of the homing switches
......
...@@ -54,23 +54,20 @@ ...@@ -54,23 +54,20 @@
#define ENDSTOPPULLUP_XMIN #define ENDSTOPPULLUP_XMIN
#define ENDSTOPPULLUP_YMIN #define ENDSTOPPULLUP_YMIN
#define ENDSTOPPULLUP_ZMIN #define ENDSTOPPULLUP_ZMIN
#define ENDSTOPPULLUP_EMIN
#endif #endif
// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. // 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 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 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 Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
const bool E_MIN_ENDSTOP_INVERTING = false;// 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 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 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. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
//#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MAX_ENDSTOPS
//#define DISABLE_MIN_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 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
#define X_ENABLE_ON 0 #define X_ENABLE_ON 0
#define Y_ENABLE_ON 0 #define Y_ENABLE_ON 0
...@@ -82,7 +79,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of ...@@ -82,7 +79,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define DISABLE_Y false #define DISABLE_Y false
#define DISABLE_Z false #define DISABLE_Z false
#define DISABLE_E false // For all extruders #define DISABLE_E false // For all extruders
#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled #define DISABLE_INACTIVE_EXTRUDER false //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_X_DIR false // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false #define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false
...@@ -92,10 +89,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of ...@@ -92,10 +89,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define INVERT_E2_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: // ENDSTOP SETTINGS:
// Sets direction of endstop s when homing; 1=MAX, -1=MIN // Sets direction of endstops when homing; 1=MAX, -1=MIN
#define X_HOME_DIR 1 #define X_HOME_DIR 1
#define Y_HOME_DIR 1 #define Y_HOME_DIR 1
#define Z_HOME_DIR -1 #define Z_HOME_DIR -1
#define E_HOME_DIR -1
#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. #define min_software_endstops true // 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. #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below.
...@@ -107,15 +105,27 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of ...@@ -107,15 +105,27 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define Y_MIN_POS 0 #define Y_MIN_POS 0
#define Z_MAX_POS 225 #define Z_MAX_POS 225
#define Z_MIN_POS MANUAL_Z_HOME_POS #define Z_MIN_POS MANUAL_Z_HOME_POS
#define E_MIN_POS 0
#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS) #define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS) #define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS) #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
//============================= 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 //============================= Bed Auto Compensation ===========================
//#define ENABLE_AUTO_BED_COMPENSATION // Delete the comment to enable
//#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable
// set the rectangle in which to probe in manual or automatic
#define LEFT_PROBE_BED_POSITION 20
#define RIGHT_PROBE_BED_POSITION 180
#define BACK_PROBE_BED_POSITION 180
#define FRONT_PROBE_BED_POSITION 20
#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min
#ifdef ENABLE_AUTO_BED_COMPENSATION
// There are 2 different ways to pick the X and Y locations to probe: // There are 2 different ways to pick the X and Y locations to probe:
...@@ -129,25 +139,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of ...@@ -129,25 +139,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
// Probe 3 arbitrary points on the bed (that aren't colinear) // Probe 3 arbitrary points on the bed (that aren't colinear)
// You must specify the X & Y coordinates of all 3 points // You must specify the X & Y coordinates of all 3 points
#define AUTO_BED_LEVELING_GRID #define AUTO_BED_COMPENSATION_GRID
// with AUTO_BED_LEVELING_GRID, the bed is sampled in a // with AUTO_BED_COMPENSATION_GRID, the bed is sampled in a
// AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid // AUTO_BED_COMPENSATION_GRID_POINTSxAUTO_BED_COMPENSATION_GRID_POINTS grid
// and least squares solution is calculated // and least squares solution is calculated
// Note: this feature occupies 10'206 byte // Note: this feature occupies 10'206 byte
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_COMPENSATION_GRID
// set the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 170
#define BACK_PROBE_BED_POSITION 180
#define FRONT_PROBE_BED_POSITION 20
// set the number of grid points per dimension // set the number of grid points per dimension
// I wouldn't see a reason to go above 3 (=9 probing points on the bed) // I wouldn't see a reason to go above 3 (=9 probing points on the bed)
#define AUTO_BED_LEVELING_GRID_POINTS 2 #define AUTO_BED_COMPENSATION_GRID_POINTS 2
#else // not AUTO_BED_LEVELING_GRID #else // not AUTO_BED_COMPENSATION_GRID
// with no grid, just probe 3 arbitrary points. A simple cross-product // with no grid, just probe 3 arbitrary points. A simple cross-product
// is used to esimate the plane of the print bed // is used to esimate the plane of the print bed
...@@ -158,7 +160,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of ...@@ -158,7 +160,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20 #define ABL_PROBE_PT_3_Y 20
#endif // AUTO_BED_LEVELING_GRID #endif // AUTO_BED_COMPENSATION_GRID
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe) // these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
...@@ -169,8 +171,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of ...@@ -169,8 +171,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//#define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance. //#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 // Be sure you have this distance over your Z_MAX_POS in case
#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min
#define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BEFORE_PROBING 15 //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 #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points
...@@ -185,12 +185,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of ...@@ -185,12 +185,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
//it is highly recommended you let this Z_SAFE_HOMING enabled!!! //it is highly recommended you let this Z_SAFE_HOMING enabled!!!
// #define Z_SAFE_HOMING // This feature is meant to avoid Z homing with probe outside the bed area. #define Z_SAFE_HOMING // This feature is meant to avoid Z homing with probe outside the bed area.
// When defined, it will: // When defined, it will:
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled // - 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 // - 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) // - 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. // - Block Z homing only when the probe is outside bed area.
#ifdef Z_SAFE_HOMING #ifdef Z_SAFE_HOMING
...@@ -199,7 +199,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of ...@@ -199,7 +199,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#endif #endif
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_COMPENSATION
// The position of the homing switches // The position of the homing switches
...@@ -238,3 +238,15 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of ...@@ -238,3 +238,15 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define DEFAULT_XYJERK 5 // (mm/sec) #define DEFAULT_XYJERK 5 // (mm/sec)
#define DEFAULT_ZJERK 0.4 // (mm/sec) #define DEFAULT_ZJERK 0.4 // (mm/sec)
#define DEFAULT_EJERK 3 // (mm/sec) #define DEFAULT_EJERK 3 // (mm/sec)
//===========================================================================
//=============================Additional Features===========================
//===========================================================================
// 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 -5
#endif
This diff is collapsed.
...@@ -262,7 +262,7 @@ uint8_t Servo::attach(int pin) ...@@ -262,7 +262,7 @@ uint8_t Servo::attach(int pin)
uint8_t Servo::attach(int pin, int min, int max) uint8_t Servo::attach(int pin, int min, int max)
{ {
if(this->servoIndex < MAX_SERVOS ) { if(this->servoIndex < MAX_SERVOS ) {
#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0) #if defined (ENABLE_AUTO_BED_COMPENSATION) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
if (pin > 0) this->pin = pin; else pin = this->pin; if (pin > 0) this->pin = pin; else pin = this->pin;
#endif #endif
pinMode( pin, OUTPUT) ; // set servo pin to output pinMode( pin, OUTPUT) ; // set servo pin to output
......
...@@ -123,7 +123,7 @@ public: ...@@ -123,7 +123,7 @@ public:
int read(); // returns current pulse width as an angle between 0 and 180 degrees int read(); // returns current pulse width as an angle between 0 and 180 degrees
int readMicroseconds(); // returns current pulse width in microseconds for this servo (was read_us() in first release) int readMicroseconds(); // returns current pulse width in microseconds for this servo (was read_us() in first release)
bool attached(); // return true if this servo is attached, otherwise false bool attached(); // return true if this servo is attached, otherwise false
#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0) #if defined (ENABLE_AUTO_BED_COMPENSATION) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
int pin; // store the hardware pin of the servo int pin; // store the hardware pin of the servo
#endif #endif
private: private:
......
...@@ -76,14 +76,14 @@ float max_e_jerk; ...@@ -76,14 +76,14 @@ float max_e_jerk;
float mintravelfeedrate; float mintravelfeedrate;
unsigned long axis_steps_per_sqr_second[NUM_AXIS]; unsigned long axis_steps_per_sqr_second[NUM_AXIS];
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
// this holds the required transform to compensate for bed level // this holds the required transform to compensate for bed level
matrix_3x3 plan_bed_level_matrix = { matrix_3x3 plan_bed_compensation_matrix = {
1.0, 0.0, 0.0, 1.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 1.0, 0.0, 0.0, 1.0,
}; };
#endif // #ifdef ENABLE_AUTO_BED_LEVELING #endif // #ifdef ENABLE_AUTO_BED_COMPENSATION
// The current position of the tool in absolute steps // The current position of the tool in absolute steps
long position[4]; //rescaled from extern when axis_steps_per_unit are changed by gcode long position[4]; //rescaled from extern when axis_steps_per_unit are changed by gcode
...@@ -543,11 +543,11 @@ float junction_deviation = 0.1; ...@@ -543,11 +543,11 @@ float junction_deviation = 0.1;
// Add a new linear movement to the buffer. steps_x, _y and _z is the absolute position in // Add a new linear movement to the buffer. steps_x, _y and _z is the absolute position in
// mm. Microseconds specify how many microseconds the move should take to perform. To aid acceleration // mm. Microseconds specify how many microseconds the move should take to perform. To aid acceleration
// calculation the caller must also provide the physical length of the line in millimeters. // calculation the caller must also provide the physical length of the line in millimeters.
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const uint8_t &extruder, const uint8_t &driver) void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const uint8_t &extruder, const uint8_t &driver)
#else #else
void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder, const uint8_t &driver) void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder, const uint8_t &driver)
#endif //ENABLE_AUTO_BED_LEVELING #endif //ENABLE_AUTO_BED_COMPENSATION
{ {
// Calculate the buffer head after we push this byte // Calculate the buffer head after we push this byte
int next_buffer_head = next_block_index(block_buffer_head); int next_buffer_head = next_block_index(block_buffer_head);
...@@ -561,9 +561,9 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa ...@@ -561,9 +561,9 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
lcd_update(); lcd_update();
} }
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
apply_rotation_xyz(plan_bed_level_matrix, x, y, z); apply_rotation_xyz(plan_bed_compensation_matrix, x, y, z);
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_COMPENSATION
// The target position of the tool in absolute steps // The target position of the tool in absolute steps
// Calculate target position in absolute steps // Calculate target position in absolute steps
...@@ -1082,29 +1082,29 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi ...@@ -1082,29 +1082,29 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
st_wake_up(); st_wake_up();
} }
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
vector_3 plan_get_position() { vector_3 plan_get_position() {
vector_3 position = vector_3(st_get_position_mm(X_AXIS), st_get_position_mm(Y_AXIS), st_get_position_mm(Z_AXIS)); vector_3 position = vector_3(st_get_position_mm(X_AXIS), st_get_position_mm(Y_AXIS), st_get_position_mm(Z_AXIS));
//position.debug("in plan_get position"); //position.debug("in plan_get position");
//plan_bed_level_matrix.debug("in plan_get bed_level"); //plan_bed_compensation_matrix.debug("in plan_get bed_level");
matrix_3x3 inverse = matrix_3x3::transpose(plan_bed_level_matrix); matrix_3x3 inverse = matrix_3x3::transpose(plan_bed_compensation_matrix);
//inverse.debug("in plan_get inverse"); //inverse.debug("in plan_get inverse");
position.apply_rotation(inverse); position.apply_rotation(inverse);
//position.debug("after rotation"); //position.debug("after rotation");
return position; return position;
} }
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_COMPENSATION
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
void plan_set_position(float x, float y, float z, const float &e) void plan_set_position(float x, float y, float z, const float &e)
{ {
apply_rotation_xyz(plan_bed_level_matrix, x, y, z); apply_rotation_xyz(plan_bed_compensation_matrix, x, y, z);
#else #else
void plan_set_position(const float &x, const float &y, const float &z, const float &e) void plan_set_position(const float &x, const float &y, const float &z, const float &e)
{ {
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_COMPENSATION
position[X_AXIS] = lround(x*axis_steps_per_unit[X_AXIS]); position[X_AXIS] = lround(x*axis_steps_per_unit[X_AXIS]);
position[Y_AXIS] = lround(y*axis_steps_per_unit[Y_AXIS]); position[Y_AXIS] = lround(y*axis_steps_per_unit[Y_AXIS]);
......
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
#include "Marlin.h" #include "Marlin.h"
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
#include "vector_3.h" #include "vector_3.h"
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_COMPENSATION
// This struct is used when buffering the setup for each linear movement "nominal" values are as specified in // This struct is used when buffering the setup for each linear movement "nominal" values are as specified in
// the source g-code and may never actually be reached if acceleration management is active. // the source g-code and may never actually be reached if acceleration management is active.
...@@ -75,10 +75,10 @@ typedef struct { ...@@ -75,10 +75,10 @@ typedef struct {
} }
block_t; block_t;
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
// this holds the required transform to compensate for bed level // this holds the required transform to compensate for bed level
extern matrix_3x3 plan_bed_level_matrix; extern matrix_3x3 plan_bed_compensation_matrix;
#endif // #ifdef ENABLE_AUTO_BED_LEVELING #endif // #ifdef ENABLE_AUTO_BED_COMPENSATION
// Initialize the motion plan subsystem // Initialize the motion plan subsystem
void plan_init(); void plan_init();
...@@ -86,21 +86,21 @@ void plan_init(); ...@@ -86,21 +86,21 @@ void plan_init();
// Add a new linear movement to the buffer. x, y and z is the signed, absolute target position in // Add a new linear movement to the buffer. x, y and z is the signed, absolute target position in
// millimaters. Feed rate specifies the speed of the motion. // millimaters. Feed rate specifies the speed of the motion.
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const uint8_t &extruder, const uint8_t &driver); void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const uint8_t &extruder, const uint8_t &driver);
// Get the position applying the bed level matrix if enabled // Get the position applying the bed level matrix if enabled
vector_3 plan_get_position(); vector_3 plan_get_position();
#else #else
void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder, const uint8_t &driver); void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder, const uint8_t &driver);
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_COMPENSATION
// Set position. Used for G92 instructions. // Set position. Used for G92 instructions.
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
void plan_set_position(float x, float y, float z, const float &e); void plan_set_position(float x, float y, float z, const float &e);
#else #else
void plan_set_position(const float &x, const float &y, const float &z, const float &e); void plan_set_position(const float &x, const float &y, const float &z, const float &e);
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_COMPENSATION
void plan_set_e_position(const float &e); void plan_set_e_position(const float &e);
......
#include "qr_solve.h" #include "qr_solve.h"
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_COMPENSATION_GRID
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
......
#include "Configuration.h" #include "Configuration.h"
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_COMPENSATION_GRID
void daxpy ( int n, double da, double dx[], int incx, double dy[], int incy ); void daxpy ( int n, double da, double dx[], int incx, double dy[], int incy );
double ddot ( int n, double dx[], int incx, double dy[], int incy ); double ddot ( int n, double dx[], int incx, double dy[], int incy );
......
...@@ -1180,13 +1180,13 @@ long st_get_position(uint8_t axis) ...@@ -1180,13 +1180,13 @@ long st_get_position(uint8_t axis)
return count_pos; return count_pos;
} }
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
float st_get_position_mm(uint8_t axis) float st_get_position_mm(uint8_t axis)
{ {
float steper_position_in_steps = st_get_position(axis); float steper_position_in_steps = st_get_position(axis);
return steper_position_in_steps / axis_steps_per_unit[axis]; return steper_position_in_steps / axis_steps_per_unit[axis];
} }
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_COMPENSATION
void finishAndDisableSteppers() void finishAndDisableSteppers()
{ {
......
...@@ -65,10 +65,10 @@ void st_set_e_position(const long &e); ...@@ -65,10 +65,10 @@ void st_set_e_position(const long &e);
// Get current position in steps // Get current position in steps
long st_get_position(uint8_t axis); long st_get_position(uint8_t axis);
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
// Get current position in mm // Get current position in mm
float st_get_position_mm(uint8_t axis); float st_get_position_mm(uint8_t axis);
#endif //ENABLE_AUTO_BED_LEVELING #endif //ENABLE_AUTO_BED_COMPENSATION
// The stepper subsystem goes to sleep when it runs out of things to execute. Call this // The stepper subsystem goes to sleep when it runs out of things to execute. Call this
// to notify the subsystem that it is time to go to work. // to notify the subsystem that it is time to go to work.
......
...@@ -1107,7 +1107,7 @@ static void lcd_control_motion_menu() ...@@ -1107,7 +1107,7 @@ static void lcd_control_motion_menu()
{ {
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, 0.5, 50); MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, 0.5, 50);
#endif #endif
MENU_ITEM_EDIT(float5, MSG_ACC, &acceleration, 500, 99000); MENU_ITEM_EDIT(float5, MSG_ACC, &acceleration, 500, 99000);
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <math.h> #include <math.h>
#include "Marlin.h" #include "Marlin.h"
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
#include "vector_3.h" #include "vector_3.h"
vector_3::vector_3() : x(0), y(0), z(0) { } vector_3::vector_3() : x(0), y(0), z(0) { }
...@@ -163,5 +163,5 @@ void matrix_3x3::debug(char* title) ...@@ -163,5 +163,5 @@ void matrix_3x3::debug(char* title)
} }
} }
#endif // #ifdef ENABLE_AUTO_BED_LEVELING #endif // #ifdef ENABLE_AUTO_BED_COMPENSATION
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef VECTOR_3_H #ifndef VECTOR_3_H
#define VECTOR_3_H #define VECTOR_3_H
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_COMPENSATION
class matrix_3x3; class matrix_3x3;
struct vector_3 struct vector_3
...@@ -57,6 +57,6 @@ struct matrix_3x3 ...@@ -57,6 +57,6 @@ struct matrix_3x3
void apply_rotation_xyz(matrix_3x3 rotationMatrix, float &x, float& y, float& z); void apply_rotation_xyz(matrix_3x3 rotationMatrix, float &x, float& y, float& z);
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_COMPENSATION
#endif // VECTOR_3_H #endif // VECTOR_3_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment