Parcourir la source

Patch G33 misuse of PROBE_MANUALLY

Scott Lahteine il y a 7 ans
Parent
révision
82f45c3e6a

+ 17
- 17
Marlin/src/gcode/calibrate/G33.cpp Voir le fichier

153
              _7p_6_centre         = probe_points >= 5 && probe_points <= 7,
153
              _7p_6_centre         = probe_points >= 5 && probe_points <= 7,
154
              _7p_9_centre         = probe_points >= 8;
154
              _7p_9_centre         = probe_points >= 8;
155
 
155
 
156
-  #if DISABLED(PROBE_MANUALLY)
156
+  #if HAS_BED_PROBE
157
     const float dx = (X_PROBE_OFFSET_FROM_EXTRUDER),
157
     const float dx = (X_PROBE_OFFSET_FROM_EXTRUDER),
158
                 dy = (Y_PROBE_OFFSET_FROM_EXTRUDER);
158
                 dy = (Y_PROBE_OFFSET_FROM_EXTRUDER);
159
   #endif
159
   #endif
164
 
164
 
165
     if (!_7p_no_intermediates && !_7p_4_intermediates && !_7p_11_intermediates) { // probe the center
165
     if (!_7p_no_intermediates && !_7p_4_intermediates && !_7p_11_intermediates) { // probe the center
166
       z_at_pt[CEN] +=
166
       z_at_pt[CEN] +=
167
-        #if ENABLED(PROBE_MANUALLY)
168
-          lcd_probe_pt(0, 0)
169
-        #else
167
+        #if HAS_BED_PROBE
170
           probe_pt(dx, dy, stow_after_each, 1, false)
168
           probe_pt(dx, dy, stow_after_each, 1, false)
169
+        #else
170
+          lcd_probe_pt(0, 0)
171
         #endif
171
         #endif
172
       ;
172
       ;
173
     }
173
     }
179
         const float a = RADIANS(210 + (360 / NPP) *  (axis - 1)),
179
         const float a = RADIANS(210 + (360 / NPP) *  (axis - 1)),
180
                     r = delta_calibration_radius * 0.1;
180
                     r = delta_calibration_radius * 0.1;
181
         z_at_pt[CEN] +=
181
         z_at_pt[CEN] +=
182
-          #if ENABLED(PROBE_MANUALLY)
183
-            lcd_probe_pt(cos(a) * r, sin(a) * r)
184
-          #else
182
+          #if HAS_BED_PROBE
185
             probe_pt(cos(a) * r + dx, sin(a) * r + dy, stow_after_each, 1)
183
             probe_pt(cos(a) * r + dx, sin(a) * r + dy, stow_after_each, 1)
184
+          #else
185
+            lcd_probe_pt(cos(a) * r, sin(a) * r)
186
           #endif
186
           #endif
187
         ;
187
         ;
188
       }
188
       }
208
                       r = delta_calibration_radius * (1 + 0.1 * (zig_zag ? circle : - circle)),
208
                       r = delta_calibration_radius * (1 + 0.1 * (zig_zag ? circle : - circle)),
209
                       interpol = FMOD(axis, 1);
209
                       interpol = FMOD(axis, 1);
210
           const float z_temp =
210
           const float z_temp =
211
-            #if ENABLED(PROBE_MANUALLY)
212
-              lcd_probe_pt(cos(a) * r, sin(a) * r)
213
-            #else
211
+            #if HAS_BED_PROBE
214
               probe_pt(cos(a) * r + dx, sin(a) * r + dy, stow_after_each, 1)
212
               probe_pt(cos(a) * r + dx, sin(a) * r + dy, stow_after_each, 1)
213
+            #else
214
+              lcd_probe_pt(cos(a) * r, sin(a) * r)
215
             #endif
215
             #endif
216
           ;
216
           ;
217
           // split probe point to neighbouring calibration points
217
           // split probe point to neighbouring calibration points
242
   return 0.00001;
242
   return 0.00001;
243
 }
243
 }
244
 
244
 
245
-#if DISABLED(PROBE_MANUALLY)
245
+#if HAS_BED_PROBE
246
 
