Переглянути джерело

misc. UBL fixes (#6631)

* Restore LSF functionality

Some of the typo's persisted...   Hopefully this gets them all fixed.

* Restore user's expectations of how G28 should behave

* Allow Nozzle size control with ornery host programs
Roxy-3D 7 роки тому
джерело
коміт
d92fa40c62

+ 2
- 1
Marlin/G26_Mesh_Validation_Tool.cpp Переглянути файл

@@ -92,6 +92,7 @@
92 92
    *        un-retraction is at 1.2mm   These numbers will be scaled by the specified amount
93 93
    *
94 94
    *   N #  Nozzle    Used to control the size of nozzle diameter.  If not specified, a .4mm nozzle is assumed.
95
+   *        'n' can be used instead if your host program does not appreciate you using 'N'.
95 96
    *
96 97
    *   O #  Ooooze    How much your nozzle will Ooooze filament while getting in position to print.  This
97 98
    *        is over kill, but using this parameter will let you get the very first 'cicle' perfect
@@ -674,7 +675,7 @@
674 675
       }
675 676
     }
676 677
 
677
-    if (code_seen('N')) {
678
+    if (code_seen('N') || code_seen('n')) {
678 679
       nozzle = code_value_float();
679 680
       if (!WITHIN(nozzle, 0.1, 1.0)) {
680 681
         SERIAL_PROTOCOLLNPGM("?Specified nozzle size not plausible.");

+ 6
- 0
Marlin/Marlin_main.cpp Переглянути файл

@@ -3741,6 +3741,9 @@ inline void gcode_G28() {
3741 3741
 
3742 3742
   // Disable the leveling matrix before homing
3743 3743
   #if HAS_LEVELING
3744
+    #if ENABLED(AUTO_BED_LEVELING_UBL)
3745
+      const bool bed_leveling_state_at_entry = ubl.state.active;
3746
+    #endif
3744 3747
     set_bed_leveling_enabled(false);
3745 3748
   #endif
3746 3749
 
@@ -3882,6 +3885,9 @@ inline void gcode_G28() {
3882 3885
     // move to a height where we can use the full xy-area
3883 3886
     do_blocking_move_to_z(delta_clip_start_height);
3884 3887
   #endif
3888
+  #if ENABLED(AUTO_BED_LEVELING_UBL)
3889
+    set_bed_leveling_enabled(bed_leveling_state_at_entry);
3890
+  #endif
3885 3891
 
3886 3892
   clean_up_after_endstop_or_probe_move();
3887 3893
 

+ 3
- 3
Marlin/least_squares_fit.cpp Переглянути файл

@@ -52,9 +52,9 @@ void incremental_LSF(struct linear_fit_data *lsf, float x, float y, float z) {
52 52
   lsf->x2bar += sq(x);
53 53
   lsf->y2bar += sq(y);
54 54
   lsf->z2bar += sq(z);
55
-  lsf->xybar += sq(x);
56
-  lsf->xzbar += sq(x);
57
-  lsf->yzbar += sq(y);
55
+  lsf->xybar += x*y;
56
+  lsf->xzbar += x*z;
57
+  lsf->yzbar += y*z;
58 58
   lsf->max_absx = max(fabs(x), lsf->max_absx);
59 59
   lsf->max_absy = max(fabs(y), lsf->max_absy);
60 60
   lsf->n++;

Завантаження…
Відмінити
Зберегти