Browse Source

UBL tabs, whitespace, spelling, etc.

Scott Lahteine 8 years ago
parent
commit
14a4257c7b

+ 3
- 3
Marlin/G26_Mesh_Validation_Tool.cpp View File

466
                   SERIAL_EOL;
466
                   SERIAL_EOL;
467
                   //debug_current_and_destination(PSTR("Connecting horizontal line."));
467
                   //debug_current_and_destination(PSTR("Connecting horizontal line."));
468
                 }
468
                 }
469
-  
469
+
470
                 print_line_from_here_to_there(LOGICAL_X_POSITION(sx), LOGICAL_Y_POSITION(sy), layer_height, LOGICAL_X_POSITION(ex), LOGICAL_Y_POSITION(ey), layer_height);
470
                 print_line_from_here_to_there(LOGICAL_X_POSITION(sx), LOGICAL_Y_POSITION(sy), layer_height, LOGICAL_X_POSITION(ex), LOGICAL_Y_POSITION(ey), layer_height);
471
               }
471
               }
472
               bit_set(horizontal_mesh_line_flags, i, j);   // Mark it as done so we don't do it again, even if we skipped it
472
               bit_set(horizontal_mesh_line_flags, i, j);   // Mark it as done so we don't do it again, even if we skipped it
685
       }
685
       }
686
     }
686
     }
687
 
687
 
688
-    if (code_seen('S')) { 
688
+    if (code_seen('S')) {
689
       nozzle = code_value_float();
689
       nozzle = code_value_float();
690
       if (!WITHIN(nozzle, 0.1, 1.0)) {
690
       if (!WITHIN(nozzle, 0.1, 1.0)) {
691
         SERIAL_PROTOCOLLNPGM("?Specified nozzle size not plausible.");
691
         SERIAL_PROTOCOLLNPGM("?Specified nozzle size not plausible.");
727
       }
727
       }
728
     }
728
     }
729
 
729
 
730
-    if (code_seen('U')) { 
730
+    if (code_seen('U')) {
731
       randomSeed(millis());
731
       randomSeed(millis());
732
       random_deviation = code_has_value() ? code_value_float() : 50.0;
732
       random_deviation = code_has_value() ? code_value_float() : 50.0;
733
     }
733
     }

+ 1
- 4
Marlin/configuration_store.cpp View File

1458
       #endif
1458
       #endif
1459
       SERIAL_EOL;
1459
       SERIAL_EOL;
1460
 
1460
 
1461
-      if (!forReplay) {
1462
-        ubl.g29_what_command();        
1463
-
1464
-      }
1461
+      if (!forReplay) ubl.g29_what_command();
1465
 
1462
 
1466
     #elif HAS_ABL
1463
     #elif HAS_ABL
1467
 
1464
 

+ 1
- 1
Marlin/ubl.h View File

110
       void save_ubl_active_state_and_disable();
110
       void save_ubl_active_state_and_disable();
111
       void restore_ubl_active_state_and_leave();
111
       void restore_ubl_active_state_and_leave();
112
       void g29_what_command();
112
       void g29_what_command();
113
-      void g29_eeprom_dump() ;
113
+      void g29_eeprom_dump();
114
       void g29_compare_current_mesh_to_stored_mesh();
114
       void g29_compare_current_mesh_to_stored_mesh();
115
       void fine_tune_mesh(const float &lx, const float &ly, const bool do_ubl_mesh_map);
115
       void fine_tune_mesh(const float &lx, const float &ly, const bool do_ubl_mesh_map);
116
       void smart_fill_mesh();
116
       void smart_fill_mesh();

+ 34
- 34
Marlin/ubl_G29.cpp View File

74
    *   A     Activate   Activate the Unified Bed Leveling system.
74
    *   A     Activate   Activate the Unified Bed Leveling system.
75
    *
75
    *
76
    *   B #   Business   Use the 'Business Card' mode of the Manual Probe subsystem. This is invoked as
