Skip to content

Commit

Permalink
Calc dcr
Browse files Browse the repository at this point in the history
Calculate calibration radius for offset probes by using new config parameter BED_RADIUS

oops
  • Loading branch information
LVD-AC committed Sep 18, 2021
1 parent f31f60b commit dbc363f
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Marlin/src/gcode/calibrate/G33.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit dbc363f

Please sign in to comment.