Browse Source

Merge pull request #9312 from thinkyhead/bf2_fade_info_too

[2.0.x] Include Z Fade in log_machine_info
Scott Lahteine 6 years ago
parent
commit
4eb41031e9
No account linked to committer's email address

+ 28
- 7
Marlin/src/core/utility.cpp View File

335
       #endif
335
       #endif
336
       if (planner.leveling_active) {
336
       if (planner.leveling_active) {
337
         SERIAL_ECHOLNPGM(" (enabled)");
337
         SERIAL_ECHOLNPGM(" (enabled)");
338
+        #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
339
+          if (planner.z_fade_height)
340
+            SERIAL_ECHOLNPAIR("Z Fade: ", planner.z_fade_height);
341
+        #endif
338
         #if ABL_PLANAR
342
         #if ABL_PLANAR
339
           const float diff[XYZ] = {
343
           const float diff[XYZ] = {
340
             stepper.get_axis_position_mm(X_AXIS) - current_position[X_AXIS],
344
             stepper.get_axis_position_mm(X_AXIS) - current_position[X_AXIS],
350
           SERIAL_ECHOPGM(" Z");
354
           SERIAL_ECHOPGM(" Z");
351
           if (diff[Z_AXIS] > 0) SERIAL_CHAR('+');
355
           if (diff[Z_AXIS] > 0) SERIAL_CHAR('+');
352
           SERIAL_ECHO(diff[Z_AXIS]);
356
           SERIAL_ECHO(diff[Z_AXIS]);
353
-        #elif ENABLED(AUTO_BED_LEVELING_UBL)
354
-          SERIAL_ECHOPAIR("UBL Adjustment Z", stepper.get_axis_position_mm(Z_AXIS) - current_position[Z_AXIS]);
355
-        #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
356
-          SERIAL_ECHOPAIR("ABL Adjustment Z", bilinear_z_offset(current_position));
357
+        #else
358
+          #if ENABLED(AUTO_BED_LEVELING_UBL)
359
+            SERIAL_ECHOPGM("UBL Adjustment Z");
360
+            const float rz = ubl.get_z_correction(current_position[X_AXIS], current_position[Y_AXIS]);
361
+          #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
362
+            SERIAL_ECHOPGM("ABL Adjustment Z");
363
+            const float rz = bilinear_z_offset(current_position);
364
+          #endif
365
+          SERIAL_ECHO(ftostr43sign(rz, '+'));
366
+          #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
367
+            if (planner.z_fade_height) {
368
+              SERIAL_ECHOPAIR(" (", ftostr43sign(rz * planner.fade_scaling_factor_for_z(current_position[Z_AXIS]), '+'));
369
+              SERIAL_CHAR(')');
370
+            }
371
+          #endif
357
         #endif
372
         #endif
358
       }
373
       }
359
       else
374
       else
365
 
380
 
366
       SERIAL_ECHOPGM("Mesh Bed Leveling");
381
       SERIAL_ECHOPGM("Mesh Bed Leveling");
367
       if (planner.leveling_active) {
382
       if (planner.leveling_active) {
368
-        float rz = current_position[Z_AXIS];
369
-        planner.apply_leveling(current_position[X_AXIS], current_position[Y_AXIS], rz);
370
         SERIAL_ECHOLNPGM(" (enabled)");
383
         SERIAL_ECHOLNPGM(" (enabled)");
371
-        SERIAL_ECHOPAIR("MBL Adjustment Z", rz);
384
+        SERIAL_ECHOPAIR("MBL Adjustment Z", ftostr43sign(mbl.get_z(current_position[X_AXIS], current_position[Y_AXIS], 1.0), '+'));
385
+        #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
386
+          if (planner.z_fade_height) {
387
+            SERIAL_ECHOPAIR(" (", ftostr43sign(
388
+              mbl.get_z(current_position[X_AXIS], current_position[Y_AXIS], planner.fade_scaling_factor_for_z(current_position[Z_AXIS])), '+'
389
+            ));
390
+            SERIAL_CHAR(')');
391
+          }
392
+        #endif
372
       }
393
       }
373
       else
394
       else
374
         SERIAL_ECHOPGM(" (disabled)");
395
         SERIAL_ECHOPGM(" (disabled)");

+ 20
- 12
Marlin/src/gcode/bedlevel/abl/G29.cpp View File

132
  */
132
  */
133
 void GcodeSuite::G29() {
133
 void GcodeSuite::G29() {
134
 
134
 
135
+  #if ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(PROBE_MANUALLY)
136
+    const bool seenQ = parser.seen('Q');
137
+  #else
138
+    constexpr bool seenQ = false;
139
+  #endif
140
+
135
   // G29 Q is also available if debugging
141
   // G29 Q is also available if debugging
136
   #if ENABLED(DEBUG_LEVELING_FEATURE)
142
   #if ENABLED(DEBUG_LEVELING_FEATURE)
137
-    const bool query = parser.seen('Q');
138
     const uint8_t old_debug_flags = marlin_debug_flags;
143
     const uint8_t old_debug_flags = marlin_debug_flags;
139
-    if (query) marlin_debug_flags |= DEBUG_LEVELING;
144
+    if (seenQ) marlin_debug_flags |= DEBUG_LEVELING;
140
     if (DEBUGGING(LEVELING)) {
145
     if (DEBUGGING(LEVELING)) {
141
       DEBUG_POS(">>> G29", current_position);
146
       DEBUG_POS(">>> G29", current_position);
142
       log_machine_info();
147
       log_machine_info();
143
     }
148
     }
144
     marlin_debug_flags = old_debug_flags;
149
     marlin_debug_flags = old_debug_flags;
145
     #if DISABLED(PROBE_MANUALLY)
150
     #if DISABLED(PROBE_MANUALLY)
146
-      if (query) return;
151
+      if (seenQ) return;
147
     #endif
152
     #endif
148
   #endif
153
   #endif
149
 
154
 
150
   #if ENABLED(PROBE_MANUALLY)
155
   #if ENABLED(PROBE_MANUALLY)
151
-    const bool seenA = parser.seen('A'), seenQ = parser.seen('Q'), no_action = seenA || seenQ;
152
-  #endif
153
-
154
-  #if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY)
155
-    const bool faux = parser.boolval('C');
156
-  #elif ENABLED(PROBE_MANUALLY)
157
-    const bool faux = no_action;
156
+    const bool seenA = parser.seen('A');
158
   #else
157
   #else
159
-    bool constexpr faux = false;
158
+    constexpr bool seenA = false;
160
   #endif
159
   #endif
161
 
160
 
161
+  const bool  no_action = seenA || seenQ,
162
+              faux =
163
+                #if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY)
164
+                  parser.boolval('C')
165
+                #else
166
+                  no_action
167
+                #endif
168
+              ;
169
+
162
   // Don't allow auto-leveling without homing first
170
   // Don't allow auto-leveling without homing first
163
   if (axis_unhomed_error()) return;
171
   if (axis_unhomed_error()) return;
164
 
172
 
388
 
396
 
389
     // Disable auto bed leveling during G29.
397
     // Disable auto bed leveling during G29.
390
     // Be formal so G29 can be done successively without G28.
398
     // Be formal so G29 can be done successively without G28.
391
-    set_bed_leveling_enabled(false);
399
+    if (!no_action) set_bed_leveling_enabled(false);
392
 
400
 
393
     #if HAS_BED_PROBE
401
     #if HAS_BED_PROBE
394
       // Deploy the probe. Probe will raise if needed.
402
       // Deploy the probe. Probe will raise if needed.

+ 1
- 1
Marlin/src/module/stepper_indirection.cpp View File

258
 
258
 
259
   #define _TMC2208_DEFINE_HARDWARE(ST) TMC2208Stepper stepper##ST(&ST##_HARDWARE_SERIAL)
259
   #define _TMC2208_DEFINE_HARDWARE(ST) TMC2208Stepper stepper##ST(&ST##_HARDWARE_SERIAL)
260
   #define _TMC2208_DEFINE_SOFTWARE(ST) SoftwareSerial ST##_HARDWARE_SERIAL = SoftwareSerial(ST##_SERIAL_RX_PIN, ST##_SERIAL_TX_PIN); \
260
   #define _TMC2208_DEFINE_SOFTWARE(ST) SoftwareSerial ST##_HARDWARE_SERIAL = SoftwareSerial(ST##_SERIAL_RX_PIN, ST##_SERIAL_TX_PIN); \
261
-                                       TMC2208Stepper stepper##ST(&stepper##ST##_serial, ST##_SERIAL_RX_PIN > -1)
261
+                                       TMC2208Stepper stepper##ST(&ST##_HARDWARE_SERIAL, ST##_SERIAL_RX_PIN > -1)
262
 
262
 
263
   // Stepper objects of TMC2208 steppers used
263
   // Stepper objects of TMC2208 steppers used
264
   #if ENABLED(X_IS_TMC2208)
264
   #if ENABLED(X_IS_TMC2208)

Loading…
Cancel
Save