76
    *   B #   Business   Use the 'Business Card' mode of the Manual Probe subsystem. This is invoked as
77
-   *                    G29 P2 B   The mode of G29 P2 allows you to use a bussiness card or recipe card
77
+   *                    G29 P2 B. The mode of G29 P2 allows you to use a business card or recipe card
78
    *                    as a shim that the nozzle will pinch as it is lowered. The idea is that you
78
    *                    as a shim that the nozzle will pinch as it is lowered. The idea is that you
79
    *                    can easily feel the nozzle getting to the same height by the amount of resistance
79
    *                    can easily feel the nozzle getting to the same height by the amount of resistance
80
    *                    the business card exhibits to movement. You should try to achieve the same amount
80
    *                    the business card exhibits to movement. You should try to achieve the same amount
81
    *                    of resistance on each probed point to facilitate accurate and repeatable measurements.
81
    *                    of resistance on each probed point to facilitate accurate and repeatable measurements.
82
-   *                    You should be very careful not to drive the nozzle into the bussiness card with a
82
+   *                    You should be very careful not to drive the nozzle into the business card with a
83
    *                    lot of force as it is very possible to cause damage to your printer if your are
83
    *                    lot of force as it is very possible to cause damage to your printer if your are
84
-   *                    careless. If you use the B option with G29 P2 B you can leave the number parameter off
85
-   *                    on its first use to enable measurement of the business card thickness. Subsequent usage
86
-   *                    of the B parameter can have the number previously measured supplied to the command.
87
-   *                    Incidently, you are much better off using something like a Spark Gap feeler gauge than
88
-   *                    something that compresses like a Business Card.
84
+   *                    careless. If you use the B option with G29 P2 B you can omit the numeric value
85
+   *                    on first use to measure the business card's thickness. Subsequent usage of 'B'
86
+   *                    will apply the previously-measured thickness as the default.
87
+   *                    Note: A non-compressible Spark Gap feeler gauge is recommended over a Business Card.
89
    *
88
    *
90
    *   C     Continue   Continue, Constant, Current Location. This is not a primary command. C is used to
89
    *   C     Continue   Continue, Constant, Current Location. This is not a primary command. C is used to
91
    *                    further refine the behaviour of several other commands. Issuing a G29 P1 C will
90
    *                    further refine the behaviour of several other commands. Issuing a G29 P1 C will
98
    *
97
    *
99
    *   E     Stow_probe Stow the probe after each sampled point.
98
    *   E     Stow_probe Stow the probe after each sampled point.
100
    *
99
    *
101
-   *   F #   Fade   *   Fade the amount of Mesh Based Compensation over a specified height. At the
100
+   *   F #   Fade       Fade the amount of Mesh Based Compensation over a specified height. At the
102
    *                    specified height, no correction is applied and natural printer kenimatics take over. If no
101
    *                    specified height, no correction is applied and natural printer kenimatics take over. If no
103
    *                    number is specified for the command, 10mm is assumed to be reasonable.
102
    *                    number is specified for the command, 10mm is assumed to be reasonable.
104
    *
103
    *
115
    *                    the bed and use this feature to select the center of the area (or cell) you want to
114
    *                    the bed and use this feature to select the center of the area (or cell) you want to
116
    *                    invalidate.
115
    *                    invalidate.
117
    *
116
    *
118
-   *   J #   Grid   *   Perform a Grid Based Leveling of the current Mesh using a grid with n points on a side.
117
+   *   J #   Grid       Perform a Grid Based Leveling of the current Mesh using a grid with n points on a side.
119
    *                    Not specifying a grid size will invoke the 3-Point leveling function.
118
    *                    Not specifying a grid size will invoke the 3-Point leveling function.
120
    *
119
    *
121
    *   K #   Kompare    Kompare current Mesh with stored Mesh # replacing current Mesh with the result. This
120
    *   K #   Kompare    Kompare current Mesh with stored Mesh # replacing current Mesh with the result. This
