Commit a7195a1f authored by MagoKimbra's avatar MagoKimbra

Update

parent 604d6aa9
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
* M400 - Finish all moves * M400 - Finish all moves
* M401 - Lower z-probe if present * M401 - Lower z-probe if present
* M402 - Raise z-probe if present * M402 - Raise z-probe if present
* M404 - N[dia in mm] Enter the nominal filament width (3mm, 1.75mm) or will display nominal filament width without parameters * M404 - D[dia in mm] Enter the nominal filament width (3mm, 1.75mm) or will display nominal filament width without parameters
* M405 - Turn on Filament Sensor extrusion control. Optional D[delay in cm] to set delay in centimeters between sensor and extruder * M405 - Turn on Filament Sensor extrusion control. Optional D[delay in cm] to set delay in centimeters between sensor and extruder
* M406 - Turn off Filament Sensor extrusion control * M406 - Turn off Filament Sensor extrusion control
* M407 - Displays measured filament diameter * M407 - Displays measured filament diameter
......
...@@ -89,8 +89,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -89,8 +89,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
// set the rectangle in which to probe in manual or automatic // set the rectangle in which to probe in manual or automatic
#define LEFT_PROBE_BED_POSITION 20 #define LEFT_PROBE_BED_POSITION 20
#define RIGHT_PROBE_BED_POSITION 180 #define RIGHT_PROBE_BED_POSITION 180
#define BACK_PROBE_BED_POSITION 180
#define FRONT_PROBE_BED_POSITION 20 #define FRONT_PROBE_BED_POSITION 20
#define BACK_PROBE_BED_POSITION 180
#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
...@@ -106,33 +106,27 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -106,33 +106,27 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
//#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable //#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_LEVELING
// There are 2 different ways to pick the X and Y locations to probe:
// - "grid" mode
// Probe every point in a rectangular grid
// You must specify the rectangle, and the density of sample points
// This mode is preferred because there are more measurements.
// It used to be called ACCURATE_BED_LEVELING but "grid" is more descriptive
// - "3-point" mode
// Probe 3 arbitrary points on the bed (that aren't colinear)
// You must specify the X & Y coordinates of all 3 points
// There are 2 different ways to specify probing locations
//
// - "grid" mode
// Probe several points in a rectangular grid.
// You specify the rectangle and the density of sample points.
// This mode is preferred because there are more measurements.
//
// - "3-point" mode
// Probe 3 arbitrary points on the bed (that aren't colinear)
// You specify the XY coordinates of all 3 points.
// Enable this to sample the bed in a grid (least squares solution)
// Note: this feature generates 10KB extra code size
#define AUTO_BED_LEVELING_GRID #define AUTO_BED_LEVELING_GRID
// with AUTO_BED_LEVELING_GRID, the bed is sampled in a
// AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid
// and least squares solution is calculated
// Note: this feature occupies 10'206 byte
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// set the number of grid points per dimension
// 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_LEVELING_GRID_POINTS 2
#else // not AUTO_BED_LEVELING_GRID #else // not AUTO_BED_LEVELING_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 estimate the plane of the print bed // is used to estimate the plane of the print bed
#define ABL_PROBE_PT_1_X 15 #define ABL_PROBE_PT_1_X 15
#define ABL_PROBE_PT_1_Y 180 #define ABL_PROBE_PT_1_Y 180
#define ABL_PROBE_PT_2_X 15 #define ABL_PROBE_PT_2_X 15
...@@ -141,47 +135,27 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -141,47 +135,27 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define ABL_PROBE_PT_3_Y 20 #define ABL_PROBE_PT_3_Y 20
#endif // AUTO_BED_LEVELING_GRID #endif // AUTO_BED_LEVELING_GRID
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe) // Offsets to the probe relative to the extruder tip (Hotend - Probe)
// X and Y offsets must be integers // X and Y offsets must be integers
#define X_PROBE_OFFSET_FROM_EXTRUDER 0 #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // -left +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // -front +behind
#define Z_PROBE_OFFSET_FROM_EXTRUDER -1 #define Z_PROBE_OFFSET_FROM_EXTRUDER -1 // -below (always!)
#define Z_RAISE_BEFORE_HOMING 10 // (in mm) Raise Z before homing (G28) for Probe Clearance. #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 // Be sure you have this distance over your Z_MAX_POS in case
#define Z_RAISE_BEFORE_PROBING 10 //How much the extruder will be raised before travelling to the first probing point. #define Z_RAISE_BEFORE_PROBING 10 //How much the extruder will be raised before travelling to the first probing point.
#define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when travelling from between next probing points #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when travelling from between next probing points
//#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
//#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pick up the sled. 0 should be fine but you can push it further if you'd like. //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pick up the sled. 0 should be fine but you can push it further if you'd like.
//If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk //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. //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. //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 //#define PROBE_SERVO_DEACTIVATION_DELAY 300
#ifdef AUTO_BED_LEVELING_GRID // Check if Probe_Offset * Grid Points is greater than Probing Range
#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
#endif
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_LEVELING
......
...@@ -89,8 +89,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -89,8 +89,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
// set the rectangle in which to probe in manual or automatic // set the rectangle in which to probe in manual or automatic
#define LEFT_PROBE_BED_POSITION 20 #define LEFT_PROBE_BED_POSITION 20
#define RIGHT_PROBE_BED_POSITION 180 #define RIGHT_PROBE_BED_POSITION 180
#define BACK_PROBE_BED_POSITION 180
#define FRONT_PROBE_BED_POSITION 20 #define FRONT_PROBE_BED_POSITION 20
#define BACK_PROBE_BED_POSITION 180
#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
...@@ -106,33 +106,27 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -106,33 +106,27 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
//#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable //#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_LEVELING
// There are 2 different ways to pick the X and Y locations to probe:
// - "grid" mode
// Probe every point in a rectangular grid
// You must specify the rectangle, and the density of sample points
// This mode is preferred because there are more measurements.
// It used to be called ACCURATE_BED_LEVELING but "grid" is more descriptive
// - "3-point" mode
// Probe 3 arbitrary points on the bed (that aren't colinear)
// You must specify the X & Y coordinates of all 3 points
// There are 2 different ways to specify probing locations
//
// - "grid" mode
// Probe several points in a rectangular grid.
// You specify the rectangle and the density of sample points.
// This mode is preferred because there are more measurements.
//
// - "3-point" mode
// Probe 3 arbitrary points on the bed (that aren't colinear)
// You specify the XY coordinates of all 3 points.
// Enable this to sample the bed in a grid (least squares solution)
// Note: this feature generates 10KB extra code size
#define AUTO_BED_LEVELING_GRID #define AUTO_BED_LEVELING_GRID
// with AUTO_BED_LEVELING_GRID, the bed is sampled in a
// AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid
// and least squares solution is calculated
// Note: this feature occupies 10'206 byte
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// set the number of grid points per dimension
// 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_LEVELING_GRID_POINTS 2
#else // not AUTO_BED_LEVELING_GRID #else // not AUTO_BED_LEVELING_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 estimate the plane of the print bed // is used to estimate the plane of the print bed
#define ABL_PROBE_PT_1_X 15 #define ABL_PROBE_PT_1_X 15
#define ABL_PROBE_PT_1_Y 180 #define ABL_PROBE_PT_1_Y 180
#define ABL_PROBE_PT_2_X 15 #define ABL_PROBE_PT_2_X 15
...@@ -141,52 +135,27 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -141,52 +135,27 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define ABL_PROBE_PT_3_Y 20 #define ABL_PROBE_PT_3_Y 20
#endif // AUTO_BED_LEVELING_GRID #endif // AUTO_BED_LEVELING_GRID
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe) // Offsets to the probe relative to the extruder tip (Hotend - Probe)
// X and Y offsets must be integers // X and Y offsets must be integers
#define X_PROBE_OFFSET_FROM_EXTRUDER 0 #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // -left +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // -front +behind
#define Z_PROBE_OFFSET_FROM_EXTRUDER -1 #define Z_PROBE_OFFSET_FROM_EXTRUDER -1 // -below (always!)
#define Z_RAISE_BEFORE_HOMING 10 // (in mm) Raise Z before homing (G28) for Probe Clearance. #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 // Be sure you have this distance over your Z_MAX_POS in case
#define Z_RAISE_BEFORE_PROBING 10 //How much the extruder will be raised before travelling to the first probing point. #define Z_RAISE_BEFORE_PROBING 10 //How much the extruder will be raised before travelling to the first probing point.
#define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when travelling from between next probing points #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when travelling from between next probing points
//#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
//#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pick up the sled. 0 should be fine but you can push it further if you'd like. //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pick up the sled. 0 should be fine but you can push it further if you'd like.
//If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk //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. //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. //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 //#define PROBE_SERVO_DEACTIVATION_DELAY 300
#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
#ifdef AUTO_BED_LEVELING_GRID // Check if Probe_Offset * Grid Points is greater than Probing Range
#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
#endif
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_LEVELING
...@@ -209,19 +178,19 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -209,19 +178,19 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define DEFAULT_RETRACTION_MAX_FEEDRATE {110,110,110,110} // E0, E1, E2, E3 (mm/sec) #define DEFAULT_RETRACTION_MAX_FEEDRATE {110,110,110,110} // E0, E1, E2, E3 (mm/sec)
#define DEFAULT_MAX_ACCELERATION {3000,3000,50,1000,1000,1000,1000} // X, Y, Z, E0, E1, E2, E3 maximum start speed for accelerated moves. #define DEFAULT_MAX_ACCELERATION {3000,3000,50,1000,1000,1000,1000} // X, Y, Z, E0, E1, E2, E3 maximum start speed for accelerated moves.
#define DEFAULT_ACCELERATION 2500 // X, Y, Z and E max acceleration in mm/s^2 for printing moves #define DEFAULT_ACCELERATION 2500 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
#define DEFAULT_RETRACT_ACCELERATION 10000 // E max acceleration in mm/s^2 for retracts #define DEFAULT_RETRACT_ACCELERATION 10000 // 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). // 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). // 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. // 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 HOTEND_OFFSET_X {0.0, 5.00, 0.0, 0.0} // (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 //#define HOTEND_OFFSET_Y {0.0, 5.00, 0.0, 0.0} // (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) // The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
#define DEFAULT_XYJERK 10.0 // (mm/sec) #define DEFAULT_XYJERK 10.0 // (mm/sec)
#define DEFAULT_ZJERK 0.4 // (mm/sec) #define DEFAULT_ZJERK 0.4 // (mm/sec)
#define DEFAULT_EJERK 5.0 // (mm/sec) #define DEFAULT_EJERK 5.0 // (mm/sec)
//=========================================================================== //===========================================================================
//=============================Additional Features=========================== //=============================Additional Features===========================
......
...@@ -113,8 +113,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the lo ...@@ -113,8 +113,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the lo
// set the rectangle in which to probe in manual or automatic // set the rectangle in which to probe in manual or automatic
#define LEFT_PROBE_BED_POSITION 20 #define LEFT_PROBE_BED_POSITION 20
#define RIGHT_PROBE_BED_POSITION 180 #define RIGHT_PROBE_BED_POSITION 180
#define BACK_PROBE_BED_POSITION 180
#define FRONT_PROBE_BED_POSITION 20 #define FRONT_PROBE_BED_POSITION 20
#define BACK_PROBE_BED_POSITION 180
#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
...@@ -130,33 +130,27 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the lo ...@@ -130,33 +130,27 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the lo
//#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable //#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_LEVELING
// There are 2 different ways to pick the X and Y locations to probe:
// - "grid" mode
// Probe every point in a rectangular grid
// You must specify the rectangle, and the density of sample points
// This mode is preferred because there are more measurements.
// It used to be called ACCURATE_BED_LEVELING but "grid" is more descriptive
// - "3-point" mode
// Probe 3 arbitrary points on the bed (that aren't colinear)
// You must specify the X & Y coordinates of all 3 points
// There are 2 different ways to specify probing locations
//
// - "grid" mode
// Probe several points in a rectangular grid.
// You specify the rectangle and the density of sample points.
// This mode is preferred because there are more measurements.
//
// - "3-point" mode
// Probe 3 arbitrary points on the bed (that aren't colinear)
// You specify the XY coordinates of all 3 points.
// Enable this to sample the bed in a grid (least squares solution)
// Note: this feature generates 10KB extra code size
#define AUTO_BED_LEVELING_GRID #define AUTO_BED_LEVELING_GRID
// with AUTO_BED_LEVELING_GRID, the bed is sampled in a
// AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid
// and least squares solution is calculated
// Note: this feature occupies 10'206 byte
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// set the number of grid points per dimension
// 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_LEVELING_GRID_POINTS 2
#else // not AUTO_BED_LEVELING_GRID #else // not AUTO_BED_LEVELING_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 estimate the plane of the print bed // is used to estimate the plane of the print bed
#define ABL_PROBE_PT_1_X 15 #define ABL_PROBE_PT_1_X 15
#define ABL_PROBE_PT_1_Y 180 #define ABL_PROBE_PT_1_Y 180
#define ABL_PROBE_PT_2_X 15 #define ABL_PROBE_PT_2_X 15
...@@ -165,47 +159,27 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the lo ...@@ -165,47 +159,27 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define ABL_PROBE_PT_3_Y 20 #define ABL_PROBE_PT_3_Y 20
#endif // AUTO_BED_LEVELING_GRID #endif // AUTO_BED_LEVELING_GRID
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe) // Offsets to the probe relative to the extruder tip (Hotend - Probe)
// X and Y offsets must be integers // X and Y offsets must be integers
#define X_PROBE_OFFSET_FROM_EXTRUDER 0 #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // -left +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // -front +behind
#define Z_PROBE_OFFSET_FROM_EXTRUDER -1 #define Z_PROBE_OFFSET_FROM_EXTRUDER -1 // -below (always!)
#define Z_RAISE_BEFORE_HOMING 10 // (in mm) Raise Z before homing (G28) for Probe Clearance. #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 // Be sure you have this distance over your Z_MAX_POS in case
#define Z_RAISE_BEFORE_PROBING 10 //How much the extruder will be raised before travelling to the first probing point. #define Z_RAISE_BEFORE_PROBING 10 //How much the extruder will be raised before travelling to the first probing point.
#define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when travelling from between next probing points #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when travelling from between next probing points
//#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
//#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pick up the sled. 0 should be fine but you can push it further if you'd like. //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pick up the sled. 0 should be fine but you can push it further if you'd like.
//If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk //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. //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. //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 //#define PROBE_SERVO_DEACTIVATION_DELAY 300
#ifdef AUTO_BED_LEVELING_GRID // Check if Probe_Offset * Grid Points is greater than Probing Range
#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
#endif
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_LEVELING
...@@ -235,8 +209,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the lo ...@@ -235,8 +209,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the lo
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // 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). // 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. // 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 HOTEND_OFFSET_X {0.0, 5.00, 0.0, 0.0} // (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 //#define HOTEND_OFFSET_Y {0.0, 5.00, 0.0, 0.0} // (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) // The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
#define DEFAULT_XYJERK 5 // (mm/sec) #define DEFAULT_XYJERK 5 // (mm/sec)
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#endif #endif
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_LEVELING
#define SERVO_LEVELING defined(ENABLE_AUTO_BED_LEVELING) && PROBE_SERVO_DEACTIVATION_DELAY > 0
#include "ultralcd.h" #include "ultralcd.h"
#include "planner.h" #include "planner.h"
#include "stepper.h" #include "stepper.h"
...@@ -162,7 +164,7 @@ M351 - Toggle MS1 MS2 pins directly. ...@@ -162,7 +164,7 @@ M351 - Toggle MS1 MS2 pins directly.
M400 - Finish all moves M400 - Finish all moves
M401 - Lower z-probe if present M401 - Lower z-probe if present
M402 - Raise z-probe if present M402 - Raise z-probe if present
M404 - N<dia in mm> Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters M404 - D<dia in mm> Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters
M405 - Turn on Filament Sensor extrusion control. Optional D<delay in cm> to set delay in centimeters between sensor and extruder M405 - Turn on Filament Sensor extrusion control. Optional D<delay in cm> to set delay in centimeters between sensor and extruder
M406 - Turn off Filament Sensor extrusion control M406 - Turn off Filament Sensor extrusion control
M407 - Displays measured filament diameter M407 - Displays measured filament diameter
...@@ -683,7 +685,7 @@ void servo_init() ...@@ -683,7 +685,7 @@ void servo_init()
} }
#endif //NUM_SERVOS #endif //NUM_SERVOS
#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0) #if SERVO_LEVELING
delay(PROBE_SERVO_DEACTIVATION_DELAY); delay(PROBE_SERVO_DEACTIVATION_DELAY);
servos[servo_endstops[Z_AXIS]].detach(); servos[servo_endstops[Z_AXIS]].detach();
#endif #endif
...@@ -1243,36 +1245,34 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); ...@@ -1243,36 +1245,34 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
static void engage_z_probe() { static void engage_z_probe() {
// Engage Z Servo endstop if enabled // Engage Z Servo endstop if enabled
#if defined(SERVO_ENDSTOPS) && (NUM_SERVOS > 0) #if NUM_SERVOS > 0
if (servo_endstops[Z_AXIS] > -1) if (servo_endstops[Z_AXIS] > -1) {
{ #if SERVO_LEVELING
#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
servos[servo_endstops[Z_AXIS]].attach(0); servos[servo_endstops[Z_AXIS]].attach(0);
#endif #endif
servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2]); servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2]);
#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0) #if SERVO_LEVELING
delay(PROBE_SERVO_DEACTIVATION_DELAY); delay(PROBE_SERVO_DEACTIVATION_DELAY);
servos[servo_endstops[Z_AXIS]].detach(); servos[servo_endstops[Z_AXIS]].detach();
#endif #endif
} }
#endif #endif //NUM_SERVOS > 0
} }
static void retract_z_probe() { static void retract_z_probe() {
// Retract Z Servo endstop if enabled // Retract Z Servo endstop if enabled
#if defined(SERVO_ENDSTOPS) && (NUM_SERVOS > 0) #if NUM_SERVOS > 0
if (servo_endstops[Z_AXIS] > -1) if (servo_endstops[Z_AXIS] > -1) {
{ #if SERVO_LEVELING
#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
servos[servo_endstops[Z_AXIS]].attach(0); servos[servo_endstops[Z_AXIS]].attach(0);
#endif #endif
servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]); servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]);
#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0) #if SERVO_LEVELING
delay(PROBE_SERVO_DEACTIVATION_DELAY); delay(PROBE_SERVO_DEACTIVATION_DELAY);
servos[servo_endstops[Z_AXIS]].detach(); servos[servo_endstops[Z_AXIS]].detach();
#endif #endif
} }
#endif // SERVO_ENDSTOPS #endif //NUM_SERVOS > 0
} }
/// Probe bed height at position (x,y), returns the measured z value /// Probe bed height at position (x,y), returns the measured z value
...@@ -1291,17 +1291,16 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); ...@@ -1291,17 +1291,16 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
#endif // Z_PROBE_SLED #endif // Z_PROBE_SLED
SERIAL_PROTOCOLPGM(MSG_BED); SERIAL_PROTOCOLPGM(MSG_BED);
SERIAL_PROTOCOLPGM(" x: "); SERIAL_PROTOCOLPGM(" X: ");
SERIAL_PROTOCOL(x); SERIAL_PROTOCOL(x + 0.0001);
SERIAL_PROTOCOLPGM(" y: "); SERIAL_PROTOCOLPGM(" Y: ");
SERIAL_PROTOCOL(y); SERIAL_PROTOCOL(y + 0.0001);
SERIAL_PROTOCOLPGM(" z: "); SERIAL_PROTOCOLPGM(" Z: ");
SERIAL_PROTOCOL(measured_z); SERIAL_PROTOCOL(measured_z + 0.0001);
SERIAL_PROTOCOLPGM("\n"); SERIAL_EOL;
return measured_z; return measured_z;
} }
#endif //ENABLE_AUTO_BED_LEVELING
#endif // #ifdef ENABLE_AUTO_BED_LEVELING
static void homeaxis(int axis) { static void homeaxis(int axis) {
#define HOMEAXIS_DO(LETTER) \ #define HOMEAXIS_DO(LETTER) \
...@@ -1310,8 +1309,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); ...@@ -1310,8 +1309,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
if (axis==X_AXIS ? HOMEAXIS_DO(X) : if (axis==X_AXIS ? HOMEAXIS_DO(X) :
axis==Y_AXIS ? HOMEAXIS_DO(Y) : axis==Y_AXIS ? HOMEAXIS_DO(Y) :
axis==Z_AXIS ? HOMEAXIS_DO(Z) : axis==Z_AXIS ? HOMEAXIS_DO(Z) :
0) 0) {
{
int axis_home_dir = home_dir(axis); int axis_home_dir = home_dir(axis);
#ifdef DUAL_X_CARRIAGE #ifdef DUAL_X_CARRIAGE
if (axis == X_AXIS) axis_home_dir = x_home_dir(active_extruder); if (axis == X_AXIS) axis_home_dir = x_home_dir(active_extruder);
...@@ -1323,15 +1321,13 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); ...@@ -1323,15 +1321,13 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
#ifndef Z_PROBE_SLED #ifndef Z_PROBE_SLED
// Engage Servo endstop if enabled // Engage Servo endstop if enabled
#if defined(SERVO_ENDSTOPS) && (NUM_SERVOS > 0) #if defined(SERVO_ENDSTOPS) && (NUM_SERVOS > 0)
#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0) #if SERVO_LEVELING
if (axis==Z_AXIS) if (axis==Z_AXIS) {
{
engage_z_probe(); engage_z_probe();
} }
else else
#endif #endif
if (servo_endstops[axis] > -1) if (servo_endstops[axis] > -1) {
{
servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]); servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]);
} }
#endif #endif
...@@ -1358,13 +1354,13 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); ...@@ -1358,13 +1354,13 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
axis_known_position[axis] = true; axis_known_position[axis] = true;
// Retract Servo endstop if enabled // Retract Servo endstop if enabled
#if defined(SERVO_ENDSTOPS) && (NUM_SERVOS > 0) #if NUM_SERVOS > 0
if (servo_endstops[axis] > -1) if (servo_endstops[axis] > -1)
{ {
servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]); servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]);
} }
#endif #endif
#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0) #if SERVO_LEVELING
#ifndef Z_PROBE_SLED #ifndef Z_PROBE_SLED
if (axis==Z_AXIS) retract_z_probe(); if (axis==Z_AXIS) retract_z_probe();
#endif #endif
...@@ -2685,15 +2681,15 @@ inline void gcode_G28(boolean home_x=false, boolean home_y=false) { ...@@ -2685,15 +2681,15 @@ inline void gcode_G28(boolean home_x=false, boolean home_y=false) {
if (verbose_level) { if (verbose_level) {
SERIAL_PROTOCOLPGM("Eqn coefficients: a: "); SERIAL_PROTOCOLPGM("Eqn coefficients: a: ");
SERIAL_PROTOCOL(plane_equation_coefficients[0]); SERIAL_PROTOCOL(plane_equation_coefficients[0] + 0.0001);
SERIAL_PROTOCOLPGM(" b: "); SERIAL_PROTOCOLPGM(" b: ");
SERIAL_PROTOCOL(plane_equation_coefficients[1]); SERIAL_PROTOCOL(plane_equation_coefficients[1] + 0.0001);
SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOLPGM(" d: ");
SERIAL_PROTOCOLLN(plane_equation_coefficients[2]); SERIAL_PROTOCOLLN(plane_equation_coefficients[2] + 0.0001);
if (verbose_level > 2) { if (verbose_level > 2) {
SERIAL_PROTOCOLPGM("Mean of sampled points: "); SERIAL_PROTOCOLPGM("Mean of sampled points: ");
SERIAL_PROTOCOL_F(mean, 6); SERIAL_PROTOCOL_F(mean, 6);
SERIAL_PROTOCOLPGM(" \n"); SERIAL_EOL;
} }
} }
...@@ -2725,14 +2721,14 @@ inline void gcode_G28(boolean home_x=false, boolean home_y=false) { ...@@ -2725,14 +2721,14 @@ inline void gcode_G28(boolean home_x=false, boolean home_y=false) {
; ;
float diff = eqnBVector[ind] - mean; float diff = eqnBVector[ind] - mean;
if (diff >= 0.0) if (diff >= 0.0)
SERIAL_PROTOCOLPGM(" +"); // Watch column alignment in Pronterface SERIAL_PROTOCOLPGM(" +"); // Include + for column alignment
else else
SERIAL_PROTOCOLPGM(" -"); SERIAL_PROTOCOLPGM(" ");
SERIAL_PROTOCOL_F(diff, 5); SERIAL_PROTOCOL_F(diff, 5);
} // xx } // xx
SERIAL_PROTOCOLPGM("\n"); SERIAL_EOL;
} // yy } // yy
SERIAL_PROTOCOLPGM("\n"); SERIAL_EOL;
} //topo_flag } //topo_flag
...@@ -2765,7 +2761,7 @@ inline void gcode_G28(boolean home_x=false, boolean home_y=false) { ...@@ -2765,7 +2761,7 @@ inline void gcode_G28(boolean home_x=false, boolean home_y=false) {
if (verbose_level > 0) if (verbose_level > 0)
plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:"); plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:");
// The following code correct the Z height difference from z-probe position and hotend tip position. // Correct the Z height difference from z-probe position and hotend tip position.
// The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend. // The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend.
// When the bed is uneven, this height must be corrected. // When the bed is uneven, this height must be corrected.
real_z = float(st_get_position(Z_AXIS)) / axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane) real_z = float(st_get_position(Z_AXIS)) / axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane)
...@@ -2794,12 +2790,12 @@ inline void gcode_G28(boolean home_x=false, boolean home_y=false) { ...@@ -2794,12 +2790,12 @@ inline void gcode_G28(boolean home_x=false, boolean home_y=false) {
run_z_probe(); run_z_probe();
SERIAL_PROTOCOLPGM(MSG_BED); SERIAL_PROTOCOLPGM(MSG_BED);
SERIAL_PROTOCOLPGM(" X: "); SERIAL_PROTOCOLPGM(" X: ");
SERIAL_PROTOCOL(current_position[X_AXIS]); SERIAL_PROTOCOL(current_position[X_AXIS] + 0.0001);
SERIAL_PROTOCOLPGM(" Y: "); SERIAL_PROTOCOLPGM(" Y: ");
SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOL(current_position[Y_AXIS] + 0.0001);
SERIAL_PROTOCOLPGM(" Z: "); SERIAL_PROTOCOLPGM(" Z: ");
SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOL(current_position[Z_AXIS] + 0.0001);
SERIAL_PROTOCOLPGM("\n"); SERIAL_EOL;
clean_up_after_endstop_move(); clean_up_after_endstop_move();
retract_z_probe(); // Retract Z Servo endstop if available retract_z_probe(); // Retract Z Servo endstop if available
...@@ -3640,8 +3636,7 @@ inline void gcode_G92() { ...@@ -3640,8 +3636,7 @@ inline void gcode_G92() {
SERIAL_PROTOCOL_F(sigma,6); SERIAL_PROTOCOL_F(sigma,6);
} }
if (verbose_level > 0) if (verbose_level > 0) SERIAL_EOL;
SERIAL_PROTOCOLPGM("\n");
plan_buffer_line(X_probe_location, Y_probe_location, Z_start_location, current_position[E_AXIS], homing_feedrate[Z_AXIS]/60, active_extruder, active_driver); plan_buffer_line(X_probe_location, Y_probe_location, Z_start_location, current_position[E_AXIS], homing_feedrate[Z_AXIS]/60, active_extruder, active_driver);
st_synchronize(); st_synchronize();
...@@ -3660,12 +3655,12 @@ inline void gcode_G92() { ...@@ -3660,12 +3655,12 @@ inline void gcode_G92() {
if (verbose_level > 0) { if (verbose_level > 0) {
SERIAL_PROTOCOLPGM("Mean: "); SERIAL_PROTOCOLPGM("Mean: ");
SERIAL_PROTOCOL_F(mean, 6); SERIAL_PROTOCOL_F(mean, 6);
SERIAL_PROTOCOLPGM("\n"); SERIAL_EOL;
} }
SERIAL_PROTOCOLPGM("Standard Deviation: "); SERIAL_PROTOCOLPGM("Standard Deviation: ");
SERIAL_PROTOCOL_F(sigma, 6); SERIAL_PROTOCOL_F(sigma, 6);
SERIAL_PROTOCOLPGM("\n\n"); SERIAL_EOL; SERIAL_EOL;
} }
#endif // ENABLE_AUTO_BED_LEVELING && Z_PROBE_REPEATABILITY_TEST #endif // ENABLE_AUTO_BED_LEVELING && Z_PROBE_REPEATABILITY_TEST
...@@ -5081,34 +5076,28 @@ void process_commands() ...@@ -5081,34 +5076,28 @@ void process_commands()
#if NUM_SERVOS > 0 #if NUM_SERVOS > 0
case 280: //M280 - set servo position absolute. P: servo index, S: angle or microseconds case 280: //M280 - set servo position absolute. P: servo index, S: angle or microseconds
{ {
int servo_index = -1; int servo_index = code_seen('P') ? code_value() : -1;
int servo_position = 0; int servo_position = 0;
if (code_seen('P')) if (code_seen('S')) {
servo_index = code_value();
if (code_seen('S'))
{
servo_position = code_value(); servo_position = code_value();
if ((servo_index >= 0) && (servo_index < NUM_SERVOS)) if ((servo_index >= 0) && (servo_index < NUM_SERVOS)) {
{ #if SERVO_LEVELING
#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
servos[servo_index].attach(0); servos[servo_index].attach(0);
#endif #endif
servos[servo_index].write(servo_position); servos[servo_index].write(servo_position);
#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0) #if SERVO_LEVELING
delay(PROBE_SERVO_DEACTIVATION_DELAY); delay(PROBE_SERVO_DEACTIVATION_DELAY);
servos[servo_index].detach(); servos[servo_index].detach();
#endif #endif
} }
else else {
{
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHO("Servo "); SERIAL_ECHO("Servo ");
SERIAL_ECHO(servo_index); SERIAL_ECHO(servo_index);
SERIAL_ECHOLN(" out of range"); SERIAL_ECHOLN(" out of range");
} }
} }
else if (servo_index >= 0) else if (servo_index >= 0) {
{
SERIAL_PROTOCOL(MSG_OK); SERIAL_PROTOCOL(MSG_OK);
SERIAL_PROTOCOL(" Servo "); SERIAL_PROTOCOL(" Servo ");
SERIAL_PROTOCOL(servo_index); SERIAL_PROTOCOL(servo_index);
...@@ -5385,7 +5374,7 @@ void process_commands() ...@@ -5385,7 +5374,7 @@ void process_commands()
case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width
{ {
#if (FILWIDTH_PIN > -1) #if (FILWIDTH_PIN > -1)
if(code_seen('N')) filament_width_nominal=code_value(); if(code_seen('D')) filament_width_nominal=code_value();
else else
{ {
SERIAL_PROTOCOLPGM("Filament dia (nominal mm):"); SERIAL_PROTOCOLPGM("Filament dia (nominal mm):");
......
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