Skip to content

Commit

Permalink
tweak the configuration, fix M997 for STM
Browse files Browse the repository at this point in the history
  • Loading branch information
JaxTheWolf committed Jan 6, 2024
1 parent 5b13d89 commit 261a77a
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 45 deletions.
60 changes: 39 additions & 21 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -707,11 +707,11 @@
#define MPC_INCLUDE_FAN // Model the fan speed?

// Measured physical constants from M306
#define MPC_BLOCK_HEAT_CAPACITY { 15.89f } // (J/K) Heat block heat capacities.
#define MPC_SENSOR_RESPONSIVENESS { 0.1071f } // (K/s per ∆K) Rate of change of sensor temperature from heat block.
#define MPC_AMBIENT_XFER_COEFF { 0.434f } // (W/K) Heat transfer coefficients from heat block to room air with fan off.
#define MPC_BLOCK_HEAT_CAPACITY { 15.77f } // (J/K) Heat block heat capacities.
#define MPC_SENSOR_RESPONSIVENESS { 0.1029f } // (K/s per ∆K) Rate of change of sensor temperature from heat block.
#define MPC_AMBIENT_XFER_COEFF { 0.1395f } // (W/K) Heat transfer coefficients from heat block to room air with fan off.
#if ENABLED(MPC_INCLUDE_FAN)
#define MPC_AMBIENT_XFER_COEFF_FAN255 { 0.1583f } // (W/K) Heat transfer coefficients from heat block to room air with fan on full.
#define MPC_AMBIENT_XFER_COEFF_FAN255 { 0.1609f } // (W/K) Heat transfer coefficients from heat block to room air with fan on full.
#endif

// For one fan and multiple hotends MPC needs to know how to apply the fan cooling effect.
Expand Down Expand Up @@ -770,9 +770,9 @@

// 120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
// from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 34.03
#define DEFAULT_bedKi 2.39
#define DEFAULT_bedKd 323.33
#define DEFAULT_bedKp 30.48
#define DEFAULT_bedKi 1.78
#define DEFAULT_bedKd 347.89

// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
#else
Expand Down Expand Up @@ -1564,7 +1564,7 @@
* | [-] |
* O-- FRONT --+
*/
#define NOZZLE_TO_PROBE_OFFSET { 35, 2, -0.611 }
#define NOZZLE_TO_PROBE_OFFSET { 35, 2, -0.885 }

// Enable and set to use a specific tool for probing. Disable to allow any tool.
#define PROBING_TOOL 0
Expand Down Expand Up @@ -1679,7 +1679,7 @@
* These options are most useful for the BLTouch probe, but may also improve
* readings with inductive probes and piezo sensors.
*/
#define PROBING_HEATERS_OFF // Turn heaters off when probing
//#define PROBING_HEATERS_OFF // Turn heaters off when probing
#if ENABLED(PROBING_HEATERS_OFF)
//#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy)
//#define WAIT_FOR_HOTEND // Wait for hotend to heat back up between probes (to improve accuracy & prevent cold extrude)
Expand Down Expand Up @@ -2257,8 +2257,8 @@
#define Z_SAFE_HOMING

#if ENABLED(Z_SAFE_HOMING)
#define Z_SAFE_HOMING_X_POINT X_CENTER // (mm) X point for Z homing
#define Z_SAFE_HOMING_Y_POINT Y_CENTER // (mm) Y point for Z homing
#define Z_SAFE_HOMING_X_POINT 35 // X point for Z homing
#define Z_SAFE_HOMING_Y_POINT 10 // Y point for Z homing
//#define Z_SAFE_HOMING_POINT_ABSOLUTE // Ignore home offsets (M206) for Z homing position
#endif

Expand Down Expand Up @@ -2379,18 +2379,36 @@
//
// Preheat Constants - Up to 10 are supported without changes
//
#define PREHEAT_1_LABEL "PLA"
#define PREHEAT_1_TEMP_HOTEND 180
#define PREHEAT_1_TEMP_BED 70
#define PREHEAT_1_TEMP_CHAMBER 35
#define PREHEAT_1_LABEL "Probe"
#define PREHEAT_1_TEMP_HOTEND 150
#define PREHEAT_1_TEMP_BED 60
#define PREHEAT_1_TEMP_CHAMBER 0
#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255

#define PREHEAT_2_LABEL "ABS"
#define PREHEAT_2_TEMP_HOTEND 240
#define PREHEAT_2_TEMP_BED 110
#define PREHEAT_2_LABEL "PLA"
#define PREHEAT_2_TEMP_HOTEND 200
#define PREHEAT_2_TEMP_BED 60
#define PREHEAT_2_TEMP_CHAMBER 35
#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255

