Pārlūkot izejas kodu

Updates for G33-LCD interface

LVD-AC 7 gadus atpakaļ
vecāks
revīzija
4bc79ec877

+ 50
- 42
Marlin/Marlin_main.cpp Parādīt failu

@@ -5168,11 +5168,28 @@ void home_all_axes() { gcode_G28(true); }
5168 5168
       SERIAL_PROTOCOL_F(f, 2);
5169 5169
     }
5170 5170
 
5171
+    inline void print_G33_settings(const bool end_stops, const bool tower_angles){ // TODO echo these to LCD ???
5172
+      SERIAL_PROTOCOLPAIR(".Height:", DELTA_HEIGHT + home_offset[Z_AXIS]);
5173
+      if (end_stops) {
5174
+        print_signed_float(PSTR("  Ex"), endstop_adj[A_AXIS]);
5175
+        print_signed_float(PSTR("Ey"), endstop_adj[B_AXIS]);
5176
+        print_signed_float(PSTR("Ez"), endstop_adj[C_AXIS]);
5177
+        SERIAL_PROTOCOLPAIR("    Radius:", delta_radius);
5178
+      }
5179
+      SERIAL_EOL();
5180
+      if (tower_angles) {
5181
+        SERIAL_PROTOCOLPGM(".Tower angle :  ");
5182
+        print_signed_float(PSTR("Tx"), delta_tower_angle_trim[A_AXIS]);
5183
+        print_signed_float(PSTR("Ty"), delta_tower_angle_trim[B_AXIS]);
5184
+        SERIAL_PROTOCOLLNPGM("  Tz:+0.00");
5185
+      }
5186
+    }
5187
+
5171 5188
     inline void gcode_G33() {
5172 5189
 
5173 5190
       const int8_t probe_points = parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS);
5174 5191
       if (!WITHIN(probe_points, 1, 7)) {
5175
-        SERIAL_PROTOCOLLNPGM("?(P)oints is implausible (1 to 7).");
5192
+        SERIAL_PROTOCOLLNPGM("?(P)oints is implausible (1-7).");
5176 5193
         return;
5177 5194
       }
5178 5195
 
@@ -5256,26 +5273,13 @@ void home_all_axes() { gcode_G28(true); }
5256 5273
 
5257 5274
       // print settings
5258 5275
 
5259
-      SERIAL_PROTOCOLPGM("Checking... AC");
5276
+      const char *checkingac = PSTR("Checking... AC"); // TODO: Make translatable string
5277
+      serialprintPGM(checkingac);
5260 5278
       if (verbose_level == 0) SERIAL_PROTOCOLPGM(" (DRY-RUN)");
5261 5279
       SERIAL_EOL();
5262
-      LCD_MESSAGEPGM("Checking... AC"); // TODO: Make translatable string
5280
+      lcd_setstatusPGM(checkingac);
5263 5281
 
5264
-      SERIAL_PROTOCOLPAIR(".Height:", DELTA_HEIGHT + home_offset[Z_AXIS]);
5265
-      if (!_1p_calibration) {
5266
-        print_signed_float(PSTR("  Ex"), endstop_adj[A_AXIS]);
5267
-        print_signed_float(PSTR("Ey"), endstop_adj[B_AXIS]);
5268
-        print_signed_float(PSTR("Ez"), endstop_adj[C_AXIS]);
5269
-        SERIAL_PROTOCOLPAIR("    Radius:", delta_radius);
5270
-      }
5271
-      SERIAL_EOL();
5272
-      if (_7p_calibration && towers_set) {
5273
-        SERIAL_PROTOCOLPGM(".Tower angle :  ");
5274
-        print_signed_float(PSTR("Tx"), delta_tower_angle_trim[A_AXIS]);
5275
-        print_signed_float(PSTR("Ty"), delta_tower_angle_trim[B_AXIS]);
5276
-        SERIAL_PROTOCOLPGM("  Tz:+0.00");
5277
-        SERIAL_EOL();
5278
-      }
5282
+      print_G33_settings(!_1p_calibration, _7p_calibration && towers_set);
5279 5283
 
5280 5284
       #if DISABLED(PROBE_MANUALLY)
5281 5285
         home_offset[Z_AXIS] -= probe_pt(dx, dy, stow_after_each, 1, false); // 1st probe to set height
@@ -5345,7 +5349,6 @@ void home_all_axes() { gcode_G28(true); }
5345 5349
             N++;
5346 5350
           }
5347 5351
         zero_std_dev_old = zero_std_dev;
