Browse Source

No retroactive changes with M851 Z

Scott Lahteine 7 years ago
parent
commit
622d100c30
4 changed files with 5 additions and 58 deletions
  1. 0
    1
      Marlin/Marlin.h
  2. 3
    45
      Marlin/Marlin_main.cpp
  3. 0
    4
      Marlin/configuration_store.cpp
  4. 2
    8
      Marlin/ultralcd.cpp

+ 0
- 1
Marlin/Marlin.h View File

345
 
345
 
346
 #if HAS_BED_PROBE
346
 #if HAS_BED_PROBE
347
   extern float zprobe_zoffset;
347
   extern float zprobe_zoffset;
348
-  void refresh_zprobe_zoffset(const bool no_babystep=false);
349
   #define DEPLOY_PROBE() set_probe_deployed(true)
348
   #define DEPLOY_PROBE() set_probe_deployed(true)
350
   #define STOW_PROBE() set_probe_deployed(false)
349
   #define STOW_PROBE() set_probe_deployed(false)
351
 #else
350
 #else

+ 3
- 45
Marlin/Marlin_main.cpp View File

9320
       for (uint8_t a = X_AXIS; a <= Z_AXIS; a++)
9320
       for (uint8_t a = X_AXIS; a <= Z_AXIS; a++)
9321
         if (parser.seenval(axis_codes[a]) || (a == Z_AXIS && parser.seenval('S'))) {
9321
         if (parser.seenval(axis_codes[a]) || (a == Z_AXIS && parser.seenval('S'))) {
9322
           const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2);
9322
           const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2);
9323
+          thermalManager.babystep_axis((AxisEnum)a, offs * planner.axis_steps_per_mm[a]);
9323
           #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
9324
           #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
9324
-            if (a == Z_AXIS) {
9325
-              zprobe_zoffset += offs;
9326
-              refresh_zprobe_zoffset(true); // 'true' to not babystep
9327
-            }
9325
+            zprobe_zoffset += offs;
9328
           #endif
9326
           #endif
9329
-          thermalManager.babystep_axis((AxisEnum)a, offs * planner.axis_steps_per_mm[a]);
9330
         }
9327
         }
9331
     #else
9328
     #else
9332
       if (parser.seenval('Z') || parser.seenval('S')) {
9329
       if (parser.seenval('Z') || parser.seenval('S')) {
9333
         const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2);
9330
         const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2);
9331
+        thermalManager.babystep_axis(Z_AXIS, offs * planner.axis_steps_per_mm[Z_AXIS]);
9334
         #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
9332
         #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
9335
           zprobe_zoffset += offs;
9333
           zprobe_zoffset += offs;
9336
-          refresh_zprobe_zoffset(); // This will babystep the axis
9337
-        #else
9338
-          thermalManager.babystep_axis(Z_AXIS, offs * planner.axis_steps_per_mm[Z_AXIS]);
9339
         #endif
9334
         #endif
9340
       }
9335
       }
9341
     #endif
9336
     #endif
10039
 
10034
 
10040
 #if HAS_BED_PROBE
10035
 #if HAS_BED_PROBE
10041
 
10036
 
