Browse Source

Merge pull request #8382 from thinkyhead/bf2_native_followup

[2.0] Remove offsets from soft endstops, tool change
Scott Lahteine 7 years ago
parent
commit
e1e68e4c95
No account linked to committer's email address
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,17 +1223,8 @@ void homeaxis(const AxisEnum axis) {
1223 1223
    * at the same positions relative to the machine.
1224 1224
    */
1225 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 1226
     #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT
1236
-      workspace_offset[axis] = offs;
1227
+      workspace_offset[axis] = home_offset[axis] + position_shift[axis];
1237 1228
     #endif
1238 1229
 
1239 1230
     #if ENABLED(DUAL_X_CARRIAGE)
@@ -1244,27 +1235,27 @@ void homeaxis(const AxisEnum axis) {
1244 1235
 
1245 1236
         if (active_extruder != 0) {
1246 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 1241
         else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) {
1251 1242
           // In Duplication Mode, T0 can move as far left as X_MIN_POS
1252 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 1247
         else {
1257 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 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 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 1259
     #endif
1269 1260
 
1270 1261
     #if ENABLED(DEBUG_LEVELING_FEATURE)

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

@@ -475,14 +475,6 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
475 475
           // The newly-selected extruder XY is actually at...
476 476
           current_position[X_AXIS] += xydiff[X_AXIS];
477 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 479
           // Set the new active extruder
488 480
           active_extruder = tmp_extruder;

Loading…
Cancel
Save