Browse Source

Fix Dual X software endstops

Scott Lahteine 8 years ago
parent
commit
c47e07d129
1 changed files with 14 additions and 6 deletions
  1. 14
    6
      Marlin/Marlin_main.cpp

+ 14
- 6
Marlin/Marlin_main.cpp View File

@@ -1349,25 +1349,33 @@ void update_software_endstops(AxisEnum axis) {
1349 1349
   float offs = LOGICAL_POSITION(0, axis);
1350 1350
 
1351 1351
   #if ENABLED(DUAL_X_CARRIAGE)
1352
+    bool did_update = false;
1352 1353
     if (axis == X_AXIS) {
1354
+
1355
+      // In Dual X mode hotend_offset[X] is T1's home position
1353 1356
       float dual_max_x = max(hotend_offset[X_AXIS][1], X2_MAX_POS);
1357
+
1354 1358
       if (active_extruder != 0) {
1359
+        // T1 can move from X2_MIN_POS to X2_MAX_POS or X2 home position (whichever is larger)
1355 1360
         soft_endstop_min[X_AXIS] = X2_MIN_POS + offs;
1356 1361
         soft_endstop_max[X_AXIS] = dual_max_x + offs;
1357
-        return;
1358 1362
       }
1359 1363
       else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) {
1364
+        // In Duplication Mode, T0 can move as far left as X_MIN_POS
1365
+        // but not so far to the right that T1 would move past the end
1360 1366
         soft_endstop_min[X_AXIS] = base_min_pos(X_AXIS) + offs;
1361 1367
         soft_endstop_max[X_AXIS] = min(base_max_pos(X_AXIS), dual_max_x - duplicate_extruder_x_offset) + offs;
1362
-        return;
1368
+      }
1369
+      else {
1370
+        // In other modes, T0 can move from X_MIN_POS to X_MAX_POS
1371
+        soft_endstop_min[axis] = base_min_pos(axis) + offs;
1372
+        soft_endstop_max[axis] = base_max_pos(axis) + offs;
1363 1373
       }
1364 1374
     }
1365
-    else
1366
-  #endif
1367
-  {
1375
+  #else
1368 1376
     soft_endstop_min[axis] = base_min_pos(axis) + offs;
1369 1377
     soft_endstop_max[axis] = base_max_pos(axis) + offs;
1370
-  }
1378
+  #endif
1371 1379
 
1372 1380
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1373 1381
     if (DEBUGGING(LEVELING)) {

Loading…
Cancel
Save