246
 
247
   static void G33_auto_tune() {
247
   static void G33_auto_tune() {
248
     float z_at_pt[NPP + 1]      = { 0.0 },
248
     float z_at_pt[NPP + 1]      = { 0.0 },
366
     SERIAL_EOL();
366
     SERIAL_EOL();
367
   }
367
   }
368
 
368
 
369
-#endif // !PROBE_MANUALLY
369
+#endif // HAS_BED_PROBE
370
 
370
 
371
 /**
371
 /**
372
  * G33 - Delta '1-4-7-point' Auto-Calibration
372
  * G33 - Delta '1-4-7-point' Auto-Calibration
488
   }
488
   }
489
 
489
 
490
   if (auto_tune) {
490
   if (auto_tune) {
491
-    #if ENABLED(PROBE_MANUALLY)
492
-      SERIAL_PROTOCOLLNPGM("A probe is needed for auto-tune");
493
-    #else
491
+    #if HAS_BED_PROBE
494
       G33_auto_tune();
492
       G33_auto_tune();
493
+    #else
494
+      SERIAL_PROTOCOLLNPGM("A probe is needed for auto-tune");
495
     #endif
495
     #endif
496
     G33_CLEANUP();
496
     G33_CLEANUP();
497
     return;
497
     return;
556
       #define Z2(I) ZP(2, I)
556
       #define Z2(I) ZP(2, I)
557
       #define Z1(I) ZP(1, I)
557
       #define Z1(I) ZP(1, I)
558
 
558
 
559
-      #if ENABLED(PROBE_MANUALLY)
559
+      #if !HAS_BED_PROBE
560
         test_precision = 0.00; // forced end
560
         test_precision = 0.00; // forced end
561
       #endif
561
       #endif
562
 
562
 
638
       if ((zero_std_dev >= test_precision && iterations > force_iterations) || zero_std_dev <= calibration_precision) {  // end iterations
638
       if ((zero_std_dev >= test_precision && iterations > force_iterations) || zero_std_dev <= calibration_precision) {  // end iterations
639
         SERIAL_PROTOCOLPGM("Calibration OK");
639
         SERIAL_PROTOCOLPGM("Calibration OK");
640
         SERIAL_PROTOCOL_SP(32);
640
         SERIAL_PROTOCOL_SP(32);
641
-        #if DISABLED(PROBE_MANUALLY)
641
+        #if HAS_BED_PROBE
642
           if (zero_std_dev >= test_precision && !_1p_calibration)
642
           if (zero_std_dev >= test_precision && !_1p_calibration)
643
             SERIAL_PROTOCOLPGM("rolling back.");
643
             SERIAL_PROTOCOLPGM("rolling back.");
644
           else
644
           else

+ 1
- 1
Marlin/src/gcode/gcode.h Voir le fichier

379
     #endif
379
     #endif
380
   #endif
380
   #endif
381
 
381
 
382
-  #if PROBE_SELECTED && ENABLED(DELTA_AUTO_CALIBRATION)
382
+  #if ENABLED(DELTA_AUTO_CALIBRATION)
383
     static void G33();
383
     static void G33();
384
   #endif
384
   #endif
385
 
385
 

+ 0
- 7
Marlin/src/inc/Conditionals_LCD.h Voir le fichier

469
 #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0)
469
 #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0)
470
 
470
 
471
 /**
471
 /**
472
- * UBL has its own manual probing, so this just causes trouble.
473
- */
474
-#if ENABLED(AUTO_BED_LEVELING_UBL)
475
-  #undef PROBE_MANUALLY
476
-#endif
477
-
478
-/**
479
  * Set a flag for any enabled probe
472
  * Set a flag for any enabled probe
480
  */
473
  */
481
 #define PROBE_SELECTED (ENABLED(PROBE_MANUALLY) || ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE))
474
 #define PROBE_SELECTED (ENABLED(PROBE_MANUALLY) || ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE))

+ 1
- 1
Marlin/src/inc/Conditionals_adv.h Voir le fichier