122
    *                    command literally performs a diff between two Meshes.
121
    *                    command literally performs a diff between two Meshes.
123
    *
122
    *
124
-   *   L     Load   *   Load Mesh from the previously activated location in the EEPROM.
123
+   *   L     Load       Load Mesh from the previously activated location in the EEPROM.
125
    *
124
    *
126
-   *   L #   Load   *   Load Mesh from the specified location in the EEPROM. Set this location as activated
125
+   *   L #   Load       Load Mesh from the specified location in the EEPROM. Set this location as activated
127
    *                    for subsequent Load and Store operations.
126
    *                    for subsequent Load and Store operations.
128
    *
127
    *
129
    *   The P or Phase commands are used for the bulk of the work to setup a Mesh. In general, your Mesh will
128
    *   The P or Phase commands are used for the bulk of the work to setup a Mesh. In general, your Mesh will
143
    *                    probing needed locations. This allows you to invalidate portions of the Mesh but still
142
    *                    probing needed locations. This allows you to invalidate portions of the Mesh but still
144
    *                    use the automatic probing capabilities of the Unified Bed Leveling System. An X and Y
143
    *                    use the automatic probing capabilities of the Unified Bed Leveling System. An X and Y
145
    *                    parameter can be given to prioritize where the command should be trying to measure points.
144
    *                    parameter can be given to prioritize where the command should be trying to measure points.
146
-   *                    If the X and Y parameters are not specified the current probe position is used. Phase 1
147
-   *                    allows you to specify the M (Map) parameter so you can watch the generation of the Mesh.
148
-   *                    Phase 1 also watches for the LCD Panel's Encoder Switch being held in a depressed state.
149
-   *                    It will suspend generation of the Mesh if it sees the user request that. (This check is
150
-   *                    only done between probe points. You will need to press and hold the switch until the
151
-   *                    Phase 1 command can detect it.)
145
+   *                    If the X and Y parameters are not specified the current probe position is used.
146
+   *                    P1 accepts a 'T' (Topology) parameter so you can observe mesh generation.
147
+   *                    P1 also watches for the LCD Panel Encoder Switch to be held down, and will suspend
148
+   *                    generation of the Mesh in that case. (Note: This check is only done between probe points,
149
+   *                    so you must press and hold the switch until the Phase 1 command detects it.)
152
    *
150
    *
153
    *   P2    Phase 2    Probe areas of the Mesh that can't be automatically handled. Phase 2 respects an H
151
    *   P2    Phase 2    Probe areas of the Mesh that can't be automatically handled. Phase 2 respects an H
154
    *                    parameter to control the height between Mesh points. The default height for movement
152
    *                    parameter to control the height between Mesh points. The default height for movement
171
    *                    be done based on the current location of the nozzle.
169
    *                    be done based on the current location of the nozzle.
172
    *
170
    *
173
    *                    A B parameter is also available for this command and described up above. It places the
171
    *                    A B parameter is also available for this command and described up above. It places the
174
-   *                    manual probe subsystem into Business Card mode where the thickness of a business care is
172
+   *                    manual probe subsystem into Business Card mode where the thickness of a business card is
175
    *                    measured and then used to accurately set the nozzle height in all manual probing for the
173
    *                    measured and then used to accurately set the nozzle height in all manual probing for the
176
    *                    duration of the command. (S for Shim mode would be a better parameter name, but S is needed
174
    *                    duration of the command. (S for Shim mode would be a better parameter name, but S is needed
177
    *                    for Save or Store of the Mesh to EEPROM)  A Business card can be used, but you will have
175
    *                    for Save or Store of the Mesh to EEPROM)  A Business card can be used, but you will have
237
    *                    you should have the Mesh adjusted for a Mean Height of 0.00 and the Z-Probe measuring
235
    *                    you should have the Mesh adjusted for a Mean Height of 0.00 and the Z-Probe measuring
238
    *                    0.000 at the Z Home location.
