Fix IDEX tool-change, and more (#13614)

This commit is contained in:
InsanityAutomation 2019-04-09 19:33:40 -04:00 committed by Scott Lahteine
parent ba31d39f6d
commit 4900c28bf6
11 changed files with 58 additions and 64 deletions

View file

@ -50,7 +50,7 @@
else { else {
hotend_offset[Z_AXIS][active_extruder] -= offs; hotend_offset[Z_AXIS][active_extruder] -= offs;
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOLNPAIR(MSG_IDEX_Z_OFFSET ": ", hotend_offset[Z_AXIS][active_extruder]); SERIAL_ECHOLNPAIR(MSG_Z_OFFSET ": ", hotend_offset[Z_AXIS][active_extruder]);
} }
#endif #endif
} }

View file

@ -101,10 +101,9 @@
#define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplizieren") #define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplizieren")
#define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Spiegelkopie") #define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Spiegelkopie")
#define MSG_IDEX_MODE_FULL_CTRL _UxGT("vollstä. Kontrolle") #define MSG_IDEX_MODE_FULL_CTRL _UxGT("vollstä. Kontrolle")
#define MSG_IDEX_X_OFFSET _UxGT("2. Düse X") #define MSG_X_OFFSET _UxGT("2. Düse X")
#define MSG_IDEX_Y_OFFSET _UxGT("2. Düse Y") #define MSG_Y_OFFSET _UxGT("2. Düse Y")
#define MSG_IDEX_Z_OFFSET _UxGT("2. Düse Z") #define MSG_Z_OFFSET _UxGT("2. Düse Z")
#define MSG_IDEX_SAVE_OFFSETS _UxGT("Versätze speichern")
#define MSG_UBL_MANUAL_MESH _UxGT("Netz manuell erst.") #define MSG_UBL_MANUAL_MESH _UxGT("Netz manuell erst.")
#define MSG_UBL_BC_INSERT _UxGT("Unterlegen & messen") #define MSG_UBL_BC_INSERT _UxGT("Unterlegen & messen")
#define MSG_UBL_BC_INSERT2 _UxGT("Messen") #define MSG_UBL_BC_INSERT2 _UxGT("Messen")

View file

@ -247,6 +247,9 @@
#ifndef MSG_IDEX_MENU #ifndef MSG_IDEX_MENU
#define MSG_IDEX_MENU _UxGT("IDEX Mode") #define MSG_IDEX_MENU _UxGT("IDEX Mode")
#endif #endif
#ifndef MSG_OFFSETS_MENU
#define MSG_OFFSETS_MENU _UxGT("Tool Offsets")
#endif
#ifndef MSG_IDEX_MODE_AUTOPARK #ifndef MSG_IDEX_MODE_AUTOPARK
#define MSG_IDEX_MODE_AUTOPARK _UxGT("Auto-Park") #define MSG_IDEX_MODE_AUTOPARK _UxGT("Auto-Park")
#endif #endif
@ -259,17 +262,14 @@
#ifndef MSG_IDEX_MODE_FULL_CTRL #ifndef MSG_IDEX_MODE_FULL_CTRL
#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Full control") #define MSG_IDEX_MODE_FULL_CTRL _UxGT("Full control")
#endif #endif
#ifndef MSG_IDEX_X_OFFSET #ifndef MSG_X_OFFSET
#define MSG_IDEX_X_OFFSET _UxGT("2nd nozzle X") #define MSG_X_OFFSET _UxGT("2nd nozzle X")
#endif #endif
#ifndef MSG_IDEX_Y_OFFSET #ifndef MSG_Y_OFFSET
#define MSG_IDEX_Y_OFFSET _UxGT("2nd nozzle Y") #define MSG_Y_OFFSET _UxGT("2nd nozzle Y")
#endif #endif
#ifndef MSG_IDEX_Z_OFFSET #ifndef MSG_Z_OFFSET
#define MSG_IDEX_Z_OFFSET _UxGT("2nd nozzle Z") #define MSG_Z_OFFSET _UxGT("2nd nozzle Z")
#endif
#ifndef MSG_IDEX_SAVE_OFFSETS
#define MSG_IDEX_SAVE_OFFSETS _UxGT("Save Offsets")
#endif #endif
#ifndef MSG_UBL_MANUAL_MESH #ifndef MSG_UBL_MANUAL_MESH
#define MSG_UBL_MANUAL_MESH _UxGT("Manually Build Mesh") #define MSG_UBL_MANUAL_MESH _UxGT("Manually Build Mesh")

View file

