Skip to content

Commit

Permalink
Merge branch 'bugfix-2.1.x' into HEVO-BTT-SKR-1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
uBaHoFF committed Feb 4, 2023
2 parents 73fa199 + 218ca05 commit 6b17d4a
Show file tree
Hide file tree
Showing 132 changed files with 2,141 additions and 1,205 deletions.
15 changes: 6 additions & 9 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
* Advanced settings can be found in Configuration_adv.h
*
*/
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
#define CONFIGURATION_H_VERSION 010109
#define CONFIGURATION_H_VERSION 02010300

//===========================================================================
//============================= Getting Started =============================
Expand Down Expand Up @@ -504,8 +502,9 @@
// Enable for Polargraph Kinematics
//#define POLARGRAPH
#if ENABLED(POLARGRAPH)
#define POLARGRAPH_MAX_BELT_LEN 1035.0
#define DEFAULT_SEGMENTS_PER_SECOND 5
#define POLARGRAPH_MAX_BELT_LEN 1035.0 // (mm) Belt length at full extension. Override with M665 H.
#define DEFAULT_SEGMENTS_PER_SECOND 5 // Move segmentation based on duration
#define PEN_UP_DOWN_MENU // Add "Pen Up" and "Pen Down" to the MarlinUI menu
#endif

// @section delta
Expand Down Expand Up @@ -1307,7 +1306,7 @@
//#define EXTRAPOLATE_BEYOND_GRID

//
// Experimental Subdivision of the grid by Catmull-Rom method.
// Subdivision of the grid by Catmull-Rom method.
// Synthesizes intermediate points to produce a more detailed mesh.
//
//#define ABL_BILINEAR_SUBDIVISION
Expand Down Expand Up @@ -1553,7 +1552,7 @@
#endif

/**
* Clean Nozzle Feature -- EXPERIMENTAL
* Clean Nozzle Feature
*
* Adds the G12 command to perform a nozzle cleaning process.
*
Expand Down Expand Up @@ -1587,8 +1586,6 @@
* Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT.
*
* Caveats: The ending Z should be the same as starting Z.
* Attention: EXPERIMENTAL. G-code arguments may change.
*
*/
//#define NOZZLE_CLEAN_FEATURE

Expand Down
277 changes: 268 additions & 9 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
* Basic settings can be found in Configuration.h
*
*/
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H_VERSION 010109
#define CONFIGURATION_ADV_H_VERSION 02010300

// @section temperature

Expand Down Expand Up @@ -78,6 +76,11 @@
#define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius

//#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops
#if ENABLED(ADAPTIVE_FAN_SLOWING) && EITHER(MPCTEMP, PIDTEMP)
//#define TEMP_TUNING_MAINTAIN_FAN // Don't slow fan speed during M303 or M306 T
#endif

/**
* Whenever an M104, M109, or M303 increases the target temperature, the
* firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
Expand Down Expand Up @@ -109,13 +112,63 @@
#endif

#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
// Add an additional term to the heater power, proportional to the extrusion speed.
// A well-chosen Kc value should add just enough power to melt the increased material volume.
//#define PID_EXTRUSION_SCALING
#if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif

/**
* Add an additional term to the heater power, proportional to the fan speed.
* A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan.
* You can either just add a constant compensation with the DEFAULT_Kf value
* or follow the instruction below to get speed-dependent compensation.
*
* Constant compensation (use only with fanspeeds of 0% and 100%)
* ---------------------------------------------------------------------
* A good starting point for the Kf-value comes from the calculation:
* kf = (power_fan * eff_fan) / power_heater * 255
* where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater.
*
* Example:
* Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8
* Kf = (2.4W * 0.8) / 40W * 255 = 12.24
*
* Fan-speed dependent compensation
* --------------------------------
* 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%).
* Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled.
* If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature
* drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big.
* 2. Note the Kf-value for fan-speed at 100%
* 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving.
* 4. Repeat step 1. and 2. for this fan speed.
* 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in
* PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED
*/
//#define PID_FAN_SCALING
#if ENABLED(PID_FAN_SCALING)
//#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION
#if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION)
// The alternative definition is used for an easier configuration.
// Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED.
// DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly.