10042
-  void refresh_zprobe_zoffset(const bool no_babystep/*=false*/) {
10043
-    static float last_zoffset = NAN;
10044
-
10045
-    if (!isnan(last_zoffset)) {
10046
-
10047
-      #if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(BABYSTEP_ZPROBE_OFFSET) || ENABLED(DELTA)
10048
-        const float diff = zprobe_zoffset - last_zoffset;
10049
-      #endif
10050
-
10051
-      #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
10052
-        // Correct bilinear grid for new probe offset
10053
-        if (diff) {
10054
-          for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
10055
-            for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
10056
-              z_values[x][y] -= diff;
10057
-        }
10058
-        #if ENABLED(ABL_BILINEAR_SUBDIVISION)
10059
-          bed_level_virt_interpolate();
10060
-        #endif
10061
-      #endif
10062
-
10063
-      #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
10064
-        if (!no_babystep && planner.leveling_active)
10065
-          thermalManager.babystep_axis(Z_AXIS, -LROUND(diff * planner.axis_steps_per_mm[Z_AXIS]));
10066
-      #else
10067
-        UNUSED(no_babystep);
10068
-      #endif
10069
-
10070
-      #if ENABLED(DELTA) // correct the delta_height
10071
-        delta_height -= diff;
10072
-      #endif
10073
-    }
10074
-
10075
-    last_zoffset = zprobe_zoffset;
10076
-  }
10077
-
10078
   inline void gcode_M851() {
10037
   inline void gcode_M851() {
10079
     SERIAL_ECHO_START();
10038
     SERIAL_ECHO_START();
10080
     SERIAL_ECHOPGM(MSG_ZPROBE_ZOFFSET " ");
10039
     SERIAL_ECHOPGM(MSG_ZPROBE_ZOFFSET " ");
10082
       const float value = parser.value_linear_units();
10041
       const float value = parser.value_linear_units();
10083
       if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
10042
       if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
10084
         zprobe_zoffset = value;
10043
         zprobe_zoffset = value;
10085
-        refresh_zprobe_zoffset();
10086
         SERIAL_ECHO(zprobe_zoffset);
10044
         SERIAL_ECHO(zprobe_zoffset);
10087
       }
10045
       }
10088
       else
10046
       else

+ 0
- 4
Marlin/configuration_store.cpp View File

246
     set_z_fade_height(new_z_fade_height);
246
     set_z_fade_height(new_z_fade_height);
247
   #endif
247
   #endif
248
 
248
 
249
-  #if HAS_BED_PROBE
250
-    refresh_zprobe_zoffset();
251
-  #endif
252
-
253
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
249
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
254
     refresh_bed_level();
250
     refresh_bed_level();
255
     //set_bed_leveling_enabled(leveling_is_on);
251
     //set_bed_leveling_enabled(leveling_is_on);

+ 2
- 8
Marlin/ultralcd.cpp View File

1112
               thermalManager.babystep_axis(Z_AXIS, babystep_increment);
1112
               thermalManager.babystep_axis(Z_AXIS, babystep_increment);
1113
 
1113
 
1114
             zprobe_zoffset = new_zoffset;
1114
             zprobe_zoffset = new_zoffset;
1115
-            refresh_zprobe_zoffset(true);
1116
             lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
1115
             lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
1117
           }
1116
           }
1118
         }
1117
         }
1678
     static void lcd_load_settings()    { lcd_completion_feedback(settings.load()); }
1677
     static void lcd_load_settings()    { lcd_completion_feedback(settings.load()); }
1679
   #endif
1678
   #endif
1680
 
1679
 
1681
-  #if HAS_BED_PROBE && DISABLED(BABYSTEP_ZPROBE_OFFSET)
1682
-    static void lcd_refresh_zprobe_zoffset() { refresh_zprobe_zoffset(); }
1683
-  #endif
1684
-
1685
-
1686
   #if ENABLED(LEVEL_BED_CORNERS)
1680
   #if ENABLED(LEVEL_BED_CORNERS)
1687
 
1681
 
1688
     /**
1682
     /**
2002
       #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
1996
       #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
2003
         MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
1997
         MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
2004
       #elif HAS_BED_PROBE
1998
       #elif HAS_BED_PROBE
2005
-        MENU_ITEM_EDIT_CALLBACK(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, lcd_refresh_zprobe_zoffset);
1999
+        MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
2006
       #endif
2000
       #endif
2007
 
2001
 
2008
       MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
2002
       MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
3659
     #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
3653
     #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
3660
       MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
3654
       MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
3661
     #elif HAS_BED_PROBE
3655
     #elif HAS_BED_PROBE
3662
-      MENU_ITEM_EDIT_CALLBACK(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, lcd_refresh_zprobe_zoffset);
3656
+      MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
3663
     #endif
3657
     #endif
3664
 
3658
 
3665
     // M203 / M205 - Feedrate items
3659
     // M203 / M205 - Feedrate items

Loading…
Cancel
Save