Skip to content

Commit

Permalink
Added configuration EQUAL_MARGIN_ALL_SIDES in Configuration.h to cent…
Browse files Browse the repository at this point in the history
…er the auto bed leveling grid in the bed by using a margin the size of the largest probed offset.
  • Loading branch information
Guizz27 committed Jul 11, 2022
1 parent de62eb8 commit f10280b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
5 changes: 4 additions & 1 deletion Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,10 @@
// Most probes should stay away from the edges of the bed, but
// with NOZZLE_AS_PROBE this can be negative for a wider probing area.
#define PROBING_MARGIN 10

#if ENABLED(LGT_MAC)
#define EQUAL_MARGIN_ALL_SIDES // Adjusts the margin so the bed is probed at equal distance on all sides.
// It will not use a margin less than PROBING_MARGIN
#endif
// X and Y axis travel speed (mm/min) between probes
#define XY_PROBE_FEEDRATE (133*60)

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2022-06-04"
#define STRING_DISTRIBUTION_DATE "2022-07-10"
#endif

/**
Expand Down
11 changes: 6 additions & 5 deletions Marlin/src/module/probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,28 +205,29 @@ class Probe {
* close it can get the RIGHT edge of the bed (unless the nozzle is able move
* far enough past the right edge).
*/
static constexpr float _min_x(const xy_pos_t &probe_offset_xy=offset_xy) {
// LGT_MAC
static constexpr float _min_x(const xy_pos_t& probe_offset_xy = offset_xy) {
return TERN(IS_KINEMATIC,
(X_CENTER) - probe_radius(probe_offset_xy),
_MAX((X_MIN_BED) + (PROBING_MARGIN_LEFT), (X_MIN_POS) + probe_offset_xy.x)
_MAX((X_MIN_BED)+(PROBING_MARGIN_LEFT), TERN(EQUAL_MARGIN_ALL_SIDES, (X_MIN_BED)+_MAX(abs(probe_offset_xy.x), abs(probe_offset_xy.y)), (X_MIN_POS)+probe_offset_xy.x))
);
}
static constexpr float _max_x(const xy_pos_t &probe_offset_xy=offset_xy) {
return TERN(IS_KINEMATIC,
(X_CENTER) + probe_radius(probe_offset_xy),
_MIN((X_MAX_BED) - (PROBING_MARGIN_RIGHT), (X_MAX_POS) + probe_offset_xy.x)
_MIN((X_MAX_BED)-(PROBING_MARGIN_RIGHT), TERN(EQUAL_MARGIN_ALL_SIDES, (X_MAX_BED)-_MAX(abs(probe_offset_xy.x), abs(probe_offset_xy.y)), (X_MAX_POS)+probe_offset_xy.x))
);
}
static constexpr float _min_y(const xy_pos_t &probe_offset_xy=offset_xy) {
return TERN(IS_KINEMATIC,
(Y_CENTER) - probe_radius(probe_offset_xy),
_MAX((Y_MIN_BED) + (PROBING_MARGIN_FRONT), (Y_MIN_POS) + probe_offset_xy.y)
_MAX((Y_MIN_BED)+(PROBING_MARGIN_FRONT), TERN(EQUAL_MARGIN_ALL_SIDES, (Y_MIN_BED)+_MAX(abs(probe_offset_xy.x), abs(probe_offset_xy.y)), (Y_MIN_POS)+probe_offset_xy.y))
);
}
static constexpr float _max_y(const xy_pos_t &probe_offset_xy=offset_xy) {
return TERN(IS_KINEMATIC,
(Y_CENTER) + probe_radius(probe_offset_xy),
_MIN((Y_MAX_BED) - (PROBING_MARGIN_BACK), (Y_MAX_POS) + probe_offset_xy.y)
_MIN((Y_MAX_BED)-(PROBING_MARGIN_BACK), TERN(EQUAL_MARGIN_ALL_SIDES, (Y_MAX_BED)-_MAX(abs(probe_offset_xy.x), abs(probe_offset_xy.y)), (Y_MAX_POS)+probe_offset_xy.y))
);
}

Expand Down

0 comments on commit f10280b

Please sign in to comment.