#define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf
#define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf
#define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING

#define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED)
#define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0

#else
#define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed)
#define DEFAULT_Kf 10 // A constant value added to the PID-tuner
#define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING
#endif
#endif
#endif

/**
Expand Down Expand Up @@ -376,7 +429,80 @@
// Default x offset in duplication mode (typically set to half print bed width)
#define DEFAULT_DUPLICATION_X_OFFSET 100

#endif // DUAL_X_CARRIAGE
// Default action to execute following M605 mode change commands. Typically G28X to apply new mode.
//#define EVENT_GCODE_IDEX_AFTER_MODECHANGE "G28X"
#endif

/**
* Multi-Stepper / Multi-Endstop
*
* When X2_DRIVER_TYPE is defined, this indicates that the X and X2 motors work in tandem.
* The following explanations for X also apply to Y and Z multi-stepper setups.
* Endstop offsets may be changed by 'M666 X<offset> Y<offset> Z<offset>' and stored to EEPROM.
*
* - Enable INVERT_X2_VS_X_DIR if the X2 motor requires an opposite DIR signal from X.
*
* - Enable X_DUAL_ENDSTOPS if the second motor has its own endstop, with adjustable offset.
*
* - Extra endstops are included in the output of 'M119'.
*
* - Set X_DUAL_ENDSTOP_ADJUSTMENT to the known error in the X2 endstop.
* Applied to the X2 motor on 'G28' / 'G28 X'.
* Get the offset by homing X and measuring the error.
* Also set with 'M666 X<offset>' and stored to EEPROM with 'M500'.
*
* - Use X2_USE_ENDSTOP to set the endstop plug by name. (_XMIN_, _XMAX_, _YMIN_, _YMAX_, _ZMIN_, _ZMAX_)
*/
#if HAS_X2_STEPPER && DISABLED(DUAL_X_CARRIAGE)
//#define INVERT_X2_VS_X_DIR // X2 direction signal is the opposite of X
//#define X_DUAL_ENDSTOPS // X2 has its own endstop
#if ENABLED(X_DUAL_ENDSTOPS)
#define X2_USE_ENDSTOP _XMAX_ // X2 endstop board plug. Don't forget to enable USE_*_PLUG.
#define X2_ENDSTOP_ADJUSTMENT 0 // X2 offset relative to X endstop
#endif
#endif

#if HAS_DUAL_Y_STEPPERS
//#define INVERT_Y2_VS_Y_DIR // Y2 direction signal is the opposite of Y
//#define Y_DUAL_ENDSTOPS // Y2 has its own endstop
#if ENABLED(Y_DUAL_ENDSTOPS)
#define Y2_USE_ENDSTOP _YMAX_ // Y2 endstop board plug. Don't forget to enable USE_*_PLUG.
#define Y2_ENDSTOP_ADJUSTMENT 0 // Y2 offset relative to Y endstop
#endif
#endif

//
// Multi-Z steppers
//
#ifdef Z2_DRIVER_TYPE
//#define INVERT_Z2_VS_Z_DIR // Z2 direction signal is the opposite of Z

//#define Z_MULTI_ENDSTOPS // Other Z axes have their own endstops
#if ENABLED(Z_MULTI_ENDSTOPS)
#define Z2_USE_ENDSTOP _XMAX_ // Z2 endstop board plug. Don't forget to enable USE_*_PLUG.
#define Z2_ENDSTOP_ADJUSTMENT 0 // Z2 offset relative to Z endstop
#endif
#ifdef Z3_DRIVER_TYPE
//#define INVERT_Z3_VS_Z_DIR // Z3 direction signal is the opposite of Z
#if ENABLED(Z_MULTI_ENDSTOPS)
#define Z3_USE_ENDSTOP _YMAX_ // Z3 endstop board plug. Don't forget to enable USE_*_PLUG.
#define Z3_ENDSTOP_ADJUSTMENT 0 // Z3 offset relative to Z endstop
#endif
#endif
#ifdef Z4_DRIVER_TYPE
//#define INVERT_Z4_VS_Z_DIR // Z4 direction signal is the opposite of Z
#if ENABLED(Z_MULTI_ENDSTOPS)
#define Z4_USE_ENDSTOP _ZMAX_ // Z4 endstop board plug. Don't forget to enable USE_*_PLUG.
#define Z4_ENDSTOP_ADJUSTMENT 0 // Z4 offset relative to Z endstop
#endif
#endif
#endif

