Skip to content

Commit

Permalink
Merge pull request #4299 from jbrazio/feature/g27-park-nozzle
Browse files Browse the repository at this point in the history
Implements park nozzle feature
  • Loading branch information
thinkyhead authored Jul 17, 2016
2 parents aaa0d29 + 336481e commit bf16ae5
Show file tree
Hide file tree
Showing 25 changed files with 683 additions and 85 deletions.
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,16 @@ script:
- opt_enable PRINTCOUNTER
- build_marlin
#
# Test CLEAN_NOZZLE_FEATURE
# Test NOZZLE_PARK_FEATURE
#
- restore_configs
- opt_enable AUTO_BED_LEVELING_FEATURE CLEAN_NOZZLE_FEATURE FIX_MOUNTED_PROBE
- opt_enable NOZZLE_PARK_FEATURE
- build_marlin
#
# Test NOZZLE_CLEAN_FEATURE
#
- restore_configs
- opt_enable AUTO_BED_LEVELING_FEATURE NOZZLE_CLEAN_FEATURE FIX_MOUNTED_PROBE
- build_marlin
#
#
Expand Down
24 changes: 24 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define PREHEAT_2_TEMP_BED 110
#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255

//
// Nozzle Park -- EXPERIMENTAL
//
// When enabled allows the user to define a special XYZ position, inside the
// machine's topology, to park the nozzle when idle or when receiving the G27
// command.
//
// The "P" paramenter controls what is the action applied to the Z axis:
// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
// be raised to reach Z-park height.
//
// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
// reach Z-park height.
//
// P2: The nozzle height will be raised by Z-park amount but never going over
// the machine's limit of Z_MAX_POS.
//
//#define NOZZLE_PARK_FEATURE

#if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z }
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
#endif

