Laser Cutter Air Assist (#21753)
This commit is contained in:
parent
1f72b4f65b
commit
450f329f05
@ -3166,13 +3166,19 @@
|
||||
//#define AIR_EVACUATION // Cutter Vacuum / Laser Blower motor control with G-codes M10-M11
|
||||
#if ENABLED(AIR_EVACUATION)
|
||||
#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 SPINDLE_SERVO // A servo converting an angle to spindle power
|
||||
//#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
|
||||
|
||||
//#define SPINDLE_SERVO // A servo converting an angle to spindle power
|
||||
#ifdef SPINDLE_SERVO
|
||||
#define SPINDLE_SERVO_NR 0 // Index of servo used for spindle control
|
||||
#define SPINDLE_SERVO_MIN 10 // Minimum angle for servo spindle
|
||||
#define SPINDLE_SERVO_NR 0 // Index of servo used for spindle control
|
||||
#define SPINDLE_SERVO_MIN 10 // Minimum angle for servo spindle
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -71,6 +71,9 @@ void SpindleLaser::init() {
|
||||
#if ENABLED(AIR_EVACUATION)
|
||||
OUT_WRITE(AIR_EVACUATION_PIN, !AIR_EVACUATION_ACTIVE); // Init Vacuum/Blower OFF
|
||||
#endif
|
||||
#if ENABLED(AIR_ASSIST)
|
||||
OUT_WRITE(AIR_ASSIST_PIN, !AIR_ASSIST_ACTIVE); // Init Air Assist OFF
|
||||
#endif
|
||||
}
|
||||
|
||||
#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
|
||||
|
||||
#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
|
||||
|
@ -221,6 +221,15 @@ public:
|
||||
}
|
||||
#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); }
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
|
@ -25,14 +25,12 @@
|
||||
#if ENABLED(AIR_EVACUATION)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../module/planner.h"
|
||||
#include "../../feature/spindle_laser.h"
|
||||
|
||||
/**
|
||||
* M10: Vacuum or Blower On
|
||||
*/
|
||||
void GcodeSuite::M10() {
|
||||
planner.synchronize(); // Wait for move to arrive (TODO: asynchronous)
|
||||
cutter.air_evac_enable(); // Turn on Vacuum or Blower motor
|
||||
}
|
||||
|
||||
@ -40,7 +38,6 @@ void GcodeSuite::M10() {
|
||||
* M11: Vacuum or Blower OFF
|
||||
*/
|
||||
void GcodeSuite::M11() {
|
||||
planner.synchronize(); // Wait for move to arrive (TODO: asynchronous)
|
||||
cutter.air_evac_disable(); // Turn off Vacuum or Blower motor
|
||||
}
|
||||
|
||||
|
@ -61,3 +61,27 @@ void GcodeSuite::M9() {
|
||||
}
|
||||
|
||||
#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
|
||||
|
@ -118,6 +118,7 @@ namespace Language_en {
|
||||
PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Spindle Pwr");
|
||||
PROGMEM Language_Str MSG_LASER_TOGGLE = _UxGT("Toggle Laser");
|
||||
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_FIRE_PULSE = _UxGT("Fire Pulse");
|
||||
PROGMEM Language_Str MSG_FLOWMETER_FAULT = _UxGT("Coolant Flow Fault");
|
||||
|
@ -56,6 +56,11 @@
|
||||
EDIT_ITEM(bool, MSG_CUTTER(EVAC_TOGGLE), &evac_state, cutter.air_evac_toggle);
|
||||
#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 (!is_enabled) {
|
||||
editable.state = is_rev;
|
||||
|
@ -173,9 +173,9 @@ exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Greek" "$3"
|
||||
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_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
|
||||
@ -183,9 +183,9 @@ exec_test $1 $2 "REPRAP MEGA2560 RAMPS | Laser Feature | Cooler | Flowmeter | 12
|
||||
restore_configs
|
||||
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 \
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user