#define PREHEAT_3_LABEL "PETG"
#define PREHEAT_3_TEMP_HOTEND 225
#define PREHEAT_3_TEMP_BED 85
#define PREHEAT_3_TEMP_CHAMBER 35
#define PREHEAT_3_FAN_SPEED 0 // Value from 0 to 255

#define PREHEAT_4_LABEL "ABS"
#define PREHEAT_4_TEMP_HOTEND 245
#define PREHEAT_4_TEMP_BED 90
#define PREHEAT_4_TEMP_CHAMBER 35
#define PREHEAT_4_FAN_SPEED 0 // Value from 0 to 255

#define PREHEAT_5_LABEL "TPU"
#define PREHEAT_5_TEMP_HOTEND 215
#define PREHEAT_5_TEMP_BED 50
#define PREHEAT_5_TEMP_CHAMBER 35
#define PREHEAT_5_FAN_SPEED 0 // Value from 0 to 255

// @section motion

/**
Expand Down Expand Up @@ -3516,22 +3534,22 @@
#if ANY(RGB_LED, RGBW_LED, PCA9632)
//#define RGB_STARTUP_TEST // For PWM pins, fade between all colors
#if ENABLED(RGB_STARTUP_TEST)
#define RGB_STARTUP_TEST_INNER_MS 10 // (ms) Reduce or increase fading speed
#define RGB_STARTUP_TEST_INNER_MS 5 // (ms) Reduce or increase fading speed
#endif
#endif

// Support for Adafruit NeoPixel LED driver
#define NEOPIXEL_LED
#if ENABLED(NEOPIXEL_LED)
#define NEOPIXEL_TYPE NEO_RGB // NEO_GRBW, NEO_RGBW, NEO_GRB, NEO_RBG, etc.
#define NEOPIXEL_TYPE NEO_BRG // NEO_GRBW, NEO_RGBW, NEO_GRB, NEO_RBG, etc.
// See https://github.com/adafruit/Adafruit_NeoPixel/blob/master/Adafruit_NeoPixel.h
//#define NEOPIXEL_PIN 4 // LED driving pin
//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
//#define NEOPIXEL2_PIN 5
#define NEOPIXEL_PIXELS 3 // Number of LEDs in the strip. (Longest strip when NEOPIXEL2_SEPARATE is disabled.)
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
#define NEOPIXEL_BRIGHTNESS 255 // Initial brightness (0-255)
//#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup

// Support for second Adafruit NeoPixel LED driver controlled with M150 S1 ...
//#define NEOPIXEL2_SEPARATE
Expand Down
44 changes: 22 additions & 22 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,7 @@
#endif

#if HAS_BED_PROBE && ANY(HAS_MARLINUI_MENU, HAS_TFT_LVGL_UI)
//#define PROBE_OFFSET_WIZARD // Add a Probe Z Offset calibration option to the LCD menu
#define PROBE_OFFSET_WIZARD // Add a Probe Z Offset calibration option to the LCD menu
#if ENABLED(PROBE_OFFSET_WIZARD)
/**
* Enable to init the Probe Z-Offset when starting the Wizard.
Expand Down Expand Up @@ -1528,7 +1528,7 @@
#endif

// Include a page of printer information in the LCD Main Menu
//#define LCD_INFO_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
Expand All @@ -1552,10 +1552,10 @@
#define MANUAL_MOVE_DISTANCE_DEG 90, 45, 22.5, 5, 1 // (°)

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

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

// Add Configuration > Debug Menu > Endstop Test for endstop/probe/runout testing
//#define LCD_ENDSTOP_TEST
Expand Down Expand Up @@ -1591,27 +1591,27 @@
//#define CUSTOM_STATUS_SCREEN_IMAGE // Show the bitmap in Marlin/_Statusscreen.h on the status screen.
#endif

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

#if HAS_WIRED_LCD
//#define DOUBLE_LCD_FRAMERATE // Not recommended for slow boards.
#define DOUBLE_LCD_FRAMERATE // Not recommended for slow boards.
#endif

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

// Scroll a longer status message into view
//#define STATUS_MESSAGE_SCROLLING
#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
#define LCD_DECIMAL_SMALL_XY

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

// Display a negative temperature instead of "err"
//#define SHOW_TEMPERATURE_BELOW_ZERO
Expand All @@ -1625,11 +1625,11 @@
#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_RED 0 // User defined RED value
#define LED_USER_PRESET_GREEN 255 // 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_WHITE 0 // User defined WHITE value
#define LED_USER_PRESET_BRIGHTNESS 150 // User defined intensity
#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup
#endif
#if ENABLED(NEO2_COLOR_PRESETS)
Expand Down Expand Up @@ -1805,13 +1805,13 @@

// Allow international symbols in long filenames. To display correctly, the
// LCD's font must contain the characters. Check your selected LCD language.
//#define UTF_FILENAME_SUPPORT
#define UTF_FILENAME_SUPPORT

//#define LONG_FILENAME_HOST_SUPPORT // Get the long filename of a file/folder with 'M33 <dosname>' and list long filenames with 'M20 L'
//#define LONG_FILENAME_WRITE_SUPPORT // Create / delete files with long filenames via M28, M30, and Binary Transfer Protocol
//#define M20_TIMESTAMP_SUPPORT // Include timestamps by adding the 'T' flag to M20 commands
#define LONG_FILENAME_HOST_SUPPORT // Get the long filename of a file/folder with 'M33 <dosname>' and list long filenames with 'M20 L'
#define LONG_FILENAME_WRITE_SUPPORT // Create / delete files with long filenames via M28, M30, and Binary Transfer Protocol
#define M20_TIMESTAMP_SUPPORT // Include timestamps by adding the 'T' flag to M20 commands

//#define SCROLL_LONG_FILENAMES // Scroll long filenames in the SD card menu
#define SCROLL_LONG_FILENAMES // Scroll long filenames in the SD card menu

//#define SD_ABORT_NO_COOLDOWN // Leave the heaters on after Stop Print (not recommended!)

Expand Down Expand Up @@ -2010,8 +2010,8 @@
//#define STATUS_CUTTER_ANIM // Use a second bitmap to indicate spindle / laser active
//#define STATUS_COOLER_ANIM // Use a second bitmap to indicate laser cooling
//#define STATUS_FLOWMETER_ANIM // Use multiple bitmaps to indicate coolant flow
//#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap
//#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap
#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap
#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap
//#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames

// Only one STATUS_HEAT_* option can be enabled
Expand Down Expand Up @@ -2273,7 +2273,7 @@
#define BABYSTEP_MULTIPLICATOR_Z 1 // (steps or mm) Steps or millimeter distance for each Z babystep
#define BABYSTEP_MULTIPLICATOR_XY 1 // (steps or mm) Steps or millimeter distance for each XY babystep

//#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
#if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING)
#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds.
// Note: Extra time may be added to mitigate controller latency.
Expand All @@ -2288,7 +2288,7 @@
#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
//#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets
//#define BABYSTEP_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
#define BABYSTEP_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
#endif
#endif

Expand Down
14 changes: 13 additions & 1 deletion Marlin/src/HAL/STM32/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,19 @@ extern "C" {
}

// Reset the system to initiate a firmware flash
WEAK void flashFirmware(const int16_t) { hal.reboot(); }
// WEAK void flashFirmware(const int16_t) { hal.reboot(); }
WEAK void flashFirmware(const int16_t) {
HAL_RCC_DeInit();
HAL_DeInit();
__HAL_REMAPMEMORY_SYSTEMFLASH();
// arm-none-eabi-gcc 4.9.0 does not correctly inline this
// MSP function, so we write it out explicitly here.
//__set_MSP(*((uint32_t*) 0x00000000));
__ASM volatile ("movs r3, #0\nldr r3, [r3, #0]\nMSR msp, r3\n" : : : "r3");//, "sp");
((void (*)(void)) *((uint32_t*) 0x00000004))();
// This will never be executed
hal.reboot();
}

// Maple Compatibility
volatile uint32_t systick_uptime_millis = 0;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -2247,7 +2247,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
#define FAUX_RGB 1
#endif
#if defined(NEOPIXEL_TYPE) && NEOPIXEL_TYPE != NEO_RGB
#error "Your FYSETC/MKS/BTT/BEEZ Mini Panel requires NEOPIXEL_TYPE to be NEO_RGB."
//#error "Your FYSETC/MKS/BTT/BEEZ Mini Panel requires NEOPIXEL_TYPE to be NEO_RGB."
#elif defined(NEOPIXEL_PIXELS) && NEOPIXEL_PIXELS < 3
#error "Your FYSETC/MKS/BTT/BEEZ Mini Panel requires NEOPIXEL_PIXELS >= 3."
#endif
Expand Down

0 comments on commit 261a77a

Please sign in to comment.