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

Add default fade height configuration #20316

Merged
Merged
Changes from 1 commit
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
Next Next commit
Add option to configure fade height
sjasonsmith committed Nov 29, 2020

Verified

This commit was signed with the committer’s verified signature.
folkertdev Folkert de Vries
commit e8cfe193ba053c7f76d17b7f97a5d47f49640b19
3 changes: 3 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
@@ -1291,6 +1291,9 @@
// at which point movement will be level to the machine's XY plane.
// The height can be set with M420 Z<height>
#define ENABLE_LEVELING_FADE_HEIGHT
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
#define DEFAULT_LEVELING_FADE_HEIGHT 10.0 // (mm) default fade height. 0.0 to disable. Override with M420 Z<height>
#endif

// For Cartesian machines, instead of dividing moves on mesh boundaries,
// split up moves into short segments like a Delta. This follows the
4 changes: 4 additions & 0 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
@@ -2448,6 +2448,10 @@
#endif
#endif

#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && !defined(DEFAULT_LEVELING_FADE_HEIGHT)
#define DEFAULT_LEVELING_FADE_HEIGHT 0.0
#endif

#if ENABLED(SEGMENT_LEVELED_MOVES) && !defined(LEVELED_SEGMENT_LENGTH)
#define LEVELED_SEGMENT_LENGTH 5
#endif
4 changes: 2 additions & 2 deletions Marlin/src/module/settings.cpp
Original file line number Diff line number Diff line change
@@ -696,7 +696,7 @@ void MarlinSettings::postprocess() {
// Global Leveling
//
{
const float zfh = TERN(ENABLE_LEVELING_FADE_HEIGHT, planner.z_fade_height, 10.0f);
const float zfh = TERN(ENABLE_LEVELING_FADE_HEIGHT, planner.z_fade_height, (DEFAULT_LEVELING_FADE_HEIGHT));
EEPROM_WRITE(zfh);
}

@@ -2588,7 +2588,7 @@ void MarlinSettings::reset() {
//
// Global Leveling
//
TERN_(ENABLE_LEVELING_FADE_HEIGHT, new_z_fade_height = 0.0);
TERN_(ENABLE_LEVELING_FADE_HEIGHT, new_z_fade_height = (DEFAULT_LEVELING_FADE_HEIGHT));
TERN_(HAS_LEVELING, reset_bed_level());

#if HAS_BED_PROBE