2.0 IDEX Independent z offset and other fixes (#11862)

* Add Formbot Raptor board

Co-Authored-By: InsanityAutomation <insanityautomation@users.noreply.github.com>

* Add a second Z probe Z offset

Co-Authored-By: InsanityAutomation <insanityautomation@users.noreply.github.com>

* Modify method to utilize live adjustment of hotend z offset

Should probably move config option to babystepping and rename as it may now apply to all multiextruder systems

* Move config item and catchup other code to current method
This commit is contained in:
InsanityAutomation
2018-09-24 10:40:48 -04:00
committed by Roxy-3D
parent 217e0efd20
commit 1104054d73
13 changed files with 290 additions and 38 deletions

View File

@ -153,7 +153,8 @@ typedef struct SettingsDataStruct {
//
// HAS_BED_PROBE
//
float zprobe_zoffset; // M851 Z
float zprobe_zoffset;
//
// ABL_PLANAR
@ -494,12 +495,12 @@ void MarlinSettings::postprocess() {
for (uint8_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_WRITE(dummy);
#endif // MESH_BED_LEVELING
_FIELD_TEST(zprobe_zoffset);
#if !HAS_BED_PROBE
const float zprobe_zoffset = 0;
#endif
EEPROM_WRITE(zprobe_zoffset);
_FIELD_TEST(zprobe_zoffset);
EEPROM_WRITE(zprobe_zoffset);
//
// Planar Bed Leveling matrix
@ -1180,12 +1181,12 @@ void MarlinSettings::postprocess() {
for (uint16_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_READ(dummy);
#endif // MESH_BED_LEVELING
_FIELD_TEST(zprobe_zoffset);
#if !HAS_BED_PROBE
float zprobe_zoffset;
#endif
EEPROM_READ(zprobe_zoffset);
_FIELD_TEST(zprobe_zoffset);
EEPROM_READ(zprobe_zoffset);
//
// Planar Bed Leveling matrix

View File

@ -1502,15 +1502,15 @@ void homeaxis(const AxisEnum axis) {
soft_endstop_max[X_AXIS] = dual_max_x;
}
else if (dxc_is_duplicating()) {
// In Duplication Mode, T0 can move as far left as X_MIN_POS
// In Duplication Mode, T0 can move as far left as X1_MIN_POS
// but not so far to the right that T1 would move past the end
soft_endstop_min[X_AXIS] = base_min_pos(X_AXIS);
soft_endstop_max[X_AXIS] = MIN(base_max_pos(X_AXIS), dual_max_x - duplicate_extruder_x_offset);
soft_endstop_min[X_AXIS] = X1_MIN_POS;
soft_endstop_max[X_AXIS] = MIN(X1_MAX_POS, dual_max_x - duplicate_extruder_x_offset);
}
else {
// In other modes, T0 can move from X_MIN_POS to X_MAX_POS
soft_endstop_min[axis] = base_min_pos(axis);
soft_endstop_max[axis] = base_max_pos(axis);
// In other modes, T0 can move from X1_MIN_POS to X1_MAX_POS
soft_endstop_min[X_AXIS] = X1_MIN_POS;
soft_endstop_max[X_AXIS] = X1_MAX_POS;
}
}
#elif ENABLED(DELTA)

View File

@ -22,13 +22,12 @@
#include "tool_change.h"
#include "probe.h"
#include "motion.h"
#include "planner.h"
#include "../Marlin.h"
#include "../inc/MarlinConfig.h"
#if ENABLED(PARKING_EXTRUDER) && PARKING_EXTRUDER_SOLENOIDS_DELAY > 0
#include "../gcode/gcode.h" // for dwell()
#endif
@ -57,6 +56,10 @@
#include "../feature/fanmux.h"
#endif
#if ENABLED(ULTIPANEL)
#include "../lcd/ultralcd.h"
#endif
#if DO_SWITCH_EXTRUDER
#if EXTRUDERS > 3
@ -498,11 +501,24 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
active_extruder = tmp_extruder;
update_software_endstops(X_AXIS);
active_extruder = !tmp_extruder;
// Don't move the new extruder out of bounds
if (!WITHIN(current_position[X_AXIS], soft_endstop_min[X_AXIS], soft_endstop_max[X_AXIS]))
no_move = true;
#else
// No software endstops? Use the configured limits
if (active_extruder == 0) {
if (!WITHIN(current_position[X_AXIS], X2_MIN_POS, X2_MAX_POS))
no_move = true;
}
else if (!WITHIN(current_position[X_AXIS], X1_MIN_POS, X1_MAX_POS))
no_move = true;
#endif
// Don't move the new extruder out of bounds
if (!WITHIN(current_position[X_AXIS], soft_endstop_min[X_AXIS], soft_endstop_max[X_AXIS]))
no_move = true;
#if ENABLED(ULTIPANEL)
lcd_return_to_status();
#endif
if (!no_move) set_destination_from_current();
dualx_tool_change(tmp_extruder, no_move); // Can modify no_move
@ -569,6 +585,13 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination);
#endif
#if ENABLED(DUAL_X_CARRIAGE)
// Dual x carriage does not properly apply these to current position due to command ordering
// So we apply the offsets for y and z to the destination here. X cannot have an offset in this mode
// as it is utilized for X2 home position.
destination[Y_AXIS] -= hotend_offset[Y_AXIS][active_extruder] - hotend_offset[Y_AXIS][tmp_extruder];
destination[Z_AXIS] -= hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder];
#endif
// Move back to the original (or tweaked) position
do_blocking_move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]);
#if ENABLED(DUAL_X_CARRIAGE)