22
 
22
 
23
 /**
23
 /**
24
  * Conditionals_adv.h
24
  * Conditionals_adv.h
25
- * Defines that depend on advanced onfiguration.
25
+ * Defines that depend on advanced configuration.
26
  */
26
  */
27
 
27
 
28
 #ifndef CONDITIONALS_ADV_H
28
 #ifndef CONDITIONALS_ADV_H

+ 0
- 5
Marlin/src/inc/Conditionals_post.h Voir le fichier

1114
 // Add commands that need sub-codes to this list
1114
 // Add commands that need sub-codes to this list
1115
 #define USE_GCODE_SUBCODES ENABLED(G38_PROBE_TARGET) || ENABLED(CNC_COORDINATE_SYSTEMS)
1115
 #define USE_GCODE_SUBCODES ENABLED(G38_PROBE_TARGET) || ENABLED(CNC_COORDINATE_SYSTEMS)
1116
 
1116
 
1117
-// MESH_BED_LEVELING overrides PROBE_MANUALLY
1118
-#if ENABLED(MESH_BED_LEVELING)
1119
-  #undef PROBE_MANUALLY
1120
-#endif
1121
-
1122
 // Parking Extruder
1117
 // Parking Extruder
1123
 #if ENABLED(PARKING_EXTRUDER)
1118
 #if ENABLED(PARKING_EXTRUDER)
1124
   #ifndef PARKING_EXTRUDER_GRAB_DISTANCE
1119
   #ifndef PARKING_EXTRUDER_GRAB_DISTANCE

+ 18
- 13
Marlin/src/inc/SanityCheck.h Voir le fichier

586
     #error "You probably want to use Max Endstops for DELTA!"
586
     #error "You probably want to use Max Endstops for DELTA!"
587
   #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_DELTA
587
   #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_DELTA
588
     #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
588
     #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
589
-  #elif ENABLED(DELTA_AUTO_CALIBRATION) && !PROBE_SELECTED
590
-    #error "DELTA_AUTO_CALIBRATION requires a probe: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, Z Servo."
591
-  #elif ENABLED(DELTA_AUTO_CALIBRATION) && ENABLED(PROBE_MANUALLY) && DISABLED(ULTIPANEL)
592
-    #error "DELTA_AUTO_CALIBRATION requires an LCD controller with PROBE_MANUALLY."
589
+  #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || ENABLED(ULTIPANEL))
590
+    #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller."
593
   #elif ABL_GRID
591
   #elif ABL_GRID
594
     #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0
592
     #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0
595
       #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
593
       #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
631
   , "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
629
   , "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
632
 );
630
 );
633
 
631
 
634
-#if PROBE_SELECTED
632
+#if HAS_BED_PROBE
635
 
633
 
636
   /**
634
   /**
637
    * Z_PROBE_SLED is incompatible with DELTA
635
    * Z_PROBE_SLED is incompatible with DELTA
679
     #if !HAS_Z_MIN_PROBE_PIN
677
     #if !HAS_Z_MIN_PROBE_PIN
680
       #error "Z_MIN_PROBE_ENDSTOP requires the Z_MIN_PROBE_PIN to be defined."
678
       #error "Z_MIN_PROBE_ENDSTOP requires the Z_MIN_PROBE_PIN to be defined."
681
     #endif
679
     #endif
682
-  #elif DISABLED(PROBE_MANUALLY)
680
+  #else
683
     #error "You must enable either Z_MIN_PROBE_ENDSTOP or Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use a probe."
681
     #error "You must enable either Z_MIN_PROBE_ENDSTOP or Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use a probe."
684
   #endif
682
   #endif
685
 
683
 
701
   /**
699
   /**
702
    * Require some kind of probe for bed leveling and probe testing
700
    * Require some kind of probe for bed leveling and probe testing
703
    */
701
    */
704
-  #if OLDSCHOOL_ABL
702
+  #if OLDSCHOOL_ABL && !PROBE_SELECTED
705
     #error "Auto Bed Leveling requires one of these: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or a Z Servo."
