From dbc363f639e71e147ceda5c77ba1892889f25d69 Mon Sep 17 00:00:00 2001 From: Luc Van Daele Date: Sat, 18 Sep 2021 09:02:38 +0200 Subject: [PATCH] Calc dcr Calculate calibration radius for offset probes by using new config parameter BED_RADIUS oops --- Marlin/src/gcode/calibrate/G33.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 591014f03eee..05eb0ef6c60a 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -409,17 +409,23 @@ void GcodeSuite::G33() { const bool probe_at_offset = TERN0(HAS_PROBE_XY_OFFSET, parser.boolval('O')), towers_set = !parser.seen_test('T'); - float max_dcr = dcr = DELTA_PRINTABLE_RADIUS; + // needs to be moved to all delta config files + #define BED_DIAMETER = 220 + #if HAS_PROBE_XY_OFFSET - // For offset probes the calibration radius is set to a safe but non-optimal value - dcr -= HYPOT(probe.offset_xy.x, probe.offset_xy.y); + // For offset probes the calibration radius is set to a calculated value if (probe_at_offset) { - // With probe positions both probe and nozzle need to be within the printable area - max_dcr = dcr; + // with probe positions both probe and nozzle need to be within the printable area + float max_dcr = dcr = DELTA_PRINTABLE_RADIUS - HYPOT(probe.offset_xy.x, probe.offset_xy.y); } - // else with nozzle positions there is a risk of the probe being outside the bed - // but as long the nozzle stays within the printable area there is no risk of - // the effector crashing into the towers. + else { + // else with nozzle positions only the nozzle needs to be within the printable area + // and the probe needs to be inside the physical bed diameter + float max_dcr = dcr = DELTA_PRINTABLE_RADIUS - _MAX(HYPOT(probe.offset_xy.x, probe.offset_xy.y) - BED_DIAMETER/2 + PRINT_RADIUS, 0); + } + #else + // For non-offset probes the calibration radius is set to the printable area + float max_dcr = dcr = DELTA_PRINTABLE_RADIUS; #endif if (parser.seenval('R')) dcr = parser.value_float();