diff --git a/Grbl_Esp32/Custom/atc.cpp b/Grbl_Esp32/Custom/atc.cpp index 6cf5c068..115f5375 100644 --- a/Grbl_Esp32/Custom/atc.cpp +++ b/Grbl_Esp32/Custom/atc.cpp @@ -77,19 +77,19 @@ void user_machine_init() { tool[1].mpos[X_AXIS] = 151.0; tool[1].mpos[Y_AXIS] = 291.0; - tool[1].mpos[Z_AXIS] = -86.0; + tool[1].mpos[Z_AXIS] = -87.0; tool[2].mpos[X_AXIS] = 186.0; tool[2].mpos[Y_AXIS] = 291.0; - tool[2].mpos[Z_AXIS] = -86.0; + tool[2].mpos[Z_AXIS] = -87.0; tool[3].mpos[X_AXIS] = 221.0; tool[3].mpos[Y_AXIS] = 292.0; - tool[3].mpos[Z_AXIS] = -86.0; + tool[3].mpos[Z_AXIS] = -87.0; tool[4].mpos[X_AXIS] = 256.0; tool[4].mpos[Y_AXIS] = 291.0; - tool[4].mpos[Z_AXIS] = -86.0; + tool[4].mpos[Z_AXIS] = -87.0; top_of_z = limitsMaxPosition(Z_AXIS) - homing_pulloff->get(); } @@ -320,7 +320,7 @@ bool set_ATC_open(bool open) { // give a squirt of air to clear top of Tool Setter bool atc_ETS_dustoff() { digitalWrite(ETS_DUST_OFF, HIGH); - gc_exec_linef(true, "G4P%0.2f", 0.250); + gc_exec_linef(true, "G4P%0.2f", ETS_DUST_OFF_DURATION); digitalWrite(ETS_DUST_OFF, LOW); } diff --git a/Grbl_Esp32/src/Config.h b/Grbl_Esp32/src/Config.h index d5ca8eba..8afbdef1 100644 --- a/Grbl_Esp32/src/Config.h +++ b/Grbl_Esp32/src/Config.h @@ -98,7 +98,7 @@ const int MAX_N_AXIS = 6; //CONFIGURE_EYECATCH_BEGIN (DO NOT MODIFY THIS LINE) #define ENABLE_BLUETOOTH // enable bluetooth -//#define ENABLE_SD_CARD // enable use of SD Card to run jobs +#define ENABLE_SD_CARD // enable use of SD Card to run jobs #define ENABLE_WIFI //enable wifi @@ -620,4 +620,4 @@ const double PARKING_PULLOUT_INCREMENT = 5.0; // Spindle pull-out and plunge const int N_PIECES = 3; const double RPM_MAX = 23935.2; -const double RPM_MIN = 2412.2; +const double RPM_MIN = 2412.2; \ No newline at end of file diff --git a/Grbl_Esp32/src/Machines/6_pack_5160_ATC_Carve.h b/Grbl_Esp32/src/Machines/6_pack_5160_ATC_Carve.h index 785096e6..7934a737 100644 --- a/Grbl_Esp32/src/Machines/6_pack_5160_ATC_Carve.h +++ b/Grbl_Esp32/src/Machines/6_pack_5160_ATC_Carve.h @@ -105,21 +105,20 @@ //#define SPINDLE_OUTPUT_PIN GPIO_NUM_14 // relay as spindle on module socket #2 -#define DEFAULT_SPINDLE_DELAY_SPINUP 2.25 -#define DEFAULT_SPINDLE_DELAY_SPINDOWN 6.0 + // - +#define ETS_DUST_OFF_DURATION .30 // seconds #define ATC_MANUAL_CHANGE_TIME 500 // milliseconds ATC is open // ================= Setting Defaults ========================== #define DEFAULT_X_STEPS_PER_MM 160 #define DEFAULT_Y_STEPS_PER_MM 160 -#define DEFAULT_Z_STEPS_PER_MM 755.904 +#define DEFAULT_Z_STEPS_PER_MM 1511.808 -#define DEFAULT_X_MAX_RATE 2000 -#define DEFAULT_Y_MAX_RATE 2000 -#define DEFAULT_Z_MAX_RATE 2000 +#define DEFAULT_X_MAX_RATE 6000 +#define DEFAULT_Y_MAX_RATE 6000 +#define DEFAULT_Z_MAX_RATE 1500 #define DEFAULT_X_HOMING_MPOS 0 #define DEFAULT_X_MAX_TRAVEL 400 @@ -135,19 +134,22 @@ #define DEFAULT_Z_MAX_TRAVEL 200 #define DEFAULT_Z_CURRENT 1.0 #define DEFAULT_Z_HOLD_CURRENT 0.25 +#define DEFAULT_Z_ACCELERATION 100.00 #define DEFAULT_X_MICROSTEPS 32 #define DEFAULT_Y_MICROSTEPS 32 -#define DEFAULT_Z_MICROSTEPS 32 +#define DEFAULT_Z_MICROSTEPS 16 -#define DEFAULT_HOMING_DIR_MASK (bit(X_AXIS) | bit(Y_AXIS)) - -#define DEFAULT_HOMING_ENABLE 1 +#define DEFAULT_HOMING_ENABLE 1 +#define DEFAULT_HOMING_DIR_MASK (bit(X_AXIS) | bit(Y_AXIS)) +#define DEFAULT_HOMING_SEEK_RATE 3500 +#define DEFAULT_HOMING_PULLOFF 3.0 +#define DEFAULT_HOMING_CYCLE_0 bit(Z_AXIS) +#define DEFAULT_HOMING_CYCLE_1 bit(X_AXIS) +#define DEFAULT_HOMING_CYCLE_2 bit(Y_AXIS) +#define DEFAULT_DIRECTION_INVERT_MASK (bit(Y_AXIS) | bit(Z_AXIS)) #define DEFAULT_STEPPER_IDLE_LOCK_TIME 255 -#define DEFAULT_HOMING_CYCLE_0 bit(Z_AXIS) -#define DEFAULT_HOMING_CYCLE_1 bit(X_AXIS) -#define DEFAULT_HOMING_CYCLE_2 bit(Y_AXIS) - -#define DEFAULT_HOMING_SEEK_RATE 3500 +#define DEFAULT_SPINDLE_DELAY_SPINUP 2.0 +#define DEFAULT_SPINDLE_DELAY_SPINDOWN 6.0 diff --git a/Grbl_Esp32/src/Settings.cpp b/Grbl_Esp32/src/Settings.cpp index 5450b444..e8141c95 100644 --- a/Grbl_Esp32/src/Settings.cpp +++ b/Grbl_Esp32/src/Settings.cpp @@ -497,7 +497,7 @@ Error EnumSetting::setStringValue(char* s) { } _currentValue = it->second; if (_storedValue != _currentValue) { - if (_storedValue == _defaultValue) { + if (_currentValue == _defaultValue) { nvs_erase_key(_handle, _keyName); } else { if (nvs_set_i8(_handle, _keyName, _currentValue)) { diff --git a/Grbl_Esp32/src/Spindles/PWMSpindle.cpp b/Grbl_Esp32/src/Spindles/PWMSpindle.cpp index 3b47c72d..1064aa6a 100644 --- a/Grbl_Esp32/src/Spindles/PWMSpindle.cpp +++ b/Grbl_Esp32/src/Spindles/PWMSpindle.cpp @@ -155,22 +155,18 @@ namespace Spindles { return; // Block during abort. } - if (_current_state == SpindleState::Disable) { // Halt or set spindle direction and rpm. + if (state == SpindleState::Disable) { // Halt or set spindle direction and rpm. sys.spindle_speed = 0; stop(); if (use_delays && (_current_state != state)) { - //grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "SpinDown Start "); mc_dwell(spindle_delay_spindown->get()); - //grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "SpinDown Done"); } } else { - set_dir_pin(_current_state == SpindleState::Cw); + set_dir_pin(state == SpindleState::Cw); set_rpm(rpm); - set_enable_pin(_current_state != SpindleState::Disable); // must be done after setting rpm for enable features to work + set_enable_pin(state != SpindleState::Disable); // must be done after setting rpm for enable features to work if (use_delays && (_current_state != state)) { - //grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "SpinUp Start %d", rpm); mc_dwell(spindle_delay_spinup->get()); - //grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "SpinUp Done"); } }