Laser Cutter Air Assist (#21753)

This commit is contained in:
Mike La Spina 2021-05-01 19:59:45 -05:00 committed by Scott Lahteine
parent 1f72b4f65b
commit 450f329f05
8 changed files with 68 additions and 12 deletions

View file

@ -3166,7 +3166,13 @@
//#define AIR_EVACUATION // Cutter Vacuum / Laser Blower motor control with G-codes M10-M11 //#define AIR_EVACUATION // Cutter Vacuum / Laser Blower motor control with G-codes M10-M11
#if ENABLED(AIR_EVACUATION) #if ENABLED(AIR_EVACUATION)
#define AIR_EVACUATION_ACTIVE LOW // Set to "HIGH" if the on/off function is active HIGH #define AIR_EVACUATION_ACTIVE LOW // Set to "HIGH" if the on/off function is active HIGH
#define AIR_EVACUATION_PIN 42 // Override the default Cutter Vacuum or Laser Blower pin //#define AIR_EVACUATION_PIN 42 // Override the default Cutter Vacuum or Laser Blower pin
#endif
//#define AIR_ASSIST // Air Assist control with G-codes M8-M9
#if ENABLED(AIR_ASSIST)
#define AIR_ASSIST_ACTIVE LOW // Active state on air assist pin
//#define AIR_ASSIST_PIN 44 // Override the default Air Assist pin
#endif #endif
//#define SPINDLE_SERVO // A servo converting an angle to spindle power //#define SPINDLE_SERVO // A servo converting an angle to spindle power

View file

@ -71,6 +71,9 @@ void SpindleLaser::init() {
#if ENABLED(AIR_EVACUATION) #if ENABLED(AIR_EVACUATION)
OUT_WRITE(AIR_EVACUATION_PIN, !AIR_EVACUATION_ACTIVE); // Init Vacuum/Blower OFF OUT_WRITE(AIR_EVACUATION_PIN, !AIR_EVACUATION_ACTIVE); // Init Vacuum/Blower OFF
#endif #endif
#if ENABLED(AIR_ASSIST)
OUT_WRITE(AIR_ASSIST_PIN, !AIR_ASSIST_ACTIVE); // Init Air Assist OFF
#endif
} }
#if ENABLED(SPINDLE_LASER_PWM) #if ENABLED(SPINDLE_LASER_PWM)
@ -147,6 +150,17 @@ void SpindleLaser::apply_power(const uint8_t opwr) {
void SpindleLaser::air_evac_toggle() { TOGGLE(AIR_EVACUATION_PIN); } // Toggle state void SpindleLaser::air_evac_toggle() { TOGGLE(AIR_EVACUATION_PIN); } // Toggle state
#endif #endif // AIR_EVACUATION
#if ENABLED(AIR_ASSIST)
// Enable / disable air assist
void SpindleLaser::air_assist_enable() { WRITE(AIR_ASSIST_PIN, AIR_ASSIST_PIN); } // Turn ON
void SpindleLaser::air_assist_disable() { WRITE(AIR_ASSIST_PIN, !AIR_ASSIST_PIN); } // Turn OFF
void SpindleLaser::air_assist_toggle() { TOGGLE(AIR_ASSIST_PIN); } // Toggle state
#endif // AIR_ASSIST
#endif // HAS_CUTTER #endif // HAS_CUTTER

View file

@ -221,6 +221,15 @@ public:
} }
#endif #endif
#if ENABLED(AIR_ASSIST)
static void air_assist_enable(); // Turn on air assist
static void air_assist_disable(); // Turn off air assist
static void air_assist_toggle(); // Toggle air assist
static inline bool air_assist_state() { // Get current state
return (READ(AIR_ASSIST_PIN) == AIR_ASSIST_ACTIVE);
}
#endif
static inline void disable() { isReady = false; set_enabled(false); } static inline void disable() { isReady = false; set_enabled(false); }
#if HAS_LCD_MENU #if HAS_LCD_MENU

View file

@ -25,14 +25,12 @@
#if ENABLED(AIR_EVACUATION) #if ENABLED(AIR_EVACUATION)
#include "../gcode.h" #include "../gcode.h"
#include "../../module/planner.h"
#include "../../feature/spindle_laser.h" #include "../../feature/spindle_laser.h"
/** /**
* M10: Vacuum or Blower On * M10: Vacuum or Blower On
*/ */
void GcodeSuite::M10() { void GcodeSuite::M10() {
planner.synchronize(); // Wait for move to arrive (TODO: asynchronous)
cutter.air_evac_enable(); // Turn on Vacuum or Blower motor cutter.air_evac_enable(); // Turn on Vacuum or Blower motor
} }
@ -40,7 +38,6 @@ void GcodeSuite::M10() {
* M11: Vacuum or Blower OFF * M11: Vacuum or Blower OFF
*/ */
void GcodeSuite::M11() { void GcodeSuite::M11() {
planner.synchronize(); // Wait for move to arrive (TODO: asynchronous)
cutter.air_evac_disable(); // Turn off Vacuum or Blower motor cutter.air_evac_disable(); // Turn off Vacuum or Blower motor
} }

View file

@ -61,3 +61,27 @@ void GcodeSuite::M9() {
} }
#endif // COOLANT_CONTROL #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