// Drive the E axis with two synchronized steppers
//#define E_DUAL_STEPPER_DRIVERS
#if ENABLED(E_DUAL_STEPPER_DRIVERS)
//#define INVERT_E1_VS_E0_DIR // E direction signals are opposites
#endif

// Activate a solenoid on the active extruder with M380. Disable all with M381.
// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid.
Expand Down Expand Up @@ -626,7 +752,133 @@
#define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity
//#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup
#endif
#endif // LED_CONTROL_MENU
#endif

#if HAS_MARLINUI_MENU

#if HAS_BED_PROBE
// Add calibration in the Probe Offsets menu to compensate for X-axis twist.
//#define X_AXIS_TWIST_COMPENSATION
#if ENABLED(X_AXIS_TWIST_COMPENSATION)
/**
* Enable to init the Probe Z-Offset when starting the Wizard.
* Use a height slightly above the estimated nozzle-to-probe Z offset.
* For example, with an offset of -5, consider a starting height of -4.
*/
#define XATC_START_Z 0.0
#define XATC_MAX_POINTS 3 // Number of points to probe in the wizard
#define XATC_Y_POSITION Y_CENTER // (mm) Y position to probe
#define XATC_Z_OFFSETS { 0, 0, 0 } // Z offsets for X axis sample points
#endif

// Show Deploy / Stow Probe options in the Motion menu.
#define PROBE_DEPLOY_STOW_MENU
#endif

// Include a page of printer information in the LCD Main Menu
//#define LCD_INFO_MENU
#if ENABLED(LCD_INFO_MENU)
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// Add 50/100mm moves to MarlinUI even with a smaller bed
//#define LARGE_MOVE_ITEMS

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

// Insert a menu for preheating at the top level to allow for quick access
//#define PREHEAT_SHORTCUT_MENU_ITEM

#endif // HAS_MARLINUI_MENU

#if HAS_DISPLAY
//#define SOUND_MENU_ITEM // Add a mute option to the LCD menu
#define SOUND_ON_DEFAULT // Buzzer/speaker default enabled state

// The timeout to return to the status screen from sub-menus
//#define LCD_TIMEOUT_TO_STATUS 15000 // (ms)

#if ENABLED(SHOW_BOOTSCREEN)
#define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)
#if EITHER(HAS_MARLINUI_U8GLIB, TFT_COLOR_UI)
#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving lots of flash)
#endif
#endif

// Scroll a longer status message into view
//#define STATUS_MESSAGE_SCROLLING

// Apply a timeout to low-priority status messages
//#define STATUS_MESSAGE_TIMEOUT_SEC 30 // (seconds)

// On the Info Screen, display XY with one decimal place when possible
//#define LCD_DECIMAL_SMALL_XY

// Show the E position (filament used) during printing
//#define LCD_SHOW_E_TOTAL

/**
* LED Control Menu
* Add LED Control to the LCD menu
*/
//#define LED_CONTROL_MENU
#if ENABLED(LED_CONTROL_MENU)
#define LED_COLOR_PRESETS // Enable the Preset Color menu option
//#define NEO2_COLOR_PRESETS // Enable a second NeoPixel Preset Color menu option
#if ENABLED(LED_COLOR_PRESETS)
#define LED_USER_PRESET_RED 255 // User defined RED value
#define LED_USER_PRESET_GREEN 128 // User defined GREEN value
#define LED_USER_PRESET_BLUE 0 // User defined BLUE value
#define LED_USER_PRESET_WHITE 255 // User defined WHITE value
#define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity
//#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup
#endif
#if ENABLED(NEO2_COLOR_PRESETS)
#define NEO2_USER_PRESET_RED 255 // User defined RED value
#define NEO2_USER_PRESET_GREEN 128 // User defined GREEN value
#define NEO2_USER_PRESET_BLUE 0 // User defined BLUE value
#define NEO2_USER_PRESET_WHITE 255 // User defined WHITE value
#define NEO2_USER_PRESET_BRIGHTNESS 255 // User defined intensity
//#define NEO2_USER_PRESET_STARTUP // Have the printer display the user preset color on startup for the second strip
#endif
#endif