703
     #error "Auto Bed Leveling requires one of these: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or a Z Servo."
706
   #endif
704
   #endif
707
 
705
 
708
-#endif
706
+  #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
707
+    #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe: FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
708
+  #endif
709
 
709
 
710
-#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) && !HAS_BED_PROBE
711
-  #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe: FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
712
 #endif
710
 #endif
713
 
711
 
714
 /**
712
 /**
743
    * Unified Bed Leveling
741
    * Unified Bed Leveling
744
    */
742
    */
745
 
743
 
744
+  // Hide PROBE_MANUALLY from the rest of the code
745
+  #undef PROBE_MANUALLY
746
+
746
   #if IS_SCARA
747
   #if IS_SCARA
747
     #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
748
     #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
748
   #elif DISABLED(EEPROM_SETTINGS)
749
   #elif DISABLED(EEPROM_SETTINGS)
760
   #if ENABLED(ENABLE_MESH_EDIT_GFX_OVERLAY) && !ENABLED(DOGLCD)
761
   #if ENABLED(ENABLE_MESH_EDIT_GFX_OVERLAY) && !ENABLED(DOGLCD)
761
     #error "ENABLE_MESH_EDIT_GFX_OVERLAY requires a DOGLCD."
762
     #error "ENABLE_MESH_EDIT_GFX_OVERLAY requires a DOGLCD."
762
   #endif
763
   #endif
763
-#elif HAS_ABL
764
+
765
+#elif OLDSCHOOL_ABL
764
 
766
 
765
   /**
767
   /**
766
    * Auto Bed Leveling
768
    * Auto Bed Leveling
809
 
811
 
810
 #elif ENABLED(MESH_BED_LEVELING)
812
 #elif ENABLED(MESH_BED_LEVELING)
811
 
813
 
814
+  // Hide PROBE_MANUALLY from the rest of the code
815
+  #undef PROBE_MANUALLY
816
+
812
   /**
817
   /**
813
    * Mesh Bed Leveling
818
    * Mesh Bed Leveling
814
    */
819
    */
827
 #if ENABLED(LCD_BED_LEVELING)
832
 #if ENABLED(LCD_BED_LEVELING)
828
   #if DISABLED(ULTIPANEL)
833
   #if DISABLED(ULTIPANEL)
829
     #error "LCD_BED_LEVELING requires an LCD controller."
834
     #error "LCD_BED_LEVELING requires an LCD controller."
830
-  #elif DISABLED(MESH_BED_LEVELING) && !(HAS_ABL && ENABLED(PROBE_MANUALLY))
831
-    #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or PROBE_MANUALLY with auto bed leveling enabled."
835
+  #elif !(ENABLED(MESH_BED_LEVELING) || (OLDSCHOOL_ABL && ENABLED(PROBE_MANUALLY)))
836
+    #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or ABL with PROBE_MANUALLY."
832
   #endif
837
   #endif
833
 #endif
838
 #endif
834
 
839
 

+ 27
- 20
Marlin/src/lcd/ultralcd.cpp Voir le fichier

155
     extern bool powersupply_on;
155
     extern bool powersupply_on;
156
   #endif
156
   #endif
157
 
157
 
158
+  float move_menu_scale;
159
+
158
   ////////////////////////////////////////////
160
   ////////////////////////////////////////////
159
   ///////////////// Menu Tree ////////////////
161
   ///////////////// Menu Tree ////////////////
160
   ////////////////////////////////////////////
162
   ////////////////////////////////////////////
2679
     END_MENU();
2681
     END_MENU();
2680
   }
2682
   }
2681
 
2683
 
2682
-  float move_menu_scale;
2683
-
2684
-  #if ENABLED(DELTA_CALIBRATION_MENU)
2684
+  #if ENABLED(DELTA_CALIBRATION_MENU) || (ENABLED(DELTA_AUTO_CALIBRATION) && !HAS_BED_PROBE)
2685
 
2685
 
2686
     void lcd_move_z();
2686
     void lcd_move_z();