236
    *                    0.000 at the Z Home location.
239
    *
237
    *
240
-   *   Q     Test   *   Load specified Test Pattern to assist in checking correct operation of system. This
238
+   *   Q     Test       Load specified Test Pattern to assist in checking correct operation of system. This
241
    *                    command is not anticipated to be of much value to the typical user. It is intended
239
    *                    command is not anticipated to be of much value to the typical user. It is intended
242
    *                    for developers to help them verify correct operation of the Unified Bed Leveling System.
240
    *                    for developers to help them verify correct operation of the Unified Bed Leveling System.
243
    *
241
    *
262
    *                    is suitable to paste into a spreadsheet for a 3D graph of the mesh.
260
    *                    is suitable to paste into a spreadsheet for a 3D graph of the mesh.
263
    *
261
    *
264
    *   U     Unlevel    Perform a probe of the outer perimeter to assist in physically leveling unlevel beds.
262
    *   U     Unlevel    Perform a probe of the outer perimeter to assist in physically leveling unlevel beds.
265
-   *                    Only used for G29 P1 O U   It will speed up the probing of the edge of the bed.  This
266
-   *                    is useful when the entire bed does not need to be probed because it will be adjusted.
263
+   *                    Only used for G29 P1 O U. This speeds up the probing of the edge of the bed. Useful
264
+   *                    when the entire bed doesn't need to be probed because it will be adjusted.
267
    *
265
    *
268
-   *   W     What?      Display valuable data the Unified Bed Leveling System knows.
266
+   *   V #   Verbosity  Set the verbosity level (0-4) for extra details. (Default 0)
269
    *
267
    *
270
-   *   X #   *      *   X Location for this line of commands
268
+   *   W     What?      Display valuable Unified Bed Leveling System data.
271
    *
269
    *
272
-   *   Y #   *      *   Y Location for this line of commands
270
+   *   X #              X Location for this command
271
+   *
272
+   *   Y #              Y Location for this command
273
    *
273
    *
274
    *
274
    *
275
    *   Release Notes:
275
    *   Release Notes:
318
     }
318
     }
319
 
319
 
320
     // Don't allow auto-leveling without homing first
320
     // Don't allow auto-leveling without homing first
321
-    if (axis_unhomed_error()) 
321
+    if (axis_unhomed_error())
322
       home_all_axes();
322
       home_all_axes();
323
 
323
 
324
     if (g29_parameter_parsing()) return; // abort if parsing the simple parameters causes a problem,
324
     if (g29_parameter_parsing()) return; // abort if parsing the simple parameters causes a problem,
377
     }
377
     }
378
 
378
 
