Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Air Assist #22159

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ec50d3d
Laser percent power
thinkyhead Dec 9, 2020
98799b5
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
descipher Dec 14, 2020
74367bc
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
descipher Dec 29, 2020
4a2dab7
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
descipher Jan 25, 2021
aa713a1
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
descipher Feb 1, 2021
2cc4d48
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
descipher Feb 2, 2021
8db0a77
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
descipher Mar 3, 2021
9dbc82f
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
descipher Mar 5, 2021
329e211
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
descipher Mar 12, 2021
80c48b0
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
descipher Mar 16, 2021
a9a8bf5
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
descipher Mar 24, 2021
245ffde
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
descipher Mar 31, 2021
825d057
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
descipher Apr 5, 2021
80ded6f
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
descipher Apr 6, 2021
d00c06f
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
descipher Apr 19, 2021
d9ee4c9
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
descipher Apr 27, 2021
ecd3c94
Merge branch 'MarlinFirmware:bugfix-2.0.x' into bugfix-2.0.x
descipher May 7, 2021
a3b165f
Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marl…
descipher Jun 1, 2021
a05783e
Merge branch 'bugfix-2.0.x' of https://github.com/descipher/Marlin in…
descipher Jun 17, 2021
9e6bd60
Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marl…
descipher Jun 17, 2021
2d72981
Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marl…
descipher Jun 17, 2021
5c23756
Merge branch 'bugfix-2.0.x' of https://github.com/descipher/Marlin in…
descipher Jun 17, 2021
75efd41
Laser Air Assist config option needs to include gcode M8 and M9 parsing
descipher Jun 17, 2021
b763ce5
Keep PWM255 Default
descipher Jun 17, 2021
96e58a1
tweaks
thinkyhead Jun 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 25 additions & 35 deletions Marlin/src/gcode/control/M7-M9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 "../../module/planner.h"
Expand All @@ -37,51 +37,41 @@
}
#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() {
planner.synchronize(); // Wait for move to arrive
WRITE(COOLANT_FLOOD_PIN, !(COOLANT_FLOOD_INVERT)); // Turn on Flood coolant
planner.synchronize(); // Wait for move to arrive
#if ENABLED(COOLANT_FLOOD)
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

/**
* M9: Coolant OFF
* M9: Coolant / Air Assist OFF
*/
void GcodeSuite::M9() {
planner.synchronize(); // Wait for move to arrive
planner.synchronize(); // Wait for move to arrive
#if ENABLED(COOLANT_MIST)
WRITE(COOLANT_MIST_PIN, COOLANT_MIST_INVERT); // Turn off Mist coolant
WRITE(COOLANT_MIST_PIN, COOLANT_MIST_INVERT); // Turn off Mist coolant
#endif
#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
#if ENABLED(AIR_ASSIST)
cutter.air_assist_disable(); // Turn off Air Assist
#endif
}

#endif // COOLANT_CONTROL

#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
#endif // COOLANT_MIST | COOLANT_FLOOD | AIR_ASSIST
27 changes: 15 additions & 12 deletions Marlin/src/gcode/gcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,20 +441,23 @@ 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 4: M3_M4(true ); break; // M4: Turn ON Laser | Spindle (counter-clockwise), set Power | Speed
case 5: M5(); break; // M5: Turn OFF Laser | Spindle
#if ENABLED(AIR_EVACUATION)
case 10: M10(); break; // M10: Vacuum or Blower motor ON
case 11: M11(); break; // M11: Vacuum or Blower motor OFF
#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
#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)
case 10: M10(); break; // M10: Vacuum or Blower motor ON
case 11: M11(); break; // M11: Vacuum or Blower motor OFF
#endif

#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER)
Expand Down
25 changes: 14 additions & 11 deletions Marlin/src/gcode/gcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -564,22 +564,25 @@ class GcodeSuite {
#if HAS_CUTTER
static void M3_M4(const bool is_M4);
static void M5();
#if ENABLED(AIR_EVACUATION)
static void M10();
static void M11();
#endif
#endif

#if ENABLED(COOLANT_CONTROL)
#if ENABLED(COOLANT_MIST)
static void M7();
#endif
#if ENABLED(COOLANT_FLOOD)
static void M8();
#endif
#if ENABLED(COOLANT_MIST)
static void M7();
#endif

#if EITHER(AIR_ASSIST, COOLANT_FLOOD)
static void M8();
#endif

#if EITHER(AIR_ASSIST, COOLANT_CONTROL)
static void M9();
#endif

#if ENABLED(AIR_EVACUATION)
static void M10();
static void M11();
#endif

#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER)
static void M12();
#endif
Expand Down
2 changes: 1 addition & 1 deletion ini/features.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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>
BAUD_RATE_GCODE = src_filter=+<src/gcode/config/M575.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>
HAS_SOFTWARE_ENDSTOPS = src_filter=+<src/gcode/control/M211.cpp>
HAS_DUPLICATION_MODE = src_filter=+<src/gcode/control/M605.cpp>
Expand Down