mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-03-02 04:47:20 +00:00
🐛 Fix Polargraph without Z (#25514)
This commit is contained in:
parent
6f5d33ce55
commit
3156595078
6 changed files with 41 additions and 36 deletions
Marlin/src
feature/mmu
inc
lcd
libs
module
|
@ -815,8 +815,7 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
|
||||||
resume_hotend_temp = thermalManager.degTargetHotend(active_extruder);
|
resume_hotend_temp = thermalManager.degTargetHotend(active_extruder);
|
||||||
resume_position = current_position;
|
resume_position = current_position;
|
||||||
|
|
||||||
if (move_axes && all_axes_homed())
|
if (move_axes && all_axes_homed()) nozzle.park(0, park_point);
|
||||||
nozzle.park(0, park_point /*= NOZZLE_PARK_POINT*/);
|
|
||||||
|
|
||||||
if (turn_off_nozzle) thermalManager.setTargetHotend(0, active_extruder);
|
if (turn_off_nozzle) thermalManager.setTargetHotend(0, active_extruder);
|
||||||
|
|
||||||
|
|
|
@ -1148,11 +1148,11 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
|
||||||
|
|
||||||
#if ENABLED(NOZZLE_PARK_FEATURE)
|
#if ENABLED(NOZZLE_PARK_FEATURE)
|
||||||
constexpr float npp[] = NOZZLE_PARK_POINT;
|
constexpr float npp[] = NOZZLE_PARK_POINT;
|
||||||
static_assert(COUNT(npp) == XYZ, "NOZZLE_PARK_POINT requires X, Y, and Z values.");
|
static_assert(COUNT(npp) == _MIN(NUM_AXES, XYZ), "NOZZLE_PARK_POINT requires coordinates for enabled axes, but only up to X,Y,Z.");
|
||||||
constexpr xyz_pos_t npp_xyz = NOZZLE_PARK_POINT;
|
constexpr xyz_pos_t npp_xyz = NOZZLE_PARK_POINT;
|
||||||
static_assert(WITHIN(npp_xyz.x, X_MIN_POS, X_MAX_POS), "NOZZLE_PARK_POINT.X is out of bounds (X_MIN_POS, X_MAX_POS).");
|
static_assert(WITHIN(npp_xyz.x, X_MIN_POS, X_MAX_POS), "NOZZLE_PARK_POINT.X is out of bounds (X_MIN_POS, X_MAX_POS).");
|
||||||
static_assert(WITHIN(npp_xyz.y, Y_MIN_POS, Y_MAX_POS), "NOZZLE_PARK_POINT.Y is out of bounds (Y_MIN_POS, Y_MAX_POS).");
|
static_assert(TERN1(HAS_Y_AXIS, WITHIN(npp_xyz.y, Y_MIN_POS, Y_MAX_POS)), "NOZZLE_PARK_POINT.Y is out of bounds (Y_MIN_POS, Y_MAX_POS).");
|
||||||
static_assert(WITHIN(npp_xyz.z, Z_MIN_POS, Z_MAX_POS), "NOZZLE_PARK_POINT.Z is out of bounds (Z_MIN_POS, Z_MAX_POS).");
|
static_assert(TERN1(HAS_Z_AXIS, WITHIN(npp_xyz.z, Z_MIN_POS, Z_MAX_POS)), "NOZZLE_PARK_POINT.Z is out of bounds (Z_MIN_POS, Z_MAX_POS).");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -521,7 +521,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
|
||||||
else if (axis_should_home(axis))
|
else if (axis_should_home(axis))
|
||||||
while (const char c = *value++) lcd_put_lchar(c <= '.' ? c : '?');
|
while (const char c = *value++) lcd_put_lchar(c <= '.' ? c : '?');
|
||||||
else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !axis_is_trusted(axis))
|
else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !axis_is_trusted(axis))
|
||||||
lcd_put_u8str(axis == Z_AXIS ? F(" ") : F(" "));
|
lcd_put_u8str(TERN0(HAS_Z_AXIS, axis == Z_AXIS) ? F(" ") : F(" "));
|
||||||
else
|
else
|
||||||
lcd_put_u8str(value);
|
lcd_put_u8str(value);
|
||||||
}
|
}
|
||||||
|
@ -998,11 +998,12 @@ void MarlinUI::draw_status_screen() {
|
||||||
|
|
||||||
#endif // LCD_WIDTH >= 20
|
#endif // LCD_WIDTH >= 20
|
||||||
|
|
||||||
lcd_moveto(LCD_WIDTH - 8, 1);
|
#if HAS_Z_AXIS
|
||||||
_draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink);
|
lcd_moveto(LCD_WIDTH - 8, 1);
|
||||||
|
_draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink);
|
||||||
#if HAS_LEVELING && !HAS_HEATED_BED
|
#if HAS_LEVELING && !HAS_HEATED_BED
|
||||||
lcd_put_lchar(planner.leveling_active || blink ? '_' : ' ');
|
lcd_put_lchar(planner.leveling_active || blink ? '_' : ' ');
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // LCD_HEIGHT > 2
|
#endif // LCD_HEIGHT > 2
|
||||||
|
|
|
@ -597,7 +597,7 @@ void menu_backlash();
|
||||||
;
|
;
|
||||||
|
|
||||||
LOOP_LOGICAL_AXES(a) {
|
LOOP_LOGICAL_AXES(a) {
|
||||||
if (a == C_AXIS || TERN0(HAS_EXTRUDERS, a == E_AXIS))
|
if (TERN0(HAS_C_AXIS, a == C_AXIS) || TERN0(HAS_EXTRUDERS, a == E_AXIS))
|
||||||
EDIT_ITEM_FAST_N(float52sign, a, MSG_VN_JERK, &planner.max_jerk[a], 0.1f, max_jerk_edit[a]);
|
EDIT_ITEM_FAST_N(float52sign, a, MSG_VN_JERK, &planner.max_jerk[a], 0.1f, max_jerk_edit[a]);
|
||||||
else
|
else
|
||||||
EDIT_ITEM_FAST_N(float3, a, MSG_VN_JERK, &planner.max_jerk[a], 1.0f, max_jerk_edit[a]);
|
EDIT_ITEM_FAST_N(float3, a, MSG_VN_JERK, &planner.max_jerk[a], 1.0f, max_jerk_edit[a]);
|
||||||
|
|
|
@ -225,38 +225,43 @@ Nozzle nozzle;
|
||||||
|
|
||||||
#if ENABLED(NOZZLE_PARK_FEATURE)
|
#if ENABLED(NOZZLE_PARK_FEATURE)
|
||||||
|
|
||||||
float Nozzle::park_mode_0_height(const_float_t park_z) {
|
#if HAS_Z_AXIS
|
||||||
// Apply a minimum raise, if specified. Use park.z as a minimum height instead.
|
float Nozzle::park_mode_0_height(const_float_t park_z) {
|
||||||
return _MAX(park_z, // Minimum height over 0 based on input
|
// Apply a minimum raise, if specified. Use park.z as a minimum height instead.
|
||||||
_MIN(Z_MAX_POS, // Maximum height is fixed
|
return _MAX(park_z, // Minimum height over 0 based on input
|
||||||
#ifdef NOZZLE_PARK_Z_RAISE_MIN
|
_MIN(Z_MAX_POS, // Maximum height is fixed
|
||||||
NOZZLE_PARK_Z_RAISE_MIN + // Minimum raise...
|
#ifdef NOZZLE_PARK_Z_RAISE_MIN
|
||||||
#endif
|
NOZZLE_PARK_Z_RAISE_MIN + // Minimum raise...
|
||||||
current_position.z // ...over current position
|
#endif
|
||||||
)
|
current_position.z // ...over current position
|
||||||
);
|
)
|
||||||
}
|
);
|
||||||
|
}
|
||||||
|
#endif // HAS_Z_AXIS
|
||||||
|
|
||||||
void Nozzle::park(const uint8_t z_action, const xyz_pos_t &park/*=NOZZLE_PARK_POINT*/) {
|
void Nozzle::park(const uint8_t z_action, const xyz_pos_t &park/*=NOZZLE_PARK_POINT*/) {
|
||||||
constexpr feedRate_t fr_xy = NOZZLE_PARK_XY_FEEDRATE, fr_z = NOZZLE_PARK_Z_FEEDRATE;
|
#if HAS_Z_AXIS
|
||||||
|
constexpr feedRate_t fr_z = NOZZLE_PARK_Z_FEEDRATE;
|
||||||
|
|
||||||
switch (z_action) {
|
switch (z_action) {
|
||||||
case 1: // Go to Z-park height
|
case 1: // Go to Z-park height
|
||||||
do_blocking_move_to_z(park.z, fr_z);
|
do_blocking_move_to_z(park.z, fr_z);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2: // Raise by Z-park height
|
case 2: // Raise by Z-park height
|
||||||
do_blocking_move_to_z(_MIN(current_position.z + park.z, Z_MAX_POS), fr_z);
|
do_blocking_move_to_z(_MIN(current_position.z + park.z, Z_MAX_POS), fr_z);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: // Raise by NOZZLE_PARK_Z_RAISE_MIN, use park.z as a minimum height
|
default: // Raise by NOZZLE_PARK_Z_RAISE_MIN, use park.z as a minimum height
|
||||||
do_blocking_move_to_z(park_mode_0_height(park.z), fr_z);
|
do_blocking_move_to_z(park_mode_0_height(park.z), fr_z);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif // HAS_Z_AXIS
|
||||||
|
|
||||||
#ifndef NOZZLE_PARK_MOVE
|
#ifndef NOZZLE_PARK_MOVE
|
||||||
#define NOZZLE_PARK_MOVE 0
|
#define NOZZLE_PARK_MOVE 0
|
||||||
#endif
|
#endif
|
||||||
|
constexpr feedRate_t fr_xy = NOZZLE_PARK_XY_FEEDRATE;
|
||||||
switch (NOZZLE_PARK_MOVE) {
|
switch (NOZZLE_PARK_MOVE) {
|
||||||
case 0: do_blocking_move_to_xy(park, fr_xy); break;
|
case 0: do_blocking_move_to_xy(park, fr_xy); break;
|
||||||
case 1: do_blocking_move_to_x(park.x, fr_xy); break;
|
case 1: do_blocking_move_to_x(park.x, fr_xy); break;
|
||||||
|
|
|
@ -43,7 +43,7 @@ xy_pos_t draw_area_min, draw_area_max;
|
||||||
|
|
||||||
void inverse_kinematics(const xyz_pos_t &raw) {
|
void inverse_kinematics(const xyz_pos_t &raw) {
|
||||||
const float x1 = raw.x - draw_area_min.x, x2 = draw_area_max.x - raw.x, y = raw.y - draw_area_max.y;
|
const float x1 = raw.x - draw_area_min.x, x2 = draw_area_max.x - raw.x, y = raw.y - draw_area_max.y;
|
||||||
delta.set(HYPOT(x1, y), HYPOT(x2, y), raw.z);
|
delta.set(HYPOT(x1, y), HYPOT(x2, y) OPTARG(HAS_Z_AXIS, raw.z));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // POLARGRAPH
|
#endif // POLARGRAPH
|
||||||
|
|
Loading…
Reference in a new issue