Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skr 3 #6

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 102 additions & 94 deletions Marlin/Configuration.h

Large diffs are not rendered by default.

175 changes: 90 additions & 85 deletions Marlin/Configuration_adv.h

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions Marlin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# BIQU B1 SE (SKR 2) Firmware

Flash drive support is enabled, but jumpers to enable support may not have been installed correctly from the factory. [Follow Biqu's instructions, starting with Step 2](https://github.com/bigtreetech/BIQU-B1-SE-PLUS/blob/master/B1-SE%20fimware/B1-SE-U%20Disk%20Usage%20Tutorial-English.pdf) if flash drive support is not working correctly.

M503 report from original B1 SE BTT firmware:
```
echo: G21 ; Units in mm (mm)

echo:; Filament settings: Disabled
echo: M200 S0 D1.75
echo:; Steps per unit:
echo: M92 X80.00 Y80.00 Z400.00 E92.00
echo:; Maximum feedrates (units/s):
echo: M203 X150.00 Y150.00 Z5.00 E65.00
echo:; Maximum Acceleration (units/s2):
echo: M201 X1000.00 Y1000.00 Z100.00 E10000.00
echo:; Acceleration (units/s2): P<print_accel> R<retract_accel> T<travel_accel>
echo: M204 P500.00 R500.00 T500.00
echo:; Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate> J<junc_dev>
echo: M205 B20000.00 S0.00 T0.00 J0.01
echo:; Home offset:
echo: M206 X0.00 Y0.00 Z0.00
echo:; PID settings:
echo: M301 P19.32 I1.32 D70.43
echo: M304 P41.78 I7.32 D158.93
; Controller Fan
echo: M710 S255 I0 A1 D60 ; (100% 0%)
echo:; Power-Loss Recovery:
echo: M413 S1
echo:; Z-Probe Offset (mm):
echo: M851 X0.00 Y0.00 Z0.20
echo:; Stepper driver current:
echo: M906 X800 Y800 Z800
echo: M906 T0 E800

echo:; Driver stepping mode:
echo: M569 S1 X Y Z
echo: M569 S1 T0 E
echo:; Filament load/unload lengths:
echo: M603 L0.00 U100.00
echo:; Filament runout sensor:
echo: M412 S0
echo:; Babystep total:
echo: M290 Z0
```
11 changes: 10 additions & 1 deletion Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,9 +936,18 @@ void minkill(const bool steppers_off/*=false*/) {

// Reboot the board
hal.reboot();

#else

#if defined(PLR_REBOOT_TIMEOUT)
if (PrintJobRecovery::outage_counter > 0) {
for (uint16_t i = 0; i < PLR_REBOOT_TIMEOUT; i++) {
hal.watchdog_refresh();
delayMicroseconds(1000000UL);
}
hal.reboot();
}
#endif

for (;;) hal.watchdog_refresh(); // Wait for RESET button or power-cycle

#endif
Expand Down
20 changes: 20 additions & 0 deletions Marlin/src/feature/powerloss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ bool PrintJobRecovery::enabled; // Initialized by settings.load()
celsius_t PrintJobRecovery::bed_temp_threshold; // Initialized by settings.load()
#endif

#if PIN_EXISTS(POWER_LOSS)
uint8_t PrintJobRecovery::outage_counter; // = 0
#endif

MediaFile PrintJobRecovery::file;
job_recovery_info_t PrintJobRecovery::info;
const char PrintJobRecovery::filename[5] = "/PLR";
Expand Down Expand Up @@ -137,6 +141,14 @@ bool PrintJobRecovery::check() {
return success;
}

/**
* Cancel recovery
*/
void PrintJobRecovery::cancel() {
TERN_(PLR_HEAT_BED_ON_REBOOT, set_bed_temp(false));
purge();
}

/**
* Delete the recovery file and clear the recovery data
*/
Expand Down Expand Up @@ -355,6 +367,14 @@ void PrintJobRecovery::write() {
if (!file.close()) DEBUG_ECHOLNPGM("Power-loss file close failed.");
}

#if ENABLED(PLR_HEAT_BED_ON_REBOOT)
void PrintJobRecovery::set_bed_temp(bool turn_on) {
// Set the bed temperature
const celsius_t bt = turn_on ? info.target_temperature_bed + PLR_HEAT_BED_RAISE: 0;
PROCESS_SUBCOMMANDS_NOW(TS(F("M190S"), bt));
}
#endif

/**
* Resume the saved print job
*/
Expand Down
7 changes: 5 additions & 2 deletions Marlin/src/feature/powerloss.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,21 @@ class PrintJobRecovery {
static void close() { file.close(); }

static bool check();
#if ENABLED(PLR_HEAT_BED_ON_REBOOT)
static void set_bed_temp(bool turn_on);
#endif
static void resume();
static void purge();

static void cancel() { purge(); }
static void cancel();

static void load();
static void save(const bool force=ENABLED(SAVE_EACH_CMD_MODE), const float zraise=POWER_LOSS_ZRAISE, const bool raised=false);

#if PIN_EXISTS(POWER_LOSS)
static uint8_t outage_counter;
static void outage() {
static constexpr uint8_t OUTAGE_THRESHOLD = 3;
static uint8_t outage_counter = 0;
if (enabled && READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) {
outage_counter++;
if (outage_counter >= OUTAGE_THRESHOLD) _outage();
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/calibrate/M48.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ void GcodeSuite::M48() {

#if HAS_STATUS_MESSAGE
// Display M48 results in the status bar
ui.set_status_and_level(MString<30>(GET_TEXT_F(MSG_M48_DEVIATION), F(": "), w_float_t(sigma, 2, 6)));
ui.set_status_and_level(MString<40>(GET_TEXT_F(MSG_M48_DEVIATION), F(": "), w_float_t(sigma, 2, 3), F(", "), GET_TEXT(MSG_M48_MAX_DELTA), F(": "), w_float_t(_MAX(mean - min, max - mean), 2, 3)));
#endif
}

Expand Down
1 change: 1 addition & 0 deletions Marlin/src/gcode/feature/powerloss/M1000.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ void GcodeSuite::M1000() {
const bool force_resume = TERN0(HAS_PLR_BED_THRESHOLD, recovery.bed_temp_threshold && (thermalManager.degBed() >= recovery.bed_temp_threshold));

if (!force_resume && parser.seen_test('S')) {
TERN_(PLR_HEAT_BED_ON_REBOOT, recovery.set_bed_temp(true));
#if HAS_MARLINUI_MENU
ui.goto_screen(menu_job_recovery);
#elif HAS_DWIN_E3V2_BASIC
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/lcd/language/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ namespace LanguageNarrow_en {
LSTR MSG_M48_POINT = _UxGT("M48 Point");
LSTR MSG_M48_OUT_OF_BOUNDS = _UxGT("Probe out of bounds");
LSTR MSG_M48_DEVIATION = _UxGT("Deviation");
LSTR MSG_M48_MAX_DELTA = _UxGT("MaxD");
LSTR MSG_IDEX_MENU = _UxGT("IDEX Mode");
LSTR MSG_OFFSETS_MENU = _UxGT("Tool Offsets");
LSTR MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Park");
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu_advanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ void menu_advanced_settings() {

// M593 - Acceleration items
#if ENABLED(SHAPING_MENU)
if (!is_busy) SUBMENU(MSG_INPUT_SHAPING, menu_advanced_input_shaping);
/*if (!is_busy)*/ SUBMENU(MSG_INPUT_SHAPING, menu_advanced_input_shaping);
#endif

#if ENABLED(CLASSIC_JERK)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/tft/ui_color_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ void MarlinUI::draw_status_screen() {
if (cm && pa)
add_control(SDCARD_ICON_X, SDCARD_ICON_Y, STOP, imgCancel, true, COLOR_CONTROL_CANCEL);
else
add_control(SDCARD_ICON_X, SDCARD_ICON_Y, menu_media, imgSD, cm && !pa, COLOR_CONTROL_ENABLED, COLOR_CONTROL_DISABLED);
add_control(SDCARD_ICON_X, SDCARD_ICON_Y, menu_media, imgSD, /*cm &&*/ !pa, COLOR_CONTROL_ENABLED, COLOR_CONTROL_DISABLED);
#endif
#endif

Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/sd/cardreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,9 @@ void CardReader::manage_media() {
TERN_(POWER_LOSS_RECOVERY, if (recovery.check()) do_auto = false);
}

// Fix check for PLR file. Skip One-Click and auto#.g if found
//TERN_(POWER_LOSS_RECOVERY, if (recovery.check()) do_auto = false);

// Find the newest file and prompt to print it.
TERN_(ONE_CLICK_PRINT, if (do_auto && one_click_check()) do_auto = false);

Expand Down
Loading