🐛 Fix Air Assist (#22159)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Mike La Spina 2021-06-17 22:46:59 -05:00 committed by Scott Lahteine
parent f22c5d3cc6
commit 3ecc99e95d
4 changed files with 55 additions and 59 deletions

View File

@ -20,9 +20,9 @@
* *
*/ */
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfigPre.h"
#if ENABLED(COOLANT_CONTROL) #if ANY(COOLANT_MIST, COOLANT_FLOOD, AIR_ASSIST)
#include "../gcode.h" #include "../gcode.h"
#include "../../module/planner.h" #include "../../module/planner.h"
@ -37,18 +37,29 @@
} }
#endif #endif
#if ENABLED(COOLANT_FLOOD) #if EITHER(COOLANT_FLOOD, AIR_ASSIST)
#if ENABLED(AIR_ASSIST)
#include "../../feature/spindle_laser.h"
#endif
/** /**
* M8: Flood Coolant On * M8: Flood Coolant / Air Assist ON
*/ */
void GcodeSuite::M8() { void GcodeSuite::M8() {
planner.synchronize(); // Wait for move to arrive planner.synchronize(); // Wait for move to arrive
#if ENABLED(COOLANT_FLOOD)
WRITE(COOLANT_FLOOD_PIN, !(COOLANT_FLOOD_INVERT)); // Turn on Flood coolant WRITE(COOLANT_FLOOD_PIN, !(COOLANT_FLOOD_INVERT)); // Turn on Flood coolant
#endif
#if ENABLED(AIR_ASSIST)
cutter.air_assist_enable(); // Turn on Air Assist
#endif
} }
#endif #endif
/** /**
* M9: Coolant OFF * M9: Coolant / Air Assist OFF
*/ */
void GcodeSuite::M9() { void GcodeSuite::M9() {
planner.synchronize(); // Wait for move to arrive planner.synchronize(); // Wait for move to arrive
@ -58,30 +69,9 @@ void GcodeSuite::M9() {
#if ENABLED(COOLANT_FLOOD) #if ENABLED(COOLANT_FLOOD)
WRITE(COOLANT_FLOOD_PIN, COOLANT_FLOOD_INVERT); // Turn off Flood coolant WRITE(COOLANT_FLOOD_PIN, COOLANT_FLOOD_INVERT); // Turn off Flood coolant
#endif #endif
#if ENABLED(AIR_ASSIST)
cutter.air_assist_disable(); // Turn off Air Assist
#endif
} }
#endif // COOLANT_CONTROL #endif // COOLANT_MIST | COOLANT_FLOOD | AIR_ASSIST
#if ENABLED(AIR_ASSIST)
#include "../gcode.h"
#include "../../module/planner.h"
#include "../../feature/spindle_laser.h"
/**
* M8: Air Assist On
*/
void GcodeSuite::M8() {
planner.synchronize();
cutter.air_assist_enable(); // Turn on Air Assist pin
}
/**
* M9: Air Assist Off
*/
void GcodeSuite::M9() {
planner.synchronize();
cutter.air_assist_disable(); // Turn off Air Assist pin
}
#endif // AIR_ASSIST

View File

@ -441,21 +441,24 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 3: M3_M4(false); break; // M3: Turn ON Laser | Spindle (clockwise), set Power | Speed case 3: M3_M4(false); break; // M3: Turn ON Laser | Spindle (clockwise), set Power | Speed
case 4: M3_M4(true ); break; // M4: Turn ON Laser | Spindle (counter-clockwise), set Power | Speed case 4: M3_M4(true ); break; // M4: Turn ON Laser | Spindle (counter-clockwise), set Power | Speed
case 5: M5(); break; // M5: Turn OFF Laser | Spindle case 5: M5(); break; // M5: Turn OFF Laser | Spindle
#endif
#if ENABLED(COOLANT_MIST)
case 7: M7(); break; // M7: Coolant Mist ON
#endif
#if EITHER(AIR_ASSIST, COOLANT_FLOOD)
case 8: M8(); break; // M8: Air Assist / Coolant Flood ON
#endif
#if EITHER(AIR_ASSIST, COOLANT_CONTROL)
case 9: M9(); break; // M9: Air Assist / Coolant OFF
#endif
#if ENABLED(AIR_EVACUATION) #if ENABLED(AIR_EVACUATION)
case 10: M10(); break; // M10: Vacuum or Blower motor ON case 10: M10(); break; // M10: Vacuum or Blower motor ON
case 11: M11(); break; // M11: Vacuum or Blower motor OFF case 11: M11(); break; // M11: Vacuum or Blower motor OFF
#endif #endif
#endif
#if ENABLED(COOLANT_CONTROL)
#if ENABLED(COOLANT_MIST)
case 7: M7(); break; // M7: Mist coolant ON
#endif
#if ENABLED(COOLANT_FLOOD)
case 8: M8(); break; // M8: Flood coolant ON
#endif
case 9: M9(); break; // M9: Coolant OFF
#endif
#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER)
case 12: M12(); break; // M12: Synchronize and optionally force a CLC set case 12: M12(); break; // M12: Synchronize and optionally force a CLC set

View File

@ -564,22 +564,25 @@ private:
#if HAS_CUTTER #if HAS_CUTTER
static void M3_M4(const bool is_M4); static void M3_M4(const bool is_M4);
static void M5(); static void M5();
#if ENABLED(AIR_EVACUATION)
static void M10();
static void M11();
#endif
#endif #endif
#if ENABLED(COOLANT_CONTROL)
#if ENABLED(COOLANT_MIST) #if ENABLED(COOLANT_MIST)
static void M7(); static void M7();
#endif #endif
#if ENABLED(COOLANT_FLOOD)
#if EITHER(AIR_ASSIST, COOLANT_FLOOD)
static void M8(); static void M8();
#endif #endif
#if EITHER(AIR_ASSIST, COOLANT_CONTROL)
static void M9(); static void M9();
#endif #endif
#if ENABLED(AIR_EVACUATION)
static void M10();
static void M11();
#endif
#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER)
static void M12(); static void M12();
#endif #endif

View File

@ -166,7 +166,7 @@ HAS_USER_THERMISTORS = src_filter=+<src/gcode/config/M305.cpp>
SD_ABORT_ON_ENDSTOP_HIT = src_filter=+<src/gcode/config/M540.cpp> SD_ABORT_ON_ENDSTOP_HIT = src_filter=+<src/gcode/config/M540.cpp>
BAUD_RATE_GCODE = src_filter=+<src/gcode/config/M575.cpp> BAUD_RATE_GCODE = src_filter=+<src/gcode/config/M575.cpp>
HAS_SMART_EFF_MOD = src_filter=+<src/gcode/config/M672.cpp> HAS_SMART_EFF_MOD = src_filter=+<src/gcode/config/M672.cpp>
COOLANT_CONTROL = src_filter=+<src/gcode/control/M7-M9.cpp> COOLANT_CONTROL|AIR_ASSIST = src_filter=+<src/gcode/control/M7-M9.cpp>
AIR_EVACUATION = src_filter=+<src/gcode/control/M10-M11.cpp> AIR_EVACUATION = src_filter=+<src/gcode/control/M10-M11.cpp>
HAS_SOFTWARE_ENDSTOPS = src_filter=+<src/gcode/control/M211.cpp> HAS_SOFTWARE_ENDSTOPS = src_filter=+<src/gcode/control/M211.cpp>
HAS_DUPLICATION_MODE = src_filter=+<src/gcode/control/M605.cpp> HAS_DUPLICATION_MODE = src_filter=+<src/gcode/control/M605.cpp>