@ -99,10 +99,9 @@
#define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplicazione") #define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplicazione")
#define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Copia speculare") #define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Copia speculare")
#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Pieno controllo") #define MSG_IDEX_MODE_FULL_CTRL _UxGT("Pieno controllo")
#define MSG_IDEX_X_OFFSET _UxGT("2° ugello X") #define MSG_X_OFFSET _UxGT("2° ugello X")
#define MSG_IDEX_Y_OFFSET _UxGT("2° ugello Y") #define MSG_Y_OFFSET _UxGT("2° ugello Y")
#define MSG_IDEX_Z_OFFSET _UxGT("2° ugello Z") #define MSG_Z_OFFSET _UxGT("2° ugello Z")
#define MSG_IDEX_SAVE_OFFSETS _UxGT("Memorizza Offsets")
#define MSG_UBL_MANUAL_MESH _UxGT("Mesh Manuale") #define MSG_UBL_MANUAL_MESH _UxGT("Mesh Manuale")
#define MSG_UBL_BC_INSERT _UxGT("Metti spes. e misura") #define MSG_UBL_BC_INSERT _UxGT("Metti spes. e misura")
#define MSG_UBL_BC_INSERT2 _UxGT("Misura") #define MSG_UBL_BC_INSERT2 _UxGT("Misura")

View file

@ -90,10 +90,9 @@
#define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplication") #define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplication")
#define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("미러 사본") #define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("미러 사본")
#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Full control") #define MSG_IDEX_MODE_FULL_CTRL _UxGT("Full control")
#define MSG_IDEX_X_OFFSET _UxGT("2nd nozzle X") #define MSG_X_OFFSET _UxGT("2nd nozzle X")
#define MSG_IDEX_Y_OFFSET _UxGT("2nd nozzle Y") #define MSG_Y_OFFSET _UxGT("2nd nozzle Y")
#define MSG_IDEX_Z_OFFSET _UxGT("2nd nozzle Z") #define MSG_Z_OFFSET _UxGT("2nd nozzle Z")
#define MSG_IDEX_SAVE_OFFSETS _UxGT("Save Offsets")
#define MSG_UBL_MANUAL_MESH _UxGT("Manually Build Mesh") #define MSG_UBL_MANUAL_MESH _UxGT("Manually Build Mesh")
#define MSG_UBL_BC_INSERT _UxGT("Place shim & measure") #define MSG_UBL_BC_INSERT _UxGT("Place shim & measure")
#define MSG_UBL_BC_INSERT2 _UxGT("Measure") #define MSG_UBL_BC_INSERT2 _UxGT("Measure")

View file

@ -101,10 +101,9 @@
#define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplicação") #define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplicação")
#define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Cópia espelhada") #define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Cópia espelhada")
#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Controle Total") #define MSG_IDEX_MODE_FULL_CTRL _UxGT("Controle Total")
#define MSG_IDEX_X_OFFSET _UxGT("2o bico X") #define MSG_X_OFFSET _UxGT("2o bico X")
#define MSG_IDEX_Y_OFFSET _UxGT("2o bico Y") #define MSG_Y_OFFSET _UxGT("2o bico Y")
#define MSG_IDEX_Z_OFFSET _UxGT("2o bico Z") #define MSG_Z_OFFSET _UxGT("2o bico Z")
#define MSG_IDEX_SAVE_OFFSETS _UxGT("Salvar Compensação")
#define MSG_UBL_MANUAL_MESH _UxGT("Fazer malha manual") #define MSG_UBL_MANUAL_MESH _UxGT("Fazer malha manual")
#define MSG_UBL_BC_INSERT _UxGT("Calçar e calibrar") #define MSG_UBL_BC_INSERT _UxGT("Calçar e calibrar")

View file

@ -108,10 +108,9 @@
#define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplikácia") #define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplikácia")
#define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Zrkadlená kópia") #define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Zrkadlená kópia")
#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Plná kontrola") #define MSG_IDEX_MODE_FULL_CTRL _UxGT("Plná kontrola")
#define MSG_IDEX_X_OFFSET _UxGT("2. tryska X") #define MSG_X_OFFSET _UxGT("2. tryska X")
#define MSG_IDEX_Y_OFFSET _UxGT("2. tryska Y") #define MSG_Y_OFFSET _UxGT("2. tryska Y")
#define MSG_IDEX_Z_OFFSET _UxGT("2. tryska Z") #define MSG_Z_OFFSET _UxGT("2. tryska Z")
#define MSG_IDEX_SAVE_OFFSETS _UxGT("Uložiť offsety")
#define MSG_UBL_MANUAL_MESH _UxGT("Manuálna sieť bodov") #define MSG_UBL_MANUAL_MESH _UxGT("Manuálna sieť bodov")
#define MSG_UBL_BC_INSERT _UxGT("Položte a zmerajte") #define MSG_UBL_BC_INSERT _UxGT("Položte a zmerajte")
#define MSG_UBL_BC_INSERT2 _UxGT("Zmerajte") #define MSG_UBL_BC_INSERT2 _UxGT("Zmerajte")

View file

@ -100,10 +100,9 @@
#define MSG_IDEX_MODE_DUPLICATE _UxGT("Kopyala") #define MSG_IDEX_MODE_DUPLICATE _UxGT("Kopyala")
#define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Yansıtılmış kopya") #define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Yansıtılmış kopya")
#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Tam Kontrol") #define MSG_IDEX_MODE_FULL_CTRL _UxGT("Tam Kontrol")
#define MSG_IDEX_X_OFFSET _UxGT("2. nozul X") #define MSG_X_OFFSET _UxGT("2. nozul X")
#define MSG_IDEX_Y_OFFSET _UxGT("2. nozul Y") #define MSG_Y_OFFSET _UxGT("2. nozul Y")
#define MSG_IDEX_Z_OFFSET _UxGT("2. nozul Z") #define MSG_Z_OFFSET _UxGT("2. nozul Z")
#define MSG_IDEX_SAVE_OFFSETS _UxGT("Ofsetleri Kaydet")
#define MSG_UBL_MANUAL_MESH _UxGT("Elle Mesh Oluştur") #define MSG_UBL_MANUAL_MESH _UxGT("Elle Mesh Oluştur")
#define MSG_UBL_BC_INSERT _UxGT("Altlık & Ölçü Ver") #define MSG_UBL_BC_INSERT _UxGT("Altlık & Ölçü Ver")
#define MSG_UBL_BC_INSERT2 _UxGT("Ölçü") #define MSG_UBL_BC_INSERT2 _UxGT("Ölçü")

View file

@ -391,7 +391,7 @@ void MarlinUI::completion_feedback(const bool good/*=true*/) {
if (ui.should_draw()) { if (ui.should_draw()) {
#if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
if (!do_probe) if (!do_probe)
draw_edit_screen(PSTR(MSG_IDEX_Z_OFFSET), ftostr43sign(hotend_offset[Z_AXIS][active_extruder])); draw_edit_screen(PSTR(MSG_Z_OFFSET), ftostr43sign(hotend_offset[Z_AXIS][active_extruder]));
else else
#endif #endif
draw_edit_screen(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset)); draw_edit_screen(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset));

View file

@ -119,19 +119,37 @@ static void lcd_factory_settings() {
#endif #endif
#if ENABLED(DUAL_X_CARRIAGE) #if HAS_HOTEND_OFFSET
#include "../../module/motion.h" #include "../../module/motion.h"
#include "../../gcode/queue.h" #include "../../gcode/queue.h"
void _recalc_IDEX_settings() { void _recalc_offsets() {
if (active_extruder) { // For the 2nd extruder re-home so the next tool-change gets the new offsets. if (active_extruder && all_axes_known()) { // For the 2nd extruder re-home so the next tool-change gets the new offsets.
enqueue_and_echo_commands_P(PSTR("G28")); // In future, we can babystep the 2nd extruder (if active), making homing unnecessary. enqueue_and_echo_commands_P(PSTR("G28")); // In future, we can babystep the 2nd extruder (if active), making homing unnecessary.
active_extruder = 0; active_extruder = 0;
} }
} }
void menu_IDEX() { void menu_tool_offsets() {
START_MENU();
MENU_BACK(MSG_MAIN);
#if ENABLED(DUAL_X_CARRIAGE)
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_X_OFFSET, &hotend_offset[X_AXIS][1], MIN(X2_HOME_POS, X2_MAX_POS) - 25.0, MAX(X2_HOME_POS, X2_MAX_POS) + 25.0, _recalc_offsets);
#else
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_X_OFFSET, &hotend_offset[X_AXIS][1], -10.0, 10.0, _recalc_offsets);
#endif
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_Y_OFFSET, &hotend_offset[Y_AXIS][1], -10.0, 10.0, _recalc_offsets);
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_Z_OFFSET, &hotend_offset[Z_AXIS][1], Z_PROBE_LOW_POINT, 10.0, _recalc_offsets);
#if ENABLED(EEPROM_SETTINGS)
MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings);
#endif
END_MENU();
}
#endif
#if ENABLED(DUAL_X_CARRIAGE)
void menu_idex() {
START_MENU(); START_MENU();
MENU_BACK(MSG_MAIN); MENU_BACK(MSG_MAIN);
@ -146,10 +164,6 @@ static void lcd_factory_settings() {
: PSTR("M605 S1\nT0\nM605 S2 X200\nG28 X\nG1 X100\nM605 S3 X200") : PSTR("M605 S1\nT0\nM605 S2 X200\nG28 X\nG1 X100\nM605 S3 X200")
); );
MENU_ITEM(gcode, MSG_IDEX_MODE_FULL_CTRL, PSTR("M605 S0\nG28 X")); MENU_ITEM(gcode, MSG_IDEX_MODE_FULL_CTRL, PSTR("M605 S0\nG28 X"));
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_IDEX_X_OFFSET , &hotend_offset[X_AXIS][1], MIN(X2_HOME_POS, X2_MAX_POS) - 25.0, MAX(X2_HOME_POS, X2_MAX_POS) + 25.0, _recalc_IDEX_settings);
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_IDEX_Y_OFFSET , &hotend_offset[Y_AXIS][1], -10.0, 10.0, _recalc_IDEX_settings);
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_IDEX_Z_OFFSET , &hotend_offset[Z_AXIS][1], -10.0, 10.0, _recalc_IDEX_settings);
MENU_ITEM(gcode, MSG_IDEX_SAVE_OFFSETS, PSTR("M500"));
END_MENU(); END_MENU();
} }
@ -287,8 +301,12 @@ void menu_configuration() {
MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, menu_delta_calibrate); MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, menu_delta_calibrate);
#endif #endif
#if HAS_HOTEND_OFFSET
MENU_ITEM(submenu, MSG_OFFSETS_MENU, menu_tool_offsets);
#endif
#if ENABLED(DUAL_X_CARRIAGE) #if ENABLED(DUAL_X_CARRIAGE)
MENU_ITEM(submenu, MSG_IDEX_MENU, menu_IDEX); MENU_ITEM(submenu, MSG_IDEX_MENU, menu_idex);
#endif #endif
#if ENABLED(BLTOUCH) #if ENABLED(BLTOUCH)

View file

@ -121,7 +121,7 @@
void move_nozzle_servo(const uint8_t angle_index) { void move_nozzle_servo(const uint8_t angle_index) {
planner.synchronize(); planner.synchronize();
MOVE_SERVO(SWITCHING_NOZZLE_SERVO_NR, servo_angles[SWITCHING_NOZZLE_SERVO_NR][e]); MOVE_SERVO(SWITCHING_NOZZLE_SERVO_NR, servo_angles[SWITCHING_NOZZLE_SERVO_NR][angle_index]);
safe_delay(500); safe_delay(500);
} }
@ -519,10 +519,6 @@ inline void invalid_extruder_error(const uint8_t e) {
planner.synchronize(); planner.synchronize();
} }
// Apply Y & Z extruder offset (X offset is used as home pos with Dual X)
current_position[Y_AXIS] -= hotend_offset[Y_AXIS][active_extruder] - hotend_offset[Y_AXIS][tmp_extruder];
current_position[Z_AXIS] -= hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder];
// Activate the new extruder ahead of calling set_axis_is_at_home! // Activate the new extruder ahead of calling set_axis_is_at_home!
active_extruder = tmp_extruder; active_extruder = tmp_extruder;
@ -784,20 +780,6 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
lower_nozzle(active_extruder); lower_nozzle(active_extruder);
#endif #endif
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP) && ADVANCED_PAUSE_RESUME_PRIME != 0
if (should_swap && !too_cold) {
const float resume_eaxis = current_position[E_AXIS];
#if ENABLED(ADVANCED_PAUSE_FEATURE)
do_pause_e_move(toolchange_settings.swap_length, toolchange_settings.prime_speed);
#else
current_position[E_AXIS] += (ADVANCED_PAUSE_RESUME_PRIME) / planner.e_factor[active_extruder];
planner.buffer_line(current_position, ADVANCED_PAUSE_PURGE_FEEDRATE, active_extruder);
#endif
planner.synchronize();
planner.set_e_position_mm((destination[E_AXIS] = current_position[E_AXIS] = resume_eaxis));
}
#endif
} // (tmp_extruder != active_extruder) } // (tmp_extruder != active_extruder)
planner.synchronize(); planner.synchronize();