//
// Clean Nozzle Feature -- EXPERIMENTAL
//
Expand Down
27 changes: 25 additions & 2 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2736,9 +2736,12 @@ inline void gcode_G4() {

#endif //FWRETRACT

#if ENABLED(NOZZLE_CLEAN_FEATURE) && ENABLED(AUTO_BED_LEVELING_FEATURE)
#if ENABLED(NOZZLE_CLEAN_FEATURE) && HAS_BED_PROBE
#include "nozzle.h"

/**
* G12: Clean the nozzle
*/
inline void gcode_G12() {
// Don't allow nozzle cleaning without homing first
if (axis_unhomed_error(true, true, true)) { return; }
Expand Down Expand Up @@ -2795,6 +2798,20 @@ inline void gcode_G4() {

#endif // QUICK_HOME

#if ENABLED(NOZZLE_PARK_FEATURE)
#include "nozzle.h"

/**
* G27: Park the nozzle
*/
inline void gcode_G27() {
// Don't allow nozzle parking without homing first
if (axis_unhomed_error(true, true, true)) { return; }
uint8_t const z_action = code_seen('P') ? code_value_ushort() : 0;
Nozzle::park(z_action);
}
#endif // NOZZLE_PARK_FEATURE

/**
* G28: Home all axes according to settings
*
Expand Down Expand Up @@ -6884,7 +6901,7 @@ void process_next_command() {

#if ENABLED(NOZZLE_CLEAN_FEATURE) && HAS_BED_PROBE
case 12:
gcode_G12(); // G12: Clean Nozzle
gcode_G12(); // G12: Nozzle Clean
break;
#endif // NOZZLE_CLEAN_FEATURE

Expand All @@ -6898,6 +6915,12 @@ void process_next_command() {
break;
#endif // INCH_MODE_SUPPORT

#if ENABLED(NOZZLE_PARK_FEATURE)
case 27: // G27: Nozzle Park
gcode_G27();
break;
#endif // NOZZLE_PARK_FEATURE

case 28: // G28: Home all axes, one at a time
gcode_G28();
break;
Expand Down
24 changes: 24 additions & 0 deletions Marlin/example_configurations/Cartesio/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define PREHEAT_2_TEMP_BED 110
#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255

//
// Nozzle Park -- EXPERIMENTAL
//
// When enabled allows the user to define a special XYZ position, inside the
// machine's topology, to park the nozzle when idle or when receiving the G27
// command.
//
// The "P" paramenter controls what is the action applied to the Z axis:
// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
// be raised to reach Z-park height.
//
// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
// reach Z-park height.
//
// P2: The nozzle height will be raised by Z-park amount but never going over
// the machine's limit of Z_MAX_POS.
//
//#define NOZZLE_PARK_FEATURE

#if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z }
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
#endif

//
// Clean Nozzle Feature -- EXPERIMENTAL
//
Expand Down
24 changes: 24 additions & 0 deletions Marlin/example_configurations/Felix/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define PREHEAT_2_TEMP_BED 100
#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255

//
// Nozzle Park -- EXPERIMENTAL
//
// When enabled allows the user to define a special XYZ position, inside the
// machine's topology, to park the nozzle when idle or when receiving the G27
// command.
//
// The "P" paramenter controls what is the action applied to the Z axis:
// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
// be raised to reach Z-park height.
//
// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
// reach Z-park height.
//
// P2: The nozzle height will be raised by Z-park amount but never going over
// the machine's limit of Z_MAX_POS.
//
//#define NOZZLE_PARK_FEATURE

#if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z }
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
#endif

//
// Clean Nozzle Feature -- EXPERIMENTAL
//
Expand Down
24 changes: 24 additions & 0 deletions Marlin/example_configurations/Felix/DUAL/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define PREHEAT_2_TEMP_BED 100
#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255

//
// Nozzle Park -- EXPERIMENTAL
//
// When enabled allows the user to define a special XYZ position, inside the
// machine's topology, to park the nozzle when idle or when receiving the G27
// command.
//
// The "P" paramenter controls what is the action applied to the Z axis:
// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
// be raised to reach Z-park height.
//
// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
// reach Z-park height.
//
// P2: The nozzle height will be raised by Z-park amount but never going over
// the machine's limit of Z_MAX_POS.
//
//#define NOZZLE_PARK_FEATURE

#if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z }
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
#endif

//
// Clean Nozzle Feature -- EXPERIMENTAL
//
Expand Down
24 changes: 24 additions & 0 deletions Marlin/example_configurations/Hephestos/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define PREHEAT_2_TEMP_BED 100
#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255

//
// Nozzle Park -- EXPERIMENTAL
//
// When enabled allows the user to define a special XYZ position, inside the
// machine's topology, to park the nozzle when idle or when receiving the G27
// command.
//
// The "P" paramenter controls what is the action applied to the Z axis:
// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
// be raised to reach Z-park height.
//
// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
// reach Z-park height.
//
// P2: The nozzle height will be raised by Z-park amount but never going over
// the machine's limit of Z_MAX_POS.
//
//#define NOZZLE_PARK_FEATURE

#if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z }
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
#endif

//
// Clean Nozzle Feature -- EXPERIMENTAL
//
Expand Down
24 changes: 24 additions & 0 deletions Marlin/example_configurations/Hephestos_2/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define PREHEAT_2_TEMP_BED 110
#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255

//
// Nozzle Park -- EXPERIMENTAL
//
// When enabled allows the user to define a special XYZ position, inside the
// machine's topology, to park the nozzle when idle or when receiving the G27
// command.
//
// The "P" paramenter controls what is the action applied to the Z axis:
// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
// be raised to reach Z-park height.
//
// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
// reach Z-park height.
//
// P2: The nozzle height will be raised by Z-park amount but never going over
// the machine's limit of Z_MAX_POS.
//
//#define NOZZLE_PARK_FEATURE

#if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z }
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
#endif

//
// Clean Nozzle Feature -- EXPERIMENTAL
//
Expand Down
24 changes: 24 additions & 0 deletions Marlin/example_configurations/K8200/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define PREHEAT_2_TEMP_BED 60 // K8200: set back to 110 if you have an upgraded heatbed power supply
#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255

//
// Nozzle Park -- EXPERIMENTAL
//
// When enabled allows the user to define a special XYZ position, inside the
// machine's topology, to park the nozzle when idle or when receiving the G27
// command.
//
// The "P" paramenter controls what is the action applied to the Z axis:
// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
// be raised to reach Z-park height.
//
// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
// reach Z-park height.
//
// P2: The nozzle height will be raised by Z-park amount but never going over
// the machine's limit of Z_MAX_POS.
//
//#define NOZZLE_PARK_FEATURE

#if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z }
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
#endif

//
// Clean Nozzle Feature -- EXPERIMENTAL
//
Expand Down
24 changes: 24 additions & 0 deletions Marlin/example_configurations/K8400/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define PREHEAT_2_TEMP_BED 0
#define PREHEAT_2_FAN_SPEED 165 // Value from 0 to 255

//
// Nozzle Park -- EXPERIMENTAL
//
// When enabled allows the user to define a special XYZ position, inside the
// machine's topology, to park the nozzle when idle or when receiving the G27
// command.
//
// The "P" paramenter controls what is the action applied to the Z axis:
// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
// be raised to reach Z-park height.
//
// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
// reach Z-park height.
//
// P2: The nozzle height will be raised by Z-park amount but never going over
// the machine's limit of Z_MAX_POS.
//
//#define NOZZLE_PARK_FEATURE

#if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z }
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
#endif

//
// Clean Nozzle Feature -- EXPERIMENTAL
//
Expand Down
24 changes: 24 additions & 0 deletions Marlin/example_configurations/K8400/Dual-head/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define PREHEAT_2_TEMP_BED 0
#define PREHEAT_2_FAN_SPEED 165 // Value from 0 to 255

//
// Nozzle Park -- EXPERIMENTAL
//
// When enabled allows the user to define a special XYZ position, inside the
// machine's topology, to park the nozzle when idle or when receiving the G27
// command.
//
// The "P" paramenter controls what is the action applied to the Z axis:
// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
// be raised to reach Z-park height.
//
// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
// reach Z-park height.
//
// P2: The nozzle height will be raised by Z-park amount but never going over
// the machine's limit of Z_MAX_POS.
//
//#define NOZZLE_PARK_FEATURE

#if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z }
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
#endif

//
// Clean Nozzle Feature -- EXPERIMENTAL
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define PREHEAT_2_TEMP_BED 110
#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255

//
// Nozzle Park -- EXPERIMENTAL
//
// When enabled allows the user to define a special XYZ position, inside the
// machine's topology, to park the nozzle when idle or when receiving the G27
// command.
//
// The "P" paramenter controls what is the action applied to the Z axis:
// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
// be raised to reach Z-park height.
//
// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
// reach Z-park height.
//
// P2: The nozzle height will be raised by Z-park amount but never going over
// the machine's limit of Z_MAX_POS.
//
//#define NOZZLE_PARK_FEATURE

#if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z }
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
#endif

//
// Clean Nozzle Feature -- EXPERIMENTAL
//
Expand Down
Loading

0 comments on commit bf16ae5

Please sign in to comment.