Merge pull request #7814 from thinkyhead/bf1_inhibit_option

[1.1.x] Option to disallow motion before homing
master
Scott Lahteine 7 years ago committed by GitHub
commit 3d1536a1b2

@ -759,6 +759,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -422,7 +422,15 @@ void do_blocking_move_to_x(const float &x, const float &fr_mm_s=0.0);
void do_blocking_move_to_z(const float &z, const float &fr_mm_s=0.0);
void do_blocking_move_to_xy(const float &x, const float &y, const float &fr_mm_s=0.0);
#define HAS_AXIS_UNHOMED_ERR (ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE) || (ENABLED(ADVANCED_PAUSE_FEATURE) && ENABLED(HOME_BEFORE_FILAMENT_CHANGE)))
#define HAS_AXIS_UNHOMED_ERR ( \
ENABLED(Z_PROBE_ALLEN_KEY) \
|| ENABLED(Z_PROBE_SLED) \
|| HAS_PROBING_PROCEDURE \
|| HOTENDS > 1 \
|| ENABLED(NOZZLE_CLEAN_FEATURE) \
|| ENABLED(NOZZLE_PARK_FEATURE) \
|| (ENABLED(ADVANCED_PAUSE_FEATURE) && ENABLED(HOME_BEFORE_FILAMENT_CHANGE)) \
) || ENABLED(NO_MOTION_BEFORE_HOMING)
#if HAS_AXIS_UNHOMED_ERR
bool axis_unhomed_error(const bool x=true, const bool y=true, const bool z=true);

@ -1850,7 +1850,7 @@ static void clean_up_after_endstop_or_probe_move() {
return false;
}
#endif
#endif // HAS_AXIS_UNHOMED_ERR
#if ENABLED(Z_PROBE_SLED)
@ -2053,7 +2053,7 @@ static void clean_up_after_endstop_or_probe_move() {
#endif
}
#endif
#endif // Z_PROBE_ALLEN_KEY
#if ENABLED(PROBING_FANS_OFF)
@ -3383,6 +3383,10 @@ inline void gcode_G0_G1(
bool fast_move=false
#endif
) {
#if ENABLED(NO_MOTION_BEFORE_HOMING)
if (axis_unhomed_error()) return;
#endif
if (IsRunning()) {
gcode_get_destination(); // For X Y Z E F
@ -3438,6 +3442,10 @@ inline void gcode_G0_G1(
#if ENABLED(ARC_SUPPORT)
inline void gcode_G2_G3(bool clockwise) {
#if ENABLED(NO_MOTION_BEFORE_HOMING)
if (axis_unhomed_error()) return;
#endif
if (IsRunning()) {
#if ENABLED(SF_ARC_FIX)
@ -3535,6 +3543,10 @@ inline void gcode_G4() {
* G5: Cubic B-spline
*/
inline void gcode_G5() {
#if ENABLED(NO_MOTION_BEFORE_HOMING)
if (axis_unhomed_error()) return;
#endif
if (IsRunning()) {
#if ENABLED(CNC_WORKSPACE_PLANES)
@ -5862,6 +5874,10 @@ void home_all_axes() { gcode_G28(true); }
* G42: Move X & Y axes to mesh coordinates (I & J)
*/
inline void gcode_G42() {
#if ENABLED(NO_MOTION_BEFORE_HOMING)
if (axis_unhomed_error()) return;
#endif
if (IsRunning()) {
const bool hasI = parser.seenval('I');
const int8_t ix = hasI ? parser.value_int() : 0;

@ -779,6 +779,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -759,6 +759,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -843,6 +843,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -765,6 +765,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -750,6 +750,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -760,6 +760,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
#define Z_HOMING_HEIGHT 5 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -750,6 +750,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -758,6 +758,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -769,6 +769,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 5 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -741,6 +741,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -741,6 +741,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -762,6 +762,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
#define Z_HOMING_HEIGHT 2 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -774,6 +774,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -759,6 +759,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
#define Z_HOMING_HEIGHT 8 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -763,6 +763,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -783,6 +783,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -759,6 +759,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -757,6 +757,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -771,6 +771,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -790,6 +790,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -810,6 +810,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -787,6 +787,9 @@
#define INVERT_E4_DIR true
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
// K8200: it is usual to have clamps for the glass plate on the heatbed
#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -759,6 +759,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -759,6 +759,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -759,6 +759,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -883,6 +883,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
#define Z_HOMING_HEIGHT 15 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -883,6 +883,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
#define Z_HOMING_HEIGHT 15 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -870,6 +870,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -873,6 +873,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 15 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -873,6 +873,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -882,6 +882,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -772,6 +772,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
#define Z_HOMING_HEIGHT 10 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -762,6 +762,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -754,6 +754,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -764,6 +764,8 @@
// @section homing
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

@ -20,8 +20,11 @@
*
*/
#include "ultralcd.h"
#include "MarlinConfig.h"
#if ENABLED(ULTRA_LCD)
#include "ultralcd.h"
#include "Marlin.h"
#include "language.h"
#include "cardreader.h"
@ -2926,19 +2929,19 @@ void kill_screen(const char* lcd_msg) {
*
*/
#if IS_KINEMATIC
#if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING)
#define _MOVE_XYZ_ALLOWED (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
#if ENABLED(DELTA)
#define _MOVE_XY_ALLOWED (current_position[Z_AXIS] <= delta_clip_start_height)
void lcd_lower_z_to_clip_height() {
line_to_z(delta_clip_start_height);
lcd_synchronize();
}
#else
#define _MOVE_XY_ALLOWED true
#endif
#else
#define _MOVE_XYZ_ALLOWED true
#endif
#if ENABLED(DELTA)
#define _MOVE_XY_ALLOWED (current_position[Z_AXIS] <= delta_clip_start_height)
void lcd_lower_z_to_clip_height() {
line_to_z(delta_clip_start_height);
lcd_synchronize();
}
#else
#define _MOVE_XY_ALLOWED true
#endif

Loading…
Cancel
Save