Преглед на файлове

Merge pull request #8381 from thinkyhead/bf1_native_followup

[1.1] Remove offsets from soft endstops, tool change
Scott Lahteine преди 6 години
родител
ревизия
5cc87abb3a
No account linked to committer's email address
променени са 1 файла, в които са добавени 11 реда и са изтрити 28 реда
  1. 11
    28
      Marlin/Marlin_main.cpp

+ 11
- 28
Marlin/Marlin_main.cpp Целия файл

@@ -1405,17 +1405,8 @@ bool get_target_extruder_from_command(const uint16_t code) {
1405 1405
    * at the same positions relative to the machine.
1406 1406
    */
1407 1407
   void update_software_endstops(const AxisEnum axis) {
1408
-    const float offs = 0.0
1409
-      #if HAS_HOME_OFFSET
1410
-        + home_offset[axis]
1411
-      #endif
1412
-      #if HAS_POSITION_SHIFT
1413
-        + position_shift[axis]
1414
-      #endif
1415
-    ;
1416
-
1417 1408
     #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT
1418
-      workspace_offset[axis] = offs;
1409
+      workspace_offset[axis] = home_offset[axis] + position_shift[axis];
1419 1410
     #endif
1420 1411
 
1421 1412
     #if ENABLED(DUAL_X_CARRIAGE)
@@ -1426,27 +1417,27 @@ bool get_target_extruder_from_command(const uint16_t code) {
1426 1417
 
1427 1418
         if (active_extruder != 0) {
1428 1419
           // T1 can move from X2_MIN_POS to X2_MAX_POS or X2 home position (whichever is larger)
1429
-          soft_endstop_min[X_AXIS] = X2_MIN_POS + offs;
1430
-          soft_endstop_max[X_AXIS] = dual_max_x + offs;
1420
+          soft_endstop_min[X_AXIS] = X2_MIN_POS;
1421
+          soft_endstop_max[X_AXIS] = dual_max_x;
1431 1422
         }
1432 1423
         else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) {
1433 1424
           // In Duplication Mode, T0 can move as far left as X_MIN_POS
1434 1425
           // but not so far to the right that T1 would move past the end
1435
-          soft_endstop_min[X_AXIS] = base_min_pos(X_AXIS) + offs;
1436
-          soft_endstop_max[X_AXIS] = min(base_max_pos(X_AXIS), dual_max_x - duplicate_extruder_x_offset) + offs;
1426
+          soft_endstop_min[X_AXIS] = base_min_pos(X_AXIS);
1427
+          soft_endstop_max[X_AXIS] = min(base_max_pos(X_AXIS), dual_max_x - duplicate_extruder_x_offset);
1437 1428
         }
1438 1429
         else {
1439 1430
           // In other modes, T0 can move from X_MIN_POS to X_MAX_POS
1440
-          soft_endstop_min[axis] = base_min_pos(axis) + offs;
1441
-          soft_endstop_max[axis] = base_max_pos(axis) + offs;
1431
+          soft_endstop_min[axis] = base_min_pos(axis);
1432
+          soft_endstop_max[axis] = base_max_pos(axis);
1442 1433
         }
1443 1434
       }
1444 1435
     #elif ENABLED(DELTA)
1445
-      soft_endstop_min[axis] = base_min_pos(axis) + offs;
1446
-      soft_endstop_max[axis] = (axis == Z_AXIS ? delta_height : base_max_pos(axis)) + offs;
1436
+      soft_endstop_min[axis] = base_min_pos(axis);
1437
+      soft_endstop_max[axis] = axis == Z_AXIS ? delta_height : base_max_pos(axis);
1447 1438
     #else
1448
-      soft_endstop_min[axis] = base_min_pos(axis) + offs;
1449
-      soft_endstop_max[axis] = base_max_pos(axis) + offs;
1439
+      soft_endstop_min[axis] = base_min_pos(axis);
1440
+      soft_endstop_max[axis] = base_max_pos(axis);
1450 1441
     #endif
1451 1442
 
1452 1443
     #if ENABLED(DEBUG_LEVELING_FEATURE)
@@ -11142,14 +11133,6 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
11142 11133
           // The newly-selected extruder XY is actually at...
11143 11134
           current_position[X_AXIS] += xydiff[X_AXIS];
11144 11135
           current_position[Y_AXIS] += xydiff[Y_AXIS];
11145
-          #if HAS_WORKSPACE_OFFSET || ENABLED(DUAL_X_CARRIAGE) || ENABLED(PARKING_EXTRUDER)
11146
-            for (uint8_t i = X_AXIS; i <= Y_AXIS; i++) {
11147
-              #if HAS_POSITION_SHIFT
11148
-                position_shift[i] += xydiff[i];
11149
-              #endif
11150
-              update_software_endstops((AxisEnum)i);
11151
-            }
11152
-          #endif
11153 11136
 
11154 11137
           // Set the new active extruder
11155 11138
           active_extruder = tmp_extruder;

Loading…
Отказ
Запис