2687
-    void lcd_delta_calibrate_menu();
2688
-
2689
-    void _lcd_calibrate_homing() {
2690
-      if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_HOMING));
2691
-      lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
2692
-      if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
2693
-        lcd_goto_previous_menu();
2694
-    }
2695
-
2696
-    void _lcd_delta_calibrate_home() {
2697
-      #if HAS_LEVELING
2698
-        reset_bed_level(); // After calibration bed-level data is no longer valid
2699
-      #endif
2700
-
2701
-      enqueue_and_echo_commands_P(PSTR("G28"));
2702
-      lcd_goto_screen(_lcd_calibrate_homing);
2703
-    }
2704
 
2687
 
2705
     void _man_probe_pt(const float &rx, const float &ry) {
2688
     void _man_probe_pt(const float &rx, const float &ry) {
2706
       #if HAS_LEVELING
2689
       #if HAS_LEVELING
2720
       lcd_goto_screen(lcd_move_z);
2703
       lcd_goto_screen(lcd_move_z);
2721
     }
2704
     }
2722
 
2705
 
2706
+  #endif // DELTA_CALIBRATION_MENU || (DELTA_AUTO_CALIBRATION && !HAS_BED_PROBE)
2707
+
2708
+  #if ENABLED(DELTA_AUTO_CALIBRATION) && !HAS_BED_PROBE
2709
+
2723
     float lcd_probe_pt(const float &rx, const float &ry) {
2710
     float lcd_probe_pt(const float &rx, const float &ry) {
2724
       _man_probe_pt(rx, ry);
2711
       _man_probe_pt(rx, ry);
2725
       KEEPALIVE_STATE(PAUSED_FOR_USER);
2712
       KEEPALIVE_STATE(PAUSED_FOR_USER);
2731
       return current_position[Z_AXIS];
2718
       return current_position[Z_AXIS];
2732
     }
2719
     }
2733
 
2720
 
2721
+  #endif // DELTA_AUTO_CALIBRATION && !HAS_BED_PROBE
2722
+
2723
+  #if ENABLED(DELTA_CALIBRATION_MENU)
2724
+
2725
+    void _lcd_calibrate_homing() {
2726
+      if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_HOMING));
2727
+      lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
2728
+      if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
2729
+        lcd_goto_previous_menu();
2730
+    }
2731
+
2732
+    void _lcd_delta_calibrate_home() {
2733
+      #if HAS_LEVELING
2734
+        reset_bed_level(); // After calibration bed-level data is no longer valid
2735
+      #endif
2736
+
2737
+      enqueue_and_echo_commands_P(PSTR("G28"));
2738
+      lcd_goto_screen(_lcd_calibrate_homing);
2739
+    }
2740
+
2734
     void _goto_tower_x() { _man_probe_pt(cos(RADIANS(210)) * delta_calibration_radius, sin(RADIANS(210)) * delta_calibration_radius); }
2741
     void _goto_tower_x() { _man_probe_pt(cos(RADIANS(210)) * delta_calibration_radius, sin(RADIANS(210)) * delta_calibration_radius); }
2735
     void _goto_tower_y() { _man_probe_pt(cos(RADIANS(330)) * delta_calibration_radius, sin(RADIANS(330)) * delta_calibration_radius); }
2742
     void _goto_tower_y() { _man_probe_pt(cos(RADIANS(330)) * delta_calibration_radius, sin(RADIANS(330)) * delta_calibration_radius); }
2736
     void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); }
2743
     void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); }

+ 1
- 1
Marlin/src/lcd/ultralcd.h Voir le fichier

118
       float lcd_z_offset_edit();
118
       float lcd_z_offset_edit();
119
     #endif
119
     #endif
120
 
120
 
121
-    #if ENABLED(DELTA_CALIBRATION_MENU)
121
+    #if ENABLED(DELTA_AUTO_CALIBRATION) && !HAS_BED_PROBE
122
       float lcd_probe_pt(const float &rx, const float &ry);
122
       float lcd_probe_pt(const float &rx, const float &ry);
123
     #endif
123
     #endif
124
 
124
 

Chargement…
Annuler
Enregistrer