5348
-        NOMORE(zero_std_dev_min, zero_std_dev);
5349 5352
         zero_std_dev = round(sqrt(S2 / N) * 1000.0) / 1000.0 + 0.00001;
5350 5353
 
5351 5354
         // Solve matrices
@@ -5436,8 +5439,9 @@ void home_all_axes() { gcode_G28(true); }
5436 5439
 
5437 5440
           recalc_delta_settings(delta_radius, delta_diagonal_rod);
5438 5441
         }
5442
+        NOMORE(zero_std_dev_min, zero_std_dev);
5439 5443
 
5440
-         // print report
5444
+        // print report
5441 5445
 
5442 5446
         if (verbose_level != 1) {
5443 5447
           SERIAL_PROTOCOLPGM(".    ");
@@ -5470,47 +5474,51 @@ void home_all_axes() { gcode_G28(true); }
5470 5474
             #endif
5471 5475
               {
5472 5476
                 SERIAL_PROTOCOLPGM("std dev:");
5473
-                SERIAL_PROTOCOL_F(zero_std_dev, 3);
5477
+                SERIAL_PROTOCOL_F(zero_std_dev_min, 3);
5474 5478
               }
5475 5479
             SERIAL_EOL();
5476
-            LCD_MESSAGEPGM("Calibration OK"); // TODO: Make translatable string
5480
+            char mess[21];
5481
+            sprintf_P(mess, PSTR("Calibration sd:"));
5482
+            if (zero_std_dev_min < 1)
5483
+              sprintf_P(&mess[15], PSTR("0.%03i"), (int)round(zero_std_dev_min * 1000.0));
5484
+            else
5485
+              sprintf_P(&mess[15], PSTR("%03i.x"), (int)round(zero_std_dev_min));
5486
+            lcd_setstatus(mess);
5487
+            print_G33_settings(!_1p_calibration, _7p_calibration && towers_set);
5488
+            serialprintPGM(save_message);
5489
+            SERIAL_EOL();
5477 5490
           }
5478 5491
           else {                                                     // !end iterations
5479
-            char mess[15] = "No convergence";
5492
+            char mess[15];
5480 5493
             if (iterations < 31)
5481 5494
               sprintf_P(mess, PSTR("Iteration : %02i"), (int)iterations);
5495
+            else
5496
+              sprintf_P(mess, PSTR("No convergence"));
5482 5497
             SERIAL_PROTOCOL(mess);
5483 5498
             SERIAL_PROTOCOL_SP(36);
5484 5499
             SERIAL_PROTOCOLPGM("std dev:");
5485 5500
             SERIAL_PROTOCOL_F(zero_std_dev, 3);
5486 5501
             SERIAL_EOL();
5487 5502
             lcd_setstatus(mess);
5503
+            print_G33_settings(!_1p_calibration, _7p_calibration && towers_set);
5488 5504
           }
5489
-          SERIAL_PROTOCOLPAIR(".Height:", DELTA_HEIGHT + home_offset[Z_AXIS]);
5490
-          if (!_1p_calibration) {
5491
-            print_signed_float(PSTR("  Ex"), endstop_adj[A_AXIS]);
5492
-            print_signed_float(PSTR("Ey"), endstop_adj[B_AXIS]);
5493
-            print_signed_float(PSTR("Ez"), endstop_adj[C_AXIS]);
5494
-            SERIAL_PROTOCOLPAIR("    Radius:", delta_radius);
5495
-          }
5496
-          SERIAL_EOL();
5497
-          if (_7p_calibration && towers_set) {
5498
-            SERIAL_PROTOCOLPGM(".Tower angle :  ");
5499
-            print_signed_float(PSTR("Tx"), delta_tower_angle_trim[A_AXIS]);
5500
-            print_signed_float(PSTR("Ty"), delta_tower_angle_trim[B_AXIS]);
5501
-            SERIAL_PROTOCOLPGM("  Tz:+0.00");
5502
-            SERIAL_EOL();
5503
-          }
5504
-          if ((zero_std_dev >= test_precision || zero_std_dev <= calibration_precision) && iterations > force_iterations)
5505
-            serialprintPGM(save_message);
5506
-            SERIAL_EOL();
5507 5505
         }
