Skip to content

Commit

Permalink
Merge branch 'bugfix-2.1.x' into mike-config
Browse files Browse the repository at this point in the history
* bugfix-2.1.x: (25 commits)
  [cron] Bump distribution date (2023-08-26)
  ✨ Mellow Fly E3 V2 (STM32F407VG) (MarlinFirmware#26081)
  🚸 Fixes for ProUI, JyersUI, backlight, etc. (MarlinFirmware#26086)
  🧑‍💻 Encapsulate ProUI G-code preview
  [cron] Bump distribution date (2023-08-25)
  🧑‍💻 Adjust LCD string draw (MarlinFirmware#26154)
  [cron] Bump distribution date (2023-08-24)
  📝 Thermistor info updates (MarlinFirmware#26202)
  [cron] Bump distribution date (2023-08-23)
  ✨ G-code 'T' report current tool (MarlinFirmware#26151)
  🔧 Allow arbitrary BLOCK_BUFFER_SIZE
  🔧 Fix Linear Leveling grid size sanity check (MarlinFirmware#26199)
  🚸 Avoid LCD messages starting with "Error:" (MarlinFirmware#26164)
  🩹 Fix FT Motion menu Back item (MarlinFirmware#26175)
  [cron] Bump distribution date (2023-08-22)
  ✅ Fix unused test
  🐛 Fixes for G2/G3 arcs (MarlinFirmware#26170)
  [cron] Bump distribution date (2023-08-21)
  🎨 FTDI cleanup
  [cron] Bump distribution date (2023-08-20)
  ...
  • Loading branch information
mikezs committed Sep 8, 2023
2 parents aaea20e + 11f98ad commit 29da21d
Show file tree
Hide file tree
Showing 90 changed files with 1,367 additions and 849 deletions.
2 changes: 2 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@
* 13 : 100kΩ Hisens up to 300°C - for "Simple ONE" & "All In ONE" hotend - beta 3950, 1%
* 14 : 100kΩ (R25), 4092K (beta25), 4.7kΩ pull-up, bed thermistor as used in Ender-5 S1
* 15 : 100kΩ Calibrated for JGAurora A5 hotend
* 17 : 100kΩ Dagoma NTC white thermistor
* 18 : 200kΩ ATC Semitec 204GT-2 Dagoma.Fr - MKS_Base_DKU001327
* 22 : 100kΩ GTM32 Pro vB - hotend - 4.7kΩ pullup to 3.3V and 220Ω to analog input
* 23 : 100kΩ GTM32 Pro vB - bed - 4.7kΩ pullup to 3.3v and 220Ω to analog input
Expand All @@ -481,6 +482,7 @@
* 68 : PT100 Smplifier board from Dyze Design
* 70 : 100kΩ bq Hephestos 2
* 75 : 100kΩ Generic Silicon Heat Pad with NTC100K MGB18-104F39050L32
* 666 : 200kΩ Einstart S custom thermistor with 10k pullup.
* 2000 : 100kΩ Ultimachine Rambo TDK NTCG104LH104KT1 NTC100K motherboard Thermistor
*
* ================================================================
Expand Down
6 changes: 3 additions & 3 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1746,9 +1746,10 @@

// SD Card Sorting options
#if ENABLED(SDCARD_SORT_ALPHA)
#define SDSORT_REVERSE false // Default to sorting file names in reverse order.
#define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each.
#define FOLDER_SORTING -1 // -1=above 0=none 1=below
#define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 G-code.
#define SDSORT_FOLDERS -1 // -1=above 0=none 1=below
#define SDSORT_GCODE false // Enable G-code M34 to set sorting behaviors: M34 S<-1|0|1> F<-1|0|1>
#define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting.
#define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
#define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option.
Expand Down Expand Up @@ -2528,7 +2529,6 @@
// @section motion

// The number of linear moves that can be in the planner at once.
// The value of BLOCK_BUFFER_SIZE must be a power of 2 (e.g., 8, 16, 32)
#if ALL(HAS_MEDIA, DIRECT_STEPPING)
#define BLOCK_BUFFER_SIZE 8
#elif HAS_MEDIA
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Marlin.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Marlin Firmware
(c) 2011-2020 MarlinFirmware
(c) 2011-2023 MarlinFirmware
Portions of Marlin are (c) by their respective authors.
All code complies with GPLv2 and/or GPLv3
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-08-14"
//#define STRING_DISTRIBUTION_DATE "2023-08-26"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@
#define BOARD_CREALITY_F401RE 5245 // Creality CR4NS200141C13 (STM32F401RE) as found in the Ender-5 S1
#define BOARD_BLACKPILL_CUSTOM 5246 // Custom board based on STM32F401CDU6.
#define BOARD_I3DBEEZ9_V1 5247 // I3DBEEZ9 V1 (STM32F407ZG)
#define BOARD_MELLOW_FLY_E3_V2 5248 // Mellow Fly E3 V2 (STM32F407VG)

//
// ARM Cortex-M7
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/core/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
#define STR_ERR_ARC_ARGS "G2/G3 bad parameters"
#define STR_ERR_PROTECTED_PIN "Protected Pin"
#define STR_ERR_M420_FAILED "Failed to enable Bed Leveling"
#define STR_ERR_M428_TOO_FAR "Too far from reference point"
#define STR_ERR_M428_TOO_FAR "Too far from MIN/MAX"
#define STR_ERR_M303_DISABLED "PIDTEMP disabled"
#define STR_M119_REPORT "Reporting endstop status"
#define STR_ON "ON"
Expand Down Expand Up @@ -254,7 +254,7 @@
#define STR_REDUNDANCY "Heater switched off. Temperature difference between temp sensors is too high !"
#define STR_T_HEATING_FAILED "Heating failed"
#define STR_T_THERMAL_RUNAWAY "Thermal Runaway"
#define STR_T_MALFUNCTION "Thermal Malfunction"
#define STR_T_THERMAL_MALFUNCTION "Thermal Malfunction"
#define STR_T_MAXTEMP "MAXTEMP triggered"
#define STR_T_MINTEMP "MINTEMP triggered"
#define STR_ERR_PROBING_FAILED "Probing Failed"
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ void unified_bed_leveling::shift_mesh_height() {
const grid_count_t point_num = (GRID_MAX_POINTS - count) + 1;
SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, ".");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS)));
TERN_(LCD_BACKLIGHT_TIMEOUT_MINS, ui.refresh_backlight_timeout());

#if HAS_MARLINUI_MENU
if (ui.button_pressed()) {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/caselight.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
class CaseLight {
public:
static bool on;
#if ENABLED(CASELIGHT_USES_BRIGHTNESS)
#if CASELIGHT_USES_BRIGHTNESS
static uint8_t brightness;
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/max7219.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ void Max7219::idle_tasks() {

#ifdef MAX7219_DEBUG_PLANNER_QUEUE
static int16_t last_depth = 0;
const int16_t current_depth = (head - tail + BLOCK_BUFFER_SIZE) & (BLOCK_BUFFER_SIZE - 1) & 0xF;
const int16_t current_depth = BLOCK_MOD(head - tail + (BLOCK_BUFFER_SIZE)) & 0xF;
if (current_depth != last_depth) {
quantity16(MAX7219_DEBUG_PLANNER_QUEUE, last_depth, current_depth, &row_change_mask);
last_depth = current_depth;
Expand Down
12 changes: 10 additions & 2 deletions Marlin/src/gcode/control/T.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,21 @@
* S1 Don't move the tool in XY after change
*
* For PRUSA_MMU2(S) and EXTENDABLE_EMU_MMU2(S)
* T[n] Gcode to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels.
* T? Gcode to extrude shouldn't have to follow. Load to extruder wheels is done automatically.
* T[n] G-code to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels.
* T? G-code to extrude shouldn't have to follow. Load to extruder wheels is done automatically.
* Tx Same as T?, but nozzle doesn't have to be preheated. Tc requires a preheated nozzle to finish filament load.
* Tc Load to nozzle after filament was prepared by Tc and nozzle is already heated.
*/
void GcodeSuite::T(const int8_t tool_index) {

#if HAS_MULTI_EXTRUDER
// For 'T' with no parameter report the current tool.
if (parser.string_arg && *parser.string_arg == '*') {
SERIAL_ECHOLNPGM(STR_ACTIVE_EXTRUDER, active_extruder);
return;
}
#endif

DEBUG_SECTION(log_T, "T", DEBUGGING(LEVELING));
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("...(", tool_index, ")");

Expand Down
130 changes: 64 additions & 66 deletions Marlin/src/gcode/motion/G2_G3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,17 @@ void plan_arc(
rt_X = cart[axis_p] - center_P,
rt_Y = cart[axis_q] - center_Q;

ARC_LIJKUVW_CODE(
const float start_L = current_position[axis_l],
const float start_I = current_position.i,
const float start_J = current_position.j,
const float start_K = current_position.k,
const float start_U = current_position.u,
const float start_V = current_position.v,
const float start_W = current_position.w
// Starting position of the move for all non-arc axes
// i.e., only one of X, Y, or Z, plus the rest.
ARC_LIJKUVWE_CODE(
float start_L = current_position[axis_l],
float start_I = current_position.i,
float start_J = current_position.j,
float start_K = current_position.k,
float start_U = current_position.u,
float start_V = current_position.v,
float start_W = current_position.w,
float start_E = current_position.e
);

// Angle of rotation between position and target from the circle center.
Expand Down Expand Up @@ -125,6 +128,7 @@ void plan_arc(
min_segments = CEIL((MIN_CIRCLE_SEGMENTS) * portion_of_circle); // Minimum segments for the arc
}

// Total travel on all the non-arc axes
ARC_LIJKUVWE_CODE(
float travel_L = cart[axis_l] - start_L,
float travel_I = cart.i - start_I,
Expand All @@ -133,7 +137,7 @@ void plan_arc(
float travel_U = cart.u - start_U,
float travel_V = cart.v - start_V,
float travel_W = cart.w - start_W,
float travel_E = cart.e - current_position.e
float travel_E = cart.e - start_E
);

// If "P" specified circles, call plan_arc recursively then continue with the rest of the arc
Expand Down Expand Up @@ -166,15 +170,29 @@ void plan_arc(
);
plan_arc(temp_position, offset, clockwise, 0); // Plan a single whole circle
}

// Get starting coordinates for the remainder from the current position
ARC_LIJKUVWE_CODE(
start_L = current_position[axis_l],
start_I = current_position.i,
start_J = current_position.j,
start_K = current_position.k,
start_U = current_position.u,
start_V = current_position.v,
start_W = current_position.w,
start_E = current_position.e
);

// Update travel distance for the remainder
ARC_LIJKUVWE_CODE(
travel_L = cart[axis_l] - current_position[axis_l], // Linear X, Y, or Z
travel_I = cart.i - current_position.i, // The rest are also non-arc
travel_J = cart.j - current_position.j,
travel_K = cart.k - current_position.k,
travel_U = cart.u - current_position.u,
travel_V = cart.v - current_position.v,
travel_W = cart.w - current_position.w,
travel_E = cart.e - current_position.e
travel_L = cart[axis_l] - start_L, // Linear X, Y, or Z
travel_I = cart.i - start_I, // The rest are also non-arc
travel_J = cart.j - start_J,
travel_K = cart.k - start_K,
travel_U = cart.u - start_U,
travel_V = cart.v - start_V,
travel_W = cart.w - start_W,
travel_E = cart.e - start_E
);
}

Expand Down Expand Up @@ -256,38 +274,35 @@ void plan_arc(

xyze_pos_t raw;

// do not calculate rotation parameters for trivial single-segment arcs
// Don't calculate rotation parameters for trivial single-segment arcs
if (segments > 1) {
// Vector rotation matrix values
const float theta_per_segment = angular_travel / segments,
sq_theta_per_segment = sq(theta_per_segment),
sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6,
cos_T = 1 - 0.5f * sq_theta_per_segment; // Small angle approximation

#if DISABLED(AUTO_BED_LEVELING_UBL)
ARC_LIJKUVW_CODE(
const float per_segment_L = travel_L / segments,
const float per_segment_I = travel_I / segments,
const float per_segment_J = travel_J / segments,
const float per_segment_K = travel_K / segments,
const float per_segment_U = travel_U / segments,
const float per_segment_V = travel_V / segments,
const float per_segment_W = travel_W / segments
);
#endif

CODE_ITEM_E(const float extruder_per_segment = travel_E / segments);
ARC_LIJKUVWE_CODE(
const float per_segment_L = travel_L / segments,
const float per_segment_I = travel_I / segments,
const float per_segment_J = travel_J / segments,
const float per_segment_K = travel_K / segments,
const float per_segment_U = travel_U / segments,
const float per_segment_V = travel_V / segments,
const float per_segment_W = travel_W / segments,
const float per_segment_E = travel_E / segments
);

// Initialize all linear axes and E
ARC_LIJKUVWE_CODE(
raw[axis_l] = current_position[axis_l],
raw.i = current_position.i,
raw.j = current_position.j,
raw.k = current_position.k,
raw.u = current_position.u,
raw.v = current_position.v,
raw.w = current_position.w,
raw.e = current_position.e
raw[axis_l] = start_L,
raw.i = start_I,
raw.j = start_J,
raw.k = start_K,
raw.u = start_U,
raw.v = start_V,
raw.w = start_W,
raw.e = start_E
);

millis_t next_idle_ms = millis() + 200UL;
Expand All @@ -305,7 +320,6 @@ void plan_arc(
const float limiting_accel = _MIN(planner.settings.max_acceleration_mm_per_s2[axis_p], planner.settings.max_acceleration_mm_per_s2[axis_q]),
limiting_speed = _MIN(planner.settings.max_feedrate_mm_s[axis_p], planner.settings.max_feedrate_mm_s[axis_q]),
limiting_speed_sqr = _MIN(sq(limiting_speed), limiting_accel * radius, sq(scaled_fr_mm_s));
float arc_mm_remaining = flat_mm;

for (uint16_t i = 1; i < segments; i++) { // Iterate (segments-1) times

Expand Down Expand Up @@ -343,16 +357,14 @@ void plan_arc(
raw[axis_p] = center_P + rvec.a;
raw[axis_q] = center_Q + rvec.b;
ARC_LIJKUVWE_CODE(
#if ENABLED(AUTO_BED_LEVELING_UBL)
raw[axis_l] = start_L,
raw.i = start_I, raw.j = start_J, raw.k = start_K,
raw.u = start_U, raw.v = start_V, raw.w = start_V
#else
raw[axis_l] += per_segment_L,
raw.i += per_segment_I, raw.j += per_segment_J, raw.k += per_segment_K,
raw.u += per_segment_U, raw.v += per_segment_V, raw.w += per_segment_W
#endif
, raw.e += extruder_per_segment
raw[axis_l] = start_L + per_segment_L * i,
raw.i = start_I + per_segment_I * i,
raw.j = start_J + per_segment_J * i,
raw.k = start_K + per_segment_K * i,
raw.u = start_U + per_segment_U * i,
raw.v = start_V + per_segment_V * i,
raw.w = start_W + per_segment_W * i,
raw.e = start_E + per_segment_E * i
);

apply_motion_limits(raw);
Expand All @@ -362,7 +374,7 @@ void plan_arc(
#endif

// calculate safe speed for stopping by the end of the arc
arc_mm_remaining -= segment_mm;
const float arc_mm_remaining = flat_mm - segment_mm * i;
hints.safe_exit_speed_sqr = _MIN(limiting_speed_sqr, 2 * limiting_accel * arc_mm_remaining);

if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, hints))
Expand All @@ -374,13 +386,6 @@ void plan_arc(

// Ensure last segment arrives at target location.
raw = cart;
#if ENABLED(AUTO_BED_LEVELING_UBL)
ARC_LIJKUVW_CODE(
raw[axis_l] = start_L,
raw.i = start_I, raw.j = start_J, raw.k = start_K,
raw.u = start_U, raw.v = start_V, raw.w = start_W
);
#endif

apply_motion_limits(raw);

Expand All @@ -392,14 +397,7 @@ void plan_arc(
hints.safe_exit_speed_sqr = 0.0f;
planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, hints);

#if ENABLED(AUTO_BED_LEVELING_UBL)
ARC_LIJKUVW_CODE(
raw[axis_l] = start_L,
raw.i = start_I, raw.j = start_J, raw.k = start_K,
raw.u = start_U, raw.v = start_V, raw.w = start_W
);
#endif
current_position = raw;
current_position = cart;

} // plan_arc

Expand Down
8 changes: 7 additions & 1 deletion Marlin/src/gcode/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,13 @@ void GCodeParser::parse(char *p) {
#endif

// Bail if there's no command code number
if (!TERN(SIGNED_CODENUM, NUMERIC_SIGNED(*p), NUMERIC(*p))) return;
if (!TERN(SIGNED_CODENUM, NUMERIC_SIGNED(*p), NUMERIC(*p))) {
if (TERN0(HAS_MULTI_EXTRUDER, letter == 'T')) {
p[0] = '*'; p[1] = '\0'; string_arg = p; // Convert 'T' alone into 'T*'
command_letter = letter;
}
return;
}

// Save the command letter at this point
// A '?' signifies an unknown command
Expand Down
12 changes: 11 additions & 1 deletion Marlin/src/gcode/sd/M34.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,19 @@

/**
* M34: Set SD Card Sorting Options
*
* S - Default sorting (i.e., SDSORT_REVERSE)
* S-1 - Reverse alpha sorting
* S0 - FID Order (not always newest)
* S1 - Forward alpha sorting
* S2 - Alias for S-1 [deprecated]
*
* F-1 - Folders above files
* F0 - Sort According to 'S'
* F1 - Folders after files
*/
void GcodeSuite::M34() {
if (parser.seen('S')) card.setSortOn(parser.value_bool());
if (parser.seen('S')) card.setSortOn(SortFlag(parser.ushortval('S', TERN(SDSORT_REVERSE, AS_REV, AS_FWD))));
if (parser.seenval('F')) {
const int v = parser.value_long();
card.setSortFolders(v < 0 ? -1 : v > 0 ? 1 : 0);
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/inc/Changes.h
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,8 @@
#error "Z4_USE_ENDSTOP is obsolete. Instead set Z4_STOP_PIN directly. (e.g., 'Z4_USE_ENDSTOP _ZMAX_' becomes 'Z4_STOP_PIN Z_MAX_PIN')"
#elif defined(INTEGRATED_BABYSTEPPING)
#error "INTEGRATED_BABYSTEPPING is no longer needed and should be removed."
#elif defined(FOLDER_SORTING)
#error "FOLDER_SORTING is now SDSORT_FOLDERS."
#endif

// L64xx stepper drivers have been removed
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -3337,8 +3337,8 @@
#define SDSORT_CACHE_NAMES true
#define SDSORT_CACHE_LPC1768_WARNING 1
#endif
#ifndef FOLDER_SORTING
#define FOLDER_SORTING -1
#ifndef SDSORT_FOLDERS
#define SDSORT_FOLDERS -1
#endif
#ifndef SDSORT_GCODE
#define SDSORT_GCODE false
Expand Down
Loading

0 comments on commit 29da21d

Please sign in to comment.