Browse Source

Remove offsets from soft endstops, tool change

Scott Lahteine 7 years ago
parent
commit
06ee6584fd
2 changed files with 11 additions and 28 deletions
  1. 11
    20
      Marlin/src/module/motion.cpp
  2. 0
    8
      Marlin/src/module/tool_change.cpp

+ 11
- 20
Marlin/src/module/motion.cpp View File

1223
    * at the same positions relative to the machine.
1223
    * at the same positions relative to the machine.
1224
    */
1224
    */
1225
   void update_software_endstops(const AxisEnum axis) {
1225
   void update_software_endstops(const AxisEnum axis) {
1226
-    const float offs = 0.0
1227
-      #if HAS_HOME_OFFSET
1228
-        + home_offset[axis]
1229
-      #endif
1230
-      #if HAS_POSITION_SHIFT
1231
-        + position_shift[axis]
1232
-      #endif
1233
-    ;
1234
-
1235
     #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT
1226
     #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT
1236
-      workspace_offset[axis] = offs;
1227
+      workspace_offset[axis] = home_offset[axis] + position_shift[axis];
1237
     #endif
1228
     #endif
1238
 
1229
 
1239
     #if ENABLED(DUAL_X_CARRIAGE)
1230
     #if ENABLED(DUAL_X_CARRIAGE)
1244
 
1235
 
1245
         if (active_extruder != 0) {
1236
         if (active_extruder != 0) {
1246
           // T1 can move from X2_MIN_POS to X2_MAX_POS or X2 home position (whichever is larger)
1237
           // T1 can move from X2_MIN_POS to X2_MAX_POS or X2 home position (whichever is larger)
1247
-          soft_endstop_min[X_AXIS] = X2_MIN_POS + offs;
1248
-          soft_endstop_max[X_AXIS] = dual_max_x + offs;
1238
+          soft_endstop_min[X_AXIS] = X2_MIN_POS;
1239
+          soft_endstop_max[X_AXIS] = dual_max_x;
1249
         }
1240
         }
1250
         else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) {
1241
         else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) {
1251
           // In Duplication Mode, T0 can move as far left as X_MIN_POS
1242
           // In Duplication Mode, T0 can move as far left as X_MIN_POS
1252
           // but not so far to the right that T1 would move past the end
1243
           // but not so far to the right that T1 would move past the end
1253
-          soft_endstop_min[X_AXIS] = base_min_pos(X_AXIS) + offs;
1254
-          soft_endstop_max[X_AXIS] = min(base_max_pos(X_AXIS), dual_max_x - duplicate_extruder_x_offset) + offs;
1244
+          soft_endstop_min[X_AXIS] = base_min_pos(X_AXIS);
1245
+          soft_endstop_max[X_AXIS] = min(base_max_pos(X_AXIS), dual_max_x - duplicate_extruder_x_offset);
1255
         }
1246
         }
1256
         else {
1247
         else {
1257
           // In other modes, T0 can move from X_MIN_POS to X_MAX_POS
1248
           // In other modes, T0 can move from X_MIN_POS to X_MAX_POS
1258
-          soft_endstop_min[axis] = base_min_pos(axis) + offs;
1259
-          soft_endstop_max[axis] = base_max_pos(axis) + offs;
1249
+          soft_endstop_min[axis] = base_min_pos(axis);
1250
+          soft_endstop_max[axis] = base_max_pos(axis);
1260
         }
1251
         }
1261
       }
1252
       }
1262
     #elif ENABLED(DELTA)
1253
     #elif ENABLED(DELTA)
1263
-      soft_endstop_min[axis] = base_min_pos(axis) + offs;
1264
-      soft_endstop_max[axis] = (axis == Z_AXIS ? delta_height : base_max_pos(axis)) + offs;
1254
+      soft_endstop_min[axis] = base_min_pos(axis);
1255
+      soft_endstop_max[axis] = (axis == Z_AXIS ? delta_height : base_max_pos(axis));
1265
     #else
1256
     #else
1266
-      soft_endstop_min[axis] = base_min_pos(axis) + offs;
1267
-      soft_endstop_max[axis] = base_max_pos(axis) + offs;
1257
+      soft_endstop_min[axis] = base_min_pos(axis);
1258
+      soft_endstop_max[axis] = base_max_pos(axis);
1268
     #endif
1259
     #endif
1269
 
1260
 
1270
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1261
     #if ENABLED(DEBUG_LEVELING_FEATURE)

+ 0
- 8
Marlin/src/module/tool_change.cpp View File

475
           // The newly-selected extruder XY is actually at...
475
           // The newly-selected extruder XY is actually at...
476
           current_position[X_AXIS] += xydiff[X_AXIS];
476
           current_position[X_AXIS] += xydiff[X_AXIS];
477
           current_position[Y_AXIS] += xydiff[Y_AXIS];
477
           current_position[Y_AXIS] += xydiff[Y_AXIS];
478
-          #if HAS_WORKSPACE_OFFSET || ENABLED(DUAL_X_CARRIAGE) || ENABLED(PARKING_EXTRUDER)
479
-            for (uint8_t i = X_AXIS; i <= Y_AXIS; i++) {
480
-              #if HAS_POSITION_SHIFT
481
-                position_shift[i] += xydiff[i];
482
-              #endif
483
-              update_software_endstops((AxisEnum)i);
484
-            }
485
-          #endif
486
 
478
 
487
           // Set the new active extruder
479
           // Set the new active extruder
488
           active_extruder = tmp_extruder;
480
           active_extruder = tmp_extruder;

Loading…
Cancel
Save