379
     if (code_seen('J')) {
379
     if (code_seen('J')) {
380
-      if (grid_size!=0) {  // if not 0 it is a normal n x n grid being probed
380
+      if (grid_size) {  // if not 0 it is a normal n x n grid being probed
381
         ubl.save_ubl_active_state_and_disable();
381
         ubl.save_ubl_active_state_and_disable();
382
         ubl.tilt_mesh_based_on_probed_grid(code_seen('T'));
382
         ubl.tilt_mesh_based_on_probed_grid(code_seen('T'));
383
         ubl.restore_ubl_active_state_and_leave();
383
         ubl.restore_ubl_active_state_and_leave();
479
           }
479
           }
480
 
480
 
481
           if (code_seen('H') && code_has_value()) height = code_value_float();
481
           if (code_seen('H') && code_has_value()) height = code_value_float();
482
-          
482
+
483
           if ( !position_is_reachable_xy( x_pos, y_pos )) {
483
           if ( !position_is_reachable_xy( x_pos, y_pos )) {
484
             SERIAL_PROTOCOLLNPGM("(X,Y) outside printable radius.");
484
             SERIAL_PROTOCOLLNPGM("(X,Y) outside printable radius.");
485
             return;
485
             return;
497
            *   - Allow 'G29 P3' to choose a 'reasonable' constant.
497
            *   - Allow 'G29 P3' to choose a 'reasonable' constant.
498
            */
498
            */
499
           if (c_flag) {
499
           if (c_flag) {
500
-
501
             if (repetition_cnt >= GRID_MAX_POINTS) {
500
             if (repetition_cnt >= GRID_MAX_POINTS) {
502
-              for ( uint8_t x = 0; x < GRID_MAX_POINTS_X; x++ ) {
503
-                for ( uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++ ) {
501
+              for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) {
502
+                for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) {
504
                   ubl.z_values[x][y] = ubl_constant;
503
                   ubl.z_values[x][y] = ubl_constant;
505
                 }
504
                 }
506
               }
505
               }
507
-            } else {
508
-              while (repetition_cnt--) {  // this only populates reachable mesh points near 
506
+            }
507
+            else {
508
+              while (repetition_cnt--) {  // this only populates reachable mesh points near
509
                 const mesh_index_pair location = find_closest_mesh_point_of_type(INVALID, x_pos, y_pos, USE_NOZZLE_AS_REFERENCE, NULL, false);
509
                 const mesh_index_pair location = find_closest_mesh_point_of_type(INVALID, x_pos, y_pos, USE_NOZZLE_AS_REFERENCE, NULL, false);
510
                 if (location.x_index < 0) break; // No more reachable invalid Mesh Points to populate
510
                 if (location.x_index < 0) break; // No more reachable invalid Mesh Points to populate
511
                 ubl.z_values[location.x_index][location.y_index] = ubl_constant;
511
                 ubl.z_values[location.x_index][location.y_index] = ubl_constant;
536
     // good to have the extra information. Soon... we prune this to just a few items
536
     // good to have the extra information. Soon... we prune this to just a few items
537
     //
537
     //
538
     if (code_seen('W')) ubl.g29_what_command();
538
     if (code_seen('W')) ubl.g29_what_command();
539
- 
539
+
540
     //
540
     //
541
     // When we are fully debugged, this may go away. But there are some valid
541
     // When we are fully debugged, this may go away. But there are some valid
542
     // use cases for the users. So we can wait and see what to do with it.
542
     // use cases for the users. So we can wait and see what to do with it.
1578
       SERIAL_ECHOPGM("Could not complete LSF!");
1578
       SERIAL_ECHOPGM("Could not complete LSF!");
1579
       return;
1579
       return;
1580
     }
1580
     }
1581
-    
1581
+
1582
     if (g29_verbose_level > 3) {
1582
     if (g29_verbose_level > 3) {
1583
       SERIAL_ECHOPGM("LSF Results A=");
1583
       SERIAL_ECHOPGM("LSF Results A=");
1584
       SERIAL_PROTOCOL_F(lsf_results.A, 7);
1584
       SERIAL_PROTOCOL_F(lsf_results.A, 7);

+ 6
- 6
Marlin/ubl_motion.cpp View File

55
                 dy = current_position[Y_AXIS] - destination[Y_AXIS],
55
                 dy = current_position[Y_AXIS] - destination[Y_AXIS],
56
                 xy_dist = HYPOT(dx, dy);
56
                 xy_dist = HYPOT(dx, dy);
57
 
57
 
58
-    if (xy_dist == 0.0) 
59
-	    return;
58
+    if (xy_dist == 0.0)
59
+      return;
60
     else {
60
     else {
61
       SERIAL_ECHOPGM("   fpmm=");
61
       SERIAL_ECHOPGM("   fpmm=");
62
       const float fpmm = de / xy_dist;
62
       const float fpmm = de / xy_dist;
461
       static float scara_feed_factor, scara_oldA, scara_oldB;
461
       static float scara_feed_factor, scara_oldA, scara_oldB;
462
     #endif
462
     #endif
463
 
463
 
464
-    // We don't want additional apply_leveling() performed by regular buffer_line or buffer_line_kinematic, 
464
+    // We don't want additional apply_leveling() performed by regular buffer_line or buffer_line_kinematic,
465
     // so we call _buffer_line directly here.  Per-segmented leveling performed first.
465
     // so we call _buffer_line directly here.  Per-segmented leveling performed first.
466
 
466
 
467
     static inline void ubl_buffer_line_segment(const float ltarget[XYZE], const float &fr_mm_s, const uint8_t extruder) {
467
     static inline void ubl_buffer_line_segment(const float ltarget[XYZE], const float &fr_mm_s, const uint8_t extruder) {
530
                     difference[X_AXIS] * inv_segments,
530
                     difference[X_AXIS] * inv_segments,
531
                     difference[Y_AXIS] * inv_segments,
531
                     difference[Y_AXIS] * inv_segments,
532
                     difference[Z_AXIS] * inv_segments,
532
                     difference[Z_AXIS] * inv_segments,
533
-                    difference[E_AXIS] * inv_segments 
533
+                    difference[E_AXIS] * inv_segments
534
                   };
534
                   };
535
 
535
 
536
       // Note that E segment distance could vary slightly as z mesh height
536
       // Note that E segment distance could vary slightly as z mesh height
610
               z_x0y1 = ubl.z_values[cell_xi  ][cell_yi+1],  // z at lower right corner
610
               z_x0y1 = ubl.z_values[cell_xi  ][cell_yi+1],  // z at lower right corner
611
               z_x1y1 = ubl.z_values[cell_xi+1][cell_yi+1];  // z at upper right corner
611
               z_x1y1 = ubl.z_values[cell_xi+1][cell_yi+1];  // z at upper right corner
612
 
612
 
613
-        if (isnan(z_x0y0)) z_x0y0 = 0;              // ideally activating ubl.state.active (G29 A) 
613
+        if (isnan(z_x0y0)) z_x0y0 = 0;              // ideally activating ubl.state.active (G29 A)
614
         if (isnan(z_x1y0)) z_x1y0 = 0;              //   should refuse if any invalid mesh points
614
         if (isnan(z_x1y0)) z_x1y0 = 0;              //   should refuse if any invalid mesh points
615
         if (isnan(z_x0y1)) z_x0y1 = 0;              //   in order to avoid isnan tests per cell,
615
         if (isnan(z_x0y1)) z_x0y1 = 0;              //   in order to avoid isnan tests per cell,
616
         if (isnan(z_x1y1)) z_x1y1 = 0;              //   thus guessing zero for undefined points
616
         if (isnan(z_x1y1)) z_x1y1 = 0;              //   thus guessing zero for undefined points
664
           if (!WITHIN(cx, 0, MESH_X_DIST) || !WITHIN(cy, 0, MESH_Y_DIST)) {  // done within this cell, break to next
664
           if (!WITHIN(cx, 0, MESH_X_DIST) || !WITHIN(cy, 0, MESH_Y_DIST)) {  // done within this cell, break to next
665
             rx = RAW_X_POSITION(seg_dest[X_AXIS]);
665
             rx = RAW_X_POSITION(seg_dest[X_AXIS]);
666
             ry = RAW_Y_POSITION(seg_dest[Y_AXIS]);
666
             ry = RAW_Y_POSITION(seg_dest[Y_AXIS]);
667
-            break;  
667
+            break;
668
           }
668
           }
669
 
669
 
670
           // Next segment still within same mesh cell, adjust the per-segment
670
           // Next segment still within same mesh cell, adjust the per-segment

+ 1
- 1
Marlin/ultralcd.cpp View File

1945
 
1945
 
1946
     /**
1946
     /**
1947
      * UBL System submenu
1947
      * UBL System submenu
1948
-     * 
1948
+     *
1949
      *  Prepare
1949
      *  Prepare
1950
      * - Unified Bed Leveling
1950
      * - Unified Bed Leveling
1951
      *   - Activate UBL
1951
      *   - Activate UBL

Loading…
Cancel
Save