#endif // HAS_DISPLAY

// Add 'M73' to set print job progress, overrides Marlin's built-in estimate
//#define SET_PROGRESS_MANUALLY
#if ENABLED(SET_PROGRESS_MANUALLY)
#define SET_PROGRESS_PERCENT // Add 'P' parameter to set percentage done
#define SET_REMAINING_TIME // Add 'R' parameter to set remaining time
//#define SET_INTERACTION_TIME // Add 'C' parameter to set time until next filament change or other user interaction
//#define M73_REPORT // Report M73 values to host
#if BOTH(M73_REPORT, SDSUPPORT)
#define M73_REPORT_SD_ONLY // Report only when printing from SD
#endif
#endif

// LCD Print Progress options. Multiple times may be displayed in turn.
#if HAS_DISPLAY && EITHER(SDSUPPORT, SET_PROGRESS_MANUALLY)
#define SHOW_PROGRESS_PERCENT // Show print progress percentage (doesn't affect progress bar)
#define SHOW_ELAPSED_TIME // Display elapsed printing time (prefix 'E')
//#define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R')
#if ENABLED(SET_INTERACTION_TIME)
#define SHOW_INTERACTION_TIME // Display time until next user interaction ('C' = filament change)
#endif
//#define PRINT_PROGRESS_SHOW_DECIMALS // Show/report progress with decimal digits, not all UIs support this

#if EITHER(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
//#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing
#if ENABLED(LCD_PROGRESS_BAR)
#define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar
#define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message
#define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever)
//#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it
//#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar
#endif
#endif
#endif

#if ENABLED(SDSUPPORT)

Expand Down Expand Up @@ -838,8 +1090,15 @@
*/
//#define LIN_ADVANCE
#if ENABLED(LIN_ADVANCE)
#define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed
//#define LA_DEBUG // If enabled, this will generate debug information output over USB.
#if ENABLED(DISTINCT_E_FACTORS)
#define ADVANCE_K { 0.22 } // (mm) Compression length per 1mm/s extruder speed, per extruder
#else
#define ADVANCE_K 0.22 // (mm) Compression length applying to all extruders
#endif
//#define ADVANCE_K_EXTRA // Add a second linear advance constant, configurable with M900 L.
//#define LA_DEBUG // Print debug information to serial during operation. Disable for production use.
//#define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends.
//#define EXPERIMENTAL_I2S_LA // Allow I2S_STEPPER_STREAM to be used with LA. Performance degrades as the LA step rate reaches ~20kHz.
#endif

// @section leveling
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2023-01-11"
//#define STRING_DISTRIBUTION_DATE "2023-02-03"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/HAL/AVR/fastio.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,11 @@ enum ClockSource2 : uint8_t {

#if HAS_MOTOR_CURRENT_PWM
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z || P == MOTOR_CURRENT_PWM_XY)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E_PIN || P == MOTOR_CURRENT_PWM_E0_PIN || P == MOTOR_CURRENT_PWM_E1_PIN || P == MOTOR_CURRENT_PWM_Z_PIN || P == MOTOR_CURRENT_PWM_XY_PIN)
#elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E_PIN || P == MOTOR_CURRENT_PWM_E0_PIN || P == MOTOR_CURRENT_PWM_E1_PIN || P == MOTOR_CURRENT_PWM_Z_PIN)
#else
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E_PIN || P == MOTOR_CURRENT_PWM_E0_PIN || P == MOTOR_CURRENT_PWM_E1_PIN)
#endif
#else
#define PWM_CHK_MOTOR_CURRENT(P) false
Expand Down
Loading

0 comments on commit 6b17d4a

Please sign in to comment.