Merge branch 'Implement-M591-Configurable-Runout-Sensors' into Raptor_2.0.X_Devel
This commit is contained in:
+44
-39
@@ -694,12 +694,12 @@
|
||||
//#define MAX31865_CALIBRATION_OHMS_1 430
|
||||
|
||||
#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109
|
||||
#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer
|
||||
#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target
|
||||
#define TEMP_WINDOW 3 // (°C) Temperature proximity for the "temperature reached" timer
|
||||
#define TEMP_HYSTERESIS 5 // (°C) Temperature proximity considered "close enough" to the target
|
||||
|
||||
#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190
|
||||
#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer
|
||||
#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target
|
||||
#define TEMP_BED_WINDOW 3 // (°C) Temperature proximity for the "temperature reached" timer
|
||||
#define TEMP_BED_HYSTERESIS 5 // (°C) Temperature proximity considered "close enough" to the target
|
||||
|
||||
#define TEMP_CHAMBER_RESIDENCY_TIME 10 // (seconds) Time to wait for chamber to "settle" in M191
|
||||
#define TEMP_CHAMBER_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer
|
||||
@@ -784,8 +784,6 @@
|
||||
#define PID_K1 0.95 // Smoothing factor within any PID loop
|
||||
|
||||
#if ENABLED(PIDTEMP)
|
||||
#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM)
|
||||
#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM)
|
||||
//#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
|
||||
// Set/get with gcode: M301 E[extruder number, 0-2]
|
||||
|
||||
@@ -810,6 +808,9 @@
|
||||
* for PID_EXTRUSION_SCALING and PID_FAN_SCALING. Use M306 to autotune the model.
|
||||
*/
|
||||
#if ENABLED(MPCTEMP)
|
||||
//#define MPC_EDIT_MENU // Add MPC editing to the "Advanced Settings" menu. (~1300 bytes of flash)
|
||||
//#define MPC_AUTOTUNE_MENU // Add MPC auto-tuning to the "Advanced Settings" menu. (~350 bytes of flash)
|
||||
|
||||
#define MPC_MAX BANG_MAX // (0..255) Current to nozzle while MPC is active.
|
||||
#define MPC_HEATER_POWER { 40.0f } // (W) Heat cartridge powers.
|
||||
|
||||
@@ -838,6 +839,7 @@
|
||||
#define MPC_STEADYSTATE 0.5f // (K/s) Temperature change rate for steady state logic to be enforced.
|
||||
|
||||
#define MPC_TUNING_POS { X_CENTER, Y_CENTER, 1.0f } // (mm) M306 Autotuning position, ideally bed center just above the surface.
|
||||
#define MPC_TUNING_END_Z 10.0f // (mm) M306 Autotuning final Z position.
|
||||
#endif
|
||||
|
||||
//===========================================================================
|
||||
@@ -942,6 +944,9 @@
|
||||
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
|
||||
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
|
||||
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
|
||||
|
||||
#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of flash)
|
||||
#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of flash)
|
||||
#endif
|
||||
|
||||
// @section extruder
|
||||
@@ -2262,7 +2267,7 @@
|
||||
* M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.)
|
||||
*/
|
||||
#define EEPROM_SETTINGS // Persistent storage with M500 and M501
|
||||
//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release!
|
||||
//#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release!
|
||||
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM.
|
||||
#define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
@@ -2993,38 +2998,38 @@
|
||||
//========================== Extensible UI Displays ===========================
|
||||
//=============================================================================
|
||||
|
||||
//
|
||||
// DGUS Touch Display with DWIN OS. (Choose one.)
|
||||
// ORIGIN : https://www.aliexpress.com/item/32993409517.html
|
||||
// FYSETC : https://www.aliexpress.com/item/32961471929.html
|
||||
// MKS : https://www.aliexpress.com/item/1005002008179262.html
|
||||
//
|
||||
// Flash display with DGUS Displays for Marlin:
|
||||
// - Format the SD card to FAT32 with an allocation size of 4kb.
|
||||
// - Download files as specified for your type of display.
|
||||
// - Plug the microSD card into the back of the display.
|
||||
// - Boot the display and wait for the update to complete.
|
||||
//
|
||||
// ORIGIN (Marlin DWIN_SET)
|
||||
// - Download https://github.com/coldtobi/Marlin_DGUS_Resources
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
// FYSETC (Supplier default)
|
||||
// - Download https://github.com/FYSETC/FYSTLCD-2.0
|
||||
// - Copy the downloaded SCREEN folder to the SD card.
|
||||
//
|
||||
// HIPRECY (Supplier default)
|
||||
// - Download https://github.com/HiPrecy/Touch-Lcd-LEO
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
// MKS (MKS-H43) (Supplier default)
|
||||
// - Download https://github.com/makerbase-mks/MKS-H43
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
// RELOADED (T5UID1)
|
||||
// - Download https://github.com/Desuuuu/DGUS-reloaded/releases
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
/**
|
||||
* DGUS Touch Display with DWIN OS. (Choose one.)
|
||||
* ORIGIN : https://www.aliexpress.com/item/32993409517.html
|
||||
* FYSETC : https://www.aliexpress.com/item/32961471929.html
|
||||
* MKS : https://www.aliexpress.com/item/1005002008179262.html
|
||||
*
|
||||
* Flash display with DGUS Displays for Marlin:
|
||||
* - Format the SD card to FAT32 with an allocation size of 4kb.
|
||||
* - Download files as specified for your type of display.
|
||||
* - Plug the microSD card into the back of the display.
|
||||
* - Boot the display and wait for the update to complete.
|
||||
*
|
||||
* ORIGIN (Marlin DWIN_SET)
|
||||
* - Download https://github.com/coldtobi/Marlin_DGUS_Resources
|
||||
* - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
*
|
||||
* FYSETC (Supplier default)
|
||||
* - Download https://github.com/FYSETC/FYSTLCD-2.0
|
||||
* - Copy the downloaded SCREEN folder to the SD card.
|
||||
*
|
||||
* HIPRECY (Supplier default)
|
||||
* - Download https://github.com/HiPrecy/Touch-Lcd-LEO
|
||||
* - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
*
|
||||
* MKS (MKS-H43) (Supplier default)
|
||||
* - Download https://github.com/makerbase-mks/MKS-H43
|
||||
* - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
*
|
||||
* RELOADED (T5UID1)
|
||||
* - Download https://github.com/Desuuuu/DGUS-reloaded/releases
|
||||
* - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
*/
|
||||
//#define DGUS_LCD_UI_ORIGIN
|
||||
//#define DGUS_LCD_UI_FYSETC
|
||||
//#define DGUS_LCD_UI_HIPRECY
|
||||
|
||||
@@ -626,7 +626,6 @@
|
||||
#define E7_AUTO_FAN_PIN -1
|
||||
#define CHAMBER_AUTO_FAN_PIN -1
|
||||
#define COOLER_AUTO_FAN_PIN -1
|
||||
#define COOLER_FAN_PIN -1
|
||||
|
||||
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
|
||||
#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed
|
||||
@@ -1716,6 +1715,17 @@
|
||||
// Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
|
||||
//#define USE_SMALL_INFOFONT
|
||||
|
||||
/**
|
||||
* Graphical Display Sleep
|
||||
*
|
||||
* The U8G library provides sleep / wake functions for SH1106, SSD1306,
|
||||
* SSD1309, and some other DOGM displays.
|
||||
* Enable this option to save energy and prevent OLED pixel burn-in.
|
||||
* Adds the menu item Configuration > LCD Timeout (m) to set a wait period
|
||||
* from 0 (disabled) to 99 minutes.
|
||||
*/
|
||||
//#define DISPLAY_SLEEP_MINUTES 2 // (minutes) Timeout before turning off the screen
|
||||
|
||||
/**
|
||||
* ST7920-based LCDs can emulate a 16 x 4 character display using
|
||||
* the ST7920 character-generator for very fast screen updates.
|
||||
@@ -2520,12 +2530,16 @@
|
||||
#define TOOLCHANGE_FS_FAN_SPEED 255 // 0-255
|
||||
#define TOOLCHANGE_FS_FAN_TIME 10 // (seconds)
|
||||
|
||||
// Swap uninitialized extruder (using TOOLCHANGE_FS_PRIME_SPEED feedrate)
|
||||
// (May break filament if not retracted beforehand.)
|
||||
//#define TOOLCHANGE_FS_INIT_BEFORE_SWAP
|
||||
// Use TOOLCHANGE_FS_PRIME_SPEED feedrate the first time each extruder is primed
|
||||
//#define TOOLCHANGE_FS_SLOW_FIRST_PRIME
|
||||
|
||||
// Prime on the first T0 (For other tools use TOOLCHANGE_FS_INIT_BEFORE_SWAP)
|
||||
// Enable with M217 V1 before printing to avoid unwanted priming on host connect
|
||||
/**
|
||||
* Prime T0 the first time T0 is sent to the printer:
|
||||
* [ Power-On -> T0 { Activate & Prime T0 } -> T1 { Retract T0, Activate & Prime T1 } ]
|
||||
* If disabled, no priming on T0 until switching back to T0 from another extruder:
|
||||
* [ Power-On -> T0 { T0 Activated } -> T1 { Activate & Prime T1 } -> T0 { Retract T1, Activate & Prime T0 } ]
|
||||
* Enable with M217 V1 before printing to avoid unwanted priming on host connect.
|
||||
*/
|
||||
//#define TOOLCHANGE_FS_PRIME_FIRST_USED
|
||||
|
||||
/**
|
||||
@@ -2902,6 +2916,7 @@
|
||||
#define U_RSENSE 0.11
|
||||
#define U_CHAIN_POS -1
|
||||
//#define U_INTERPOLATE true
|
||||
//#define U_HOLD_MULTIPLIER 0.5
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(V)
|
||||
@@ -2911,6 +2926,7 @@
|
||||
#define V_RSENSE 0.11
|
||||
#define V_CHAIN_POS -1
|
||||
//#define V_INTERPOLATE true
|
||||
//#define V_HOLD_MULTIPLIER 0.5
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(W)
|
||||
@@ -2920,6 +2936,7 @@
|
||||
#define W_RSENSE 0.11
|
||||
#define W_CHAIN_POS -1
|
||||
//#define W_INTERPOLATE true
|
||||
//#define W_HOLD_MULTIPLIER 0.5
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E0)
|
||||
@@ -3918,6 +3935,9 @@
|
||||
* Auto-report temperatures with M155 S<seconds>
|
||||
*/
|
||||
#define AUTO_REPORT_TEMPERATURES
|
||||
#if ENABLED(AUTO_REPORT_TEMPERATURES) && TEMP_SENSOR_REDUNDANT
|
||||
//#define AUTO_REPORT_REDUNDANT // Include the "R" sensor in the auto-report
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Auto-report position with M154 S<seconds>
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@
|
||||
* here we define this default string as the date where the latest release
|
||||
* version was tagged.
|
||||
*/
|
||||
#define STRING_DISTRIBUTION_DATE "2022-04-03"
|
||||
#define STRING_DISTRIBUTION_DATE "2022-04-10"
|
||||
|
||||
/**
|
||||
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
||||
|
||||
@@ -229,7 +229,7 @@ public:
|
||||
SBI(DIDR0, ch);
|
||||
}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given channel. Called from Temperature::isr!
|
||||
static void adc_start(const uint8_t ch) {
|
||||
#ifdef MUX5
|
||||
ADCSRB = ch > 7 ? _BV(MUX5) : 0;
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
#define MULTI_NAME_PAD 26 // space needed to be pretty if not first name assigned to a pin
|
||||
|
||||
void PRINT_ARRAY_NAME(uint8_t x) {
|
||||
char *name_mem_pointer = (char*)pgm_read_ptr(&pin_array[x].name);
|
||||
char *name_mem_pointer = (PGM_P)pgm_read_ptr(&pin_array[x].name);
|
||||
LOOP_L_N(y, MAX_NAME_LENGTH) {
|
||||
char temp_char = pgm_read_byte(name_mem_pointer + y);
|
||||
if (temp_char != 0)
|
||||
|
||||
@@ -209,7 +209,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const uint8_t ch) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given channel. Called from Temperature::isr!
|
||||
static void adc_start(const uint8_t ch) { adc_result = analogRead(ch); }
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -244,7 +244,8 @@ void MarlinHAL::adc_start(const pin_t pin) {
|
||||
const adc1_channel_t chan = get_channel(pin);
|
||||
uint32_t mv;
|
||||
esp_adc_cal_get_voltage((adc_channel_t)chan, &characteristics[attenuations[chan]], &mv);
|
||||
adc_result = mv * 1023.0f / float(ADC_REFERENCE_VOLTAGE) / 1000.0f;
|
||||
|
||||
adc_result = mv * isr_float_t(1023) / isr_float_t(ADC_REFERENCE_VOLTAGE) / isr_float_t(1000);
|
||||
|
||||
// Change the attenuation level based on the new reading
|
||||
adc_atten_t atten;
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
// Types
|
||||
// ------------------------
|
||||
|
||||
typedef double isr_float_t; // FPU ops are used for single-precision, so use double for ISRs.
|
||||
typedef int16_t pin_t;
|
||||
|
||||
class Servo;
|
||||
@@ -205,7 +206,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t pin) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -234,7 +234,7 @@ public:
|
||||
FilteredADC::enable_channel(pin);
|
||||
}
|
||||
|
||||
// Begin ADC sampling on the given pin
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static uint32_t adc_result;
|
||||
static void adc_start(const pin_t pin) {
|
||||
adc_result = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits
|
||||
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const uint8_t ch);
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given channel. Called from Temperature::isr!
|
||||
static void adc_start(const uint8_t ch);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const uint8_t ch) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -127,6 +127,8 @@
|
||||
// Types
|
||||
// ------------------------
|
||||
|
||||
typedef double isr_float_t; // FPU ops are used for single-precision, so use double for ISRs.
|
||||
|
||||
#ifdef STM32G0B1xx
|
||||
typedef int32_t pin_t;
|
||||
#else
|
||||
@@ -241,7 +243,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t pin) { pinMode(pin, INPUT); }
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin) { adc_result = analogRead(pin); }
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -280,7 +280,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t pin) { pinMode(pin, INPUT_ANALOG); }
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t ch) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given channel. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t ch);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -173,7 +173,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t pin) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -412,7 +412,9 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
|
||||
if (do_reset_timeout) gcode.reset_stepper_timeout(ms);
|
||||
|
||||
if (gcode.stepper_max_timed_out(ms)) {
|
||||
SERIAL_ERROR_MSG(STR_KILL_INACTIVE_TIME, parser.command_ptr);
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ECHOPGM(STR_KILL_PRE);
|
||||
SERIAL_ECHOLNPGM(STR_KILL_INACTIVE_TIME, parser.command_ptr);
|
||||
kill();
|
||||
}
|
||||
|
||||
@@ -473,7 +475,9 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
|
||||
// KILL the machine
|
||||
// ----------------------------------------------------------------
|
||||
if (killCount >= KILL_DELAY) {
|
||||
SERIAL_ERROR_MSG(STR_KILL_BUTTON);
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ECHOPGM(STR_KILL_PRE);
|
||||
SERIAL_ECHOLNPGM(STR_KILL_BUTTON);
|
||||
kill();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -199,16 +199,20 @@
|
||||
#define STR_FILAMENT_CHANGE_INSERT_M108 "Insert filament and send M108"
|
||||
#define STR_FILAMENT_CHANGE_WAIT_M108 "Send M108 to resume"
|
||||
|
||||
#define STR_STOP_BLTOUCH "!! STOP called because of BLTouch error - restart with M999"
|
||||
#define STR_STOP_UNHOMED "!! STOP called because of unhomed error - restart with M999"
|
||||
#define STR_KILL_INACTIVE_TIME "!! KILL caused by too much inactive time - current command: "
|
||||
#define STR_KILL_BUTTON "!! KILL caused by KILL button/pin"
|
||||
#define STR_STOP_PRE "!! STOP called because of "
|
||||
#define STR_STOP_POST " error - restart with M999"
|
||||
#define STR_STOP_BLTOUCH "BLTouch"
|
||||
#define STR_STOP_UNHOMED "unhomed"
|
||||
#define STR_KILL_PRE "!! KILL caused by "
|
||||
#define STR_KILL_INACTIVE_TIME "too much inactive time - current command: "
|
||||
#define STR_KILL_BUTTON "KILL button/pin"
|
||||
|
||||
// temperature.cpp strings
|
||||
#define STR_PID_AUTOTUNE_START "PID Autotune start"
|
||||
#define STR_PID_BAD_HEATER_ID "PID Autotune failed! Bad heater id"
|
||||
#define STR_PID_TEMP_TOO_HIGH "PID Autotune failed! Temperature too high"
|
||||
#define STR_PID_TIMEOUT "PID Autotune failed! timeout"
|
||||
#define STR_PID_AUTOTUNE "PID Autotune"
|
||||
#define STR_PID_AUTOTUNE_START " start"
|
||||
#define STR_PID_BAD_HEATER_ID " failed! Bad heater id"
|
||||
#define STR_PID_TEMP_TOO_HIGH " failed! Temperature too high"
|
||||
#define STR_PID_TIMEOUT " failed! timeout"
|
||||
#define STR_BIAS " bias: "
|
||||
#define STR_D_COLON " d: "
|
||||
#define STR_T_MIN " min: "
|
||||
@@ -219,7 +223,7 @@
|
||||
#define STR_KP " Kp: "
|
||||
#define STR_KI " Ki: "
|
||||
#define STR_KD " Kd: "
|
||||
#define STR_PID_AUTOTUNE_FINISHED "PID Autotune finished! Put the last Kp, Ki and Kd constants from below into Configuration.h"
|
||||
#define STR_PID_AUTOTUNE_FINISHED " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h"
|
||||
#define STR_PID_DEBUG " PID_DEBUG "
|
||||
#define STR_PID_DEBUG_INPUT ": Input "
|
||||
#define STR_PID_DEBUG_OUTPUT " Output "
|
||||
@@ -228,6 +232,14 @@
|
||||
#define STR_PID_DEBUG_DTERM " dTerm "
|
||||
#define STR_PID_DEBUG_CTERM " cTerm "
|
||||
#define STR_INVALID_EXTRUDER_NUM " - Invalid extruder number !"
|
||||
#define STR_MPC_AUTOTUNE "MPC Autotune"
|
||||
#define STR_MPC_AUTOTUNE_START " start for " STR_E
|
||||
#define STR_MPC_AUTOTUNE_INTERRUPTED " interrupted!"
|
||||
#define STR_MPC_AUTOTUNE_FINISHED " finished! Put the constants below into Configuration.h"
|
||||
#define STR_MPC_COOLING_TO_AMBIENT "Cooling to ambient"
|
||||
#define STR_MPC_HEATING_PAST_200 "Heating to over 200C"
|
||||
#define STR_MPC_MEASURING_AMBIENT "Measuring ambient heatloss at "
|
||||
#define STR_MPC_TEMPERATURE_ERROR "Temperature error"
|
||||
|
||||
#define STR_HEATER_BED "bed"
|
||||
#define STR_HEATER_CHAMBER "chamber"
|
||||
@@ -303,6 +315,7 @@
|
||||
#define STR_MATERIAL_HEATUP "Material heatup parameters"
|
||||
#define STR_LCD_CONTRAST "LCD Contrast"
|
||||
#define STR_LCD_BRIGHTNESS "LCD Brightness"
|
||||
#define STR_DISPLAY_SLEEP "Display Sleep"
|
||||
#define STR_UI_LANGUAGE "UI Language"
|
||||
#define STR_Z_PROBE_OFFSET "Z-Probe Offset"
|
||||
#define STR_TEMPERATURE_UNITS "Temperature Units"
|
||||
|
||||
@@ -36,6 +36,9 @@ extern const char NUL_STR[], SP_P_STR[], SP_T_STR[],
|
||||
X_STR[], Y_STR[], Z_STR[], I_STR[], J_STR[], K_STR[], U_STR[], V_STR[], W_STR[], E_STR[],
|
||||
X_LBL[], Y_LBL[], Z_LBL[], I_LBL[], J_LBL[], K_LBL[], U_LBL[], V_LBL[], W_LBL[], E_LBL[];
|
||||
|
||||
PGM_P const SP_AXIS_LBL[] PROGMEM = LOGICAL_AXIS_ARRAY(SP_E_LBL, SP_X_LBL, SP_Y_LBL, SP_Z_LBL, SP_I_LBL, SP_J_LBL, SP_K_LBL, SP_U_LBL, SP_V_LBL, SP_W_LBL);
|
||||
PGM_P const SP_AXIS_STR[] PROGMEM = LOGICAL_AXIS_ARRAY(SP_E_STR, SP_X_STR, SP_Y_STR, SP_Z_STR, SP_I_STR, SP_J_STR, SP_K_STR, SP_U_STR, SP_V_STR, SP_W_STR);
|
||||
|
||||
//
|
||||
// Debugging flags for use by M111
|
||||
//
|
||||
|
||||
@@ -76,6 +76,59 @@ struct IF<true, L, R> { typedef L type; };
|
||||
|
||||
#define AXIS_COLLISION(L) (AXIS4_NAME == L || AXIS5_NAME == L || AXIS6_NAME == L || AXIS7_NAME == L || AXIS8_NAME == L || AXIS9_NAME == L)
|
||||
|
||||
// General Flags for some number of states
|
||||
template<size_t N>
|
||||
struct Flags {
|
||||
typedef typename IF<(N>8), uint16_t, uint8_t>::type bits_t;
|
||||
typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1; } N8;
|
||||
typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1, b8:1, b9:1, b10:1, b11:1, b12:1, b13:1, b14:1, b15:1; } N16;
|
||||
union {
|
||||
bits_t b;
|
||||
typename IF<(N>8), N16, N8>::type flag;
|
||||
};
|
||||
void reset() { b = 0; }
|
||||
void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); }
|
||||
void set(const int n) { b |= (bits_t)_BV(n); }
|
||||
void clear(const int n) { b &= ~(bits_t)_BV(n); }
|
||||
bool test(const int n) const { return TEST(b, n); }
|
||||
bool operator[](const int n) { return test(n); }
|
||||
const bool operator[](const int n) const { return test(n); }
|
||||
const int size() const { return sizeof(b); }
|
||||
};
|
||||
|
||||
// Specialization for a single bool flag
|
||||
template<>
|
||||
struct Flags<1> {
|
||||
bool b;
|
||||
void reset() { b = false; }
|
||||
void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); }
|
||||
void set(const int) { b = true; }
|
||||
void clear(const int) { b = false; }
|
||||
bool test(const int) const { return b; }
|
||||
bool operator[](const int) { return b; }
|
||||
const bool operator[](const int) const { return b; }
|
||||
const int size() const { return sizeof(b); }
|
||||
};
|
||||
|
||||
typedef Flags<8> flags_8_t;
|
||||
typedef Flags<16> flags_16_t;
|
||||
|
||||
// Flags for some axis states, with per-axis aliases xyzijkuvwe
|
||||
typedef struct AxisFlags {
|
||||
union {
|
||||
struct Flags<LOGICAL_AXES> flags;
|
||||
struct { bool LOGICAL_AXIS_LIST(e:1, x:1, y:1, z:1, i:1, j:1, k:1, u:1, v:1, w:1); };
|
||||
};
|
||||
void reset() { flags.reset(); }
|
||||
void set(const int n) { flags.set(n); }
|
||||
void set(const int n, const bool onoff) { flags.set(n, onoff); }
|
||||
void clear(const int n) { flags.clear(n); }
|
||||
bool test(const int n) const { return flags.test(n); }
|
||||
bool operator[](const int n) { return flags[n]; }
|
||||
const bool operator[](const int n) const { return flags[n]; }
|
||||
const int size() const { return sizeof(flags); }
|
||||
} axis_flags_t;
|
||||
|
||||
//
|
||||
// Enumerated axis indices
|
||||
//
|
||||
|
||||
@@ -126,7 +126,7 @@ void safe_delay(millis_t ms) {
|
||||
#if ABL_PLANAR
|
||||
SERIAL_ECHOPGM("ABL Adjustment");
|
||||
LOOP_NUM_AXES(a) {
|
||||
SERIAL_CHAR(' ', AXIS_CHAR(a));
|
||||
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_STR[a]));
|
||||
serial_offset(planner.get_axis_position_mm(AxisEnum(a)) - current_position[a]);
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -79,7 +79,7 @@ constexpr uint8_t ui8_to_percent(const uint8_t i) { return (int(i) * 100 + 127)
|
||||
|
||||
// Axis names for G-code parsing, reports, etc.
|
||||
const xyze_char_t axis_codes LOGICAL_AXIS_ARRAY('E', 'X', 'Y', 'Z', AXIS4_NAME, AXIS5_NAME, AXIS6_NAME, AXIS7_NAME, AXIS8_NAME, AXIS9_NAME);
|
||||
#if NUM_AXES <= XYZ
|
||||
#if NUM_AXES <= XYZ && !HAS_EXTRUDERS
|
||||
#define AXIS_CHAR(A) ((char)('X' + A))
|
||||
#define IAXIS_CHAR AXIS_CHAR
|
||||
#else
|
||||
|
||||
@@ -111,11 +111,8 @@ bool BLTouch::deploy_proc() {
|
||||
// Last attempt to DEPLOY
|
||||
if (_deploy_query_alarm()) {
|
||||
// The deploy might have failed or the probe is actually triggered (nozzle too low?) again
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Recovery Failed");
|
||||
|
||||
SERIAL_ERROR_MSG(STR_STOP_BLTOUCH); // Tell the user something is wrong, needs action
|
||||
stop(); // but it's not too bad, no need to kill, allow restart
|
||||
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Deploy Failed");
|
||||
probe.probe_error_stop(); // Something is wrong, needs action, but not too bad, allow restart
|
||||
return true; // Tell our caller we goofed in case he cares to know
|
||||
}
|
||||
}
|
||||
@@ -153,12 +150,8 @@ bool BLTouch::stow_proc() {
|
||||
// But one more STOW will catch that
|
||||
// Last attempt to STOW
|
||||
if (_stow_query_alarm()) { // so if there is now STILL an ALARM condition:
|
||||
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Recovery Failed");
|
||||
|
||||
SERIAL_ERROR_MSG(STR_STOP_BLTOUCH); // Tell the user something is wrong, needs action
|
||||
stop(); // but it's not too bad, no need to kill, allow restart
|
||||
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Stow Failed");
|
||||
probe.probe_error_stop(); // Something is wrong, needs action, but not too bad, allow restart
|
||||
return true; // Tell our caller we goofed in case he cares to know
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ void I2CPositionEncoder::init(const uint8_t address, const AxisEnum axis) {
|
||||
|
||||
initialized = true;
|
||||
|
||||
SERIAL_ECHOLNPGM("Setting up encoder on ", AS_CHAR(axis_codes[encoderAxis]), " axis, addr = ", address);
|
||||
SERIAL_ECHOLNPGM("Setting up encoder on ", AS_CHAR(AXIS_CHAR(encoderAxis)), " axis, addr = ", address);
|
||||
|
||||
position = get_position();
|
||||
}
|
||||
@@ -67,7 +67,7 @@ void I2CPositionEncoder::update() {
|
||||
/*
|
||||
if (trusted) { //commented out as part of the note below
|
||||
trusted = false;
|
||||
SERIAL_ECHOLNPGM("Fault detected on ", AS_CHAR(axis_codes[encoderAxis]), " axis encoder. Disengaging error correction until module is trusted again.");
|
||||
SERIAL_ECHOLNPGM("Fault detected on ", AS_CHAR(AXIS_CHAR(encoderAxis)), " axis encoder. Disengaging error correction until module is trusted again.");
|
||||
}
|
||||
*/
|
||||
return;
|
||||
@@ -92,7 +92,7 @@ void I2CPositionEncoder::update() {
|
||||
if (millis() - lastErrorTime > I2CPE_TIME_TRUSTED) {
|
||||
trusted = true;
|
||||
|
||||
SERIAL_ECHOLNPGM("Untrusted encoder module on ", AS_CHAR(axis_codes[encoderAxis]), " axis has been fault-free for set duration, reinstating error correction.");
|
||||
SERIAL_ECHOLNPGM("Untrusted encoder module on ", AS_CHAR(AXIS_CHAR(encoderAxis)), " axis has been fault-free for set duration, reinstating error correction.");
|
||||
|
||||
//the encoder likely lost its place when the error occurred, so we'll reset and use the printer's
|
||||
//idea of where it the axis is to re-initialize
|
||||
@@ -172,7 +172,7 @@ void I2CPositionEncoder::update() {
|
||||
float sumP = 0;
|
||||
LOOP_L_N(i, I2CPE_ERR_PRST_ARRAY_SIZE) sumP += errPrst[i];
|
||||
const int32_t errorP = int32_t(sumP * RECIPROCAL(I2CPE_ERR_PRST_ARRAY_SIZE));
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
SERIAL_ECHOLNPGM(" : CORRECT ERR ", errorP * planner.mm_per_step[encoderAxis], "mm");
|
||||
babystep.add_steps(encoderAxis, -LROUND(errorP));
|
||||
errPrstIdx = 0;
|
||||
@@ -192,7 +192,7 @@ void I2CPositionEncoder::update() {
|
||||
if (ABS(error) > I2CPE_ERR_CNT_THRESH * planner.settings.axis_steps_per_mm[encoderAxis]) {
|
||||
const millis_t ms = millis();
|
||||
if (ELAPSED(ms, nextErrorCountTime)) {
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
SERIAL_ECHOLNPGM(" : LARGE ERR ", error, "; diffSum=", diffSum);
|
||||
errorCount++;
|
||||
nextErrorCountTime = ms + I2CPE_ERR_CNT_DEBOUNCE_MS;
|
||||
@@ -212,7 +212,7 @@ void I2CPositionEncoder::set_homed() {
|
||||
homed = trusted = true;
|
||||
|
||||
#ifdef I2CPE_DEBUG
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
SERIAL_ECHOLNPGM(" axis encoder homed, offset of ", zeroOffset, " ticks.");
|
||||
#endif
|
||||
}
|
||||
@@ -223,7 +223,7 @@ void I2CPositionEncoder::set_unhomed() {
|
||||
homed = trusted = false;
|
||||
|
||||
#ifdef I2CPE_DEBUG
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
SERIAL_ECHOLNPGM(" axis encoder unhomed.");
|
||||
#endif
|
||||
}
|
||||
@@ -231,7 +231,7 @@ void I2CPositionEncoder::set_unhomed() {
|
||||
bool I2CPositionEncoder::passes_test(const bool report) {
|
||||
if (report) {
|
||||
if (H != I2CPE_MAG_SIG_GOOD) SERIAL_ECHOPGM("Warning. ");
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
serial_ternary(H == I2CPE_MAG_SIG_BAD, F(" axis "), F("magnetic strip "), F("encoder "));
|
||||
switch (H) {
|
||||
case I2CPE_MAG_SIG_GOOD:
|
||||
@@ -252,7 +252,7 @@ float I2CPositionEncoder::get_axis_error_mm(const bool report) {
|
||||
error = ABS(diff) > 10000 ? 0 : diff; // Huge error is a bad reading
|
||||
|
||||
if (report) {
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
SERIAL_ECHOLNPGM(" axis target=", target, "mm; actual=", actual, "mm; err=", error, "mm");
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ float I2CPositionEncoder::get_axis_error_mm(const bool report) {
|
||||
int32_t I2CPositionEncoder::get_axis_error_steps(const bool report) {
|
||||
if (!active) {
|
||||
if (report) {
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
SERIAL_ECHOLNPGM(" axis encoder not active!");
|
||||
}
|
||||
return 0;
|
||||
@@ -287,7 +287,7 @@ int32_t I2CPositionEncoder::get_axis_error_steps(const bool report) {
|
||||
errorPrev = error;
|
||||
|
||||
if (report) {
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
SERIAL_ECHOLNPGM(" axis target=", target, "; actual=", encoderCountInStepperTicksScaled, "; err=", error);
|
||||
}
|
||||
|
||||
@@ -657,7 +657,7 @@ void I2CPositionEncodersMgr::report_position(const int8_t idx, const bool units,
|
||||
else {
|
||||
if (noOffset) {
|
||||
const int32_t raw_count = encoders[idx].get_raw_count();
|
||||
SERIAL_CHAR(axis_codes[encoders[idx].get_axis()], ' ');
|
||||
SERIAL_CHAR(AXIS_CHAR(encoders[idx).get_axis()], ' ');
|
||||
|
||||
for (uint8_t j = 31; j > 0; j--)
|
||||
SERIAL_ECHO((bool)(0x00000001 & (raw_count >> j)));
|
||||
@@ -712,7 +712,7 @@ void I2CPositionEncodersMgr::change_module_address(const uint8_t oldaddr, const
|
||||
// and enable it (it will likely have failed initialization on power-up, before the address change).
|
||||
const int8_t idx = idx_from_addr(newaddr);
|
||||
if (idx >= 0 && !encoders[idx].get_active()) {
|
||||
SERIAL_CHAR(axis_codes[encoders[idx].get_axis()]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoders[idx).get_axis()]);
|
||||
SERIAL_ECHOLNPGM(" axis encoder was not detected on printer startup. Trying again.");
|
||||
encoders[idx].set_active(encoders[idx].passes_test(true));
|
||||
}
|
||||
@@ -814,7 +814,7 @@ void I2CPositionEncodersMgr::M860() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen_test(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen_test(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) report_position(idx, hasU, hasO);
|
||||
}
|
||||
@@ -841,7 +841,7 @@ void I2CPositionEncodersMgr::M861() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) report_status(idx);
|
||||
}
|
||||
@@ -869,7 +869,7 @@ void I2CPositionEncodersMgr::M862() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) test_axis(idx);
|
||||
}
|
||||
@@ -900,7 +900,7 @@ void I2CPositionEncodersMgr::M863() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) calibrate_steps_mm(idx, iterations);
|
||||
}
|
||||
@@ -976,7 +976,7 @@ void I2CPositionEncodersMgr::M865() {
|
||||
|
||||
if (!I2CPE_addr) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) report_module_firmware(encoders[idx].get_address());
|
||||
}
|
||||
@@ -1007,7 +1007,7 @@ void I2CPositionEncodersMgr::M866() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) {
|
||||
if (hasR)
|
||||
@@ -1045,7 +1045,7 @@ void I2CPositionEncodersMgr::M867() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) {
|
||||
const bool ena = onoff == -1 ? !encoders[I2CPE_idx].get_ec_enabled() : !!onoff;
|
||||
@@ -1081,7 +1081,7 @@ void I2CPositionEncodersMgr::M868() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) {
|
||||
if (newThreshold != -9999)
|
||||
@@ -1115,7 +1115,7 @@ void I2CPositionEncodersMgr::M869() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) report_error(idx);
|
||||
}
|
||||
|
||||
@@ -261,32 +261,32 @@ class I2CPositionEncodersMgr {
|
||||
|
||||
static void report_error_count(const int8_t idx, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
SERIAL_ECHOLNPGM("Error count on ", AS_CHAR(axis_codes[axis]), " axis is ", encoders[idx].get_error_count());
|
||||
SERIAL_ECHOLNPGM("Error count on ", AS_CHAR(AXIS_CHAR(axis)), " axis is ", encoders[idx].get_error_count());
|
||||
}
|
||||
|
||||
static void reset_error_count(const int8_t idx, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
encoders[idx].set_error_count(0);
|
||||
SERIAL_ECHOLNPGM("Error count on ", AS_CHAR(axis_codes[axis]), " axis has been reset.");
|
||||
SERIAL_ECHOLNPGM("Error count on ", AS_CHAR(AXIS_CHAR(axis)), " axis has been reset.");
|
||||
}
|
||||
|
||||
static void enable_ec(const int8_t idx, const bool enabled, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
encoders[idx].set_ec_enabled(enabled);
|
||||
SERIAL_ECHOPGM("Error correction on ", AS_CHAR(axis_codes[axis]));
|
||||
SERIAL_ECHOPGM("Error correction on ", AS_CHAR(AXIS_CHAR(axis)));
|
||||
SERIAL_ECHO_TERNARY(encoders[idx].get_ec_enabled(), " axis is ", "en", "dis", "abled.\n");
|
||||
}
|
||||
|
||||
static void set_ec_threshold(const int8_t idx, const float newThreshold, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
encoders[idx].set_ec_threshold(newThreshold);
|
||||
SERIAL_ECHOLNPGM("Error correct threshold for ", AS_CHAR(axis_codes[axis]), " axis set to ", newThreshold, "mm.");
|
||||
SERIAL_ECHOLNPGM("Error correct threshold for ", AS_CHAR(AXIS_CHAR(axis)), " axis set to ", newThreshold, "mm.");
|
||||
}
|
||||
|
||||
static void get_ec_threshold(const int8_t idx, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
const float threshold = encoders[idx].get_ec_threshold();
|
||||
SERIAL_ECHOLNPGM("Error correct threshold for ", AS_CHAR(axis_codes[axis]), " axis is ", threshold, "mm.");
|
||||
SERIAL_ECHOLNPGM("Error correct threshold for ", AS_CHAR(AXIS_CHAR(axis)), " axis is ", threshold, "mm.");
|
||||
}
|
||||
|
||||
static int8_t idx_from_axis(const AxisEnum axis) {
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255 && DISABLED(FOURWIRES_FANS)
|
||||
bool FanCheck::measuring = false;
|
||||
#endif
|
||||
bool FanCheck::tacho_state[TACHO_COUNT];
|
||||
Flags<TACHO_COUNT> FanCheck::tacho_state;
|
||||
uint16_t FanCheck::edge_counter[TACHO_COUNT];
|
||||
uint8_t FanCheck::rps[TACHO_COUNT];
|
||||
FanCheck::TachoError FanCheck::error = FanCheck::TachoError::NONE;
|
||||
@@ -103,7 +103,7 @@ void FanCheck::update_tachometers() {
|
||||
|
||||
if (status != tacho_state[f]) {
|
||||
if (measuring) ++edge_counter[f];
|
||||
tacho_state[f] = status;
|
||||
tacho_state.set(f, status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ class FanCheck {
|
||||
#else
|
||||
static constexpr bool measuring = true;
|
||||
#endif
|
||||
static bool tacho_state[TACHO_COUNT];
|
||||
static Flags<TACHO_COUNT> tacho_state;
|
||||
static uint16_t edge_counter[TACHO_COUNT];
|
||||
static uint8_t rps[TACHO_COUNT];
|
||||
static TachoError error;
|
||||
|
||||
@@ -45,7 +45,7 @@ FWRetract fwretract; // Single instance - this calls the constructor
|
||||
// private:
|
||||
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
bool FWRetract::retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted
|
||||
Flags<EXTRUDERS> FWRetract::retracted_swap; // Which extruders are swap-retracted
|
||||
#endif
|
||||
|
||||
// public:
|
||||
@@ -56,7 +56,7 @@ fwretract_settings_t FWRetract::settings; // M207 S F Z W, M208 S F
|
||||
bool FWRetract::autoretract_enabled; // M209 S - Autoretract switch
|
||||
#endif
|
||||
|
||||
bool FWRetract::retracted[EXTRUDERS]; // Which extruders are currently retracted
|
||||
Flags<EXTRUDERS> FWRetract::retracted; // Which extruders are currently retracted
|
||||
|
||||
float FWRetract::current_retract[EXTRUDERS], // Retract value used by planner
|
||||
FWRetract::current_hop;
|
||||
@@ -73,9 +73,9 @@ void FWRetract::reset() {
|
||||
settings.swap_retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE_SWAP;
|
||||
current_hop = 0.0;
|
||||
|
||||
retracted.reset();
|
||||
EXTRUDER_LOOP() {
|
||||
retracted[e] = false;
|
||||
E_TERN_(retracted_swap[e] = false);
|
||||
E_TERN_(retracted_swap.clear(e));
|
||||
current_retract[e] = 0.0;
|
||||
}
|
||||
}
|
||||
@@ -173,11 +173,11 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/))
|
||||
|
||||
TERN_(RETRACT_SYNC_MIXING, mixer.T(old_mixing_tool)); // Restore original mixing tool
|
||||
|
||||
retracted[active_extruder] = retracting; // Active extruder now retracted / recovered
|
||||
retracted.set(active_extruder, retracting); // Active extruder now retracted / recovered
|
||||
|
||||
// If swap retract/recover update the retracted_swap flag too
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
if (swapping) retracted_swap[active_extruder] = retracting;
|
||||
if (swapping) retracted_swap.set(active_extruder, retracting);
|
||||
#endif
|
||||
|
||||
/* // debugging
|
||||
|
||||
@@ -43,7 +43,7 @@ typedef struct {
|
||||
class FWRetract {
|
||||
private:
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
static bool retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted
|
||||
static Flags<EXTRUDERS> retracted_swap; // Which extruders are swap-retracted
|
||||
#endif
|
||||
|
||||
public:
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
static constexpr bool autoretract_enabled = false;
|
||||
#endif
|
||||
|
||||
static bool retracted[EXTRUDERS]; // Which extruders are currently retracted
|
||||
static Flags<EXTRUDERS> retracted; // Which extruders are currently retracted
|
||||
static float current_retract[EXTRUDERS], // Retract value used by planner
|
||||
current_hop; // Hop value used by planner
|
||||
|
||||
@@ -63,9 +63,7 @@ public:
|
||||
|
||||
static void reset();
|
||||
|
||||
static void refresh_autoretract() {
|
||||
EXTRUDER_LOOP() retracted[e] = false;
|
||||
}
|
||||
static void refresh_autoretract() { retracted.reset(); }
|
||||
|
||||
static void enable_autoretract(const bool enable) {
|
||||
#if ENABLED(FWRETRACT_AUTORETRACT)
|
||||
|
||||
@@ -681,8 +681,9 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
|
||||
|
||||
// If resume_position is negative
|
||||
if (resume_position.e < 0) unscaled_e_move(resume_position.e, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));
|
||||
#if ADVANCED_PAUSE_RESUME_PRIME != 0
|
||||
unscaled_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE));
|
||||
#ifdef ADVANCED_PAUSE_RESUME_PRIME
|
||||
if (ADVANCED_PAUSE_RESUME_PRIME != 0)
|
||||
unscaled_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE));
|
||||
#endif
|
||||
|
||||
// Now all extrusion positions are resumed and ready to be confirmed
|
||||
|
||||
@@ -514,7 +514,7 @@ void PrintJobRecovery::resume() {
|
||||
EXTRUDER_LOOP() {
|
||||
if (info.retract[e] != 0.0) {
|
||||
fwretract.current_retract[e] = info.retract[e];
|
||||
fwretract.retracted[e] = true;
|
||||
fwretract.retracted.set(e);
|
||||
}
|
||||
}
|
||||
fwretract.current_hop = info.retract_hop;
|
||||
|
||||
@@ -375,7 +375,7 @@ void GcodeSuite::G28() {
|
||||
homeZZ = homeZ,
|
||||
homeI = needI || parser.seen_test(AXIS4_NAME), homeJ = needJ || parser.seen_test(AXIS5_NAME),
|
||||
homeK = needK || parser.seen_test(AXIS6_NAME), homeU = needU || parser.seen_test(AXIS7_NAME),
|
||||
homeV = needV || parser.seen_test(AXIS8_NAME), homeW = needW || parser.seen_test(AXIS9_NAME),
|
||||
homeV = needV || parser.seen_test(AXIS8_NAME), homeW = needW || parser.seen_test(AXIS9_NAME)
|
||||
),
|
||||
home_all = NUM_AXIS_GANG( // Home-all if all or none are flagged
|
||||
homeX == homeX, && homeY == homeX, && homeZ == homeX,
|
||||
|
||||
@@ -66,7 +66,7 @@ void GcodeSuite::M425() {
|
||||
LOOP_NUM_AXES(a) {
|
||||
if (axis_can_calibrate(a) && parser.seen(AXIS_CHAR(a))) {
|
||||
planner.synchronize();
|
||||
backlash.set_distance_mm(AxisEnum(a), parser.has_value() ? parser.value_axis_units(AxisEnum(a)) : backlash.get_measurement(AxisEnum(a)));
|
||||
backlash.set_distance_mm((AxisEnum)a, parser.has_value() ? parser.value_axis_units((AxisEnum)a) : backlash.get_measurement((AxisEnum)a));
|
||||
noArgs = false;
|
||||
}
|
||||
}
|
||||
@@ -92,9 +92,7 @@ void GcodeSuite::M425() {
|
||||
SERIAL_ECHOLNPGM(" Correction Amount/Fade-out: F", backlash.get_correction(), " (F1.0 = full, F0.0 = none)");
|
||||
SERIAL_ECHOPGM(" Backlash Distance (mm): ");
|
||||
LOOP_NUM_AXES(a) if (axis_can_calibrate(a)) {
|
||||
SERIAL_CHAR(' ', AXIS_CHAR(a));
|
||||
SERIAL_ECHO(backlash.get_distance_mm(AxisEnum(a)));
|
||||
SERIAL_EOL();
|
||||
SERIAL_ECHOLNPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_STR[a]), backlash.get_distance_mm((AxisEnum)a));
|
||||
}
|
||||
|
||||
#ifdef BACKLASH_SMOOTHING_MM
|
||||
@@ -105,8 +103,7 @@ void GcodeSuite::M425() {
|
||||
SERIAL_ECHOPGM(" Average measured backlash (mm):");
|
||||
if (backlash.has_any_measurement()) {
|
||||
LOOP_NUM_AXES(a) if (axis_can_calibrate(a) && backlash.has_measurement(AxisEnum(a))) {
|
||||
SERIAL_CHAR(' ', AXIS_CHAR(a));
|
||||
SERIAL_ECHO(backlash.get_measurement(AxisEnum(a)));
|
||||
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_STR[a]), backlash.get_measurement((AxisEnum)a));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -125,7 +125,7 @@ void GcodeSuite::M201() {
|
||||
#endif
|
||||
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (parser.seenval(axis_codes[i])) {
|
||||
if (parser.seenval(AXIS_CHAR(i))) {
|
||||
const uint8_t a = TERN(HAS_EXTRUDERS, (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i), i);
|
||||
planner.set_max_acceleration(a, parser.value_axis_units((AxisEnum)a));
|
||||
}
|
||||
@@ -144,7 +144,7 @@ void GcodeSuite::M201_report(const bool forReplay/*=true*/) {
|
||||
SP_K_STR, K_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[K_AXIS]),
|
||||
SP_U_STR, U_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[U_AXIS]),
|
||||
SP_V_STR, V_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[V_AXIS]),
|
||||
SP_W_STR, W_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[W_AXIS]),
|
||||
SP_W_STR, W_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[W_AXIS])
|
||||
)
|
||||
#if HAS_EXTRUDERS && DISABLED(DISTINCT_E_FACTORS)
|
||||
, SP_E_STR, VOLUMETRIC_UNIT(planner.settings.max_acceleration_mm_per_s2[E_AXIS])
|
||||
@@ -174,7 +174,7 @@ void GcodeSuite::M203() {
|
||||
if (target_extruder < 0) return;
|
||||
|
||||
LOOP_LOGICAL_AXES(i)
|
||||
if (parser.seenval(axis_codes[i])) {
|
||||
if (parser.seenval(AXIS_CHAR(i))) {
|
||||
const uint8_t a = TERN(HAS_EXTRUDERS, (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i), i);
|
||||
planner.set_max_feedrate(a, parser.value_axis_units((AxisEnum)a));
|
||||
}
|
||||
|
||||
@@ -34,31 +34,31 @@
|
||||
#include "../../MarlinCore.h" // for SP_X_STR, etc.
|
||||
|
||||
/**
|
||||
* M217 - Set SINGLENOZZLE toolchange parameters
|
||||
* M217 - Set toolchange parameters
|
||||
*
|
||||
* // Tool change command
|
||||
* Q Prime active tool and exit
|
||||
*
|
||||
* // Tool change settings
|
||||
* S[linear] Swap length
|
||||
* B[linear] Extra Swap length
|
||||
* E[linear] Prime length
|
||||
* P[linear/m] Prime speed
|
||||
* R[linear/m] Retract speed
|
||||
* U[linear/m] UnRetract speed
|
||||
* V[linear] 0/1 Enable auto prime first extruder used
|
||||
* W[linear] 0/1 Enable park & Z Raise
|
||||
* X[linear] Park X (Requires TOOLCHANGE_PARK)
|
||||
* Y[linear] Park Y (Requires TOOLCHANGE_PARK)
|
||||
* I[linear] Park I (Requires TOOLCHANGE_PARK and NUM_AXES >= 4)
|
||||
* J[linear] Park J (Requires TOOLCHANGE_PARK and NUM_AXES >= 5)
|
||||
* K[linear] Park K (Requires TOOLCHANGE_PARK and NUM_AXES >= 6)
|
||||
* C[linear] Park U (Requires TOOLCHANGE_PARK and NUM_AXES >= 7)
|
||||
* H[linear] Park V (Requires TOOLCHANGE_PARK and NUM_AXES >= 8)
|
||||
* O[linear] Park W (Requires TOOLCHANGE_PARK and NUM_AXES >= 9)
|
||||
* Z[linear] Z Raise
|
||||
* F[linear] Fan Speed 0-255
|
||||
* G[linear/s] Fan time
|
||||
* S[linear] Swap length
|
||||
* B[linear] Extra Swap resume length
|
||||
* E[linear] Extra Prime length (as used by M217 Q)
|
||||
* P[linear/min] Prime speed
|
||||
* R[linear/min] Retract speed
|
||||
* U[linear/min] UnRetract speed
|
||||
* V[linear] 0/1 Enable auto prime first extruder used
|
||||
* W[linear] 0/1 Enable park & Z Raise
|
||||
* X[linear] Park X (Requires TOOLCHANGE_PARK)
|
||||
* Y[linear] Park Y (Requires TOOLCHANGE_PARK)
|
||||
* I[linear] Park I (Requires TOOLCHANGE_PARK and NUM_AXES >= 4)
|
||||
* J[linear] Park J (Requires TOOLCHANGE_PARK and NUM_AXES >= 5)
|
||||
* K[linear] Park K (Requires TOOLCHANGE_PARK and NUM_AXES >= 6)
|
||||
* C[linear] Park U (Requires TOOLCHANGE_PARK and NUM_AXES >= 7)
|
||||
* H[linear] Park V (Requires TOOLCHANGE_PARK and NUM_AXES >= 8)
|
||||
* O[linear] Park W (Requires TOOLCHANGE_PARK and NUM_AXES >= 9)
|
||||
* Z[linear] Z Raise
|
||||
* F[speed] Fan Speed 0-255
|
||||
* D[seconds] Fan time
|
||||
*
|
||||
* Tool migration settings
|
||||
* A[0|1] Enable auto-migration on runout
|
||||
@@ -82,8 +82,8 @@ void GcodeSuite::M217() {
|
||||
if (parser.seenval('R')) { const int16_t v = parser.value_linear_units(); toolchange_settings.retract_speed = constrain(v, 10, 5400); }
|
||||
if (parser.seenval('U')) { const int16_t v = parser.value_linear_units(); toolchange_settings.unretract_speed = constrain(v, 10, 5400); }
|
||||
#if TOOLCHANGE_FS_FAN >= 0 && HAS_FAN
|
||||
if (parser.seenval('F')) { const int16_t v = parser.value_linear_units(); toolchange_settings.fan_speed = constrain(v, 0, 255); }
|
||||
if (parser.seenval('G')) { const int16_t v = parser.value_linear_units(); toolchange_settings.fan_time = constrain(v, 1, 30); }
|
||||
if (parser.seenval('F')) { const uint16_t v = parser.value_ushort(); toolchange_settings.fan_speed = constrain(v, 0, 255); }
|
||||
if (parser.seenval('D')) { const uint16_t v = parser.value_ushort(); toolchange_settings.fan_time = constrain(v, 1, 30); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -171,7 +171,7 @@ void GcodeSuite::M217_report(const bool forReplay/*=true*/) {
|
||||
SERIAL_ECHOPGM(" R", LINEAR_UNIT(toolchange_settings.retract_speed),
|
||||
" U", LINEAR_UNIT(toolchange_settings.unretract_speed),
|
||||
" F", toolchange_settings.fan_speed,
|
||||
" G", toolchange_settings.fan_time);
|
||||
" D", toolchange_settings.fan_time);
|
||||
|
||||
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
||||
SERIAL_ECHOPGM(" A", migration.automode);
|
||||
@@ -186,13 +186,13 @@ void GcodeSuite::M217_report(const bool forReplay/*=true*/) {
|
||||
, SP_Y_STR, LINEAR_UNIT(toolchange_settings.change_point.y)
|
||||
#endif
|
||||
#if SECONDARY_AXES >= 1
|
||||
, LIST_N(DOUBLE(SECONDARY_AXES),
|
||||
PSTR(" I"), I_AXIS_UNIT(toolchange_settings.change_point.i),
|
||||
PSTR(" J"), J_AXIS_UNIT(toolchange_settings.change_point.j),
|
||||
PSTR(" K"), K_AXIS_UNIT(toolchange_settings.change_point.k),
|
||||
SP_C_STR, U_AXIS_UNIT(toolchange_settings.change_point.u),
|
||||
PSTR(" H"), V_AXIS_UNIT(toolchange_settings.change_point.v),
|
||||
PSTR(" O"), W_AXIS_UNIT(toolchange_settings.change_point.w),
|
||||
, LIST_N(DOUBLE(SECONDARY_AXES)
|
||||
, SP_I_STR, I_AXIS_UNIT(toolchange_settings.change_point.i)
|
||||
, SP_J_STR, J_AXIS_UNIT(toolchange_settings.change_point.j)
|
||||
, SP_K_STR, K_AXIS_UNIT(toolchange_settings.change_point.k)
|
||||
, SP_C_STR, U_AXIS_UNIT(toolchange_settings.change_point.u)
|
||||
, PSTR(" H"), V_AXIS_UNIT(toolchange_settings.change_point.v)
|
||||
, PSTR(" O"), W_AXIS_UNIT(toolchange_settings.change_point.w)
|
||||
)
|
||||
#endif
|
||||
);
|
||||
|
||||
@@ -47,7 +47,7 @@ void GcodeSuite::M92() {
|
||||
return M92_report(true, target_extruder);
|
||||
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (parser.seenval(axis_codes[i])) {
|
||||
if (parser.seenval(AXIS_CHAR(i))) {
|
||||
if (TERN1(HAS_EXTRUDERS, i != E_AXIS))
|
||||
planner.settings.axis_steps_per_mm[i] = parser.value_per_axis_units((AxisEnum)i);
|
||||
else {
|
||||
|
||||
@@ -49,7 +49,7 @@ void GcodeSuite::M111() {
|
||||
LOOP_L_N(i, COUNT(debug_strings)) {
|
||||
if (TEST(marlin_debug_flags, i)) {
|
||||
if (comma++) SERIAL_CHAR(',');
|
||||
SERIAL_ECHOPGM_P((char*)pgm_read_ptr(&debug_strings[i]));
|
||||
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&debug_strings[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
#include "../../core/debug_out.h"
|
||||
#include "../../libs/hex_print.h"
|
||||
|
||||
inline axis_flags_t selected_axis_bits() {
|
||||
axis_flags_t selected{0};
|
||||
inline stepper_flags_t selected_axis_bits() {
|
||||
stepper_flags_t selected{0};
|
||||
#if HAS_EXTRUDERS
|
||||
if (parser.seen('E')) {
|
||||
if (E_TERN0(parser.has_value())) {
|
||||
@@ -61,7 +61,7 @@ inline axis_flags_t selected_axis_bits() {
|
||||
}
|
||||
|
||||
// Enable specified axes and warn about other affected axes
|
||||
void do_enable(const axis_flags_t to_enable) {
|
||||
void do_enable(const stepper_flags_t to_enable) {
|
||||
const ena_mask_t was_enabled = stepper.axis_enabled.bits,
|
||||
shall_enable = to_enable.bits & ~was_enabled;
|
||||
|
||||
@@ -75,7 +75,7 @@ void do_enable(const axis_flags_t to_enable) {
|
||||
LOOP_NUM_AXES(a) {
|
||||
if (TEST(shall_enable, a)) {
|
||||
stepper.enable_axis(AxisEnum(a)); // Mark and enable the requested axis
|
||||
DEBUG_ECHOLNPGM("Enabled ", axis_codes[a], " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... Enabled: ", hex_word(stepper.axis_enabled.bits));
|
||||
DEBUG_ECHOLNPGM("Enabled ", AXIS_CHAR(a), " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... Enabled: ", hex_word(stepper.axis_enabled.bits));
|
||||
also_enabled |= enable_overlap[a];
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ void do_enable(const axis_flags_t to_enable) {
|
||||
|
||||
if ((also_enabled &= ~(shall_enable | was_enabled))) {
|
||||
SERIAL_CHAR('(');
|
||||
LOOP_NUM_AXES(a) if (TEST(also_enabled, a)) SERIAL_CHAR(axis_codes[a], ' ');
|
||||
LOOP_NUM_AXES(a) if (TEST(also_enabled, a)) SERIAL_CHAR(AXIS_CHAR(a), ' ');
|
||||
#if HAS_EXTRUDERS
|
||||
#define _EN_ALSO(N) if (TEST(also_enabled, INDEX_OF_AXIS(E_AXIS, N))) SERIAL_CHAR('E', '0' + N, ' ');
|
||||
REPEAT(EXTRUDERS, _EN_ALSO)
|
||||
@@ -147,7 +147,7 @@ void GcodeSuite::M17() {
|
||||
}
|
||||
}
|
||||
|
||||
void try_to_disable(const axis_flags_t to_disable) {
|
||||
void try_to_disable(const stepper_flags_t to_disable) {
|
||||
ena_mask_t still_enabled = to_disable.bits & stepper.axis_enabled.bits;
|
||||
|
||||
DEBUG_ECHOLNPGM("Enabled: ", hex_word(stepper.axis_enabled.bits), " To Disable: ", hex_word(to_disable.bits), " | ", hex_word(still_enabled));
|
||||
@@ -157,7 +157,7 @@ void try_to_disable(const axis_flags_t to_disable) {
|
||||
// Attempt to disable all flagged axes
|
||||
LOOP_NUM_AXES(a)
|
||||
if (TEST(to_disable.bits, a)) {
|
||||
DEBUG_ECHOPGM("Try to disable ", axis_codes[a], " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... ");
|
||||
DEBUG_ECHOPGM("Try to disable ", AXIS_CHAR(a), " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... ");
|
||||
if (stepper.disable_axis(AxisEnum(a))) { // Mark the requested axis and request to disable
|
||||
DEBUG_ECHOPGM("OK");
|
||||
still_enabled &= ~(_BV(a) | enable_overlap[a]); // If actually disabled, clear one or more tracked bits
|
||||
@@ -184,7 +184,7 @@ void try_to_disable(const axis_flags_t to_disable) {
|
||||
|
||||
auto overlap_warning = [](const ena_mask_t axis_bits) {
|
||||
SERIAL_ECHOPGM(" not disabled. Shared with");
|
||||
LOOP_NUM_AXES(a) if (TEST(axis_bits, a)) SERIAL_CHAR(' ', axis_codes[a]);
|
||||
LOOP_NUM_AXES(a) if (TEST(axis_bits, a)) SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_STR[a]));
|
||||
#if HAS_EXTRUDERS
|
||||
#define _EN_STILLON(N) if (TEST(axis_bits, INDEX_OF_AXIS(E_AXIS, N))) SERIAL_CHAR(' ', 'E', '0' + N);
|
||||
REPEAT(EXTRUDERS, _EN_STILLON)
|
||||
@@ -195,7 +195,7 @@ void try_to_disable(const axis_flags_t to_disable) {
|
||||
// If any of the requested axes are still enabled, give a warning
|
||||
LOOP_NUM_AXES(a) {
|
||||
if (TEST(still_enabled, a)) {
|
||||
SERIAL_CHAR(axis_codes[a]);
|
||||
SERIAL_CHAR(AXIS_CHAR(a));
|
||||
overlap_warning(stepper.axis_enabled.bits & enable_overlap[a]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,35 +27,45 @@
|
||||
#include "../gcode.h"
|
||||
#include "../../module/stepper.h"
|
||||
|
||||
#if NUM_AXES == XYZ && EXTRUDERS >= 1
|
||||
#define HAS_M350_B_PARAM 1 // "5th axis" (after E0) for an original XYZEB setup.
|
||||
#if AXIS_COLLISION('B')
|
||||
#error "M350 parameter 'B' collision with axis name."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* M350: Set axis microstepping modes. S sets mode for all drivers.
|
||||
*
|
||||
* Warning: Steps-per-unit remains unchanged.
|
||||
*/
|
||||
void GcodeSuite::M350() {
|
||||
if (parser.seen('S')) LOOP_LE_N(i, 4) stepper.microstep_mode(i, parser.value_byte());
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen(axis_codes[i])) stepper.microstep_mode(i, parser.value_byte());
|
||||
if (parser.seen('B')) stepper.microstep_mode(4, parser.value_byte());
|
||||
if (parser.seen('S')) LOOP_DISTINCT_AXES(i) stepper.microstep_mode(i, parser.value_byte());
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen(AXIS_CHAR(i))) stepper.microstep_mode(i, parser.value_byte());
|
||||
TERN_(HAS_M350_B_PARAM, if (parser.seenval('B')) stepper.microstep_mode(E_AXIS + 1, parser.value_byte()));
|
||||
stepper.microstep_readings();
|
||||
}
|
||||
|
||||
/**
|
||||
* M351: Toggle MS1 MS2 pins directly with axis codes X Y Z E B
|
||||
* M351: Toggle MS1 MS2 pins directly with axis codes X Y Z . . . E [B]
|
||||
* S# determines MS1, MS2 or MS3, X# sets the pin high/low.
|
||||
*
|
||||
* Parameter 'B' sets "5th axis" (after E0) only for an original XYZEB setup.
|
||||
*/
|
||||
void GcodeSuite::M351() {
|
||||
const int8_t bval = TERN(HAS_M350_B_PARAM, parser.byteval('B', -1), -1); UNUSED(bval);
|
||||
if (parser.seenval('S')) switch (parser.value_byte()) {
|
||||
case 1:
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, parser.value_byte(), -1, -1);
|
||||
if (parser.seenval('B')) stepper.microstep_ms(4, parser.value_byte(), -1, -1);
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(AXIS_CHAR(i))) stepper.microstep_ms(i, parser.value_byte(), -1, -1);
|
||||
TERN_(HAS_M350_B_PARAM, if (bval >= 0) stepper.microstep_ms(E_AXIS + 1, bval != 0, -1, -1));
|
||||
break;
|
||||
case 2:
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, parser.value_byte(), -1);
|
||||
if (parser.seenval('B')) stepper.microstep_ms(4, -1, parser.value_byte(), -1);
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(AXIS_CHAR(i))) stepper.microstep_ms(i, -1, parser.value_byte(), -1);
|
||||
TERN_(HAS_M350_B_PARAM, if (bval >= 0) stepper.microstep_ms(E_AXIS + 1, -1, bval != 0, -1));
|
||||
break;
|
||||
case 3:
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, -1, parser.value_byte());
|
||||
if (parser.seenval('B')) stepper.microstep_ms(4, -1, -1, parser.value_byte());
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(AXIS_CHAR(i))) stepper.microstep_ms(i, -1, -1, parser.value_byte());
|
||||
TERN_(HAS_M350_B_PARAM, if (bval >= 0) stepper.microstep_ms(E_AXIS + 1, -1, -1, bval != 0));
|
||||
break;
|
||||
}
|
||||
stepper.microstep_readings();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#if HAS_L64XX
|
||||
|
||||
#if AXIS_COLLISION('I')
|
||||
#error "M906 parameter collision with axis name."
|
||||
#error "M906 parameter 'I' collision with axis name."
|
||||
#endif
|
||||
|
||||
#include "../../gcode.h"
|
||||
@@ -211,7 +211,7 @@ void L64XX_report_current(L64XX &motor, const L64XX_axis_t axis) {
|
||||
* 1 - monitor only X2, Y2, Z2
|
||||
* 2 - monitor only Z3
|
||||
* 3 - monitor only Z4
|
||||
* Xxxx, Yxxx, Zxxx, Exxx - axis to change (optional)
|
||||
* Xxxx, Yxxx, Zxxx, Axxx, Bxxx, Cxxx, Uxxx, Vxxx, Wxxx, Exxx - axis to change (optional)
|
||||
* L6474 - current in mA (4A max)
|
||||
* All others - 0-255
|
||||
*
|
||||
@@ -236,7 +236,7 @@ void GcodeSuite::M906() {
|
||||
constexpr int8_t index = -1;
|
||||
#endif
|
||||
|
||||
LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(axis_codes[i])) {
|
||||
LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(AXIS_CHAR(i))) {
|
||||
|
||||
report_current = false;
|
||||
|
||||
@@ -285,6 +285,25 @@ void GcodeSuite::M906() {
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_L64XX(I)
|
||||
case I_AXIS: L6470_SET_KVAL_HOLD(I); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(J)
|
||||
case J_AXIS: L6470_SET_KVAL_HOLD(J); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(K)
|
||||
case K_AXIS: L6470_SET_KVAL_HOLD(K); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(U)
|
||||
case U_AXIS: L6470_SET_KVAL_HOLD(U); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(V)
|
||||
case V_AXIS: L6470_SET_KVAL_HOLD(V); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(W)
|
||||
case W_AXIS: L6470_SET_KVAL_HOLD(W); break;
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_L64XX(E0) || AXIS_IS_L64XX(E1) || AXIS_IS_L64XX(E2) || AXIS_IS_L64XX(E3) || AXIS_IS_L64XX(E4) || AXIS_IS_L64XX(E5) || AXIS_IS_L64XX(E6) || AXIS_IS_L64XX(E7)
|
||||
case E_AXIS: {
|
||||
const int8_t eindex = get_target_e_stepper_from_command(-2);
|
||||
@@ -346,6 +365,24 @@ void GcodeSuite::M906() {
|
||||
#if AXIS_IS_L64XX(Z4)
|
||||
L64XX_REPORT_CURRENT(Z4);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(I)
|
||||
L64XX_REPORT_CURRENT(I);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(J)
|
||||
L64XX_REPORT_CURRENT(J);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(K)
|
||||
L64XX_REPORT_CURRENT(K);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(U)
|
||||
L64XX_REPORT_CURRENT(U);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(V)
|
||||
L64XX_REPORT_CURRENT(V);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(W)
|
||||
L64XX_REPORT_CURRENT(W);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E0)
|
||||
L64XX_REPORT_CURRENT(E0);
|
||||
#endif
|
||||
|
||||
@@ -63,16 +63,20 @@ void GcodeSuite::M591() {
|
||||
}
|
||||
}
|
||||
else {
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPGM("Filament runout ");
|
||||
serialprint_onoff(runout.enabled[active_extruder]);
|
||||
SERIAL_ECHOPGM(" ; Distance ", runout.runout_distance(active_extruder), "mm");
|
||||
SERIAL_ECHOPGM(" ; Mode ", runout.mode[active_extruder]);
|
||||
#if ENABLED(HOST_ACTION_COMMANDS)
|
||||
SERIAL_ECHOPGM(" ; Host handling ");
|
||||
serialprint_onoff(runout.host_handling);
|
||||
#if DISABLED(SLIM_LCD_MENUS)
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPGM("Filament runout ");
|
||||
serialprint_onoff(runout.enabled[active_extruder]);
|
||||
SERIAL_ECHOPGM(" ; Distance ", runout.runout_distance(active_extruder), "mm");
|
||||
SERIAL_ECHOPGM(" ; Mode ", runout.mode[active_extruder]);
|
||||
#if ENABLED(HOST_ACTION_COMMANDS)
|
||||
SERIAL_ECHOPGM(" ; Host handling ");
|
||||
serialprint_onoff(runout.host_handling);
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
#else
|
||||
M591_report(false);
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ void GcodeSuite::M122() {
|
||||
xyze_bool_t print_axis = ARRAY_N_1(LOGICAL_AXES, false);
|
||||
|
||||
bool print_all = true;
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen_test(axis_codes[i])) { print_axis[i] = true; print_all = false; }
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen_test(AXIS_CHAR(i))) { print_axis[i] = true; print_all = false; }
|
||||
|
||||
if (print_all) LOOP_LOGICAL_AXES(i) print_axis[i] = true;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#if HAS_STEALTHCHOP
|
||||
|
||||
#if AXIS_COLLISION('I')
|
||||
#error "M569 parameter collision with axis name."
|
||||
#error "M569 parameter 'I' collision with axis name."
|
||||
#endif
|
||||
|
||||
#include "../../gcode.h"
|
||||
@@ -53,7 +53,7 @@ static void set_stealth_status(const bool enable, const int8_t eindex) {
|
||||
constexpr int8_t index = -1;
|
||||
#endif
|
||||
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen(axis_codes[i])) {
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen(AXIS_CHAR(i))) {
|
||||
switch (i) {
|
||||
case X_AXIS:
|
||||
TERN_(X_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_STEALTH(X));
|
||||
|
||||
@@ -66,7 +66,7 @@ void GcodeSuite::M906() {
|
||||
constexpr int8_t index = -1;
|
||||
#endif
|
||||
|
||||
LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(axis_codes[i])) {
|
||||
LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(AXIS_CHAR(i))) {
|
||||
report = false;
|
||||
switch (i) {
|
||||
#if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2)
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
#elif AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
|
||||
constexpr int8_t index = -1;
|
||||
#endif
|
||||
LOOP_LOGICAL_AXES(i) if (int32_t value = parser.longval(axis_codes[i])) {
|
||||
LOOP_LOGICAL_AXES(i) if (int32_t value = parser.longval(AXIS_CHAR(i))) {
|
||||
report = false;
|
||||
switch (i) {
|
||||
#if X_HAS_STEALTHCHOP || X2_HAS_STEALTHCHOP
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#if HAS_TRINAMIC_CONFIG
|
||||
|
||||
#if AXIS_COLLISION('I')
|
||||
#error "M919 parameter collision with axis name."
|
||||
#error "M919 parameter 'I' collision with axis name."
|
||||
#endif
|
||||
|
||||
#include "../../gcode.h"
|
||||
@@ -112,13 +112,13 @@ void GcodeSuite::M919() {
|
||||
int8_t eindex = -1;
|
||||
#endif
|
||||
bool report = true;
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen_test(axis_codes[i])) {
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen_test(AXIS_CHAR(i))) {
|
||||
report = false;
|
||||
|
||||
// Get the chopper timing for the specified axis and index
|
||||
switch (i) {
|
||||
default: // A specified axis isn't Trinamic
|
||||
SERIAL_ECHOLNPGM("?Axis ", AS_CHAR(axis_codes[i]), " has no TMC drivers.");
|
||||
SERIAL_ECHOLNPGM("?Axis ", AS_CHAR(AXIS_CHAR(i)), " has no TMC drivers.");
|
||||
break;
|
||||
|
||||
#if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2)
|
||||
|
||||
@@ -202,6 +202,7 @@
|
||||
* M226 - Wait until a pin is in a given state: "M226 P<pin> S<state>" (Requires DIRECT_PIN_CONTROL)
|
||||
* M240 - Trigger a camera to take a photograph. (Requires PHOTO_GCODE)
|
||||
* M250 - Set LCD contrast: "M250 C<contrast>" (0-63). (Requires LCD support)
|
||||
* M255 - Set LCD sleep time: "M255 S<minutes>" (0-99). (Requires an LCD with brightness or sleep/wake)
|
||||
* M256 - Set LCD brightness: "M256 B<brightness>" (0-255). (Requires an LCD with brightness control)
|
||||
* M260 - i2c Send Data (Requires EXPERIMENTAL_I2CBUS)
|
||||
* M261 - i2c Request Data (Requires EXPERIMENTAL_I2CBUS)
|
||||
@@ -879,6 +880,11 @@ private:
|
||||
static void M250_report(const bool forReplay=true);
|
||||
#endif
|
||||
|
||||
#if HAS_DISPLAY_SLEEP
|
||||
static void M255();
|
||||
static void M255_report(const bool forReplay=true);
|
||||
#endif
|
||||
|
||||
#if HAS_LCD_BRIGHTNESS
|
||||
static void M256();
|
||||
static void M256_report(const bool forReplay=true);
|
||||
|
||||
@@ -74,7 +74,7 @@ void GcodeSuite::G92() {
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
case 9: // G92.9 - Set Current Position directly (like Marlin 1.0)
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (parser.seenval(axis_codes[i])) {
|
||||
if (parser.seenval(AXIS_CHAR(i))) {
|
||||
if (TERN1(HAS_EXTRUDERS, i != E_AXIS))
|
||||
sync_XYZE = true;
|
||||
else {
|
||||
@@ -88,7 +88,7 @@ void GcodeSuite::G92() {
|
||||
|
||||
case 0:
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (parser.seenval(axis_codes[i])) {
|
||||
if (parser.seenval(AXIS_CHAR(i))) {
|
||||
const float l = parser.value_axis_units((AxisEnum)i), // Given axis coordinate value, converted to millimeters
|
||||
v = TERN0(HAS_EXTRUDERS, i == E_AXIS) ? l : LOGICAL_TO_NATIVE(l, i), // Axis position in NATIVE space (applying the existing offset)
|
||||
d = v - current_position[i]; // How much is the current axis position altered by?
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
#include "../../core/debug_out.h"
|
||||
#endif
|
||||
|
||||
void report_all_axis_pos(const xyze_pos_t &pos, const uint8_t n=XYZE, const uint8_t precision=3) {
|
||||
void report_all_axis_pos(const xyze_pos_t &pos, const uint8_t n=LOGICAL_AXES, const uint8_t precision=3) {
|
||||
char str[12];
|
||||
LOOP_L_N(a, n) {
|
||||
SERIAL_CHAR(' ', axis_codes[a], ':');
|
||||
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[a]));
|
||||
if (pos[a] >= 0) SERIAL_CHAR(' ');
|
||||
SERIAL_ECHO(dtostrf(pos[a], 1, precision, str));
|
||||
}
|
||||
@@ -47,10 +47,7 @@
|
||||
|
||||
void report_linear_axis_pos(const xyz_pos_t &pos, const uint8_t precision=3) {
|
||||
char str[12];
|
||||
LOOP_NUM_AXES(a) {
|
||||
SERIAL_CHAR(' ', AXIS_CHAR(a), ':');
|
||||
SERIAL_ECHO(dtostrf(pos[a], 1, precision, str));
|
||||
}
|
||||
LOOP_NUM_AXES(a) SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[a]), dtostrf(pos[a], 1, precision, str));
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
@@ -172,8 +169,7 @@
|
||||
|
||||
SERIAL_ECHOPGM("Stepper:");
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
SERIAL_CHAR(' ', axis_codes[i], ':');
|
||||
SERIAL_ECHO(stepper.position((AxisEnum)i));
|
||||
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[i]), stepper.position((AxisEnum)i));
|
||||
}
|
||||
SERIAL_EOL();
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER)
|
||||
#if HAS_GCODE_M876
|
||||
|
||||
#include "../../feature/host_actions.h"
|
||||
#include "../gcode.h"
|
||||
@@ -37,4 +37,4 @@ void GcodeSuite::M876() {
|
||||
|
||||
}
|
||||
|
||||
#endif // HOST_PROMPT_SUPPORT && !EMERGENCY_PARSER
|
||||
#endif // HAS_GCODE_M876
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_GCODE_M255
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
|
||||
/**
|
||||
* M255: Set the LCD sleep timeout (in minutes)
|
||||
* S<minutes> - Period of inactivity required for display / backlight sleep
|
||||
*/
|
||||
void GcodeSuite::M255() {
|
||||
if (parser.seenval('S')) {
|
||||
#if HAS_DISPLAY_SLEEP
|
||||
const int m = parser.value_int();
|
||||
ui.sleep_timeout_minutes = constrain(m, SLEEP_TIMEOUT_MIN, SLEEP_TIMEOUT_MAX);
|
||||
#else
|
||||
const int s = parser.value_int() * 60;
|
||||
ui.lcd_backlight_timeout = constrain(s, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
M255_report();
|
||||
}
|
||||
|
||||
void GcodeSuite::M255_report(const bool forReplay/*=true*/) {
|
||||
report_heading_etc(forReplay, F(STR_DISPLAY_SLEEP));
|
||||
SERIAL_ECHOLNPGM(" M255 S",
|
||||
#if HAS_DISPLAY_SLEEP
|
||||
ui.sleep_timeout_minutes, " ; (minutes)"
|
||||
#else
|
||||
ui.lcd_backlight_timeout, " ; (seconds)"
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
#endif // HAS_GCODE_M255
|
||||
@@ -25,7 +25,7 @@
|
||||
#if ENABLED(BEZIER_CURVE_SUPPORT)
|
||||
|
||||
#if AXIS_COLLISION('I') || AXIS_COLLISION('J')
|
||||
#error "G5 parameter collision with axis name."
|
||||
#error "G5 parameter 'I' or 'J' collision with axis name."
|
||||
#endif
|
||||
|
||||
#include "../../module/motion.h"
|
||||
|
||||
@@ -71,6 +71,7 @@ void GcodeSuite::M303() {
|
||||
case H_CHAMBER: default_temp = PREHEAT_1_TEMP_CHAMBER; break;
|
||||
#endif
|
||||
default:
|
||||
SERIAL_ECHOPGM(STR_PID_AUTOTUNE);
|
||||
SERIAL_ECHOLNPGM(STR_PID_BAD_HEATER_ID);
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_EXTRUDER_NUM));
|
||||
TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_BAD_EXTRUDER_NUM));
|
||||
|
||||
@@ -56,17 +56,7 @@ void GcodeSuite::M306() {
|
||||
return;
|
||||
}
|
||||
|
||||
HOTEND_LOOP() {
|
||||
SERIAL_ECHOLNPGM("MPC constants for hotend ", e);
|
||||
MPC_t& constants = thermalManager.temp_hotend[e].constants;
|
||||
SERIAL_ECHOLNPGM("Heater power: ", constants.heater_power);
|
||||
SERIAL_ECHOLNPGM("Heatblock heat capacity: ", constants.block_heat_capacity);
|
||||
SERIAL_ECHOLNPAIR_F("Sensor responsivness: ", constants.sensor_responsiveness, 4);
|
||||
SERIAL_ECHOLNPAIR_F("Ambient heat transfer coeff. (no fan): ", constants.ambient_xfer_coeff_fan0, 4);
|
||||
#if ENABLED(MPC_INCLUDE_FAN)
|
||||
SERIAL_ECHOLNPAIR_F("Ambient heat transfer coeff. (full fan): ", constants.ambient_xfer_coeff_fan0 + constants.fan255_adjustment, 4);
|
||||
#endif
|
||||
}
|
||||
M306_report(true);
|
||||
}
|
||||
|
||||
void GcodeSuite::M306_report(const bool forReplay/*=true*/) {
|
||||
|
||||
@@ -524,7 +524,7 @@
|
||||
#define HAS_LCDPRINT 1
|
||||
#endif
|
||||
|
||||
#if ANY(HAS_DISPLAY, HAS_DWIN_E3V2, GLOBAL_STATUS_MESSAGE)
|
||||
#if ANY(HAS_DISPLAY, HAS_DWIN_E3V2)
|
||||
#define HAS_STATUS_MESSAGE 1
|
||||
#endif
|
||||
|
||||
@@ -712,7 +712,7 @@
|
||||
* Number of Primary Linear Axes (e.g., XYZ)
|
||||
* X, XY, or XYZ axes. Excluding duplicate axes (X2, Y2. Z2. Z3, Z4)
|
||||
*/
|
||||
#if HAS_I_AXIS
|
||||
#if NUM_AXES >= 3
|
||||
#define PRIMARY_LINEAR_AXES 3
|
||||
#else
|
||||
#define PRIMARY_LINEAR_AXES NUM_AXES
|
||||
|
||||
@@ -616,6 +616,12 @@
|
||||
#if ALL(HAS_RESUME_CONTINUE, PRINTER_EVENT_LEDS, SDSUPPORT)
|
||||
#define HAS_LEDS_OFF_FLAG 1
|
||||
#endif
|
||||
#ifdef DISPLAY_SLEEP_MINUTES
|
||||
#define HAS_DISPLAY_SLEEP 1
|
||||
#endif
|
||||
#if HAS_DISPLAY_SLEEP || LCD_BACKLIGHT_TIMEOUT
|
||||
#define HAS_GCODE_M255 1
|
||||
#endif
|
||||
|
||||
#if EITHER(DIGIPOT_MCP4018, DIGIPOT_MCP4451)
|
||||
#define HAS_MOTOR_CURRENT_I2C 1
|
||||
@@ -689,6 +695,10 @@
|
||||
#undef SERIAL_XON_XOFF
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER)
|
||||
#define HAS_GCODE_M876 1
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_ACTION_COMMANDS)
|
||||
#ifndef ACTION_ON_PAUSE
|
||||
#define ACTION_ON_PAUSE "pause"
|
||||
|
||||
@@ -390,6 +390,8 @@
|
||||
#error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]."
|
||||
#elif defined(RETRACT_ZLIFT)
|
||||
#error "RETRACT_ZLIFT is now RETRACT_ZRAISE."
|
||||
#elif defined(TOOLCHANGE_FS_INIT_BEFORE_SWAP)
|
||||
#error "TOOLCHANGE_FS_INIT_BEFORE_SWAP is now TOOLCHANGE_FS_SLOW_FIRST_PRIME."
|
||||
#elif defined(TOOLCHANGE_PARK_ZLIFT) || defined(TOOLCHANGE_UNPARK_ZLIFT)
|
||||
#error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE."
|
||||
#elif defined(SINGLENOZZLE_TOOLCHANGE_ZRAISE)
|
||||
@@ -612,7 +614,7 @@
|
||||
#elif defined(NOZZLE_PARK_X_ONLY)
|
||||
#error "NOZZLE_PARK_X_ONLY is now NOZZLE_PARK_MOVE 1."
|
||||
#elif defined(NOZZLE_PARK_Y_ONLY)
|
||||
#error "NOZZLE_PARK_X_ONLY is now NOZZLE_PARK_MOVE 2."
|
||||
#error "NOZZLE_PARK_Y_ONLY is now NOZZLE_PARK_MOVE 2."
|
||||
#elif defined(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
||||
#error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS is now just Z_STEPPER_ALIGN_STEPPER_XY."
|
||||
#elif defined(DWIN_CREALITY_LCD_ENHANCED)
|
||||
@@ -1374,6 +1376,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Generic Switching Toolhead requirements
|
||||
*/
|
||||
#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
|
||||
constexpr float thpx[] = SWITCHING_TOOLHEAD_X_POS;
|
||||
static_assert(COUNT(thpx) == EXTRUDERS, "SWITCHING_TOOLHEAD_X_POS must be an array EXTRUDERS long.");
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Switching Toolhead requirements
|
||||
*/
|
||||
@@ -2495,17 +2505,17 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
* FYSETC LCD Requirements
|
||||
*/
|
||||
#if EITHER(FYSETC_242_OLED_12864, FYSETC_MINI_12864_2_1)
|
||||
#ifndef NEO_RGB
|
||||
#define NEO_RGB 123
|
||||
#ifndef NEO_GRB
|
||||
#define NEO_GRB 123
|
||||
#define FAUX_RGB 1
|
||||
#endif
|
||||
#if defined(NEOPIXEL_TYPE) && NEOPIXEL_TYPE != NEO_RGB
|
||||
#error "Your FYSETC Mini Panel requires NEOPIXEL_TYPE to be NEO_RGB."
|
||||
#if defined(NEOPIXEL_TYPE) && NEOPIXEL_TYPE != NEO_GRB
|
||||
#error "Your FYSETC Mini Panel requires NEOPIXEL_TYPE to be NEO_GRB."
|
||||
#elif defined(NEOPIXEL_PIXELS) && NEOPIXEL_PIXELS < 3
|
||||
#error "Your FYSETC Mini Panel requires NEOPIXEL_PIXELS >= 3."
|
||||
#endif
|
||||
#if FAUX_RGB
|
||||
#undef NEO_RGB
|
||||
#undef NEO_GRB
|
||||
#undef FAUX_RGB
|
||||
#endif
|
||||
#elif EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && !DISABLED(RGB_LED)
|
||||
@@ -3011,10 +3021,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#if ENABLED(DWIN_CREALITY_LCD)
|
||||
#if DISABLED(SDSUPPORT)
|
||||
#error "DWIN_CREALITY_LCD requires SDSUPPORT to be enabled."
|
||||
#elif ENABLED(PID_EDIT_MENU)
|
||||
#error "DWIN_CREALITY_LCD does not support PID_EDIT_MENU."
|
||||
#elif ENABLED(PID_AUTOTUNE_MENU)
|
||||
#error "DWIN_CREALITY_LCD does not support PID_AUTOTUNE_MENU."
|
||||
#elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU)
|
||||
#error "DWIN_CREALITY_LCD does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU."
|
||||
#elif EITHER(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU)
|
||||
#error "DWIN_CREALITY_LCD does not support MPC_EDIT_MENU or MPC_AUTOTUNE_MENU."
|
||||
#elif ENABLED(LEVEL_BED_CORNERS)
|
||||
#error "DWIN_CREALITY_LCD does not support LEVEL_BED_CORNERS."
|
||||
#elif BOTH(LCD_BED_LEVELING, PROBE_MANUALLY)
|
||||
@@ -3023,10 +3033,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#elif ENABLED(DWIN_LCD_PROUI)
|
||||
#if DISABLED(SDSUPPORT)
|
||||
#error "DWIN_LCD_PROUI requires SDSUPPORT to be enabled."
|
||||
#elif ENABLED(PID_EDIT_MENU)
|
||||
#error "DWIN_LCD_PROUI does not support PID_EDIT_MENU."
|
||||
#elif ENABLED(PID_AUTOTUNE_MENU)
|
||||
#error "DWIN_LCD_PROUI does not support PID_AUTOTUNE_MENU."
|
||||
#elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU)
|
||||
#error "DWIN_LCD_PROUI does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU."
|
||||
#elif EITHER(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU)
|
||||
#error "DWIN_LCD_PROUI does not support MPC_EDIT_MENU or MPC_AUTOTUNE_MENU."
|
||||
#elif ENABLED(LEVEL_BED_CORNERS)
|
||||
#error "DWIN_LCD_PROUI does not support LEVEL_BED_CORNERS."
|
||||
#elif BOTH(LCD_BED_LEVELING, PROBE_MANUALLY)
|
||||
@@ -3042,6 +3052,17 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Display Sleep is not supported by these common displays
|
||||
*/
|
||||
#if HAS_DISPLAY_SLEEP
|
||||
#if ANY(IS_U8GLIB_LM6059_AF, IS_U8GLIB_ST7565_64128, REPRAPWORLD_GRAPHICAL_LCD, FYSETC_MINI, ENDER2_STOCKDISPLAY, MINIPANEL)
|
||||
#error "DISPLAY_SLEEP_MINUTES is not supported by your display."
|
||||
#elif !WITHIN(DISPLAY_SLEEP_MINUTES, 0, 255)
|
||||
#error "DISPLAY_SLEEP_MINUTES must be between 0 and 255."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Some boards forbid the use of -1 Native USB
|
||||
*/
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* version was tagged.
|
||||
*/
|
||||
#ifndef STRING_DISTRIBUTION_DATE
|
||||
#define STRING_DISTRIBUTION_DATE "2022-04-03"
|
||||
#define STRING_DISTRIBUTION_DATE "2022-04-10"
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -342,6 +342,11 @@ void MarlinUI::draw_kill_screen() {
|
||||
|
||||
void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
|
||||
|
||||
#if HAS_DISPLAY_SLEEP
|
||||
void MarlinUI::sleep_on() { u8g.sleepOn(); }
|
||||
void MarlinUI::sleep_off() { u8g.sleepOff(); }
|
||||
#endif
|
||||
|
||||
#if HAS_LCD_BRIGHTNESS
|
||||
|
||||
void MarlinUI::_set_brightness() {
|
||||
|
||||
@@ -432,7 +432,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
|
||||
const bool is_inch = parser.using_inch_units();
|
||||
const AxisEnum a = TERN(LCD_SHOW_E_TOTAL, axis == E_AXIS ? X_AXIS : axis, axis);
|
||||
const uint8_t offs = a * (is_inch ? XYZ_SPACING_IN : XYZ_SPACING);
|
||||
lcd_put_wchar((is_inch ? X_LABEL_POS_IN : X_LABEL_POS) + offs, XYZ_BASELINE, axis_codes[axis]);
|
||||
lcd_put_wchar((is_inch ? X_LABEL_POS_IN : X_LABEL_POS) + offs, XYZ_BASELINE, AXIS_CHAR(axis));
|
||||
lcd_moveto((is_inch ? X_VALUE_POS_IN : X_VALUE_POS) + offs, XYZ_BASELINE);
|
||||
|
||||
if (blink)
|
||||
|
||||
@@ -235,7 +235,6 @@ void DWIN_Frame_AreaMove(uint8_t mode, uint8_t dir, uint16_t dis,
|
||||
// rlimit: To limit the drawn string length
|
||||
void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, const char * const string, uint16_t rlimit/*=0xFFFF*/) {
|
||||
DWIN_Draw_Rectangle(1, bColor, x, y, x + (fontWidth(size) * strlen_P(string)), y + fontHeight(size));
|
||||
DWIN_UpdateLCD();
|
||||
constexpr uint8_t widthAdjust = 0;
|
||||
size_t i = 0;
|
||||
DWIN_Byte(i, 0x11);
|
||||
@@ -250,7 +249,6 @@ void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor,
|
||||
DWIN_Word(i, y);
|
||||
DWIN_Text(i, string, rlimit);
|
||||
DWIN_Send(i);
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
|
||||
// Draw a positive integer
|
||||
@@ -297,7 +295,6 @@ void DWIN_Draw_IntValue(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t
|
||||
#endif
|
||||
|
||||
DWIN_Send(i);
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
|
||||
// Draw a floating point number
|
||||
@@ -332,7 +329,6 @@ void DWIN_Draw_FloatValue(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_
|
||||
DWIN_Byte(i, fvalue[0]);
|
||||
*/
|
||||
DWIN_Send(i);
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
|
||||
// Draw a floating point number
|
||||
|
||||
@@ -2926,7 +2926,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
||||
Draw_Checkbox(row, runout.enabled[0]);
|
||||
}
|
||||
else {
|
||||
runout.enabled = !runout.enabled[0];
|
||||
runout.enabled[0] = !runout.enabled[0];
|
||||
Draw_Checkbox(row, runout.enabled[0]);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -70,7 +70,7 @@ void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *itemString/*
|
||||
else if (ch == '$' && itemString)
|
||||
add(itemString);
|
||||
else if (ch == '@')
|
||||
add_character(axis_codes[index]);
|
||||
add_character(AXIS_CHAR(index));
|
||||
else
|
||||
add_character(ch);
|
||||
}
|
||||
|
||||
@@ -181,7 +181,6 @@ void MarlinUI::draw_status_message(const bool blink) {
|
||||
dwin_font.solid = true;
|
||||
dwin_font.fg = Color_White;
|
||||
dwin_font.bg = Color_Bg_Black;
|
||||
DWIN_Draw_Box(1, Color_Bg_Black, 0, (LCD_PIXEL_HEIGHT - (STAT_FONT_HEIGHT) - 1), 272, STAT_FONT_HEIGHT + 1);
|
||||
lcd_moveto_xy(0, LCD_PIXEL_HEIGHT - (STAT_FONT_HEIGHT) - 1);
|
||||
|
||||
constexpr uint8_t max_status_chars = (LCD_PIXEL_WIDTH) / (STAT_FONT_WIDTH);
|
||||
|
||||
@@ -196,13 +196,13 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater, const uint16_t x
|
||||
#else
|
||||
#define HOTEND_STATS 1
|
||||
#endif
|
||||
static celsius_t old_temp[HOTEND_STATS] = ARRAY_N_1(HOTEND_STATS, 500),
|
||||
old_target[HOTEND_STATS] = ARRAY_N_1(HOTEND_STATS, 500);
|
||||
static bool old_on[HOTEND_STATS] = ARRAY_N_1(HOTEND_STATS, false);
|
||||
static celsius_t old_temp[HOTEND_STATS] = { 0 },
|
||||
old_target[HOTEND_STATS] = { 0 };
|
||||
static bool old_on[HOTEND_STATS] = { false };
|
||||
#endif
|
||||
|
||||
#if HAS_HEATED_BED
|
||||
static celsius_t old_bed_temp = 500, old_bed_target = 500;
|
||||
static celsius_t old_bed_temp = 0, old_bed_target = 0;
|
||||
static bool old_bed_on = false;
|
||||
#if HAS_LEVELING
|
||||
static bool old_leveling_on = false;
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
*/
|
||||
#define __DECL_DATA_IF_INCLUDED(CLASS) struct CLASS ## Data CLASS ;
|
||||
#define _DECL_DATA_IF_INCLUDED(CLASS) __DECL_DATA_IF_INCLUDED(CLASS)
|
||||
#define DECL_DATA_IF_INCLUDED(HEADER) TERN(HEADER, _DECL_DATA_IF_INCLUDED(HEADER ## _CLASS), )
|
||||
#define DECL_DATA_IF_INCLUDED(HEADER) TERN_(HEADER, _DECL_DATA_IF_INCLUDED(HEADER ## _CLASS))
|
||||
|
||||
union screen_data_t {
|
||||
DECL_DATA_IF_INCLUDED(FTDI_INTERFACE_SETTINGS_SCREEN)
|
||||
|
||||
@@ -74,7 +74,7 @@ void lv_draw_level_settings() {
|
||||
#if HAS_BED_PROBE
|
||||
lv_screen_menu_item(scr, machine_menu.LevelingAutoZoffsetConf, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_LEVEL_ZOFFSET, 2);
|
||||
#if ENABLED(PROBE_OFFSET_WIZARD)
|
||||
lv_screen_menu_item(scr, machine_menu.LevelingZoffsetWizard, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_Z_OFFSET_WIZARD, 3);
|
||||
lv_screen_menu_item(scr, machine_menu.LevelingZoffsetTitle, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_Z_OFFSET_WIZARD, 3);
|
||||
#endif
|
||||
#endif
|
||||
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_LEVEL_RETURN, true);
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
//****************俄语***************************//
|
||||
#define TOOL_TEXT_RU "инструмент"
|
||||
#define PREHEAT_TEXT_RU " нагрев"
|
||||
#define MOVE_TEXT_RU "движение"
|
||||
#define HOME_TEXT_RU "домой"
|
||||
#define PRINT_TEXT_RU " печать"
|
||||
#define MOVE_TEXT_RU "двигать"
|
||||
#define HOME_TEXT_RU "дом"
|
||||
#define PRINT_TEXT_RU "печать"
|
||||
#define EXTRUDE_TEXT_RU "экструзия"
|
||||
#define LEVELING_TEXT_RU "уровень"
|
||||
#define AUTO_LEVELING_TEXT_RU "aвтоуровень"
|
||||
@@ -40,17 +40,17 @@
|
||||
#define EXTRUDER_1_TEXT_RU "экструдер1"
|
||||
#define EXTRUDER_2_TEXT_RU "экструдер2"
|
||||
#define HEATBED_TEXT_RU "стол"
|
||||
#define TEXT_1C_RU "1℃"
|
||||
#define TEXT_5C_RU "5℃"
|
||||
#define TEXT_10C_RU "10℃"
|
||||
#define TEXT_1C_RU "1°Ц"
|
||||
#define TEXT_5C_RU "5°Ц"
|
||||
#define TEXT_10C_RU "10°Ц"
|
||||
#define CLOSE_TEXT_RU "выкл"
|
||||
|
||||
#define BACK_TEXT_RU "назад"
|
||||
|
||||
#define TOOL_PREHEAT_RU "нагрев"
|
||||
#define TOOL_EXTRUDE_RU "экструдер"
|
||||
#define TOOL_MOVE_RU "движение"
|
||||
#define TOOL_HOME_RU "домой"
|
||||
#define TOOL_MOVE_RU "двигать"
|
||||
#define TOOL_HOME_RU "дом"
|
||||
#define TOOL_LEVELING_RU "уровень"
|
||||
#define TOOL_AUTO_LEVELING_RU "aвтоуровень"
|
||||
#define TOOL_FILAMENT_RU "замена"
|
||||
@@ -62,33 +62,33 @@
|
||||
#define AXIS_Y_DEC_TEXT_RU "Y -"
|
||||
#define AXIS_Z_ADD_TEXT_RU "Z +"
|
||||
#define AXIS_Z_DEC_TEXT_RU "Z -"
|
||||
#define TEXT_01MM_RU "0.1 mm"
|
||||
#define TEXT_1MM_RU "1 mm"
|
||||
#define TEXT_10MM_RU "10 mm"
|
||||
#define TEXT_01MM_RU "0.1 мм"
|
||||
#define TEXT_1MM_RU "1 мм"
|
||||
#define TEXT_10MM_RU "10 мм"
|
||||
|
||||
#define HOME_X_TEXT_RU "X"
|
||||
#define HOME_Y_TEXT_RU "Y"
|
||||
#define HOME_Z_TEXT_RU "Z"
|
||||
#define HOME_ALL_TEXT_RU "Home"
|
||||
#define HOME_STOPMOVE_RU "Quickstop"
|
||||
#define HOME_ALL_TEXT_RU "Дом"
|
||||
#define HOME_STOPMOVE_RU "Концевик"
|
||||
|
||||
#define PAGE_UP_TEXT_RU "вверх"
|
||||
#define PAGE_DOWN_TEXT_RU "вниз"
|
||||
|
||||
#define EXTRUDER_IN_TEXT_RU "втянуть"
|
||||
#define EXTRUDER_OUT_TEXT_RU "выдавить"
|
||||
#define EXTRUDE_1MM_TEXT_RU "1 mm"
|
||||
#define EXTRUDE_5MM_TEXT_RU "5 mm"
|
||||
#define EXTRUDE_10MM_TEXT_RU "10 mm"
|
||||
#define EXTRUDE_LOW_SPEED_TEXT_RU "мин"
|
||||
#define EXTRUDE_MEDIUM_SPEED_TEXT_RU "сред"
|
||||
#define EXTRUDE_HIGH_SPEED_TEXT_RU "выс"
|
||||
#define EXTRUDE_1MM_TEXT_RU "1 мм"
|
||||
#define EXTRUDE_5MM_TEXT_RU "5 мм"
|
||||
#define EXTRUDE_10MM_TEXT_RU "10 мм"
|
||||
#define EXTRUDE_LOW_SPEED_TEXT_RU "минимум"
|
||||
#define EXTRUDE_MEDIUM_SPEED_TEXT_RU "средний"
|
||||
#define EXTRUDE_HIGH_SPEED_TEXT_RU "высокий"
|
||||
|
||||
#define LEVELING_POINT1_TEXT_RU "1 точка"
|
||||
#define LEVELING_POINT2_TEXT_RU "2 точка"
|
||||
#define LEVELING_POINT3_TEXT_RU "3 точка"
|
||||
#define LEVELING_POINT4_TEXT_RU "4 точка"
|
||||
#define LEVELING_POINT5_TEXT_RU "5 точка"
|
||||
#define LEVELING_POINT1_TEXT_RU "Первая позиция"
|
||||
#define LEVELING_POINT2_TEXT_RU "Вторая позиция"
|
||||
#define LEVELING_POINT3_TEXT_RU "Третья позиция"
|
||||
#define LEVELING_POINT4_TEXT_RU "Четвёртое позиция"
|
||||
#define LEVELING_POINT5_TEXT_RU "Пятая позиция"
|
||||
|
||||
#define FILESYS_TEXT_RU "система"
|
||||
#define WIFI_TEXT_RU "WiFi"
|
||||
@@ -115,7 +115,7 @@
|
||||
#define WIFI_RECONNECT_TEXT_RU "выбор сети"
|
||||
#define CLOUD_TEXT_RU "облако"
|
||||
#define CLOUD_BIND_RU "соединён"
|
||||
#define CLOUD_UNBIND_RU "отсоед."
|
||||
#define CLOUD_UNBIND_RU "отсоединён"
|
||||
#define CLOUD_UNBINDING_RU "отвязано"
|
||||
#define CLOUD_DISCONNECTED_RU "отключено"
|
||||
#define CLOUD_UNBINDED_RU "несвяз."
|
||||
@@ -126,7 +126,7 @@
|
||||
#define FAN_DEC_TEXT_RU "уменьшить"
|
||||
#define FAN_OPEN_TEXT_RU "100%"
|
||||
#define FAN_HALF_TEXT_RU "50%"
|
||||
#define FAN_CLOSE_TEXT_RU "откл"
|
||||
#define FAN_CLOSE_TEXT_RU "отключить"
|
||||
#define FAN_TIPS1_TEXT_RU "вентилятор"
|
||||
#define FAN_TIPS2_TEXT_RU "вентилятор\nоткл"
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
#define PRE_HEAT_EXT_TEXT_RU "E"
|
||||
#define PRE_HEAT_BED_TEXT_RU "стол"
|
||||
|
||||
#define FILE_LOADING_RU "загрузка......"
|
||||
#define FILE_LOADING_RU "загрузка"
|
||||
#define NO_FILE_AND_CHECK_RU "нет файла,попробуйте ещё раз!"
|
||||
|
||||
#define NO_FILE_RU "нет файла!"
|
||||
@@ -170,11 +170,11 @@
|
||||
#define ABOUT_VERSION_TEXT_RU "Firmware: "
|
||||
#define ABOUT_WIFI_TEXT_RU "WiFi: "
|
||||
|
||||
#define PRINTING_OPERATION_RU "опции"
|
||||
#define PRINTING_OPERATION_RU "опций"
|
||||
#define PRINTING_PAUSE_RU "пауза"
|
||||
#define PRINTING_TEMP_RU "темп"
|
||||
#define PRINTING_CHANGESPEED_RU "скорости"
|
||||
#define PRINTING_RESUME_RU "возобн. "
|
||||
#define PRINTING_CHANGESPEED_RU "скорост"
|
||||
#define PRINTING_RESUME_RU "возобновить"
|
||||
#define PRINTING_STOP_RU "стоп"
|
||||
#define PRINTING_MORE_RU "больше"
|
||||
#define PRINTING_EXTRUDER_RU "экстр"
|
||||
@@ -222,8 +222,8 @@
|
||||
#define DIALOG_RETRY_RU "повтор"
|
||||
#define DIALOG_DISABLE_RU "запретить"
|
||||
#define DIALOG_PRINT_MODEL_RU "печать модели?"
|
||||
#define DIALOG_CANCEL_PRINT_RU "стоп?"
|
||||
#define DIALOG_STOP_RU "стоп"
|
||||
#define DIALOG_CANCEL_PRINT_RU "Остановить?"
|
||||
#define DIALOG_STOP_RU "Остановить"
|
||||
#define DIALOG_REPRINT_FROM_BREAKPOINT_RU "продолжить?"
|
||||
#define DIALOG_ERROR_TIPS1_RU "ошибка:нет файла, попробуйте ещё раз."
|
||||
#define DIALOG_ERROR_TIPS2_RU "ошибка:сбой передачи. установите скорость \nпередачи данных как на плате управления!"
|
||||
@@ -236,8 +236,8 @@
|
||||
#define DIALOG_REPRINT_RU "Print again"
|
||||
#define DIALOG_WIFI_ENABLE_TIPS_RU "The wifi module is being configured,\nplease wait a moment....."
|
||||
|
||||
#define MESSAGE_PAUSING_RU "Стоянка..."
|
||||
#define MESSAGE_CHANGING_RU "Подождите, пока начнется смена филамента"
|
||||
#define MESSAGE_PAUSING_RU "Пауза"
|
||||
#define MESSAGE_CHANGING_RU "Подождите"
|
||||
#define MESSAGE_UNLOAD_RU "Дождитесь выгрузки нити"
|
||||
#define MESSAGE_WAITING_RU "Нажмите кнопку,чтобы возобновить печать"
|
||||
#define MESSAGE_INSERT_RU "Вставьте нить и нажмите кнопку,чтобы продолжить"
|
||||
@@ -250,7 +250,7 @@
|
||||
#define MESSAGE_PURGE_MORE_RU "чистка"
|
||||
#define MESSAGE_CONTINUE_PRINT_RU "Распечатать"
|
||||
#define EEPROM_SETTINGS_TITLE_RU "Настройки EEPROM"
|
||||
#define EEPROM_SETTINGS_STORE_RU "Cохранение настроек в EEPROM"
|
||||
#define EEPROM_SETTINGS_STORE_RU "Cохранить настройки в EEPROM"
|
||||
#define EEPROM_SETTINGS_READ_RU "Чтение настроек из EEPROM"
|
||||
#define EEPROM_SETTINGS_REVERT_RU "Bосстановить заводские настройки по умолчанию"
|
||||
|
||||
@@ -272,7 +272,7 @@
|
||||
#define DISABLE_RU "нет"
|
||||
#define KEY_CONFIRM_RU "OK"
|
||||
|
||||
#define MACHINE_PARA_TITLE_RU "настройки"
|
||||
#define MACHINE_PARA_TITLE_RU "Настройки"
|
||||
#define MACHINE_TYPE_CNOFIG_RU "Hастройки принтера"
|
||||
#define MOTOR_CONFIG_RU "Hастройки моторов"
|
||||
#define MACHINE_LEVELING_CONFIG_RU "Hастройки уровня"
|
||||
|
||||
@@ -389,7 +389,7 @@ namespace Language_de {
|
||||
LSTR MSG_ADVANCE_K_E = _UxGT("Vorschubfaktor *");
|
||||
LSTR MSG_CONTRAST = _UxGT("LCD-Kontrast");
|
||||
LSTR MSG_BRIGHTNESS = _UxGT("LCD-Helligkeit");
|
||||
LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD-Ruhezustand (s)");
|
||||
LSTR MSG_LCD_TIMEOUT_SEC = _UxGT("LCD-Ruhezustand (s)");
|
||||
LSTR MSG_BRIGHTNESS_OFF = _UxGT("LCD ausschalten");
|
||||
LSTR MSG_STORE_EEPROM = _UxGT("Konfig. speichern");
|
||||
LSTR MSG_LOAD_EEPROM = _UxGT("Konfig. laden");
|
||||
|
||||
@@ -350,6 +350,14 @@ namespace Language_en {
|
||||
LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed. Bad extruder.");
|
||||
LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed. Temperature too high.");
|
||||
LSTR MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout.");
|
||||
LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Testing heat loss");
|
||||
LSTR MSG_MPC_AUTOTUNE = _UxGT("MPC Autotune");
|
||||
LSTR MSG_MPC_EDIT = _UxGT("Edit * MPC");
|
||||
LSTR MSG_MPC_POWER_E = _UxGT("Power *");
|
||||
LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Block C *");
|
||||
LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensor res *");
|
||||
LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ambient h *");
|
||||
LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN255_E= _UxGT("Amb. h fan *");
|
||||
LSTR MSG_SELECT = _UxGT("Select");
|
||||
LSTR MSG_SELECT_E = _UxGT("Select *");
|
||||
LSTR MSG_ACC = _UxGT("Accel");
|
||||
@@ -421,7 +429,8 @@ namespace Language_en {
|
||||
LSTR MSG_ADVANCE_K_E = _UxGT("Advance K *");
|
||||
LSTR MSG_CONTRAST = _UxGT("LCD Contrast");
|
||||
LSTR MSG_BRIGHTNESS = _UxGT("LCD Brightness");
|
||||
LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD Timeout (s)");
|
||||
LSTR MSG_LCD_TIMEOUT_SEC = _UxGT("LCD Timeout (s)");
|
||||
LSTR MSG_SCREEN_TIMEOUT = _UxGT("LCD Timeout (m)");
|
||||
LSTR MSG_BRIGHTNESS_OFF = _UxGT("Backlight Off");
|
||||
LSTR MSG_STORE_EEPROM = _UxGT("Store Settings");
|
||||
LSTR MSG_LOAD_EEPROM = _UxGT("Load Settings");
|
||||
|
||||
@@ -335,7 +335,7 @@ namespace Language_fr {
|
||||
LSTR MSG_ADVANCE_K_E = _UxGT("Avance K *");
|
||||
LSTR MSG_BRIGHTNESS = _UxGT("Luminosité LCD");
|
||||
LSTR MSG_CONTRAST = _UxGT("Contraste LCD");
|
||||
LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("Veille LCD (s)");
|
||||
LSTR MSG_LCD_TIMEOUT_SEC = _UxGT("Veille LCD (s)");
|
||||
LSTR MSG_BRIGHTNESS_OFF = _UxGT("Éteindre l'écran LCD");
|
||||
LSTR MSG_STORE_EEPROM = _UxGT("Enregistrer config.");
|
||||
LSTR MSG_LOAD_EEPROM = _UxGT("Charger config.");
|
||||
|
||||
@@ -472,7 +472,7 @@ namespace Language_uk {
|
||||
LSTR MSG_CONTRAST = _UxGT("Контраст");
|
||||
LSTR MSG_BRIGHTNESS = _UxGT("Яскравість");
|
||||
#endif
|
||||
LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD Таймаут, с");
|
||||
LSTR MSG_LCD_TIMEOUT_SEC = _UxGT("LCD Таймаут, с");
|
||||
LSTR MSG_BRIGHTNESS_OFF = _UxGT("Підсвітка вимк.");
|
||||
LSTR MSG_STORE_EEPROM = _UxGT("Зберегти в EEPROM");
|
||||
LSTR MSG_LOAD_EEPROM = _UxGT("Зчитати з EEPROM");
|
||||
|
||||
@@ -55,6 +55,7 @@ namespace Language_zh_CN {
|
||||
LSTR MSG_DISABLE_STEPPERS = _UxGT("关闭步进电机"); // "Disable steppers"
|
||||
LSTR MSG_DEBUG_MENU = _UxGT("调试菜单"); // "Debug Menu"
|
||||
LSTR MSG_PROGRESS_BAR_TEST = _UxGT("进度条测试"); // "Progress Bar Test"
|
||||
LSTR MSG_HOMING = _UxGT("回原点");
|
||||
LSTR MSG_AUTO_HOME = _UxGT("自动回原点"); // "Auto home"
|
||||
LSTR MSG_AUTO_HOME_X = _UxGT("回X原位"); // "Home X"
|
||||
LSTR MSG_AUTO_HOME_Y = _UxGT("回Y原位"); // "Home Y"
|
||||
@@ -93,8 +94,8 @@ namespace Language_zh_CN {
|
||||
LSTR MSG_SPINDLE_MENU = _UxGT("主轴控制");
|
||||
LSTR MSG_SPINDLE_POWER = _UxGT("主轴电源");
|
||||
LSTR MSG_SPINDLE_REVERSE = _UxGT("主轴反转");
|
||||
LSTR MSG_SWITCH_PS_ON = _UxGT("电源打开"); // "Switch power on"
|
||||
LSTR MSG_SWITCH_PS_OFF = _UxGT("电源关闭"); // "Switch power off"
|
||||
LSTR MSG_SWITCH_PS_ON = _UxGT("开启电源"); // "Switch power on"
|
||||
LSTR MSG_SWITCH_PS_OFF = _UxGT("关闭电源"); // "Switch power off"
|
||||
LSTR MSG_EXTRUDE = _UxGT("挤出"); // "Extrude"
|
||||
LSTR MSG_RETRACT = _UxGT("回抽"); // "Retract"
|
||||
LSTR MSG_MOVE_AXIS = _UxGT("移动轴"); // "Move axis"
|
||||
|
||||
@@ -75,7 +75,7 @@ lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const i
|
||||
n -= lcd_put_u8str_max_P(inStr, n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH);
|
||||
}
|
||||
else if (ch == '@') {
|
||||
lcd_put_wchar(axis_codes[ind]);
|
||||
lcd_put_wchar(AXIS_CHAR(ind));
|
||||
n--;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -184,12 +184,23 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
||||
#endif
|
||||
|
||||
#if LCD_BACKLIGHT_TIMEOUT
|
||||
|
||||
uint16_t MarlinUI::lcd_backlight_timeout; // Initialized by settings.load()
|
||||
millis_t MarlinUI::backlight_off_ms = 0;
|
||||
void MarlinUI::refresh_backlight_timeout() {
|
||||
backlight_off_ms = lcd_backlight_timeout ? millis() + lcd_backlight_timeout * 1000UL : 0;
|
||||
WRITE(LCD_BACKLIGHT_PIN, HIGH);
|
||||
}
|
||||
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
|
||||
uint8_t MarlinUI::sleep_timeout_minutes; // Initialized by settings.load()
|
||||
millis_t MarlinUI::screen_timeout_millis = 0;
|
||||
void MarlinUI::refresh_screen_timeout() {
|
||||
screen_timeout_millis = sleep_timeout_minutes ? millis() + sleep_timeout_minutes * 60UL * 1000UL : 0;
|
||||
sleep_off();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void MarlinUI::init() {
|
||||
@@ -829,7 +840,7 @@ void MarlinUI::init() {
|
||||
TERN_(MULTI_E_MANUAL, axis == E_AXIS ? e_index :) active_extruder
|
||||
);
|
||||
|
||||
//SERIAL_ECHOLNPGM("Add planner.move with Axis ", AS_CHAR(axis_codes[axis]), " at FR ", fr_mm_s);
|
||||
//SERIAL_ECHOLNPGM("Add planner.move with Axis ", AS_CHAR(AXIS_CHAR(axis)), " at FR ", fr_mm_s);
|
||||
|
||||
axis = NO_AXIS_ENUM;
|
||||
|
||||
@@ -846,7 +857,7 @@ void MarlinUI::init() {
|
||||
TERN_(MULTI_E_MANUAL, if (move_axis == E_AXIS) e_index = eindex);
|
||||
start_time = millis() + (menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves
|
||||
axis = move_axis;
|
||||
//SERIAL_ECHOLNPGM("Post Move with Axis ", AS_CHAR(axis_codes[axis]), " soon.");
|
||||
//SERIAL_ECHOLNPGM("Post Move with Axis ", AS_CHAR(AXIS_CHAR(axis)), " soon.");
|
||||
}
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
@@ -1059,6 +1070,8 @@ void MarlinUI::init() {
|
||||
|
||||
#if LCD_BACKLIGHT_TIMEOUT
|
||||
refresh_backlight_timeout();
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
refresh_screen_timeout();
|
||||
#endif
|
||||
|
||||
refresh(LCDVIEW_REDRAW_NOW);
|
||||
@@ -1170,6 +1183,9 @@ void MarlinUI::init() {
|
||||
WRITE(LCD_BACKLIGHT_PIN, LOW); // Backlight off
|
||||
backlight_off_ms = 0;
|
||||
}
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
if (screen_timeout_millis && ELAPSED(ms, screen_timeout_millis))
|
||||
sleep_on();
|
||||
#endif
|
||||
|
||||
// Change state of drawing flag between screen updates
|
||||
|
||||
@@ -279,6 +279,14 @@ public:
|
||||
static uint16_t lcd_backlight_timeout;
|
||||
static millis_t backlight_off_ms;
|
||||
static void refresh_backlight_timeout();
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
#define SLEEP_TIMEOUT_MIN 0
|
||||
#define SLEEP_TIMEOUT_MAX 99
|
||||
static uint8_t sleep_timeout_minutes;
|
||||
static millis_t screen_timeout_millis;
|
||||
static void refresh_screen_timeout();
|
||||
static void sleep_on();
|
||||
static void sleep_off();
|
||||
#endif
|
||||
|
||||
#if HAS_DWIN_E3V2_BASIC
|
||||
|
||||
@@ -97,7 +97,7 @@ void menu_backlash();
|
||||
|
||||
#endif
|
||||
|
||||
#if HAS_FILAMENT_SENSOR
|
||||
#if HAS_FILAMENT_SENSOR && DISABLED(SLIM_LCD_MENUS)
|
||||
|
||||
void set_runout_mode_none(const uint8_t e) { runout.mode[e] = RM_NONE; runout.setup(); }
|
||||
void set_runout_mode_high(const uint8_t e) { runout.mode[e] = RM_OUT_ON_HIGH; runout.setup(); }
|
||||
@@ -198,7 +198,7 @@ void menu_backlash();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_FILAMENT_SENSOR
|
||||
#if HAS_FILAMENT_SENSOR && DISABLED(SLIM_LCD_MENUS)
|
||||
SUBMENU(MSG_RUNOUT_MODE, menu_runout_config);
|
||||
#endif
|
||||
|
||||
@@ -255,7 +255,7 @@ void menu_backlash();
|
||||
|
||||
// Helpers for editing PID Ki & Kd values
|
||||
// grab the PID value out of the temp variable; scale it; then update the PID driver
|
||||
void copy_and_scalePID_i(int16_t e) {
|
||||
void copy_and_scalePID_i(const int8_t e) {
|
||||
switch (e) {
|
||||
#if ENABLED(PIDTEMPBED)
|
||||
case H_BED: thermalManager.temp_bed.pid.Ki = scalePID_i(raw_Ki); break;
|
||||
@@ -271,7 +271,7 @@ void menu_backlash();
|
||||
break;
|
||||
}
|
||||
}
|
||||
void copy_and_scalePID_d(int16_t e) {
|
||||
void copy_and_scalePID_d(const int8_t e) {
|
||||
switch (e) {
|
||||
#if ENABLED(PIDTEMPBED)
|
||||
case H_BED: thermalManager.temp_bed.pid.Kd = scalePID_d(raw_Kd); break;
|
||||
@@ -287,33 +287,9 @@ void menu_backlash();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#define _DEFINE_PIDTEMP_BASE_FUNCS(N) \
|
||||
void copy_and_scalePID_i_E##N() { copy_and_scalePID_i(N); } \
|
||||
void copy_and_scalePID_d_E##N() { copy_and_scalePID_d(N); }
|
||||
|
||||
#else
|
||||
|
||||
#define _DEFINE_PIDTEMP_BASE_FUNCS(N) //
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(PID_AUTOTUNE_MENU)
|
||||
#define DEFINE_PIDTEMP_FUNCS(N) \
|
||||
_DEFINE_PIDTEMP_BASE_FUNCS(N); \
|
||||
void lcd_autotune_callback_E##N() { _lcd_autotune(heater_id_t(N)); }
|
||||
#else
|
||||
#define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N);
|
||||
#endif
|
||||
|
||||
#if HAS_HOTEND
|
||||
DEFINE_PIDTEMP_FUNCS(0);
|
||||
#if ENABLED(PID_PARAMS_PER_HOTEND)
|
||||
REPEAT_S(1, HOTENDS, DEFINE_PIDTEMP_FUNCS)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if BOTH(AUTOTEMP, HAS_TEMP_HOTEND) || EITHER(PID_AUTOTUNE_MENU, PID_EDIT_MENU)
|
||||
#if BOTH(AUTOTEMP, HAS_TEMP_HOTEND) || ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU, MPC_AUTOTUNE_MENU, MPC_EDIT_MENU)
|
||||
#define SHOW_MENU_ADVANCED_TEMPERATURE 1
|
||||
#endif
|
||||
|
||||
@@ -322,9 +298,20 @@ void menu_backlash();
|
||||
//
|
||||
#if SHOW_MENU_ADVANCED_TEMPERATURE
|
||||
|
||||
#if ENABLED(MPC_EDIT_MENU)
|
||||
#define MPC_EDIT_DEFS(N) \
|
||||
MPC_t &c = thermalManager.temp_hotend[N].constants; \
|
||||
TERN(MPC_INCLUDE_FAN, editable.decimal = c.ambient_xfer_coeff_fan0 + c.fan255_adjustment)
|
||||
#endif
|
||||
|
||||
void menu_advanced_temperature() {
|
||||
#if ENABLED(MPC_EDIT_MENU) && !HAS_MULTI_HOTEND
|
||||
MPC_EDIT_DEFS(0);
|
||||
#endif
|
||||
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_ADVANCED_SETTINGS);
|
||||
|
||||
//
|
||||
// Autotemp, Min, Max, Fact
|
||||
//
|
||||
@@ -344,14 +331,7 @@ void menu_backlash();
|
||||
// PID-P E5, PID-I E5, PID-D E5, PID-C E5, PID Autotune E5
|
||||
//
|
||||
|
||||
#if ENABLED(PID_EDIT_MENU)
|
||||
#define _PID_EDIT_ITEMS_TMPL(N,T) \
|
||||
raw_Ki = unscalePID_i(T.pid.Ki); \
|
||||
raw_Kd = unscalePID_d(T.pid.Kd); \
|
||||
EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_P_E, &T.pid.Kp, 1, 9990); \
|
||||
EDIT_ITEM_FAST_N(float52sign, N, MSG_PID_I_E, &raw_Ki, 0.01f, 9990, []{ copy_and_scalePID_i(N); }); \
|
||||
EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_D_E, &raw_Kd, 1, 9990, []{ copy_and_scalePID_d(N); })
|
||||
|
||||
#if BOTH(PIDTEMP, PID_EDIT_MENU)
|
||||
#define __PID_HOTEND_MENU_ITEMS(N) \
|
||||
raw_Ki = unscalePID_i(PID_PARAM(Ki, N)); \
|
||||
raw_Kd = unscalePID_d(PID_PARAM(Kd, N)); \
|
||||
@@ -381,17 +361,67 @@ void menu_backlash();
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(PID_AUTOTUNE_MENU)
|
||||
#define HOTEND_PID_EDIT_MENU_ITEMS(N) \
|
||||
_HOTEND_PID_EDIT_MENU_ITEMS(N); \
|
||||
EDIT_ITEM_FAST_N(int3, N, MSG_PID_AUTOTUNE_E, &autotune_temp[N], 150, thermalManager.hotend_max_target(N), []{ _lcd_autotune(heater_id_t(MenuItemBase::itemIndex)); });
|
||||
#else
|
||||
#define HOTEND_PID_EDIT_MENU_ITEMS(N) _HOTEND_PID_EDIT_MENU_ITEMS(N);
|
||||
#if ENABLED(PID_EDIT_MENU) && EITHER(PIDTEMPBED, PIDTEMPCHAMBER)
|
||||
#define _PID_EDIT_ITEMS_TMPL(N,T) \
|
||||
raw_Ki = unscalePID_i(T.pid.Ki); \
|
||||
raw_Kd = unscalePID_d(T.pid.Kd); \
|
||||
EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_P_E, &T.pid.Kp, 1, 9990); \
|
||||
EDIT_ITEM_FAST_N(float52sign, N, MSG_PID_I_E, &raw_Ki, 0.01f, 9990, []{ copy_and_scalePID_i(N); }); \
|
||||
EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_D_E, &raw_Kd, 1, 9990, []{ copy_and_scalePID_d(N); })
|
||||
#endif
|
||||
|
||||
HOTEND_PID_EDIT_MENU_ITEMS(0);
|
||||
#if ENABLED(PID_PARAMS_PER_HOTEND)
|
||||
REPEAT_S(1, HOTENDS, HOTEND_PID_EDIT_MENU_ITEMS)
|
||||
#if ENABLED(PIDTEMP)
|
||||
#if ENABLED(PID_AUTOTUNE_MENU)
|
||||
#define HOTEND_PID_EDIT_MENU_ITEMS(N) \
|
||||
_HOTEND_PID_EDIT_MENU_ITEMS(N); \
|
||||
EDIT_ITEM_FAST_N(int3, N, MSG_PID_AUTOTUNE_E, &autotune_temp[N], 150, thermalManager.hotend_max_target(N), []{ _lcd_autotune(heater_id_t(MenuItemBase::itemIndex)); });
|
||||
#else
|
||||
#define HOTEND_PID_EDIT_MENU_ITEMS(N) _HOTEND_PID_EDIT_MENU_ITEMS(N);
|
||||
#endif
|
||||
|
||||
HOTEND_PID_EDIT_MENU_ITEMS(0);
|
||||
#if ENABLED(PID_PARAMS_PER_HOTEND)
|
||||
REPEAT_S(1, HOTENDS, HOTEND_PID_EDIT_MENU_ITEMS);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(MPC_EDIT_MENU)
|
||||
|
||||
#define _MPC_EDIT_ITEMS(N) \
|
||||
EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_POWER_E, &c.heater_power, 1, 200); \
|
||||
EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_BLOCK_HEAT_CAPACITY_E, &c.block_heat_capacity, 0, 40); \
|
||||
EDIT_ITEM_FAST_N(float43, N, MSG_SENSOR_RESPONSIVENESS_E, &c.sensor_responsiveness, 0, 1); \
|
||||
EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_E, &c.ambient_xfer_coeff_fan0, 0, 1)
|
||||
|
||||
#if ENABLED(MPC_INCLUDE_FAN)
|
||||
#define MPC_EDIT_ITEMS(N) \
|
||||
_MPC_EDIT_ITEMS(N); \
|
||||
EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_FAN255_E, &editable.decimal, 0, 1, []{ \
|
||||
c.fan255_adjustment = editable.decimal - c.ambient_xfer_coeff_fan0; \
|
||||
})
|
||||
#else
|
||||
#define MPC_EDIT_ITEMS _MPC_EDIT_ITEMS
|
||||
#endif
|
||||
|
||||
#if HAS_MULTI_HOTEND
|
||||
auto mpc_edit_hotend = [&](const uint8_t e) {
|
||||
MPC_EDIT_DEFS(e);
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_TEMPERATURE);
|
||||
MPC_EDIT_ITEMS(e);
|
||||
END_MENU();
|
||||
};
|
||||
#define MPC_ENTRY(N) SUBMENU_N(N, MSG_MPC_EDIT, []{ mpc_edit_hotend(MenuItemBase::itemIndex); });
|
||||
#else
|
||||
#define MPC_ENTRY MPC_EDIT_ITEMS
|
||||
#endif
|
||||
|
||||
REPEAT(HOTENDS, MPC_ENTRY);
|
||||
|
||||
#endif // MPC_EDIT_MENU
|
||||
|
||||
#if ENABLED(MPC_AUTOTUNE_MENU)
|
||||
ACTION_ITEM(MSG_MPC_AUTOTUNE, []{ queue.inject(F("M306 T")); ui.return_to_status(); });
|
||||
#endif
|
||||
|
||||
#if ENABLED(PIDTEMPBED)
|
||||
|
||||
@@ -122,8 +122,8 @@ void menu_advanced_settings();
|
||||
EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_UNRETRACT_SPEED, &toolchange_settings.unretract_speed, 10, 5400);
|
||||
EDIT_ITEM(float3, MSG_FILAMENT_PURGE_LENGTH, &toolchange_settings.extra_prime, 0, max_extrude);
|
||||
EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_PRIME_SPEED, &toolchange_settings.prime_speed, 10, 5400);
|
||||
EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_FAN_SPEED, &toolchange_settings.fan_speed, 0, 255);
|
||||
EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_FAN_TIME, &toolchange_settings.fan_time, 1, 30);
|
||||
EDIT_ITEM_FAST(uint8, MSG_SINGLENOZZLE_FAN_SPEED, &toolchange_settings.fan_speed, 0, 255);
|
||||
EDIT_ITEM_FAST(uint8, MSG_SINGLENOZZLE_FAN_TIME, &toolchange_settings.fan_time, 1, 30);
|
||||
#endif
|
||||
EDIT_ITEM(float3, MSG_TOOL_CHANGE_ZLIFT, &toolchange_settings.z_raise, 0, 10);
|
||||
END_MENU();
|
||||
@@ -541,8 +541,14 @@ void menu_configuration() {
|
||||
#if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN < LCD_CONTRAST_MAX
|
||||
EDIT_ITEM_FAST(uint8, MSG_CONTRAST, &ui.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, ui.refresh_contrast, true);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Set display backlight / sleep timeout
|
||||
//
|
||||
#if LCD_BACKLIGHT_TIMEOUT && LCD_BKL_TIMEOUT_MIN < LCD_BKL_TIMEOUT_MAX
|
||||
EDIT_ITEM(uint16_4, MSG_LCD_BKL_TIMEOUT, &ui.lcd_backlight_timeout, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX, ui.refresh_backlight_timeout);
|
||||
EDIT_ITEM(uint16_4, MSG_LCD_TIMEOUT_SEC, &ui.lcd_backlight_timeout, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX, ui.refresh_backlight_timeout);
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
EDIT_ITEM(uint8, MSG_SCREEN_TIMEOUT, &ui.sleep_timeout_minutes, SLEEP_TIMEOUT_MIN, SLEEP_TIMEOUT_MAX, ui.refresh_screen_timeout);
|
||||
#endif
|
||||
|
||||
#if ENABLED(FWRETRACT)
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "../../core/debug_out.h"
|
||||
|
||||
static float z_measured[G35_PROBE_COUNT];
|
||||
static bool z_isvalid[G35_PROBE_COUNT];
|
||||
static Flags<G35_PROBE_COUNT> z_isvalid;
|
||||
static uint8_t tram_index = 0;
|
||||
static int8_t reference_index; // = 0
|
||||
|
||||
@@ -61,7 +61,10 @@ static bool probe_single_point() {
|
||||
move_to_tramming_wait_pos();
|
||||
|
||||
DEBUG_ECHOLNPGM("probe_single_point(", tram_index, ") = ", z_probed_height, "mm");
|
||||
return (z_isvalid[tram_index] = !isnan(z_probed_height));
|
||||
|
||||
const bool v = !isnan(z_probed_height);
|
||||
z_isvalid.set(tram_index, v);
|
||||
return v;
|
||||
}
|
||||
|
||||
static void _menu_single_probe() {
|
||||
@@ -80,7 +83,7 @@ static void tramming_wizard_menu() {
|
||||
|
||||
// Draw a menu item for each tramming point
|
||||
for (tram_index = 0; tram_index < G35_PROBE_COUNT; tram_index++)
|
||||
SUBMENU_P((char*)pgm_read_ptr(&tramming_point_name[tram_index]), _menu_single_probe);
|
||||
SUBMENU_P((PGM_P)pgm_read_ptr(&tramming_point_name[tram_index]), _menu_single_probe);
|
||||
|
||||
ACTION_ITEM(MSG_BUTTON_DONE, []{
|
||||
probe.stow(); // Stow before exiting Tramming Wizard
|
||||
@@ -95,7 +98,7 @@ void goto_tramming_wizard() {
|
||||
ui.defer_status_screen();
|
||||
|
||||
// Initialize measured point flags
|
||||
ZERO(z_isvalid);
|
||||
z_isvalid.reset();
|
||||
reference_index = -1;
|
||||
|
||||
// Inject G28, wait for homing to complete,
|
||||
|
||||
@@ -116,7 +116,7 @@ void TFT_String::add(uint8_t *string, int8_t index, uint8_t *itemString/*=nullpt
|
||||
else if (ch == '$' && itemString)
|
||||
add(itemString);
|
||||
else if (ch == '@')
|
||||
add_character(axis_codes[index]);
|
||||
add_character(AXIS_CHAR(index));
|
||||
else
|
||||
add_character(ch);
|
||||
}
|
||||
|
||||
@@ -412,11 +412,11 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
|
||||
}
|
||||
|
||||
uint8_t found_displacement = false;
|
||||
LOOP_LOGICAL_AXES(i) if (uint16_t _displacement = parser.intval(axis_codes[i])) {
|
||||
LOOP_LOGICAL_AXES(i) if (uint16_t _displacement = parser.intval(AXIS_CHAR(i))) {
|
||||
found_displacement = true;
|
||||
displacement = _displacement;
|
||||
uint8_t axis_offset = parser.byteval('J');
|
||||
axis_mon[0][0] = axis_codes[i]; // Axis first character, one of XYZE
|
||||
const uint8_t axis_offset = parser.byteval('J');
|
||||
axis_mon[0][0] = AXIS_CHAR(i); // Axis first character, one of XYZ...E
|
||||
const bool single_or_e = axis_offset >= 2 || axis_mon[0][0] == 'E',
|
||||
one_or_more = !single_or_e && axis_offset == 0;
|
||||
uint8_t driver_count_local = 0; // Can't use "driver_count" directly as a subscript because it's passed by reference
|
||||
@@ -667,7 +667,7 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
|
||||
static constexpr float default_max_feedrate[] = DEFAULT_MAX_FEEDRATE;
|
||||
const uint8_t num_feedrates = COUNT(default_max_feedrate);
|
||||
for (j = 0; j < num_feedrates; j++) {
|
||||
if (axis_codes[j] == axis_mon[0][0]) {
|
||||
if (AXIS_CHAR(j) == axis_mon[0][0]) {
|
||||
final_feedrate = default_max_feedrate[j];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#define HAS_L64XX_EXTRUDER (AXIS_IS_L64XX(E0) || AXIS_IS_L64XX(E1) || AXIS_IS_L64XX(E2) || AXIS_IS_L64XX(E3) || AXIS_IS_L64XX(E4) || AXIS_IS_L64XX(E5) || AXIS_IS_L64XX(E6) || AXIS_IS_L64XX(E7))
|
||||
|
||||
#define _EN_ITEM(N) , E##N
|
||||
enum L64XX_axis_t : uint8_t { NUM_AXIS_LIST(X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM), MAX_L64XX };
|
||||
enum L64XX_axis_t : uint8_t { NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM), MAX_L64XX };
|
||||
#undef _EN_ITEM
|
||||
|
||||
class L64XX_Marlin : public L64XXHelper {
|
||||
|
||||
@@ -670,18 +670,23 @@ void _O2 Endstops::report_states() {
|
||||
const RunoutMode rm = runout.mode[i - 1];
|
||||
const uint8_t outval = runout.out_state(i - 1);
|
||||
|
||||
SERIAL_ECHOPGM(STR_FILAMENT);
|
||||
if (i > 1) SERIAL_CHAR(' ', '0' + i);
|
||||
SERIAL_ECHOPGM(": ");
|
||||
if (rm == RM_NONE)
|
||||
SERIAL_ECHOLNPGM(STR_OFF);
|
||||
else if (rm == RM_MOTION_SENSOR) {
|
||||
SERIAL_ECHOPGM("MOTION : ");
|
||||
print_es_state(extDigitalRead(pin) == outval);
|
||||
}
|
||||
else
|
||||
SERIAL_ECHOLNPGM_P(extDigitalRead(pin) == outval ? PSTR("OUT") : PSTR("PRESENT"));
|
||||
#if DISABLED(SLIM_LCD_MENUS)
|
||||
SERIAL_ECHOPGM(STR_FILAMENT);
|
||||
if (i > 1) SERIAL_CHAR(' ', '0' + i);
|
||||
SERIAL_ECHOPGM(": ");
|
||||
if (rm == RM_NONE)
|
||||
SERIAL_ECHOLNPGM(STR_OFF);
|
||||
else if (rm == RM_MOTION_SENSOR) {
|
||||
SERIAL_ECHOPGM("MOTION : ");
|
||||
print_es_state(extDigitalRead(pin) == outval);
|
||||
}
|
||||
else
|
||||
SERIAL_ECHOLNPGM_P(extDigitalRead(pin) == outval ? PSTR("OUT") : PSTR("PRESENT"));
|
||||
#else
|
||||
print_es_state(extDigitalRead(pin) == outval, F(STR_FILAMENT));
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
TERN_(BLTOUCH, bltouch._reset_SW_mode());
|
||||
|
||||
@@ -1166,7 +1166,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
|
||||
#if ENABLED(MESH_BED_LEVELING)
|
||||
mbl.line_to_destination(scaled_fr_mm_s);
|
||||
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
||||
bilinear_line_to_destination(scaled_fr_mm_s);
|
||||
bbl.line_to_destination(scaled_fr_mm_s);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -592,7 +592,7 @@ class Planner {
|
||||
*/
|
||||
static float fade_scaling_factor_for_z(const_float_t rz) {
|
||||
static float z_fade_factor = 1;
|
||||
if (!z_fade_height) return 1;
|
||||
if (!z_fade_height || rz <= 0) return 1;
|
||||
if (rz >= z_fade_height) return 0;
|
||||
if (last_fade_z != rz) {
|
||||
last_fade_z = rz;
|
||||
|
||||
@@ -415,6 +415,21 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Print an error and stop()
|
||||
*/
|
||||
void Probe::probe_error_stop() {
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ECHOPGM(STR_STOP_PRE);
|
||||
#if EITHER(Z_PROBE_SLED, Z_PROBE_ALLEN_KEY)
|
||||
SERIAL_ECHOPGM(STR_STOP_UNHOMED);
|
||||
#elif ENABLED(BLTOUCH)
|
||||
SERIAL_ECHOPGM(STR_STOP_BLTOUCH);
|
||||
#endif
|
||||
SERIAL_ECHOLNPGM(STR_STOP_POST);
|
||||
stop();
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to deploy or stow the probe
|
||||
*
|
||||
@@ -443,8 +458,7 @@ bool Probe::set_deployed(const bool deploy) {
|
||||
|
||||
#if EITHER(Z_PROBE_SLED, Z_PROBE_ALLEN_KEY)
|
||||
if (homing_needed_error(TERN_(Z_PROBE_SLED, _BV(X_AXIS)))) {
|
||||
SERIAL_ERROR_MSG(STR_STOP_UNHOMED);
|
||||
stop();
|
||||
probe_error_stop();
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
@@ -484,15 +498,12 @@ bool Probe::set_deployed(const bool deploy) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Used by run_z_probe to do a single Z probe move.
|
||||
* @brief Move down until the probe triggers or the low limit is reached
|
||||
* Used by run_z_probe to do a single Z probe move.
|
||||
*
|
||||
* @param z Z destination
|
||||
* @param fr_mm_s Feedrate in mm/s
|
||||
* @return true to indicate an error
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Move down until the probe triggers or the low limit is reached
|
||||
*
|
||||
* @details Used by run_z_probe to get each bed Z height measurement.
|
||||
* Sets current_position.z to the height where the probe triggered
|
||||
|
||||
@@ -78,6 +78,8 @@ public:
|
||||
static void preheat_for_probing(const celsius_t hotend_temp, const celsius_t bed_temp);
|
||||
#endif
|
||||
|
||||
static void probe_error_stop();
|
||||
|
||||
static bool set_deployed(const bool deploy);
|
||||
|
||||
#if IS_KINEMATIC
|
||||
|
||||
@@ -175,11 +175,12 @@
|
||||
#endif
|
||||
|
||||
#define _EN_ITEM(N) , E##N
|
||||
#define _EN1_ITEM(N) , E##N:1
|
||||
|
||||
typedef struct { uint16_t NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } tmc_stepper_current_t;
|
||||
typedef struct { uint32_t NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } tmc_hybrid_threshold_t;
|
||||
typedef struct { int16_t NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4; } tmc_sgt_t;
|
||||
typedef struct { bool NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } tmc_stealth_enabled_t;
|
||||
typedef struct { uint16_t NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint16_t;
|
||||
typedef struct { uint32_t NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint32_t;
|
||||
typedef struct { int16_t NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4; } mot_stepper_int16_t;
|
||||
typedef struct { bool NUM_AXIS_LIST(X:1, Y:1, Z:1, I:1, J:1, K:1, U:1, V:1, W:1), X2:1, Y2:1, Z2:1, Z3:1, Z4:1 REPEAT(E_STEPPERS, _EN1_ITEM); } per_stepper_bool_t;
|
||||
|
||||
#undef _EN_ITEM
|
||||
|
||||
@@ -398,10 +399,12 @@ typedef struct SettingsDataStruct {
|
||||
uint8_t lcd_brightness; // M256 B
|
||||
|
||||
//
|
||||
// LCD_BACKLIGHT_TIMEOUT
|
||||
// Display Sleep
|
||||
//
|
||||
#if LCD_BACKLIGHT_TIMEOUT
|
||||
uint16_t lcd_backlight_timeout; // (G-code needed)
|
||||
uint16_t lcd_backlight_timeout; // M255 S
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
uint8_t sleep_timeout_minutes; // M255 S
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -430,10 +433,10 @@ typedef struct SettingsDataStruct {
|
||||
//
|
||||
// HAS_TRINAMIC_CONFIG
|
||||
//
|
||||
tmc_stepper_current_t tmc_stepper_current; // M906 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
|
||||
tmc_hybrid_threshold_t tmc_hybrid_threshold; // M913 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
|
||||
tmc_sgt_t tmc_sgt; // M914 X Y Z X2 Y2 Z2 Z3 Z4
|
||||
tmc_stealth_enabled_t tmc_stealth_enabled; // M569 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
|
||||
per_stepper_uint16_t tmc_stepper_current; // M906 X Y Z I J K U V W X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
|
||||
per_stepper_uint32_t tmc_hybrid_threshold; // M913 X Y Z I J K U V W X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
|
||||
mot_stepper_int16_t tmc_sgt; // M914 X Y Z I J K U V W X2 Y2 Z2 Z3 Z4
|
||||
per_stepper_bool_t tmc_stealth_enabled; // M569 X Y Z I J K U V W X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
|
||||
|
||||
//
|
||||
// LIN_ADVANCE
|
||||
@@ -630,6 +633,8 @@ void MarlinSettings::postprocess() {
|
||||
|
||||
#if LCD_BACKLIGHT_TIMEOUT
|
||||
ui.refresh_backlight_timeout();
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
ui.refresh_screen_timeout();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1131,10 +1136,12 @@ void MarlinSettings::postprocess() {
|
||||
}
|
||||
|
||||
//
|
||||
// LCD Backlight Timeout
|
||||
// LCD Backlight / Sleep Timeout
|
||||
//
|
||||
#if LCD_BACKLIGHT_TIMEOUT
|
||||
EEPROM_WRITE(ui.lcd_backlight_timeout);
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
EEPROM_WRITE(ui.sleep_timeout_minutes);
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -1145,7 +1152,7 @@ void MarlinSettings::postprocess() {
|
||||
#if ENABLED(USE_CONTROLLER_FAN)
|
||||
const controllerFan_settings_t &cfs = controllerFan.settings;
|
||||
#else
|
||||
controllerFan_settings_t cfs = controllerFan_defaults;
|
||||
constexpr controllerFan_settings_t cfs = controllerFan_defaults;
|
||||
#endif
|
||||
EEPROM_WRITE(cfs);
|
||||
}
|
||||
@@ -1210,7 +1217,7 @@ void MarlinSettings::postprocess() {
|
||||
{
|
||||
_FIELD_TEST(tmc_stepper_current);
|
||||
|
||||
tmc_stepper_current_t tmc_stepper_current{0};
|
||||
per_stepper_uint16_t tmc_stepper_current{0};
|
||||
|
||||
#if HAS_TRINAMIC_CONFIG
|
||||
#if AXIS_IS_TMC(X)
|
||||
@@ -1290,7 +1297,7 @@ void MarlinSettings::postprocess() {
|
||||
_FIELD_TEST(tmc_hybrid_threshold);
|
||||
|
||||
#if ENABLED(HYBRID_THRESHOLD)
|
||||
tmc_hybrid_threshold_t tmc_hybrid_threshold{0};
|
||||
per_stepper_uint32_t tmc_hybrid_threshold{0};
|
||||
TERN_(X_HAS_STEALTHCHOP, tmc_hybrid_threshold.X = stepperX.get_pwm_thrs());
|
||||
TERN_(Y_HAS_STEALTHCHOP, tmc_hybrid_threshold.Y = stepperY.get_pwm_thrs());
|
||||
TERN_(Z_HAS_STEALTHCHOP, tmc_hybrid_threshold.Z = stepperZ.get_pwm_thrs());
|
||||
@@ -1315,7 +1322,7 @@ void MarlinSettings::postprocess() {
|
||||
TERN_(E7_HAS_STEALTHCHOP, tmc_hybrid_threshold.E7 = stepperE7.get_pwm_thrs());
|
||||
#else
|
||||
#define _EN_ITEM(N) , .E##N = 30
|
||||
const tmc_hybrid_threshold_t tmc_hybrid_threshold = {
|
||||
const per_stepper_uint32_t tmc_hybrid_threshold = {
|
||||
NUM_AXIS_LIST(.X = 100, .Y = 100, .Z = 3, .I = 3, .J = 3, .K = 3, .U = 3, .V = 3, .W = 3),
|
||||
.X2 = 100, .Y2 = 100, .Z2 = 3, .Z3 = 3, .Z4 = 3
|
||||
REPEAT(E_STEPPERS, _EN_ITEM)
|
||||
@@ -1329,7 +1336,7 @@ void MarlinSettings::postprocess() {
|
||||
// TMC StallGuard threshold
|
||||
//
|
||||
{
|
||||
tmc_sgt_t tmc_sgt{0};
|
||||
mot_stepper_int16_t tmc_sgt{0};
|
||||
#if USE_SENSORLESS
|
||||
NUM_AXIS_CODE(
|
||||
TERN_(X_SENSORLESS, tmc_sgt.X = stepperX.homing_threshold()),
|
||||
@@ -1357,7 +1364,7 @@ void MarlinSettings::postprocess() {
|
||||
{
|
||||
_FIELD_TEST(tmc_stealth_enabled);
|
||||
|
||||
tmc_stealth_enabled_t tmc_stealth_enabled = { false };
|
||||
per_stepper_bool_t tmc_stealth_enabled = { false };
|
||||
TERN_(X_HAS_STEALTHCHOP, tmc_stealth_enabled.X = stepperX.get_stored_stealthChop());
|
||||
TERN_(Y_HAS_STEALTHCHOP, tmc_stealth_enabled.Y = stepperY.get_stored_stealthChop());
|
||||
TERN_(Z_HAS_STEALTHCHOP, tmc_stealth_enabled.Z = stepperZ.get_stored_stealthChop());
|
||||
@@ -2086,10 +2093,12 @@ void MarlinSettings::postprocess() {
|
||||
}
|
||||
|
||||
//
|
||||
// LCD Backlight Timeout
|
||||
// LCD Backlight / Sleep Timeout
|
||||
//
|
||||
#if LCD_BACKLIGHT_TIMEOUT
|
||||
EEPROM_READ(ui.lcd_backlight_timeout);
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
EEPROM_READ(ui.sleep_timeout_minutes);
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -2164,7 +2173,7 @@ void MarlinSettings::postprocess() {
|
||||
{
|
||||
_FIELD_TEST(tmc_stepper_current);
|
||||
|
||||
tmc_stepper_current_t currents;
|
||||
per_stepper_uint16_t currents;
|
||||
EEPROM_READ(currents);
|
||||
|
||||
#if HAS_TRINAMIC_CONFIG
|
||||
@@ -2243,7 +2252,7 @@ void MarlinSettings::postprocess() {
|
||||
|
||||
// TMC Hybrid Threshold
|
||||
{
|
||||
tmc_hybrid_threshold_t tmc_hybrid_threshold;
|
||||
per_stepper_uint32_t tmc_hybrid_threshold;
|
||||
_FIELD_TEST(tmc_hybrid_threshold);
|
||||
EEPROM_READ(tmc_hybrid_threshold);
|
||||
|
||||
@@ -2279,7 +2288,7 @@ void MarlinSettings::postprocess() {
|
||||
// TMC StallGuard threshold.
|
||||
//
|
||||
{
|
||||
tmc_sgt_t tmc_sgt;
|
||||
mot_stepper_int16_t tmc_sgt;
|
||||
_FIELD_TEST(tmc_sgt);
|
||||
EEPROM_READ(tmc_sgt);
|
||||
#if USE_SENSORLESS
|
||||
@@ -2308,7 +2317,7 @@ void MarlinSettings::postprocess() {
|
||||
{
|
||||
_FIELD_TEST(tmc_stealth_enabled);
|
||||
|
||||
tmc_stealth_enabled_t tmc_stealth_enabled;
|
||||
per_stepper_bool_t tmc_stealth_enabled;
|
||||
EEPROM_READ(tmc_stealth_enabled);
|
||||
|
||||
#if HAS_TRINAMIC_CONFIG
|
||||
@@ -3170,10 +3179,12 @@ void MarlinSettings::reset() {
|
||||
TERN_(HAS_LCD_BRIGHTNESS, ui.brightness = LCD_BRIGHTNESS_DEFAULT);
|
||||
|
||||
//
|
||||
// LCD Backlight Timeout
|
||||
// LCD Backlight / Sleep Timeout
|
||||
//
|
||||
#if LCD_BACKLIGHT_TIMEOUT
|
||||
ui.lcd_backlight_timeout = LCD_BACKLIGHT_TIMEOUT;
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
ui.sleep_timeout_minutes = DISPLAY_SLEEP_MINUTES;
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -3504,6 +3515,11 @@ void MarlinSettings::reset() {
|
||||
//
|
||||
TERN_(HAS_LCD_CONTRAST, gcode.M250_report(forReplay));
|
||||
|
||||
//
|
||||
// Display Sleep
|
||||
//
|
||||
TERN_(HAS_GCODE_M255, gcode.M255_report(forReplay));
|
||||
|
||||
//
|
||||
// LCD Brightness
|
||||
//
|
||||
|
||||
@@ -153,7 +153,7 @@ Stepper stepper; // Singleton
|
||||
#endif
|
||||
#endif
|
||||
|
||||
axis_flags_t Stepper::axis_enabled; // {0}
|
||||
stepper_flags_t Stepper::axis_enabled; // {0}
|
||||
|
||||
// private:
|
||||
|
||||
@@ -3638,7 +3638,7 @@ void Stepper::report_positions() {
|
||||
void Stepper::microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2, const int8_t ms3) {
|
||||
if (ms1 >= 0) switch (driver) {
|
||||
#if HAS_X_MS_PINS || HAS_X2_MS_PINS
|
||||
case 0:
|
||||
case X_AXIS:
|
||||
#if HAS_X_MS_PINS
|
||||
WRITE(X_MS1_PIN, ms1);
|
||||
#endif
|
||||
@@ -3648,7 +3648,7 @@ void Stepper::report_positions() {
|
||||
break;
|
||||
#endif
|
||||
#if HAS_Y_MS_PINS || HAS_Y2_MS_PINS
|
||||
case 1:
|
||||
case Y_AXIS:
|
||||
#if HAS_Y_MS_PINS
|
||||
WRITE(Y_MS1_PIN, ms1);
|
||||
#endif
|
||||
@@ -3658,7 +3658,7 @@ void Stepper::report_positions() {
|
||||
break;
|
||||
#endif
|
||||
#if HAS_SOME_Z_MS_PINS
|
||||
case 2:
|
||||
case Z_AXIS:
|
||||
#if HAS_Z_MS_PINS
|
||||
WRITE(Z_MS1_PIN, ms1);
|
||||
#endif
|
||||
@@ -3673,52 +3673,52 @@ void Stepper::report_positions() {
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
#if HAS_E0_MS_PINS
|
||||
case 3: WRITE(E0_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E1_MS_PINS
|
||||
case 4: WRITE(E1_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E2_MS_PINS
|
||||
case 5: WRITE(E2_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E3_MS_PINS
|
||||
case 6: WRITE(E3_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E4_MS_PINS
|
||||
case 7: WRITE(E4_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E5_MS_PINS
|
||||
case 8: WRITE(E5_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E6_MS_PINS
|
||||
case 9: WRITE(E6_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E7_MS_PINS
|
||||
case 10: WRITE(E7_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_I_MS_PINS
|
||||
case 11: WRITE(I_MS1_PIN, ms1); break
|
||||
case I_AXIS: WRITE(I_MS1_PIN, ms1); break
|
||||
#endif
|
||||
#if HAS_J_MS_PINS
|
||||
case 12: WRITE(J_MS1_PIN, ms1); break
|
||||
case J_AXIS: WRITE(J_MS1_PIN, ms1); break
|
||||
#endif
|
||||
#if HAS_K_MS_PINS
|
||||
case 13: WRITE(K_MS1_PIN, ms1); break
|
||||
case K_AXIS: WRITE(K_MS1_PIN, ms1); break
|
||||
#endif
|
||||
#if HAS_U_MS_PINS
|
||||
case 14: WRITE(U_MS1_PIN, ms1); break
|
||||
case U_AXIS: WRITE(U_MS1_PIN, ms1); break
|
||||
#endif
|
||||
#if HAS_V_MS_PINS
|
||||
case 15: WRITE(V_MS1_PIN, ms1); break
|
||||
case V_AXIS: WRITE(V_MS1_PIN, ms1); break
|
||||
#endif
|
||||
#if HAS_W_MS_PINS
|
||||
case 16: WRITE(W_MS1_PIN, ms1); break
|
||||
case W_AXIS: WRITE(W_MS1_PIN, ms1); break
|
||||
#endif
|
||||
#if HAS_E0_MS_PINS
|
||||
case E_AXIS: WRITE(E0_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E1_MS_PINS
|
||||
case (E_AXIS + 1): WRITE(E1_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E2_MS_PINS
|
||||
case (E_AXIS + 2): WRITE(E2_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E3_MS_PINS
|
||||
case (E_AXIS + 3): WRITE(E3_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E4_MS_PINS
|
||||
case (E_AXIS + 4): WRITE(E4_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E5_MS_PINS
|
||||
case (E_AXIS + 5): WRITE(E5_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E6_MS_PINS
|
||||
case (E_AXIS + 6): WRITE(E6_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E7_MS_PINS
|
||||
case (E_AXIS + 7): WRITE(E7_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
}
|
||||
if (ms2 >= 0) switch (driver) {
|
||||
#if HAS_X_MS_PINS || HAS_X2_MS_PINS
|
||||
case 0:
|
||||
case X_AXIS:
|
||||
#if HAS_X_MS_PINS
|
||||
WRITE(X_MS2_PIN, ms2);
|
||||
#endif
|
||||
@@ -3728,7 +3728,7 @@ void Stepper::report_positions() {
|
||||
break;
|
||||
#endif
|
||||
#if HAS_Y_MS_PINS || HAS_Y2_MS_PINS
|
||||
case 1:
|
||||
case Y_AXIS:
|
||||
#if HAS_Y_MS_PINS
|
||||
WRITE(Y_MS2_PIN, ms2);
|
||||
#endif
|
||||
@@ -3738,7 +3738,7 @@ void Stepper::report_positions() {
|
||||
break;
|
||||
#endif
|
||||
#if HAS_SOME_Z_MS_PINS
|
||||
case 2:
|
||||
case Z_AXIS:
|
||||
#if HAS_Z_MS_PINS
|
||||
WRITE(Z_MS2_PIN, ms2);
|
||||
#endif
|
||||
@@ -3753,52 +3753,52 @@ void Stepper::report_positions() {
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
#if HAS_E0_MS_PINS
|
||||
case 3: WRITE(E0_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E1_MS_PINS
|
||||
case 4: WRITE(E1_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E2_MS_PINS
|
||||
case 5: WRITE(E2_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E3_MS_PINS
|
||||
case 6: WRITE(E3_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E4_MS_PINS
|
||||
case 7: WRITE(E4_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E5_MS_PINS
|
||||
case 8: WRITE(E5_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E6_MS_PINS
|
||||
case 9: WRITE(E6_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E7_MS_PINS
|
||||
case 10: WRITE(E7_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_I_MS_PINS
|
||||
case 11: WRITE(I_MS2_PIN, ms2); break
|
||||
case I_AXIS: WRITE(I_MS2_PIN, ms2); break
|
||||
#endif
|
||||
#if HAS_J_MS_PINS
|
||||
case 12: WRITE(J_MS2_PIN, ms2); break
|
||||
case J_AXIS: WRITE(J_MS2_PIN, ms2); break
|
||||
#endif
|
||||
#if HAS_K_MS_PINS
|
||||
case 13: WRITE(K_MS2_PIN, ms2); break
|
||||
case K_AXIS: WRITE(K_MS2_PIN, ms2); break
|
||||
#endif
|
||||
#if HAS_U_MS_PINS
|
||||
case 14: WRITE(U_MS2_PIN, ms2); break
|
||||
case U_AXIS: WRITE(U_MS2_PIN, ms2); break
|
||||
#endif
|
||||
#if HAS_V_MS_PINS
|
||||
case 15: WRITE(V_MS2_PIN, ms2); break
|
||||
case V_AXIS: WRITE(V_MS2_PIN, ms2); break
|
||||
#endif
|
||||
#if HAS_W_MS_PINS
|
||||
case 16: WRITE(W_MS2_PIN, ms2); break
|
||||
case W_AXIS: WRITE(W_MS2_PIN, ms2); break
|
||||
#endif
|
||||
#if HAS_E0_MS_PINS
|
||||
case E_AXIS: WRITE(E0_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E1_MS_PINS
|
||||
case (E_AXIS + 1): WRITE(E1_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E2_MS_PINS
|
||||
case (E_AXIS + 2): WRITE(E2_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E3_MS_PINS
|
||||
case (E_AXIS + 3): WRITE(E3_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E4_MS_PINS
|
||||
case (E_AXIS + 4): WRITE(E4_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E5_MS_PINS
|
||||
case (E_AXIS + 5): WRITE(E5_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E6_MS_PINS
|
||||
case (E_AXIS + 6): WRITE(E6_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E7_MS_PINS
|
||||
case (E_AXIS + 7): WRITE(E7_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
}
|
||||
if (ms3 >= 0) switch (driver) {
|
||||
#if HAS_X_MS_PINS || HAS_X2_MS_PINS
|
||||
case 0:
|
||||
case X_AXIS:
|
||||
#if HAS_X_MS_PINS && PIN_EXISTS(X_MS3)
|
||||
WRITE(X_MS3_PIN, ms3);
|
||||
#endif
|
||||
@@ -3808,7 +3808,7 @@ void Stepper::report_positions() {
|
||||
break;
|
||||
#endif
|
||||
#if HAS_Y_MS_PINS || HAS_Y2_MS_PINS
|
||||
case 1:
|
||||
case Y_AXIS:
|
||||
#if HAS_Y_MS_PINS && PIN_EXISTS(Y_MS3)
|
||||
WRITE(Y_MS3_PIN, ms3);
|
||||
#endif
|
||||
@@ -3818,7 +3818,7 @@ void Stepper::report_positions() {
|
||||
break;
|
||||
#endif
|
||||
#if HAS_SOME_Z_MS_PINS
|
||||
case 2:
|
||||
case Z_AXIS:
|
||||
#if HAS_Z_MS_PINS && PIN_EXISTS(Z_MS3)
|
||||
WRITE(Z_MS3_PIN, ms3);
|
||||
#endif
|
||||
@@ -3833,29 +3833,47 @@ void Stepper::report_positions() {
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
#if HAS_I_MS_PINS
|
||||
case I_AXIS: WRITE(I_MS3_PIN, ms3); break
|
||||
#endif
|
||||
#if HAS_J_MS_PINS
|
||||
case J_AXIS: WRITE(J_MS3_PIN, ms3); break
|
||||
#endif
|
||||
#if HAS_K_MS_PINS
|
||||
case K_AXIS: WRITE(K_MS3_PIN, ms3); break
|
||||
#endif
|
||||
#if HAS_U_MS_PINS
|
||||
case U_AXIS: WRITE(U_MS3_PIN, ms3); break
|
||||
#endif
|
||||
#if HAS_V_MS_PINS
|
||||
case V_AXIS: WRITE(V_MS3_PIN, ms3); break
|
||||
#endif
|
||||
#if HAS_W_MS_PINS
|
||||
case W_AXIS: WRITE(W_MS3_PIN, ms3); break
|
||||
#endif
|
||||
#if HAS_E0_MS_PINS && PIN_EXISTS(E0_MS3)
|
||||
case 3: WRITE(E0_MS3_PIN, ms3); break;
|
||||
case E_AXIS: WRITE(E0_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
#if HAS_E1_MS_PINS && PIN_EXISTS(E1_MS3)
|
||||
case 4: WRITE(E1_MS3_PIN, ms3); break;
|
||||
case (E_AXIS + 1): WRITE(E1_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
#if HAS_E2_MS_PINS && PIN_EXISTS(E2_MS3)
|
||||
case 5: WRITE(E2_MS3_PIN, ms3); break;
|
||||
case (E_AXIS + 2): WRITE(E2_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
#if HAS_E3_MS_PINS && PIN_EXISTS(E3_MS3)
|
||||
case 6: WRITE(E3_MS3_PIN, ms3); break;
|
||||
case (E_AXIS + 3): WRITE(E3_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
#if HAS_E4_MS_PINS && PIN_EXISTS(E4_MS3)
|
||||
case 7: WRITE(E4_MS3_PIN, ms3); break;
|
||||
case (E_AXIS + 4): WRITE(E4_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
#if HAS_E5_MS_PINS && PIN_EXISTS(E5_MS3)
|
||||
case 8: WRITE(E5_MS3_PIN, ms3); break;
|
||||
case (E_AXIS + 5): WRITE(E5_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
#if HAS_E6_MS_PINS && PIN_EXISTS(E6_MS3)
|
||||
case 9: WRITE(E6_MS3_PIN, ms3); break;
|
||||
case (E_AXIS + 6): WRITE(E6_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
#if HAS_E7_MS_PINS && PIN_EXISTS(E7_MS3)
|
||||
case 10: WRITE(E7_MS3_PIN, ms3); break;
|
||||
case (E_AXIS + 7): WRITE(E7_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ typedef struct {
|
||||
};
|
||||
constexpr ena_mask_t linear_bits() { return _BV(NUM_AXES) - 1; }
|
||||
constexpr ena_mask_t e_bits() { return (_BV(EXTRUDERS) - 1) << NUM_AXES; }
|
||||
} axis_flags_t;
|
||||
} stepper_flags_t;
|
||||
|
||||
// All the stepper enable pins
|
||||
constexpr pin_t ena_pins[] = {
|
||||
@@ -596,7 +596,7 @@ class Stepper {
|
||||
static void refresh_motor_power();
|
||||
#endif
|
||||
|
||||
static axis_flags_t axis_enabled; // Axis stepper(s) ENABLED states
|
||||
static stepper_flags_t axis_enabled; // Axis stepper(s) ENABLED states
|
||||
|
||||
static bool axis_is_enabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) {
|
||||
return TEST(axis_enabled.bits, INDEX_OF_AXIS(axis, eindex));
|
||||
|
||||
@@ -141,8 +141,12 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if EITHER(MPCTEMP, PID_EXTRUSION_SCALING)
|
||||
#if ENABLED(MPCTEMP)
|
||||
#include <math.h>
|
||||
#include "probe.h"
|
||||
#endif
|
||||
|
||||
#if EITHER(MPCTEMP, PID_EXTRUSION_SCALING)
|
||||
#include "stepper.h"
|
||||
#endif
|
||||
|
||||
@@ -632,6 +636,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(isbed ? PID_BED_START : PID_EXTR_START));
|
||||
|
||||
if (target > GHV(CHAMBER_MAX_TARGET, BED_MAX_TARGET, temp_range[heater_id].maxtemp - (HOTEND_OVERSHOOT))) {
|
||||
SERIAL_ECHOPGM(STR_PID_AUTOTUNE);
|
||||
SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH);
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH));
|
||||
TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_TEMP_TOO_HIGH));
|
||||
@@ -639,6 +644,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
return;
|
||||
}
|
||||
|
||||
SERIAL_ECHOPGM(STR_PID_AUTOTUNE);
|
||||
SERIAL_ECHOLNPGM(STR_PID_AUTOTUNE_START);
|
||||
|
||||
disable_all_heaters();
|
||||
@@ -654,10 +660,11 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
|
||||
TERN_(NO_FAN_SLOWING_IN_PID_TUNING, adaptive_fan_slowing = false);
|
||||
|
||||
// PID Tuning loop
|
||||
wait_for_heatup = true; // Can be interrupted with M108
|
||||
LCD_MESSAGE(MSG_HEATING);
|
||||
while (wait_for_heatup) {
|
||||
|
||||
// PID Tuning loop
|
||||
wait_for_heatup = true;
|
||||
while (wait_for_heatup) { // Can be interrupted with M108
|
||||
|
||||
const millis_t ms = millis();
|
||||
|
||||
@@ -723,6 +730,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
#define MAX_OVERSHOOT_PID_AUTOTUNE 30
|
||||
#endif
|
||||
if (current_temp > target + MAX_OVERSHOOT_PID_AUTOTUNE) {
|
||||
SERIAL_ECHOPGM(STR_PID_AUTOTUNE);
|
||||
SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH);
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH));
|
||||
TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_TEMP_TOO_HIGH));
|
||||
@@ -765,11 +773,13 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_TUNING_TIMEOUT));
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TUNING_TIMEOUT));
|
||||
TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TIMEOUT)));
|
||||
SERIAL_ECHOPGM(STR_PID_AUTOTUNE);
|
||||
SERIAL_ECHOLNPGM(STR_PID_TIMEOUT);
|
||||
break;
|
||||
}
|
||||
|
||||
if (cycles > ncycles && cycles > 2) {
|
||||
SERIAL_ECHOPGM(STR_PID_AUTOTUNE);
|
||||
SERIAL_ECHOLNPGM(STR_PID_AUTOTUNE_FINISHED);
|
||||
TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_AUTOTUNE_DONE)));
|
||||
|
||||
@@ -858,34 +868,65 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
|
||||
if (ELAPSED(ms, next_report_ms)) {
|
||||
next_report_ms += 1000UL;
|
||||
SERIAL_ECHOLNPGM("Temperature ", current_temp);
|
||||
|
||||
print_heater_states(active_extruder);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
hal.idletask();
|
||||
TERN(DWIN_CREALITY_LCD, DWIN_Update(), ui.update());
|
||||
|
||||
if (!wait_for_heatup) {
|
||||
SERIAL_ECHOPGM(STR_MPC_AUTOTUNE);
|
||||
SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_INTERRUPTED);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
SERIAL_ECHOLNPGM("Measuring MPC constants for E", active_extruder);
|
||||
MPCHeaterInfo& hotend = temp_hotend[active_extruder];
|
||||
MPC_t& constants = hotend.constants;
|
||||
struct OnExit {
|
||||
~OnExit() {
|
||||
wait_for_heatup = false;
|
||||
|
||||
// move to center of bed, just above bed height and cool with max fan
|
||||
SERIAL_ECHOLNPGM("Moving to tuning position");
|
||||
TERN_(HAS_FAN, zero_fan_speeds());
|
||||
ui.reset_status();
|
||||
|
||||
temp_hotend[active_extruder].target = 0.0f;
|
||||
temp_hotend[active_extruder].soft_pwm_amount = 0;
|
||||
#if HAS_FAN
|
||||
set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0);
|
||||
planner.sync_fan_speeds(fan_speed);
|
||||
#endif
|
||||
|
||||
do_z_clearance(MPC_TUNING_END_Z);
|
||||
}
|
||||
} on_exit;
|
||||
|
||||
SERIAL_ECHOPGM(STR_MPC_AUTOTUNE);
|
||||
SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_START, active_extruder);
|
||||
MPCHeaterInfo &hotend = temp_hotend[active_extruder];
|
||||
MPC_t &constants = hotend.constants;
|
||||
|
||||
// Move to center of bed, just above bed height and cool with max fan
|
||||
disable_all_heaters();
|
||||
TERN_(HAS_FAN, set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255));
|
||||
TERN_(HAS_FAN, planner.sync_fan_speeds(fan_speed));
|
||||
#if HAS_FAN
|
||||
zero_fan_speeds();
|
||||
set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255);
|
||||
planner.sync_fan_speeds(fan_speed);
|
||||
#endif
|
||||
gcode.home_all_axes(true);
|
||||
const xyz_pos_t tuningpos = MPC_TUNING_POS;
|
||||
do_blocking_move_to(tuningpos);
|
||||
|
||||
SERIAL_ECHOLNPGM("Cooling to ambient");
|
||||
SERIAL_ECHOLNPGM(STR_MPC_COOLING_TO_AMBIENT);
|
||||
LCD_MESSAGE(MSG_COOLING);
|
||||
millis_t ms = millis(), next_report_ms = ms, next_test_ms = ms + 10000UL;
|
||||
celsius_float_t current_temp = degHotend(active_extruder),
|
||||
ambient_temp = current_temp;
|
||||
|
||||
wait_for_heatup = true; // Can be interrupted with M108
|
||||
while (wait_for_heatup) {
|
||||
housekeeping(ms, current_temp, next_report_ms);
|
||||
wait_for_heatup = true;
|
||||
for (;;) { // Can be interrupted with M108
|
||||
if (!housekeeping(ms, current_temp, next_report_ms)) return;
|
||||
|
||||
if (ELAPSED(ms, next_test_ms)) {
|
||||
if (current_temp >= ambient_temp) {
|
||||
@@ -896,27 +937,31 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
next_test_ms += 10000UL;
|
||||
}
|
||||
}
|
||||
TERN_(HAS_FAN, set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0));
|
||||
TERN_(HAS_FAN, planner.sync_fan_speeds(fan_speed));
|
||||
|
||||
#if HAS_FAN
|
||||
set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0);
|
||||
planner.sync_fan_speeds(fan_speed);
|
||||
#endif
|
||||
|
||||
hotend.modeled_ambient_temp = ambient_temp;
|
||||
|
||||
SERIAL_ECHOLNPGM("Heating to 200C");
|
||||
SERIAL_ECHOLNPGM(STR_MPC_HEATING_PAST_200);
|
||||
LCD_MESSAGE(MSG_HEATING);
|
||||
hotend.target = 200.0f; // So M105 looks nice
|
||||
hotend.soft_pwm_amount = MPC_MAX >> 1;
|
||||
const millis_t heat_start_time = ms;
|
||||
next_test_ms = ms;
|
||||
const millis_t heat_start_time = next_test_ms = ms;
|
||||
celsius_float_t temp_samples[16];
|
||||
uint8_t sample_count = 0;
|
||||
uint16_t sample_distance = 1;
|
||||
float t1_time = 0;
|
||||
|
||||
while (wait_for_heatup) {
|
||||
housekeeping(ms, current_temp, next_report_ms);
|
||||
for (;;) { // Can be interrupted with M108
|
||||
if (!housekeeping(ms, current_temp, next_report_ms)) return;
|
||||
|
||||
if (ELAPSED(ms, next_test_ms)) {
|
||||
// record samples between 100C and 200C
|
||||
// Record samples between 100C and 200C
|
||||
if (current_temp >= 100.0f) {
|
||||
// if there are too many samples, space them more widely
|
||||
// If there are too many samples, space them more widely
|
||||
if (sample_count == COUNT(temp_samples)) {
|
||||
for (uint8_t i = 0; i < COUNT(temp_samples) / 2; i++)
|
||||
temp_samples[i] = temp_samples[i*2];
|
||||
@@ -935,13 +980,13 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
}
|
||||
hotend.soft_pwm_amount = 0;
|
||||
|
||||
// calculate physical constants from three equally spaced samples
|
||||
// Calculate physical constants from three equally-spaced samples
|
||||
sample_count = (sample_count + 1) / 2 * 2 - 1;
|
||||
const float t1 = temp_samples[0],
|
||||
t2 = temp_samples[(sample_count - 1) >> 1],
|
||||
t3 = temp_samples[sample_count - 1],
|
||||
asymp_temp = (t2 * t2 - t1 * t3) / (2 * t2 - t1 - t3),
|
||||
block_responsiveness = -log((t2 - asymp_temp) / (t1 - asymp_temp)) / (sample_distance * (sample_count >> 1));
|
||||
t3 = temp_samples[sample_count - 1];
|
||||
float asymp_temp = (t2 * t2 - t1 * t3) / (2 * t2 - t1 - t3),
|
||||
block_responsiveness = -log((t2 - asymp_temp) / (t1 - asymp_temp)) / (sample_distance * (sample_count >> 1));
|
||||
|
||||
constants.ambient_xfer_coeff_fan0 = constants.heater_power * MPC_MAX / 255 / (asymp_temp - ambient_temp);
|
||||
constants.fan255_adjustment = 0.0f;
|
||||
@@ -951,14 +996,14 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
hotend.modeled_block_temp = asymp_temp + (ambient_temp - asymp_temp) * exp(-block_responsiveness * (ms - heat_start_time) / 1000.0f);
|
||||
hotend.modeled_sensor_temp = current_temp;
|
||||
|
||||
// let the system stabilise under MPC control then get a better measure of ambient loss without and with fan
|
||||
SERIAL_ECHOLNPGM("Measuring ambient heatloss at target ", hotend.modeled_block_temp);
|
||||
// Allow the system to stabilize under MPC, then get a better measure of ambient loss with and without fan
|
||||
SERIAL_ECHOLNPGM(STR_MPC_MEASURING_AMBIENT, hotend.modeled_block_temp);
|
||||
LCD_MESSAGE(MSG_MPC_MEASURING_AMBIENT);
|
||||
hotend.target = hotend.modeled_block_temp;
|
||||
next_test_ms = ms + MPC_dT * 1000;
|
||||
constexpr millis_t settle_time = 20000UL,
|
||||
test_length = 20000UL;
|
||||
constexpr millis_t settle_time = 20000UL, test_duration = 20000UL;
|
||||
millis_t settle_end_ms = ms + settle_time,
|
||||
test_end_ms = settle_end_ms + test_length;
|
||||
test_end_ms = settle_end_ms + test_duration;
|
||||
float total_energy_fan0 = 0.0f;
|
||||
#if HAS_FAN
|
||||
bool fan0_done = false;
|
||||
@@ -966,22 +1011,20 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
#endif
|
||||
float last_temp = current_temp;
|
||||
|
||||
while (wait_for_heatup) {
|
||||
housekeeping(ms, current_temp, next_report_ms);
|
||||
for (;;) { // Can be interrupted with M108
|
||||
if (!housekeeping(ms, current_temp, next_report_ms)) return;
|
||||
|
||||
if (ELAPSED(ms, next_test_ms)) {
|
||||
// use MPC to control the temperature, let it settle for 30s and then track power output for 10s
|
||||
hotend.soft_pwm_amount = (int)get_pid_output_hotend(active_extruder) >> 1;
|
||||
|
||||
if (ELAPSED(ms, settle_end_ms) && !ELAPSED(ms, test_end_ms) && TERN1(HAS_FAN, !fan0_done))
|
||||
total_energy_fan0 += constants.heater_power * hotend.soft_pwm_amount / 127 * MPC_dT + (last_temp - current_temp) * constants.block_heat_capacity;
|
||||
#if HAS_FAN
|
||||
else if (ELAPSED(ms, test_end_ms) && !fan0_done) {
|
||||
SERIAL_ECHOLNPGM("Measuring ambient heatloss with full fan");
|
||||
set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255);
|
||||
planner.sync_fan_speeds(fan_speed);
|
||||
settle_end_ms = ms + settle_time;
|
||||
test_end_ms = settle_end_ms + test_length;
|
||||
test_end_ms = settle_end_ms + test_duration;
|
||||
fan0_done = true;
|
||||
}
|
||||
else if (ELAPSED(ms, settle_end_ms) && !ELAPSED(ms, test_end_ms))
|
||||
@@ -993,31 +1036,29 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
next_test_ms += MPC_dT * 1000;
|
||||
}
|
||||
|
||||
if (!WITHIN(current_temp, hotend.target - 15.0f, hotend.target + 15.0f)) {
|
||||
SERIAL_ECHOLNPGM("Temperature error while measuring ambient loss");
|
||||
if (!WITHIN(current_temp, t3 - 15.0f, hotend.target + 15.0f)) {
|
||||
SERIAL_ECHOLNPGM(STR_MPC_TEMPERATURE_ERROR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const float power_fan0 = total_energy_fan0 * 1000 / test_length;
|
||||
const float power_fan0 = total_energy_fan0 * 1000 / test_duration;
|
||||
constants.ambient_xfer_coeff_fan0 = power_fan0 / (hotend.target - ambient_temp);
|
||||
|
||||
#if HAS_FAN
|
||||
const float power_fan255 = total_energy_fan255 * 1000 / test_length,
|
||||
const float power_fan255 = total_energy_fan255 * 1000 / test_duration,
|
||||
ambient_xfer_coeff_fan255 = power_fan255 / (hotend.target - ambient_temp);
|
||||
constants.fan255_adjustment = ambient_xfer_coeff_fan255 - constants.ambient_xfer_coeff_fan0;
|
||||
#endif
|
||||
|
||||
hotend.target = 0.0f;
|
||||
hotend.soft_pwm_amount = 0;
|
||||
TERN_(HAS_FAN, set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0));
|
||||
TERN_(HAS_FAN, planner.sync_fan_speeds(fan_speed));
|
||||
// Calculate a new and better asymptotic temperature and re-evaluate the other constants
|
||||
asymp_temp = ambient_temp + constants.heater_power / constants.ambient_xfer_coeff_fan0;
|
||||
block_responsiveness = -log((t2 - asymp_temp) / (t1 - asymp_temp)) / (sample_distance * (sample_count >> 1));
|
||||
constants.block_heat_capacity = constants.ambient_xfer_coeff_fan0 / block_responsiveness;
|
||||
constants.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp));
|
||||
|
||||
if (!wait_for_heatup) SERIAL_ECHOLNPGM("Test was interrupted");
|
||||
|
||||
wait_for_heatup = false;
|
||||
|
||||
SERIAL_ECHOLNPGM("Done");
|
||||
SERIAL_ECHOPGM(STR_MPC_AUTOTUNE);
|
||||
SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_FINISHED);
|
||||
|
||||
/* <-- add a slash to enable
|
||||
SERIAL_ECHOLNPGM("t1_time ", t1_time);
|
||||
@@ -1283,7 +1324,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
|
||||
static hotend_pid_t work_pid[HOTENDS];
|
||||
static float temp_iState[HOTENDS] = { 0 },
|
||||
temp_dState[HOTENDS] = { 0 };
|
||||
static bool pid_reset[HOTENDS] = { false };
|
||||
static Flags<HOTENDS> pid_reset;
|
||||
const float pid_error = temp_hotend[ee].target - temp_hotend[ee].celsius;
|
||||
|
||||
float pid_output;
|
||||
@@ -1293,17 +1334,17 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
|
||||
|| TERN0(HEATER_IDLE_HANDLER, heater_idle[ee].timed_out)
|
||||
) {
|
||||
pid_output = 0;
|
||||
pid_reset[ee] = true;
|
||||
pid_reset.set(ee);
|
||||
}
|
||||
else if (pid_error > PID_FUNCTIONAL_RANGE) {
|
||||
pid_output = PID_MAX;
|
||||
pid_reset[ee] = true;
|
||||
pid_reset.set(ee);
|
||||
}
|
||||
else {
|
||||
if (pid_reset[ee]) {
|
||||
temp_iState[ee] = 0.0;
|
||||
work_pid[ee].Kd = 0.0;
|
||||
pid_reset[ee] = false;
|
||||
pid_reset.clear(ee);
|
||||
}
|
||||
|
||||
work_pid[ee].Kd = work_pid[ee].Kd + PID_K2 * (PID_PARAM(Kd, ee) * (temp_dState[ee] - temp_hotend[ee].celsius) - work_pid[ee].Kd);
|
||||
@@ -1369,12 +1410,12 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
|
||||
#endif
|
||||
|
||||
#elif ENABLED(MPCTEMP)
|
||||
MPCHeaterInfo& hotend = temp_hotend[ee];
|
||||
MPC_t& constants = hotend.constants;
|
||||
MPCHeaterInfo &hotend = temp_hotend[ee];
|
||||
MPC_t &constants = hotend.constants;
|
||||
|
||||
// At startup, initialize modeled temperatures
|
||||
if (isnan(hotend.modeled_block_temp)) {
|
||||
hotend.modeled_ambient_temp = min(30.0f, hotend.celsius); // cap initial value at reasonable max room temperature of 30C
|
||||
hotend.modeled_ambient_temp = min(30.0f, hotend.celsius); // Cap initial value at reasonable max room temperature of 30C
|
||||
hotend.modeled_block_temp = hotend.modeled_sensor_temp = hotend.celsius;
|
||||
}
|
||||
|
||||
@@ -1395,16 +1436,16 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
|
||||
const int32_t e_position = stepper.position(E_AXIS);
|
||||
const float e_speed = (e_position - mpc_e_position) * planner.mm_per_step[E_AXIS] / MPC_dT;
|
||||
|
||||
// the position can appear to make big jumps when, e.g. homing
|
||||
// The position can appear to make big jumps when, e.g. homing
|
||||
if (fabs(e_speed) > planner.settings.max_feedrate_mm_s[E_AXIS])
|
||||
mpc_e_position = e_position;
|
||||
else if (e_speed > 0.0f) { // ignore retract/recover moves
|
||||
else if (e_speed > 0.0f) { // Ignore retract/recover moves
|
||||
ambient_xfer_coeff += e_speed * FILAMENT_HEAT_CAPACITY_PERMM;
|
||||
mpc_e_position = e_position;
|
||||
}
|
||||
}
|
||||
|
||||
// update the modeled temperatures
|
||||
// Update the modeled temperatures
|
||||
float blocktempdelta = hotend.soft_pwm_amount * constants.heater_power * (MPC_dT / 127) / constants.block_heat_capacity;
|
||||
blocktempdelta += (hotend.modeled_ambient_temp - hotend.modeled_block_temp) * ambient_xfer_coeff * MPC_dT / constants.block_heat_capacity;
|
||||
hotend.modeled_block_temp += blocktempdelta;
|
||||
@@ -1418,18 +1459,18 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
|
||||
hotend.modeled_block_temp += delta_to_apply;
|
||||
hotend.modeled_sensor_temp += delta_to_apply;
|
||||
|
||||
// only correct ambient when close to steady state (output power is not clipped or asymptotic temperature is reached)
|
||||
// Only correct ambient when close to steady state (output power is not clipped or asymptotic temperature is reached)
|
||||
if (WITHIN(hotend.soft_pwm_amount, 1, 126) || fabs(blocktempdelta + delta_to_apply) < (MPC_STEADYSTATE * MPC_dT))
|
||||
hotend.modeled_ambient_temp += delta_to_apply > 0.f ? max(delta_to_apply, MPC_MIN_AMBIENT_CHANGE * MPC_dT) : min(delta_to_apply, -MPC_MIN_AMBIENT_CHANGE * MPC_dT);
|
||||
|
||||
float power = 0.0;
|
||||
if (hotend.target != 0 && TERN1(HEATER_IDLE_HANDLER, !heater_idle[ee].timed_out)) {
|
||||
// plan power level to get to target temperature in 2 seconds
|
||||
// Plan power level to get to target temperature in 2 seconds
|
||||
power = (hotend.target - hotend.modeled_block_temp) * constants.block_heat_capacity / 2.0f;
|
||||
power -= (hotend.modeled_ambient_temp - hotend.modeled_block_temp) * ambient_xfer_coeff;
|
||||
}
|
||||
|
||||
float pid_output = power * 254.0f / constants.heater_power + 1.0f; // ensure correct quantization into a range of 0 to 127
|
||||
float pid_output = power * 254.0f / constants.heater_power + 1.0f; // Ensure correct quantization into a range of 0 to 127
|
||||
pid_output = constrain(pid_output, 0, MPC_MAX);
|
||||
|
||||
/* <-- add a slash to enable
|
||||
@@ -2075,7 +2116,7 @@ void Temperature::manage_heater() {
|
||||
- (t.beta_recip * t.res_25_log) - (t.sh_c_coeff * cu(t.res_25_log));
|
||||
}
|
||||
|
||||
// maximum adc value .. take into account the over sampling
|
||||
// Maximum ADC value .. take into account the over sampling
|
||||
constexpr raw_adc_t adc_max = MAX_RAW_THERMISTOR_VALUE;
|
||||
const raw_adc_t adc_raw = constrain(raw, 1, adc_max - 1); // constrain to prevent divide-by-zero
|
||||
|
||||
@@ -3073,7 +3114,7 @@ void Temperature::disable_all_heaters() {
|
||||
spiInit(MAX_TC_SPEED_BITS);
|
||||
#endif
|
||||
|
||||
MAXTC_CS_WRITE(LOW); // enable MAXTC
|
||||
MAXTC_CS_WRITE(LOW); // Enable MAXTC
|
||||
DELAY_NS(100); // Ensure 100ns delay
|
||||
|
||||
// Read a big-endian temperature value without using a library
|
||||
@@ -3082,7 +3123,7 @@ void Temperature::disable_all_heaters() {
|
||||
if (i > 0) max_tc_temp <<= 8; // shift left if not the last byte
|
||||
}
|
||||
|
||||
MAXTC_CS_WRITE(HIGH); // disable MAXTC
|
||||
MAXTC_CS_WRITE(HIGH); // Disable MAXTC
|
||||
#else
|
||||
#if HAS_MAX6675_LIBRARY
|
||||
MAX6675 &max6675ref = THERMO_SEL(max6675_0, max6675_1);
|
||||
@@ -3293,7 +3334,7 @@ void Temperature::isr() {
|
||||
static ADCSensorState adc_sensor_state = StartupDelay;
|
||||
static uint8_t pwm_count = _BV(SOFT_PWM_SCALE);
|
||||
|
||||
// avoid multiple loads of pwm_count
|
||||
// Avoid multiple loads of pwm_count
|
||||
uint8_t pwm_count_tmp = pwm_count;
|
||||
|
||||
#if HAS_ADC_BUTTONS
|
||||
@@ -3571,8 +3612,8 @@ void Temperature::isr() {
|
||||
// 5: / 4 = 244.1406 Hz
|
||||
pwm_count = pwm_count_tmp + _BV(SOFT_PWM_SCALE);
|
||||
|
||||
// increment slow_pwm_count only every 64th pwm_count,
|
||||
// i.e. yielding a PWM frequency of 16/128 Hz (8s).
|
||||
// Increment slow_pwm_count only every 64th pwm_count,
|
||||
// i.e., yielding a PWM frequency of 16/128 Hz (8s).
|
||||
if (((pwm_count >> SOFT_PWM_SCALE) & 0x3F) == 0) {
|
||||
slow_pwm_count++;
|
||||
slow_pwm_count &= 0x7F;
|
||||
@@ -3907,7 +3948,10 @@ void Temperature::isr() {
|
||||
|
||||
#if ENABLED(AUTO_REPORT_TEMPERATURES)
|
||||
AutoReporter<Temperature::AutoReportTemp> Temperature::auto_reporter;
|
||||
void Temperature::AutoReportTemp::report() { print_heater_states(active_extruder); SERIAL_EOL(); }
|
||||
void Temperature::AutoReportTemp::report() {
|
||||
print_heater_states(active_extruder OPTARG(HAS_TEMP_REDUNDANT, ENABLED(AUTO_REPORT_REDUNDANT)));
|
||||
SERIAL_EOL();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAS_HOTEND && HAS_STATUS_MESSAGE
|
||||
@@ -4025,7 +4069,7 @@ void Temperature::isr() {
|
||||
|
||||
// Prevent a wait-forever situation if R is misused i.e. M109 R0
|
||||
if (wants_to_cool) {
|
||||
// break after MIN_COOLING_SLOPE_TIME seconds
|
||||
// Break after MIN_COOLING_SLOPE_TIME seconds
|
||||
// if the temperature did not drop at least MIN_COOLING_SLOPE_DEG
|
||||
if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) {
|
||||
if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG)) break;
|
||||
@@ -4047,7 +4091,7 @@ void Temperature::isr() {
|
||||
wait_for_heatup = false;
|
||||
#if HAS_DWIN_E3V2_BASIC
|
||||
HMI_flag.heat_flag = 0;
|
||||
duration_t elapsed = print_job_timer.duration(); // print timer
|
||||
duration_t elapsed = print_job_timer.duration(); // Print timer
|
||||
dwin_heat_time = elapsed.value;
|
||||
#else
|
||||
ui.reset_status();
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "../MarlinCore.h"
|
||||
|
||||
//#define DEBUG_TOOL_CHANGE
|
||||
//#define DEBUG_TOOLCHANGE_FILAMENT_SWAP
|
||||
|
||||
#define DEBUG_OUT ENABLED(DEBUG_TOOL_CHANGE)
|
||||
#include "../core/debug_out.h"
|
||||
@@ -42,11 +43,10 @@
|
||||
|
||||
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
||||
migration_settings_t migration = migration_defaults;
|
||||
bool enable_first_prime;
|
||||
#endif
|
||||
|
||||
#if ENABLED(TOOLCHANGE_FS_INIT_BEFORE_SWAP)
|
||||
bool toolchange_extruder_ready[EXTRUDERS];
|
||||
Flags<EXTRUDERS> toolchange_extruder_ready;
|
||||
#endif
|
||||
|
||||
#if EITHER(MAGNETIC_PARKING_EXTRUDER, TOOL_SENSOR) \
|
||||
@@ -150,6 +150,7 @@
|
||||
|
||||
#endif // SWITCHING_NOZZLE
|
||||
|
||||
// Move to position routines
|
||||
void _line_to_current(const AxisEnum fr_axis, const float fscale=1) {
|
||||
line_to_current_position(planner.settings.max_feedrate_mm_s[fr_axis] * fscale);
|
||||
}
|
||||
@@ -899,10 +900,135 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
|
||||
*/
|
||||
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
|
||||
|
||||
#ifdef DEBUG_TOOLCHANGE_FILAMENT_SWAP
|
||||
#define FS_DEBUG(V...) SERIAL_ECHOLNPGM("DEBUG: " V)
|
||||
#else
|
||||
#define FS_DEBUG(...) NOOP
|
||||
#endif
|
||||
|
||||
// Define any variables required
|
||||
static Flags<EXTRUDERS> extruder_was_primed; // Extruders primed status
|
||||
|
||||
#if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED)
|
||||
bool enable_first_prime; // As set by M217 V
|
||||
#endif
|
||||
|
||||
// Cool down with fan
|
||||
inline void filament_swap_cooling() {
|
||||
#if HAS_FAN && TOOLCHANGE_FS_FAN >= 0
|
||||
thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed;
|
||||
gcode.dwell(SEC_TO_MS(toolchange_settings.fan_time));
|
||||
thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if too cold to move the specified tool
|
||||
*
|
||||
* Returns TRUE if too cold to move (also echos message: STR_ERR_HOTEND_TOO_COLD)
|
||||
* Returns FALSE if able to move.
|
||||
*/
|
||||
bool too_cold(uint8_t toolID){
|
||||
if (TERN0(PREVENT_COLD_EXTRUSION, !DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(toolID))) {
|
||||
SERIAL_ECHO_MSG(STR_ERR_HOTEND_TOO_COLD);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cutting recovery -- Recover from cutting retraction that occurs at the end of nozzle priming
|
||||
*
|
||||
* If the active_extruder is up to temp (!too_cold):
|
||||
* Extrude filament distance = toolchange_settings.extra_resume + TOOLCHANGE_FS_WIPE_RETRACT
|
||||
* current_position.e = e;
|
||||
* sync_plan_position_e();
|
||||
*/
|
||||
void extruder_cutting_recover(const_float_t e) {
|
||||
if (!too_cold(active_extruder)) {
|
||||
const float dist = toolchange_settings.extra_resume + (TOOLCHANGE_FS_WIPE_RETRACT);
|
||||
FS_DEBUG("Performing Cutting Recover | Distance: ", dist, " | Speed: ", MMM_TO_MMS(toolchange_settings.unretract_speed), "mm/s");
|
||||
unscaled_e_move(dist, MMM_TO_MMS(toolchange_settings.unretract_speed));
|
||||
planner.synchronize();
|
||||
FS_DEBUG("Set position to: ", e);
|
||||
current_position.e = e;
|
||||
sync_plan_position_e(); // Resume new E Position
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prime the currently selected extruder (Filament loading only)
|
||||
*
|
||||
* If too_cold(toolID) returns TRUE -> returns without moving extruder.
|
||||
* Extruders filament = swap_length + extra prime, then performs cutting retraction if enabled.
|
||||
* If cooling fan is enabled, calls filament_swap_cooling();
|
||||
*/
|
||||
void extruder_prime() {
|
||||
|
||||
if (too_cold(active_extruder)) {
|
||||
FS_DEBUG("Priming Aborted - Nozzle Too Cold!");
|
||||
return; // Extruder too cold to prime
|
||||
}
|
||||
|
||||
float fr = toolchange_settings.unretract_speed; // Set default speed for unretract
|
||||
|
||||
#if ENABLED(TOOLCHANGE_FS_SLOW_FIRST_PRIME)
|
||||
/*
|
||||
* Perform first unretract movement at the slower Prime_Speed to avoid breakage on first prime
|
||||
*/
|
||||
static Flags<EXTRUDERS> extruder_did_first_prime; // Extruders first priming status
|
||||
if (!extruder_did_first_prime[active_extruder]) {
|
||||
extruder_did_first_prime.set(active_extruder); // Log first prime complete
|
||||
// new nozzle - prime at user-specified speed.
|
||||
FS_DEBUG("First time priming T", active_extruder, ", reducing speed from ", MMM_TO_MMS(fr), " to ", MMM_TO_MMS(toolchange_settings.prime_speed), "mm/s");
|
||||
fr = toolchange_settings.prime_speed;
|
||||
unscaled_e_move(0, MMM_TO_MMS(fr)); // Init planner with 0 length move
|
||||
}
|
||||
#endif
|
||||
|
||||
//Calculate and perform the priming distance
|
||||
if (toolchange_settings.extra_prime >= 0) {
|
||||
// Positive extra_prime value
|
||||
// - Return filament at speed (fr) then extra_prime at prime speed
|
||||
FS_DEBUG("Loading Filament for T", active_extruder, " | Distance: ", toolchange_settings.swap_length, " | Speed: ", MMM_TO_MMS(fr), "mm/s");
|
||||
unscaled_e_move(toolchange_settings.swap_length, MMM_TO_MMS(fr)); // Prime (Unretract) filament by extruding equal to Swap Length (Unretract)
|
||||
|
||||
if (toolchange_settings.extra_prime > 0) {
|
||||
FS_DEBUG("Performing Extra Priming for T", active_extruder, " | Distance: ", toolchange_settings.extra_prime, " | Speed: ", MMM_TO_MMS(toolchange_settings.prime_speed), "mm/s");
|
||||
unscaled_e_move(toolchange_settings.extra_prime, MMM_TO_MMS(toolchange_settings.prime_speed)); // Extra Prime Distance
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Negative extra_prime value
|
||||
// - Unretract distance (swap length) is reduced by the value of extra_prime
|
||||
const float eswap = toolchange_settings.swap_length + toolchange_settings.extra_prime;
|
||||
FS_DEBUG("Negative ExtraPrime value - Swap Return Length has been reduced from ", toolchange_settings.swap_length, " to ", eswap);
|
||||
FS_DEBUG("Loading Filament for T", active_extruder, " | Distance: ", eswap, " | Speed: ", MMM_TO_MMS(fr), "mm/s");
|
||||
unscaled_e_move(eswap, MMM_TO_MMS(fr));
|
||||
}
|
||||
|
||||
extruder_was_primed.set(active_extruder); // Log that this extruder has been primed
|
||||
|
||||
// Cutting retraction
|
||||
#if TOOLCHANGE_FS_WIPE_RETRACT
|
||||
FS_DEBUG("Performing Cutting Retraction | Distance: ", -(TOOLCHANGE_FS_WIPE_RETRACT), " | Speed: ", MMM_TO_MMS(toolchange_settings.retract_speed), "mm/s");
|
||||
unscaled_e_move(-(TOOLCHANGE_FS_WIPE_RETRACT), MMM_TO_MMS(toolchange_settings.retract_speed));
|
||||
#endif
|
||||
|
||||
// Cool down with fan
|
||||
filament_swap_cooling();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sequence to Prime the currently selected extruder
|
||||
* Raise Z, move the ToolChange_Park if enabled, prime the extruder, move back.
|
||||
*/
|
||||
void tool_change_prime() {
|
||||
if (toolchange_settings.extra_prime > 0
|
||||
&& TERN(PREVENT_COLD_EXTRUSION, !thermalManager.targetTooColdToExtrude(active_extruder), 1)
|
||||
) {
|
||||
|
||||
FS_DEBUG(">>> tool_change_prime()");
|
||||
|
||||
if (!too_cold(active_extruder)) {
|
||||
destination = current_position; // Remember the old position
|
||||
|
||||
const bool ok = TERN1(TOOLCHANGE_PARK, all_axes_homed() && toolchange_settings.enable_park);
|
||||
@@ -933,7 +1059,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
|
||||
current_position.k = toolchange_settings.change_point.k,
|
||||
current_position.u = toolchange_settings.change_point.u,
|
||||
current_position.v = toolchange_settings.change_point.v,
|
||||
current_position.w = toolchange_settings.change_point.w,
|
||||
current_position.w = toolchange_settings.change_point.w
|
||||
);
|
||||
#endif
|
||||
planner.buffer_line(current_position, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE), active_extruder);
|
||||
@@ -941,20 +1067,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
|
||||
}
|
||||
#endif
|
||||
|
||||
// Prime (All distances are added and slowed down to ensure secure priming in all circumstances)
|
||||
unscaled_e_move(toolchange_settings.swap_length + toolchange_settings.extra_prime, MMM_TO_MMS(toolchange_settings.prime_speed));
|
||||
|
||||
// Cutting retraction
|
||||
#if TOOLCHANGE_FS_WIPE_RETRACT
|
||||
unscaled_e_move(-(TOOLCHANGE_FS_WIPE_RETRACT), MMM_TO_MMS(toolchange_settings.retract_speed));
|
||||
#endif
|
||||
|
||||
// Cool down with fan
|
||||
#if HAS_FAN && TOOLCHANGE_FS_FAN >= 0
|
||||
thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed;
|
||||
gcode.dwell(SEC_TO_MS(toolchange_settings.fan_time));
|
||||
thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0;
|
||||
#endif
|
||||
extruder_prime();
|
||||
|
||||
// Move back
|
||||
#if ENABLED(TOOLCHANGE_PARK)
|
||||
@@ -968,13 +1081,11 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
|
||||
}
|
||||
#endif
|
||||
|
||||
// Cutting recover
|
||||
unscaled_e_move(toolchange_settings.extra_resume + TOOLCHANGE_FS_WIPE_RETRACT, MMM_TO_MMS(toolchange_settings.unretract_speed));
|
||||
|
||||
// Resume at the old E position
|
||||
current_position.e = destination.e;
|
||||
sync_plan_position_e();
|
||||
extruder_cutting_recover(destination.e); // Cutting recover
|
||||
}
|
||||
|
||||
FS_DEBUG("<<< tool_change_prime");
|
||||
|
||||
}
|
||||
|
||||
#endif // TOOLCHANGE_FILAMENT_SWAP
|
||||
@@ -1051,13 +1162,11 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||
TEMPORARY_BED_LEVELING_STATE(false);
|
||||
#endif
|
||||
|
||||
// First tool priming. To prime again, reboot the machine.
|
||||
// First tool priming. To prime again, reboot the machine. -- Should only occur for first T0 after powerup!
|
||||
#if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED)
|
||||
static bool first_tool_is_primed = false;
|
||||
if (new_tool == old_tool && !first_tool_is_primed && enable_first_prime) {
|
||||
if (enable_first_prime && old_tool == 0 && new_tool == 0 && !extruder_was_primed[0]) {
|
||||
tool_change_prime();
|
||||
first_tool_is_primed = true;
|
||||
TERN_(TOOLCHANGE_FS_INIT_BEFORE_SWAP, toolchange_extruder_ready[old_tool] = true); // Primed and initialized
|
||||
TERN_(TOOLCHANGE_FS_INIT_BEFORE_SWAP, toolchange_extruder_ready.set(old_tool)); // Primed and initialized
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1082,20 +1191,17 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||
|
||||
// Unload / Retract
|
||||
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
|
||||
const bool should_swap = can_move_away && toolchange_settings.swap_length,
|
||||
too_cold = TERN0(PREVENT_COLD_EXTRUSION,
|
||||
!DEBUGGING(DRYRUN) && (thermalManager.targetTooColdToExtrude(old_tool) || thermalManager.targetTooColdToExtrude(new_tool))
|
||||
);
|
||||
const bool should_swap = can_move_away && toolchange_settings.swap_length;
|
||||
if (should_swap) {
|
||||
if (too_cold) {
|
||||
SERIAL_ECHO_MSG(STR_ERR_HOTEND_TOO_COLD);
|
||||
if (too_cold(old_tool)) {
|
||||
// If SingleNozzle setup is too cold, unable to perform tool_change.
|
||||
if (ENABLED(SINGLENOZZLE)) { active_extruder = new_tool; return; }
|
||||
}
|
||||
else {
|
||||
// For first new tool, change without unloading the old. 'Just prime/init the new'
|
||||
if (TERN1(TOOLCHANGE_FS_PRIME_FIRST_USED, first_tool_is_primed))
|
||||
unscaled_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed));
|
||||
TERN_(TOOLCHANGE_FS_PRIME_FIRST_USED, first_tool_is_primed = true); // The first new tool will be primed by toolchanging
|
||||
else if (extruder_was_primed[old_tool]) {
|
||||
// Retract the old extruder if it was previously primed
|
||||
// To-Do: Should SingleNozzle always retract?
|
||||
FS_DEBUG("Retracting Filament for T", old_tool, ". | Distance: ", toolchange_settings.swap_length, " | Speed: ", MMM_TO_MMS(toolchange_settings.retract_speed), "mm/s");
|
||||
unscaled_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1138,7 +1244,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||
current_position.k = toolchange_settings.change_point.k,
|
||||
current_position.u = toolchange_settings.change_point.u,
|
||||
current_position.v = toolchange_settings.change_point.v,
|
||||
current_position.w = toolchange_settings.change_point.w,
|
||||
current_position.w = toolchange_settings.change_point.w
|
||||
);
|
||||
#endif
|
||||
planner.buffer_line(current_position, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE), old_tool);
|
||||
@@ -1210,36 +1316,8 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||
#endif
|
||||
|
||||
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
|
||||
if (should_swap && !too_cold) {
|
||||
|
||||
float fr = toolchange_settings.unretract_speed;
|
||||
|
||||
#if ENABLED(TOOLCHANGE_FS_INIT_BEFORE_SWAP)
|
||||
if (!toolchange_extruder_ready[new_tool]) {
|
||||
toolchange_extruder_ready[new_tool] = true;
|
||||
fr = toolchange_settings.prime_speed; // Next move is a prime
|
||||
unscaled_e_move(0, MMM_TO_MMS(fr)); // Init planner with 0 length move
|
||||
}
|
||||
#endif
|
||||
|
||||
// Unretract (or Prime)
|
||||
unscaled_e_move(toolchange_settings.swap_length, MMM_TO_MMS(fr));
|
||||
|
||||
// Extra Prime
|
||||
unscaled_e_move(toolchange_settings.extra_prime, MMM_TO_MMS(toolchange_settings.prime_speed));
|
||||
|
||||
// Cutting retraction
|
||||
#if TOOLCHANGE_FS_WIPE_RETRACT
|
||||
unscaled_e_move(-(TOOLCHANGE_FS_WIPE_RETRACT), MMM_TO_MMS(toolchange_settings.retract_speed));
|
||||
#endif
|
||||
|
||||
// Cool down with fan
|
||||
#if HAS_FAN && TOOLCHANGE_FS_FAN >= 0
|
||||
thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed;
|
||||
gcode.dwell(SEC_TO_MS(toolchange_settings.fan_time));
|
||||
thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0;
|
||||
#endif
|
||||
}
|
||||
if (should_swap && !too_cold(active_extruder))
|
||||
extruder_prime(); // Prime selected Extruder
|
||||
#endif
|
||||
|
||||
// Prevent a move outside physical bounds
|
||||
@@ -1280,11 +1358,8 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||
else DEBUG_ECHOLNPGM("Move back skipped");
|
||||
|
||||
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
|
||||
if (should_swap && !too_cold) {
|
||||
// Cutting recover
|
||||
unscaled_e_move(toolchange_settings.extra_resume + TOOLCHANGE_FS_WIPE_RETRACT, MMM_TO_MMS(toolchange_settings.unretract_speed));
|
||||
current_position.e = 0;
|
||||
sync_plan_position_e(); // New extruder primed and set to 0
|
||||
if (should_swap && !too_cold(active_extruder)) {
|
||||
extruder_cutting_recover(0); // New extruder primed and set to 0
|
||||
|
||||
// Restart Fan
|
||||
#if HAS_FAN && TOOLCHANGE_FS_FAN >= 0
|
||||
@@ -1342,7 +1417,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||
#endif
|
||||
}
|
||||
|
||||
SERIAL_ECHO_MSG(STR_ACTIVE_EXTRUDER, active_extruder);
|
||||
SERIAL_ECHOLNPGM(STR_ACTIVE_EXTRUDER, active_extruder);
|
||||
|
||||
#endif // HAS_MULTI_EXTRUDER
|
||||
}
|
||||
@@ -1401,7 +1476,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||
|
||||
// Migrate the retracted state
|
||||
#if ENABLED(FWRETRACT)
|
||||
fwretract.retracted[migration_extruder] = fwretract.retracted[active_extruder];
|
||||
fwretract.retracted.set(migration_extruder, fwretract.retracted[active_extruder]);
|
||||
#endif
|
||||
|
||||
// Migrate the temperature to the new hotend
|
||||
|
||||
@@ -29,28 +29,34 @@
|
||||
|
||||
typedef struct {
|
||||
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
|
||||
float swap_length, extra_prime, extra_resume;
|
||||
int16_t prime_speed, retract_speed, unretract_speed, fan, fan_speed, fan_time;
|
||||
float swap_length; // M217 S
|
||||
float extra_prime; // M217 E
|
||||
float extra_resume; // M217 B
|
||||
int16_t prime_speed; // M217 P
|
||||
int16_t retract_speed; // M217 R
|
||||
int16_t unretract_speed; // M217 U
|
||||
uint8_t fan_speed; // M217 F
|
||||
uint8_t fan_time; // M217 D
|
||||
#endif
|
||||
#if ENABLED(TOOLCHANGE_PARK)
|
||||
bool enable_park;
|
||||
xyz_pos_t change_point;
|
||||
bool enable_park; // M217 W
|
||||
xyz_pos_t change_point; // M217 X Y I J K C H O
|
||||
#endif
|
||||
float z_raise;
|
||||
float z_raise; // M217 Z
|
||||
} toolchange_settings_t;
|
||||
|
||||
extern toolchange_settings_t toolchange_settings;
|
||||
|
||||
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
|
||||
void tool_change_prime();
|
||||
#if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED)
|
||||
extern bool enable_first_prime; // M217 V
|
||||
#endif
|
||||
|
||||
#if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED)
|
||||
extern bool enable_first_prime;
|
||||
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
|
||||
void tool_change_prime(); // Prime the currently selected extruder
|
||||
#endif
|
||||
|
||||
#if ENABLED(TOOLCHANGE_FS_INIT_BEFORE_SWAP)
|
||||
extern bool toolchange_extruder_ready[EXTRUDERS];
|
||||
extern Flags<EXTRUDERS> toolchange_extruder_ready;
|
||||
#endif
|
||||
|
||||
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
|
||||
#define LCD_RESET_PIN 16
|
||||
|
||||
#define LCD_CONTRAST_DEFAULT 220
|
||||
#define LCD_CONTRAST_INIT 220
|
||||
|
||||
#define LCD_BACKLIGHT_PIN -1
|
||||
#else
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
#define LCD_CONTRAST_MIN 0
|
||||
#define LCD_CONTRAST_MAX 100
|
||||
#define LCD_CONTRAST_DEFAULT 30
|
||||
#define LCD_CONTRAST_INIT 30
|
||||
//#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270
|
||||
|
||||
#if IS_NEWPANEL
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
#define NEOPIXEL_PIN PB9
|
||||
#endif
|
||||
|
||||
#define LCD_CONTRAST_DEFAULT 255
|
||||
#define LCD_CONTRAST_INIT 255
|
||||
#else
|
||||
#define LCD_PINS_RS PC15
|
||||
#define LCD_PINS_ENABLE PB6
|
||||
|
||||
@@ -61,10 +61,8 @@
|
||||
#define USB_NO_TEST_UNIT_READY // Required for removable media adapter
|
||||
#define USB_HOST_MANUAL_POLL // Optimization to shut off IRQ automatically
|
||||
|
||||
// Workarounds for keeping Marlin's watchdog timer from barking...
|
||||
void marlin_yield() {
|
||||
thermalManager.manage_heater();
|
||||
}
|
||||
// Workarounds to keep Marlin's watchdog timer from barking...
|
||||
void marlin_yield() { thermalManager.manage_heater(); }
|
||||
#define SYSTEM_OR_SPECIAL_YIELD(...) marlin_yield();
|
||||
#define delay(x) safe_delay(x)
|
||||
|
||||
@@ -82,6 +80,7 @@
|
||||
|
||||
#define UHS_START (usb.Init() == 0)
|
||||
#define UHS_STATE(state) UHS_USB_HOST_STATE_##state
|
||||
|
||||
#elif ENABLED(USE_OTG_USB_HOST)
|
||||
|
||||
#if HAS_SD_HOST_DRIVE
|
||||
@@ -93,7 +92,9 @@
|
||||
#define UHS_START usb.start()
|
||||
#define rREVISION 0
|
||||
#define UHS_STATE(state) USB_STATE_##state
|
||||
|
||||
#else
|
||||
|
||||
#include "lib-uhs2/Usb.h"
|
||||
#include "lib-uhs2/masstorage.h"
|
||||
|
||||
@@ -102,6 +103,7 @@
|
||||
|
||||
#define UHS_START usb.start()
|
||||
#define UHS_STATE(state) USB_STATE_##state
|
||||
|
||||
#endif
|
||||
|
||||
#include "Sd2Card_FlashDrive.h"
|
||||
@@ -271,11 +273,11 @@ bool DiskIODriver_USBFlash::init(const uint8_t, const pin_t) {
|
||||
if (!isInserted()) return false;
|
||||
|
||||
#if USB_DEBUG >= 1
|
||||
const uint32_t sectorSize = bulk.GetSectorSize(0);
|
||||
if (sectorSize != 512) {
|
||||
SERIAL_ECHOLNPGM("Expecting sector size of 512. Got: ", sectorSize);
|
||||
return false;
|
||||
}
|
||||
const uint32_t sectorSize = bulk.GetSectorSize(0);
|
||||
if (sectorSize != 512) {
|
||||
SERIAL_ECHOLNPGM("Expecting sector size of 512. Got: ", sectorSize);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if USB_DEBUG >= 3
|
||||
|
||||
@@ -27,19 +27,18 @@
|
||||
|
||||
#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && DISABLED(USE_UHS3_USB)
|
||||
|
||||
#if !PINS_EXIST(USB_CS, USB_INTR)
|
||||
#error "USB_FLASH_DRIVE_SUPPORT requires USB_CS_PIN and USB_INTR_PIN to be defined."
|
||||
#endif
|
||||
|
||||
#include "Usb.h"
|
||||
#include "usbhost.h"
|
||||
|
||||
uint8_t MAX3421e::vbusState = 0;
|
||||
|
||||
// constructor
|
||||
void MAX3421e::cs() {
|
||||
WRITE(USB_CS_PIN,0);
|
||||
}
|
||||
|
||||
void MAX3421e::ncs() {
|
||||
WRITE(USB_CS_PIN,1);
|
||||
}
|
||||
void MAX3421e::cs() { WRITE(USB_CS_PIN, LOW); }
|
||||
void MAX3421e::ncs() { WRITE(USB_CS_PIN, HIGH); }
|
||||
|
||||
// write single byte into MAX3421 register
|
||||
void MAX3421e::regWr(uint8_t reg, uint8_t data) {
|
||||
@@ -76,8 +75,8 @@ uint8_t MAX3421e::regRd(uint8_t reg) {
|
||||
ncs();
|
||||
return rv;
|
||||
}
|
||||
// multiple-byte register read
|
||||
|
||||
// multiple-byte register read
|
||||
// return a pointer to a memory position after last read
|
||||
uint8_t* MAX3421e::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t *data_p) {
|
||||
cs();
|
||||
@@ -86,8 +85,8 @@ uint8_t* MAX3421e::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t *data_p) {
|
||||
ncs();
|
||||
return data_p;
|
||||
}
|
||||
// GPIO read. See gpioWr for explanation
|
||||
|
||||
// GPIO read. See gpioWr for explanation
|
||||
// GPIN pins are in high nybbles of IOPINS1, IOPINS2
|
||||
uint8_t MAX3421e::gpioRd() {
|
||||
return (regRd(rIOPINS2) & 0xF0) | // pins 4-7, clean lower nybble
|
||||
|
||||
@@ -29,7 +29,7 @@ if pioutil.is_pio_build():
|
||||
# It useful to keep two live versions: a debug version for debugging and another for
|
||||
# release, for flashing when upload is not done automatically by jlink/stlink.
|
||||
# Without this, PIO needs to recompile everything twice for any small change.
|
||||
if env.GetBuildType() == "debug" and env.get('UPLOAD_PROTOCOL') not in ['jlink', 'stlink']:
|
||||
if env.GetBuildType() == "debug" and env.get('UPLOAD_PROTOCOL') not in ['jlink', 'stlink', 'custom']:
|
||||
env['BUILD_DIR'] = '$PROJECT_BUILD_DIR/$PIOENV/debug'
|
||||
|
||||
# On some platform, F_CPU is a runtime variable. Since it's used to convert from ns
|
||||
|
||||
@@ -45,10 +45,6 @@
|
||||
#define HAS_SAVED_POSITIONS
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER)
|
||||
#define HAS_GCODE_M876
|
||||
#endif
|
||||
|
||||
#if ENABLED(DUET_SMART_EFFECTOR) && PIN_EXISTS(SMART_EFFECTOR_MOD)
|
||||
#define HAS_SMART_EFF_MOD
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user