5508 5506
         else {                                                       // dry run
5509
-          SERIAL_PROTOCOLPGM("End DRY-RUN");
5507
+          const char *enddryrun = PSTR("End DRY-RUN");
5508
+          serialprintPGM(enddryrun);
5510 5509
           SERIAL_PROTOCOL_SP(39);
5511 5510
           SERIAL_PROTOCOLPGM("std dev:");
5512 5511
           SERIAL_PROTOCOL_F(zero_std_dev, 3);
5513 5512
           SERIAL_EOL();
5513
+
5514
+          char mess[21];
5515
+          sprintf_P(mess, enddryrun);
5516
+          sprintf_P(&mess[11], PSTR(" sd:"));
5517
+          if (zero_std_dev < 1)
5518
+            sprintf_P(&mess[15], PSTR("0.%03i"), (int)round(zero_std_dev * 1000.0));
5519
+          else
5520
+            sprintf_P(&mess[15], PSTR("%03i.x"), (int)round(zero_std_dev));
5521
+          lcd_setstatus(mess);
5514 5522
         }
5515 5523
 
5516 5524
         endstops.enable(true);

+ 2
- 0
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h Parādīt failu

@@ -482,6 +482,8 @@
482 482
   #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU)
483 483
     // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS*0.869 for non-eccentric probes
484 484
     #define DELTA_CALIBRATION_RADIUS 73.5 // mm
485
+    // Set the steprate for papertest probing
486
+    #define PROBE_MANUALLY_STEP 0.025
485 487
   #endif
486 488
 
487 489
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).

+ 2
- 0
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h Parādīt failu

@@ -482,6 +482,8 @@
482 482
   #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU)
483 483
     // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS*0.869 for non-eccentric probes
484 484
     #define DELTA_CALIBRATION_RADIUS 73.5 // mm
485
+    // Set the steprate for papertest probing
486
+    #define PROBE_MANUALLY_STEP 0.025
485 487
   #endif
486 488
 
487 489
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).

+ 2
- 0
Marlin/example_configurations/delta/generic/Configuration.h Parādīt failu

@@ -472,6 +472,8 @@
472 472
   #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU)
473 473
     // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS*0.869 for non-eccentric probes
474 474
     #define DELTA_CALIBRATION_RADIUS 121.5 // mm
475
+    // Set the steprate for papertest probing
476
+    #define PROBE_MANUALLY_STEP 0.025
475 477
   #endif
476 478
 
477 479
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).

+ 2
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration.h Parādīt failu

@@ -472,6 +472,8 @@
472 472
   #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU)
473 473
     // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS*0.869 for non-eccentric probes
474 474
     #define DELTA_CALIBRATION_RADIUS 78.0 // mm
475
+    // Set the steprate for papertest probing
476
+    #define PROBE_MANUALLY_STEP 0.025
475 477
   #endif
476 478
 
477 479
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).

+ 2
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration.h Parādīt failu

@@ -458,6 +458,8 @@
458 458
   #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU)
459 459
     // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS*0.869 for non-eccentric probes
460 460
     #define DELTA_CALIBRATION_RADIUS 110.0 // mm
461
+    // Set the steprate for papertest probing
462
+    #define PROBE_MANUALLY_STEP 0.025
461 463
   #endif
462 464
 
463 465
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).

+ 2
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration.h Parādīt failu

@@ -476,6 +476,8 @@
476 476
   #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU)
477 477
     // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS*0.869 for non-eccentric probes
478 478
     #define DELTA_CALIBRATION_RADIUS 121.5 // mm
479
+    // Set the steprate for papertest probing
480
+    #define PROBE_MANUALLY_STEP 0.025
479 481
   #endif
480 482
 
481 483
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).

+ 3
- 0
Marlin/language_en.h Parādīt failu

@@ -713,6 +713,9 @@
713 713
 #ifndef MSG_DELTA_CALIBRATE_CENTER
714 714
   #define MSG_DELTA_CALIBRATE_CENTER          _UxGT("Calibrate Center")
715 715
 #endif
716
+#ifndef MSG_DELTA_SETTINGS
717
+  #define MSG_DELTA_SETTINGS                  _UxGT("Show Delta Settings")
718
+#endif
716 719
 #ifndef MSG_DELTA_AUTO_CALIBRATE
717 720
   #define MSG_DELTA_AUTO_CALIBRATE            _UxGT("Auto Calibration")
718 721
 #endif

+ 26
- 2
Marlin/ultralcd.cpp Parādīt failu

@@ -2500,16 +2500,19 @@ void kill_screen(const char* lcd_msg) {
2500 2500
       line_to_z(z_dest);
2501 2501
 
2502 2502
       lcd_synchronize();
2503
-      move_menu_scale = 0.1;
2503
+      move_menu_scale = PROBE_MANUALLY_STEP;
2504 2504
       lcd_goto_screen(lcd_move_z);
2505 2505
     }