View file

@ -118,6 +118,7 @@ namespace Language_en {
PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Spindle Pwr"); PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Spindle Pwr");
PROGMEM Language_Str MSG_LASER_TOGGLE = _UxGT("Toggle Laser"); PROGMEM Language_Str MSG_LASER_TOGGLE = _UxGT("Toggle Laser");
PROGMEM Language_Str MSG_LASER_EVAC_TOGGLE = _UxGT("Toggle Blower"); PROGMEM Language_Str MSG_LASER_EVAC_TOGGLE = _UxGT("Toggle Blower");
PROGMEM Language_Str MSG_LASER_ASSIST_TOGGLE = _UxGT("Air Assist");
PROGMEM Language_Str MSG_LASER_PULSE_MS = _UxGT("Test Pulse ms"); PROGMEM Language_Str MSG_LASER_PULSE_MS = _UxGT("Test Pulse ms");
PROGMEM Language_Str MSG_LASER_FIRE_PULSE = _UxGT("Fire Pulse"); PROGMEM Language_Str MSG_LASER_FIRE_PULSE = _UxGT("Fire Pulse");
PROGMEM Language_Str MSG_FLOWMETER_FAULT = _UxGT("Coolant Flow Fault"); PROGMEM Language_Str MSG_FLOWMETER_FAULT = _UxGT("Coolant Flow Fault");

View file

@ -56,6 +56,11 @@
EDIT_ITEM(bool, MSG_CUTTER(EVAC_TOGGLE), &evac_state, cutter.air_evac_toggle); EDIT_ITEM(bool, MSG_CUTTER(EVAC_TOGGLE), &evac_state, cutter.air_evac_toggle);
#endif #endif
#if ENABLED(AIR_ASSIST)
bool air_assist_state = cutter.air_assist_state();
EDIT_ITEM(bool, MSG_CUTTER(ASSIST_TOGGLE), &air_assist_state, cutter.air_assist_toggle);
#endif
#if ENABLED(SPINDLE_CHANGE_DIR) #if ENABLED(SPINDLE_CHANGE_DIR)
if (!is_enabled) { if (!is_enabled) {
editable.state = is_rev; editable.state = is_rev;

View file

@ -173,9 +173,9 @@ exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Greek" "$3"
restore_configs restore_configs
opt_set MOTHERBOARD BOARD_RAMPS_14_EFB LCD_LANGUAGE en TEMP_SENSOR_COOLER 1 EXTRUDERS 0 TEMP_SENSOR_1 0 SERIAL_PORT_2 2 opt_set MOTHERBOARD BOARD_RAMPS_14_EFB LCD_LANGUAGE en TEMP_SENSOR_COOLER 1 EXTRUDERS 0 TEMP_SENSOR_1 0 SERIAL_PORT_2 2
opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT \ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT \
LASER_FEATURE LASER_COOLANT_FLOW_METER MEATPACK_ON_SERIAL_PORT_1 LASER_FEATURE AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN LASER_COOLANT_FLOW_METER MEATPACK_ON_SERIAL_PORT_1
exec_test $1 $2 "REPRAP MEGA2560 RAMPS | Laser Feature | Cooler | Flowmeter | 12864 LCD | meatpack | SERIAL_PORT_2 " "$3" exec_test $1 $2 "REPRAP MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Flowmeter | 12864 LCD | meatpack | SERIAL_PORT_2 " "$3"
# #
# Test Laser features with 44780 LCD # Test Laser features with 44780 LCD
@ -183,9 +183,9 @@ exec_test $1 $2 "REPRAP MEGA2560 RAMPS | Laser Feature | Cooler | Flowmeter | 12
restore_configs restore_configs
opt_set MOTHERBOARD BOARD_RAMPS_14_EFB LCD_LANGUAGE en TEMP_SENSOR_COOLER 1 EXTRUDERS 0 TEMP_SENSOR_1 0 opt_set MOTHERBOARD BOARD_RAMPS_14_EFB LCD_LANGUAGE en TEMP_SENSOR_COOLER 1 EXTRUDERS 0 TEMP_SENSOR_1 0
opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT \ opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT \
LASER_FEATURE LASER_COOLANT_FLOW_METER LASER_FEATURE AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN LASER_COOLANT_FLOW_METER
exec_test $1 $2 "REPRAP MEGA2560 RAMPS | Laser Feature | Cooler | Flowmeter | 44780 LCD " "$3" exec_test $1 $2 "REPRAP MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Flowmeter | 44780 LCD " "$3"
# #
# Language files test with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER # Language files test with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER