Fix IDEX tool-change, and more (#13614)
This commit is contained in:
		
				
					committed by
					
						
						Scott Lahteine
					
				
			
			
				
	
			
			
			
						parent
						
							ba31d39f6d
						
					
				
				
					commit
					4900c28bf6
				
			@@ -50,7 +50,7 @@
 | 
			
		||||
      else {
 | 
			
		||||
        hotend_offset[Z_AXIS][active_extruder] -= offs;
 | 
			
		||||
        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
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -101,10 +101,9 @@
 | 
			
		||||
#define MSG_IDEX_MODE_DUPLICATE             _UxGT("Duplizieren")
 | 
			
		||||
#define MSG_IDEX_MODE_MIRRORED_COPY         _UxGT("Spiegelkopie")
 | 
			
		||||
#define MSG_IDEX_MODE_FULL_CTRL             _UxGT("vollstä. Kontrolle")
 | 
			
		||||
#define MSG_IDEX_X_OFFSET                   _UxGT("2. Düse X")
 | 
			
		||||
#define MSG_IDEX_Y_OFFSET                   _UxGT("2. Düse Y")
 | 
			
		||||
#define MSG_IDEX_Z_OFFSET                   _UxGT("2. Düse Z")
 | 
			
		||||
#define MSG_IDEX_SAVE_OFFSETS               _UxGT("Versätze speichern")
 | 
			
		||||
#define MSG_X_OFFSET                        _UxGT("2. Düse X")
 | 
			
		||||
#define MSG_Y_OFFSET                        _UxGT("2. Düse Y")
 | 
			
		||||
#define MSG_Z_OFFSET                        _UxGT("2. Düse Z")
 | 
			
		||||
#define MSG_UBL_MANUAL_MESH                 _UxGT("Netz manuell erst.")
 | 
			
		||||
#define MSG_UBL_BC_INSERT                   _UxGT("Unterlegen & messen")
 | 
			
		||||
#define MSG_UBL_BC_INSERT2                  _UxGT("Messen")
 | 
			
		||||
 
 | 
			
		||||
@@ -247,6 +247,9 @@
 | 
			
		||||
#ifndef MSG_IDEX_MENU
 | 
			
		||||
  #define MSG_IDEX_MENU                       _UxGT("IDEX Mode")
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef MSG_OFFSETS_MENU
 | 
			
		||||
  #define MSG_OFFSETS_MENU                    _UxGT("Tool Offsets")
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef MSG_IDEX_MODE_AUTOPARK
 | 
			
		||||
  #define MSG_IDEX_MODE_AUTOPARK              _UxGT("Auto-Park")
 | 
			
		||||
#endif
 | 
			
		||||
@@ -259,17 +262,14 @@
 | 
			
		||||
#ifndef MSG_IDEX_MODE_FULL_CTRL
 | 
			
		||||
  #define MSG_IDEX_MODE_FULL_CTRL             _UxGT("Full control")
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef MSG_IDEX_X_OFFSET
 | 
			
		||||
  #define MSG_IDEX_X_OFFSET                   _UxGT("2nd nozzle X")
 | 
			
		||||
#ifndef MSG_X_OFFSET
 | 
			
		||||
  #define MSG_X_OFFSET                        _UxGT("2nd nozzle X")
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef MSG_IDEX_Y_OFFSET
 | 
			
		||||
  #define MSG_IDEX_Y_OFFSET                   _UxGT("2nd nozzle Y")
 | 
			
		||||
#ifndef MSG_Y_OFFSET
 | 
			
		||||
  #define MSG_Y_OFFSET                        _UxGT("2nd nozzle Y")
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef MSG_IDEX_Z_OFFSET
 | 
			
		||||
  #define MSG_IDEX_Z_OFFSET                   _UxGT("2nd nozzle Z")
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef MSG_IDEX_SAVE_OFFSETS
 | 
			
		||||
  #define MSG_IDEX_SAVE_OFFSETS               _UxGT("Save Offsets")
 | 
			
		||||
#ifndef MSG_Z_OFFSET
 | 
			
		||||
  #define MSG_Z_OFFSET                        _UxGT("2nd nozzle Z")
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef MSG_UBL_MANUAL_MESH
 | 
			
		||||
  #define MSG_UBL_MANUAL_MESH                 _UxGT("Manually Build Mesh")
 | 
			
		||||
 
 | 
			
		||||
@@ -99,10 +99,9 @@
 | 
			
		||||
#define MSG_IDEX_MODE_DUPLICATE             _UxGT("Duplicazione")
 | 
			
		||||
#define MSG_IDEX_MODE_MIRRORED_COPY         _UxGT("Copia speculare")
 | 
			
		||||
#define MSG_IDEX_MODE_FULL_CTRL             _UxGT("Pieno controllo")
 | 
			
		||||
#define MSG_IDEX_X_OFFSET                   _UxGT("2° ugello X")
 | 
			
		||||
#define MSG_IDEX_Y_OFFSET                   _UxGT("2° ugello Y")
 | 
			
		||||
#define MSG_IDEX_Z_OFFSET                   _UxGT("2° ugello Z")
 | 
			
		||||
#define MSG_IDEX_SAVE_OFFSETS               _UxGT("Memorizza Offsets")
 | 
			
		||||
#define MSG_X_OFFSET                        _UxGT("2° ugello X")
 | 
			
		||||
#define MSG_Y_OFFSET                        _UxGT("2° ugello Y")
 | 
			
		||||
#define MSG_Z_OFFSET                        _UxGT("2° ugello Z")
 | 
			
		||||
#define MSG_UBL_MANUAL_MESH                 _UxGT("Mesh Manuale")
 | 
			
		||||
#define MSG_UBL_BC_INSERT                   _UxGT("Metti spes. e misura")
 | 
			
		||||
#define MSG_UBL_BC_INSERT2                  _UxGT("Misura")
 | 
			
		||||
 
 | 
			
		||||
@@ -90,10 +90,9 @@
 | 
			
		||||
#define MSG_IDEX_MODE_DUPLICATE             _UxGT("Duplication")
 | 
			
		||||
#define MSG_IDEX_MODE_MIRRORED_COPY         _UxGT("미러 사본")
 | 
			
		||||
#define MSG_IDEX_MODE_FULL_CTRL             _UxGT("Full control")
 | 
			
		||||
#define MSG_IDEX_X_OFFSET                   _UxGT("2nd nozzle X")
 | 
			
		||||
#define MSG_IDEX_Y_OFFSET                   _UxGT("2nd nozzle Y")
 | 
			
		||||
#define MSG_IDEX_Z_OFFSET                   _UxGT("2nd nozzle Z")
 | 
			
		||||
#define MSG_IDEX_SAVE_OFFSETS               _UxGT("Save Offsets")
 | 
			
		||||
#define MSG_X_OFFSET                        _UxGT("2nd nozzle X")
 | 
			
		||||
#define MSG_Y_OFFSET                        _UxGT("2nd nozzle Y")
 | 
			
		||||
#define MSG_Z_OFFSET                        _UxGT("2nd nozzle Z")
 | 
			
		||||
#define MSG_UBL_MANUAL_MESH                 _UxGT("Manually Build Mesh")
 | 
			
		||||
#define MSG_UBL_BC_INSERT                   _UxGT("Place shim & measure")
 | 
			
		||||
#define MSG_UBL_BC_INSERT2                  _UxGT("Measure")
 | 
			
		||||
 
 | 
			
		||||
@@ -101,10 +101,9 @@
 | 
			
		||||
#define MSG_IDEX_MODE_DUPLICATE             _UxGT("Duplicação")
 | 
			
		||||
#define MSG_IDEX_MODE_MIRRORED_COPY         _UxGT("Cópia espelhada")
 | 
			
		||||
#define MSG_IDEX_MODE_FULL_CTRL             _UxGT("Controle Total")
 | 
			
		||||
#define MSG_IDEX_X_OFFSET                   _UxGT("2o bico X")
 | 
			
		||||
#define MSG_IDEX_Y_OFFSET                   _UxGT("2o bico Y")
 | 
			
		||||
#define MSG_IDEX_Z_OFFSET                   _UxGT("2o bico Z")
 | 
			
		||||
#define MSG_IDEX_SAVE_OFFSETS               _UxGT("Salvar Compensação")
 | 
			
		||||
#define MSG_X_OFFSET                        _UxGT("2o bico X")
 | 
			
		||||
#define MSG_Y_OFFSET                        _UxGT("2o bico Y")
 | 
			
		||||
#define MSG_Z_OFFSET                        _UxGT("2o bico Z")
 | 
			
		||||
 | 
			
		||||
#define MSG_UBL_MANUAL_MESH                 _UxGT("Fazer malha manual")
 | 
			
		||||
#define MSG_UBL_BC_INSERT                   _UxGT("Calçar e calibrar")
 | 
			
		||||
 
 | 
			
		||||
@@ -108,10 +108,9 @@
 | 
			
		||||
#define MSG_IDEX_MODE_DUPLICATE             _UxGT("Duplikácia")
 | 
			
		||||
#define MSG_IDEX_MODE_MIRRORED_COPY         _UxGT("Zrkadlená kópia")
 | 
			
		||||
#define MSG_IDEX_MODE_FULL_CTRL             _UxGT("Plná kontrola")
 | 
			
		||||
#define MSG_IDEX_X_OFFSET                   _UxGT("2. tryska X")
 | 
			
		||||
#define MSG_IDEX_Y_OFFSET                   _UxGT("2. tryska Y")
 | 
			
		||||
#define MSG_IDEX_Z_OFFSET                   _UxGT("2. tryska Z")
 | 
			
		||||
#define MSG_IDEX_SAVE_OFFSETS               _UxGT("Uložiť offsety")
 | 
			
		||||
#define MSG_X_OFFSET                        _UxGT("2. tryska X")
 | 
			
		||||
#define MSG_Y_OFFSET                        _UxGT("2. tryska Y")
 | 
			
		||||
#define MSG_Z_OFFSET                        _UxGT("2. tryska Z")
 | 
			
		||||
#define MSG_UBL_MANUAL_MESH                 _UxGT("Manuálna sieť bodov")
 | 
			
		||||
#define MSG_UBL_BC_INSERT                   _UxGT("Položte a zmerajte")
 | 
			
		||||
#define MSG_UBL_BC_INSERT2                  _UxGT("Zmerajte")
 | 
			
		||||
 
 | 
			
		||||
@@ -100,10 +100,9 @@
 | 
			
		||||
#define MSG_IDEX_MODE_DUPLICATE             _UxGT("Kopyala")
 | 
			
		||||
#define MSG_IDEX_MODE_MIRRORED_COPY         _UxGT("Yansıtılmış kopya")
 | 
			
		||||
#define MSG_IDEX_MODE_FULL_CTRL             _UxGT("Tam Kontrol")
 | 
			
		||||
#define MSG_IDEX_X_OFFSET                   _UxGT("2. nozul X")
 | 
			
		||||
#define MSG_IDEX_Y_OFFSET                   _UxGT("2. nozul Y")
 | 
			
		||||
#define MSG_IDEX_Z_OFFSET                   _UxGT("2. nozul Z")
 | 
			
		||||
#define MSG_IDEX_SAVE_OFFSETS               _UxGT("Ofsetleri Kaydet")
 | 
			
		||||
#define MSG_X_OFFSET                        _UxGT("2. nozul X")
 | 
			
		||||
#define MSG_Y_OFFSET                        _UxGT("2. nozul Y")
 | 
			
		||||
#define MSG_Z_OFFSET                        _UxGT("2. nozul Z")
 | 
			
		||||
#define MSG_UBL_MANUAL_MESH                 _UxGT("Elle Mesh Oluştur")
 | 
			
		||||
#define MSG_UBL_BC_INSERT                   _UxGT("Altlık & Ölçü Ver")
 | 
			
		||||
#define MSG_UBL_BC_INSERT2                  _UxGT("Ölçü")
 | 
			
		||||
 
 | 
			
		||||
@@ -391,7 +391,7 @@ void MarlinUI::completion_feedback(const bool good/*=true*/) {
 | 
			
		||||
    if (ui.should_draw()) {
 | 
			
		||||
      #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
 | 
			
		||||
        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
 | 
			
		||||
      #endif
 | 
			
		||||
          draw_edit_screen(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset));
 | 
			
		||||
 
 | 
			
		||||
@@ -119,19 +119,37 @@ static void lcd_factory_settings() {
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if ENABLED(DUAL_X_CARRIAGE)
 | 
			
		||||
 | 
			
		||||
#if HAS_HOTEND_OFFSET
 | 
			
		||||
  #include "../../module/motion.h"
 | 
			
		||||
  #include "../../gcode/queue.h"
 | 
			
		||||
 | 
			
		||||
  void _recalc_IDEX_settings() {
 | 
			
		||||
    if (active_extruder) {                      // For the 2nd extruder re-home so the next tool-change gets the new offsets.
 | 
			
		||||
  void _recalc_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.
 | 
			
		||||
      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();
 | 
			
		||||
    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")
 | 
			
		||||
    );
 | 
			
		||||
    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();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -287,8 +301,12 @@ void menu_configuration() {
 | 
			
		||||
      MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, menu_delta_calibrate);
 | 
			
		||||
    #endif
 | 
			
		||||
 | 
			
		||||
    #if HAS_HOTEND_OFFSET
 | 
			
		||||
      MENU_ITEM(submenu, MSG_OFFSETS_MENU, menu_tool_offsets);
 | 
			
		||||
    #endif
 | 
			
		||||
 | 
			
		||||
    #if ENABLED(DUAL_X_CARRIAGE)
 | 
			
		||||
      MENU_ITEM(submenu, MSG_IDEX_MENU, menu_IDEX);
 | 
			
		||||
      MENU_ITEM(submenu, MSG_IDEX_MENU, menu_idex);
 | 
			
		||||
    #endif
 | 
			
		||||
 | 
			
		||||
    #if ENABLED(BLTOUCH)
 | 
			
		||||
 
 | 
			
		||||
@@ -121,7 +121,7 @@
 | 
			
		||||
 | 
			
		||||
    void move_nozzle_servo(const uint8_t angle_index) {
 | 
			
		||||
      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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -519,10 +519,6 @@ inline void invalid_extruder_error(const uint8_t e) {
 | 
			
		||||
      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!
 | 
			
		||||
    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);
 | 
			
		||||
      #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)
 | 
			
		||||
 | 
			
		||||
    planner.synchronize();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user