2506 2506
 
2507 2507
     float lcd_probe_pt(const float &lx, const float &ly) {
2508 2508
       _man_probe_pt(lx, ly);
2509 2509
       KEEPALIVE_STATE(PAUSED_FOR_USER);
2510
+      defer_return_to_status = true;
2510 2511
       wait_for_user = true;
2511 2512
       while (wait_for_user) idle();
2512 2513
       KEEPALIVE_STATE(IN_HANDLER);
2514
+      defer_return_to_status = false;
2515
+      lcd_goto_previous_menu();
2513 2516
       return current_position[Z_AXIS];
2514 2517
     }
2515 2518
 
@@ -2518,12 +2521,32 @@ void kill_screen(const char* lcd_msg) {
2518 2521
     void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); }
2519 2522
     void _goto_center()  { _man_probe_pt(0,0); }
2520 2523
 
2524
+    void lcd_delta_G33_settings() {
2525
+      START_MENU();
2526
+      MENU_BACK(MSG_DELTA_CALIBRATE);
2527
+      float delta_height = DELTA_HEIGHT + home_offset[Z_AXIS], Tz = 0.00;
2528
+      MENU_ITEM_EDIT(float52, "Height", &delta_height, delta_height, delta_height);
2529
+      MENU_ITEM_EDIT(float43, "Ex", &endstop_adj[A_AXIS], -5.0, 5.0);
2530
+      MENU_ITEM_EDIT(float43, "Ey", &endstop_adj[B_AXIS], -5.0, 5.0);
2531
+      MENU_ITEM_EDIT(float43, "Ez", &endstop_adj[C_AXIS], -5.0, 5.0);
2532
+      MENU_ITEM_EDIT(float52, "Radius", &delta_radius, DELTA_RADIUS - 5.0, DELTA_RADIUS + 5.0);
2533
+      MENU_ITEM_EDIT(float43, "Tx", &delta_tower_angle_trim[A_AXIS], -5.0, 5.0);
2534
+      MENU_ITEM_EDIT(float43, "Ty", &delta_tower_angle_trim[B_AXIS], -5.0, 5.0);
2535
+      MENU_ITEM_EDIT(float43, "Tz", &Tz, -5.0, 5.0);
2536
+      END_MENU();
2537
+    }
2538
+
2521 2539
     void lcd_delta_calibrate_menu() {
2522 2540
       START_MENU();
2523 2541
       MENU_BACK(MSG_MAIN);
2524 2542
       #if ENABLED(DELTA_AUTO_CALIBRATION)
2543
+        MENU_ITEM(submenu, MSG_DELTA_SETTINGS, lcd_delta_G33_settings);
2525 2544
         MENU_ITEM(gcode, MSG_DELTA_AUTO_CALIBRATE, PSTR("G33"));
2526 2545
         MENU_ITEM(gcode, MSG_DELTA_HEIGHT_CALIBRATE, PSTR("G33 P1"));
2546
+        #if ENABLED(EEPROM_SETTINGS)
2547
+          MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings);
2548
+          MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings);
2549
+        #endif
2527 2550
       #endif
2528 2551
       MENU_ITEM(submenu, MSG_AUTO_HOME, _lcd_delta_calibrate_home);
2529 2552
       if (axis_homed[Z_AXIS]) {
@@ -2612,7 +2635,8 @@ void kill_screen(const char* lcd_msg) {
2612 2635
       encoderPosition = 0;
2613 2636
       lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
2614 2637
     }
2615
-    if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr41sign(current_position[axis]));
2638
+    if (lcdDrawUpdate)
2639
+      lcd_implementation_drawedit(name, move_menu_scale >= 0.1 ? ftostr41sign(current_position[axis]) : ftostr43sign(current_position[axis]));
2616 2640
   }
2617 2641
   void lcd_move_x() { _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS); }
2618 2642
   void lcd_move_y() { _lcd_move_xyz(PSTR(MSG_MOVE_Y), Y_AXIS); }

+ 1
- 1
Marlin/utility.h Parādīt failu

@@ -47,7 +47,7 @@ void safe_delay(millis_t ms);
47 47
   char* ftostr12ns(const float &x);
48 48
 
49 49
   // Convert signed float to fixed-length string with 023.45 / -23.45 format
50
-  char *ftostr32(const float &x);
50
+  char* ftostr32(const float &x);
51 51
 
52 52
   // Convert float to fixed-length string with +123.4 / -123.4 format
53 53
   char* ftostr41sign(const float &x);

Notiek ielāde…
Atcelt
Saglabāt