浏览代码

Implement DUAL_NOZZLE_DUPLICATION_MODE

Scott Lahteine 9 年前
父节点
当前提交
cbc7f22ad9
共有 4 个文件被更改,包括 29 次插入11 次删除
  1. 1
    1
      Marlin/Marlin.h
  2. 26
    9
      Marlin/Marlin_main.cpp
  3. 1
    0
      Marlin/language.h
  4. 1
    1
      Marlin/stepper_indirection.h

+ 1
- 1
Marlin/Marlin.h 查看文件

134
 
134
 
135
 void manage_inactivity(bool ignore_stepper_queue = false);
135
 void manage_inactivity(bool ignore_stepper_queue = false);
136
 
136
 
137
-#if ENABLED(DUAL_X_CARRIAGE)
137
+#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
138
   extern bool extruder_duplication_enabled;
138
   extern bool extruder_duplication_enabled;
139
 #endif
139
 #endif
140
 
140
 

+ 26
- 9
Marlin/Marlin_main.cpp 查看文件

1392
 XYZ_CONSTS_FROM_CONFIG(float, home_bump_mm,   HOME_BUMP_MM);
1392
 XYZ_CONSTS_FROM_CONFIG(float, home_bump_mm,   HOME_BUMP_MM);
1393
 XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
1393
 XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
1394
 
1394
 
1395
+#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
1396
+  bool extruder_duplication_enabled = false; // Used in Dual X mode 2
1397
+#endif
1398
+
1395
 #if ENABLED(DUAL_X_CARRIAGE)
1399
 #if ENABLED(DUAL_X_CARRIAGE)
1396
 
1400
 
1397
   #define DXC_FULL_CONTROL_MODE 0
1401
   #define DXC_FULL_CONTROL_MODE 0
1423
   static millis_t delayed_move_time = 0; // used in mode 1
1427
   static millis_t delayed_move_time = 0; // used in mode 1
1424
   static float duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2
1428
   static float duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2
1425
   static float duplicate_extruder_temp_offset = 0; // used in mode 2
1429
   static float duplicate_extruder_temp_offset = 0; // used in mode 2
1426
-  bool extruder_duplication_enabled = false; // used in mode 2
1427
 
1430
 
1428
 #endif //DUAL_X_CARRIAGE
1431
 #endif //DUAL_X_CARRIAGE
1429
 
1432
 
2820
     current_position[X_AXIS] = current_position[Y_AXIS] = 0.0;
2823
     current_position[X_AXIS] = current_position[Y_AXIS] = 0.0;
2821
     sync_plan_position();
2824
     sync_plan_position();
2822
 
2825
 
2823
-    #if ENABLED(DUAL_X_CARRIAGE)
2824
-      int x_axis_home_dir = x_home_dir(active_extruder);
2825
-      extruder_duplication_enabled = false;
2826
-    #else
2827
-      int x_axis_home_dir = home_dir(X_AXIS);
2828
-    #endif
2826
+    int x_axis_home_dir =
2827
+      #if ENABLED(DUAL_X_CARRIAGE)
2828
+        x_home_dir(active_extruder)
2829
+      #else
2830
+        home_dir(X_AXIS)
2831
+      #endif
2832
+    ;
2829
 
2833
 
2830
     float mlx = max_length(X_AXIS),
2834
     float mlx = max_length(X_AXIS),
2831
           mly = max_length(Y_AXIS),
2835
           mly = max_length(Y_AXIS),
2878
     tool_change(0, 0, true);
2882
     tool_change(0, 0, true);
2879
   #endif
2883
   #endif
2880
 
2884
 
2885
+  #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
2886
+    extruder_duplication_enabled = false;
2887
+  #endif
2888
+
2881
   /**
2889
   /**
2882
    * For mesh bed leveling deactivate the mesh calculations, will be turned
2890
    * For mesh bed leveling deactivate the mesh calculations, will be turned
2883
    * on again when homing all axis
2891
    * on again when homing all axis
2996
     if (home_all_axis || homeX) {
3004
     if (home_all_axis || homeX) {
2997
       #if ENABLED(DUAL_X_CARRIAGE)
3005
       #if ENABLED(DUAL_X_CARRIAGE)
2998
         int tmp_extruder = active_extruder;
3006
         int tmp_extruder = active_extruder;
2999
-        extruder_duplication_enabled = false;
3000
         active_extruder = !active_extruder;
3007
         active_extruder = !active_extruder;
3001
         HOMEAXIS(X);
3008
         HOMEAXIS(X);
3002
         inactive_extruder_x_pos = current_position[X_AXIS];
3009
         inactive_extruder_x_pos = current_position[X_AXIS];
6473
     delayed_move_time = 0;
6480
     delayed_move_time = 0;
6474
   }
6481
   }
6475
 
6482
 
6476
-#endif // DUAL_X_CARRIAGE
6483
+#elif ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
6484
+
6485
+  inline void gcode_M605() {
6486
+    stepper.synchronize();
6487
+    extruder_duplication_enabled = code_seen('S') && code_value_int() == 2;
6488
+    SERIAL_ECHO_START;
6489
+    SERIAL_ECHOPAIR(MSG_DUPLICATION_MODE, extruder_duplication_enabled ? MSG_ON : MSG_OFF);
6490
+    SERIAL_EOL;
6491
+  }
6492
+
6493
+#endif // M605
6477
 
6494
 
6478
 #if ENABLED(LIN_ADVANCE)
6495
 #if ENABLED(LIN_ADVANCE)
6479
   /**
6496
   /**

+ 1
- 0
Marlin/language.h 查看文件

159
 #define MSG_ENDSTOP_HIT                     "TRIGGERED"
159
 #define MSG_ENDSTOP_HIT                     "TRIGGERED"
160
 #define MSG_ENDSTOP_OPEN                    "open"
160
 #define MSG_ENDSTOP_OPEN                    "open"
161
 #define MSG_HOTEND_OFFSET                   "Hotend offsets:"
161
 #define MSG_HOTEND_OFFSET                   "Hotend offsets:"
162
+#define MSG_DUPLICATION_MODE                "Duplication mode: "
162
 
163
 
163
 #define MSG_SD_CANT_OPEN_SUBDIR             "Cannot open subdir "
164
 #define MSG_SD_CANT_OPEN_SUBDIR             "Cannot open subdir "
164
 #define MSG_SD_INIT_FAIL                    "SD init fail"
165
 #define MSG_SD_INIT_FAIL                    "SD init fail"

+ 1
- 1
Marlin/stepper_indirection.h 查看文件

195
   #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); } }
195
   #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); } }
196
   #define REV_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(INVERT_E2_DIR); } }
196
   #define REV_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(INVERT_E2_DIR); } }
197
 #elif EXTRUDERS > 1
197
 #elif EXTRUDERS > 1
198
-  #if DISABLED(DUAL_X_CARRIAGE)
198
+  #if DISABLED(DUAL_X_CARRIAGE) && DISABLED(DUAL_NOZZLE_DUPLICATION_MODE)
199
     #define E_STEP_WRITE(v) { if (current_block->active_extruder == 0) { E0_STEP_WRITE(v); } else { E1_STEP_WRITE(v); } }
199
     #define E_STEP_WRITE(v) { if (current_block->active_extruder == 0) { E0_STEP_WRITE(v); } else { E1_STEP_WRITE(v); } }
200
     #define NORM_E_DIR() { if (current_block->active_extruder == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } }
200
     #define NORM_E_DIR() { if (current_block->active_extruder == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } }
201
     #define REV_E_DIR() { if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } }
201
     #define REV_E_DIR() { if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } }

正在加载...
取消
保存