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

Merge pull request #8325 from LVD-AC/1.1.x-manual-probe

[1.1.x] PROBE_SELECTED etc.
Scott Lahteine 6 роки тому
джерело
коміт
2a54fd1444
Аккаунт користувача з таким Email не знайдено

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

@@ -310,7 +310,7 @@ void report_current_position();
310 310
                delta_segments_per_second,
311 311
                delta_tower_angle_trim[ABC],
312 312
                delta_clip_start_height;
313
-  void recalc_delta_settings(float radius, float diagonal_rod, float tower_angle_trim[ABC]);
313
+  void recalc_delta_settings();
314 314
 #elif IS_SCARA
315 315
   void forward_kinematics_SCARA(const float &a, const float &b);
316 316
 #endif
@@ -482,7 +482,7 @@ void do_blocking_move_to_xy(const float &x, const float &y, const float &fr_mm_s
482 482
     // This won't work on SCARA since the probe offset rotates with the arm.
483 483
 
484 484
     return position_is_reachable(rx, ry)
485
-        && position_is_reachable(rx - X_PROBE_OFFSET_FROM_EXTRUDER, ry - Y_PROBE_OFFSET_FROM_EXTRUDER);
485
+        && position_is_reachable(rx - (X_PROBE_OFFSET_FROM_EXTRUDER), ry - (Y_PROBE_OFFSET_FROM_EXTRUDER));
486 486
   }
487 487
 
488 488
 #else // CARTESIAN

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

@@ -2333,10 +2333,9 @@ static void clean_up_after_endstop_or_probe_move() {
2333 2333
    * @details Used by probe_pt to do a single Z probe.
2334 2334
    *          Leaves current_position[Z_AXIS] at the height where the probe triggered.
2335 2335
    *
2336
-   * @param  short_move Flag for a shorter probe move towards the bed
2337 2336
    * @return The raw Z position where the probe was triggered
2338 2337
    */
2339
-  static float run_z_probe(const bool short_move=true) {
2338
+  static float run_z_probe() {
2340 2339
 
2341 2340
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2342 2341
       if (DEBUGGING(LEVELING)) DEBUG_POS(">>> run_z_probe", current_position);
@@ -2374,7 +2373,7 @@ static void clean_up_after_endstop_or_probe_move() {
2374 2373
     #endif
2375 2374
 
2376 2375
     // move down slowly to find bed
2377
-    if (do_probe_move(-10 + (short_move ? 0 : -(Z_MAX_LENGTH)), Z_PROBE_SPEED_SLOW)) return NAN;
2376
+    if (do_probe_move(-10, Z_PROBE_SPEED_SLOW)) return NAN;
2378 2377
 
2379 2378
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2380 2379
       if (DEBUGGING(LEVELING)) DEBUG_POS("<<< run_z_probe", current_position);
@@ -2413,12 +2412,11 @@ static void clean_up_after_endstop_or_probe_move() {
2413 2412
 
2414 2413
     const float nx = rx - (X_PROBE_OFFSET_FROM_EXTRUDER), ny = ry - (Y_PROBE_OFFSET_FROM_EXTRUDER);
2415 2414
 
2416
-    if (printable
2415
+    if (!printable
2417 2416
       ? !position_is_reachable(nx, ny)
2418 2417
       : !position_is_reachable_by_probe(rx, ry)
2419 2418
     ) return NAN;
2420 2419
 
2421
-
2422 2420
     const float old_feedrate_mm_s = feedrate_mm_s;
2423 2421
 
2424 2422
     #if ENABLED(DELTA)
@@ -2426,12 +2424,6 @@ static void clean_up_after_endstop_or_probe_move() {
2426 2424
         do_blocking_move_to_z(delta_clip_start_height);
2427 2425
     #endif
2428 2426
 
2429
-    #if HAS_SOFTWARE_ENDSTOPS
2430
-      // Store the status of the soft endstops and disable if we're probing a non-printable location
2431
-      static bool enable_soft_endstops = soft_endstops_enabled;
2432
-      if (!printable) soft_endstops_enabled = false;
2433
-    #endif
2434
-
2435 2427
     feedrate_mm_s = XY_PROBE_FEEDRATE_MM_S;
2436 2428
 
2437 2429
     // Move the probe to the given XY
@@ -2439,7 +2431,7 @@ static void clean_up_after_endstop_or_probe_move() {
2439 2431
 
2440 2432
     float measured_z = NAN;
2441 2433
     if (!DEPLOY_PROBE()) {
2442
-      measured_z = run_z_probe(printable);
2434
+      measured_z = run_z_probe();
2443 2435
 
2444 2436
       if (!stow)
2445 2437
         do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
@@ -2447,11 +2439,6 @@ static void clean_up_after_endstop_or_probe_move() {
2447 2439
         if (STOW_PROBE()) measured_z = NAN;
2448 2440
     }
2449 2441
 
2450
-    #if HAS_SOFTWARE_ENDSTOPS
2451
-      // Restore the soft endstop status
2452
-      soft_endstops_enabled = enable_soft_endstops;
2453
-    #endif
2454
-
2455 2442
     if (verbose_level > 2) {
2456 2443
       SERIAL_PROTOCOLPGM("Bed X: ");
2457 2444
       SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(rx), 3);
@@ -5592,7 +5579,7 @@ void home_all_axes() { gcode_G28(true); }
5592 5579
                       r = delta_calibration_radius * 0.1;
5593 5580
           z_at_pt[CEN] +=
5594 5581
             #if HAS_BED_PROBE
5595
-              probe_pt(cos(a) * r + dx, sin(a) * r + dy, stow_after_each, 1)
5582
+              probe_pt(cos(a) * r + dx, sin(a) * r + dy, stow_after_each, 1, false)
5596 5583
             #else
5597 5584
               lcd_probe_pt(cos(a) * r, sin(a) * r)
5598 5585
             #endif
@@ -5621,7 +5608,7 @@ void home_all_axes() { gcode_G28(true); }
5621 5608
                         interpol = fmod(axis, 1);
5622 5609
             const float z_temp =
5623 5610
               #if HAS_BED_PROBE
5624
-                probe_pt(cos(a) * r + dx, sin(a) * r + dy, stow_after_each, 1)
5611
+                probe_pt(cos(a) * r + dx, sin(a) * r + dy, stow_after_each, 1, false)
5625 5612
               #else
5626 5613
                 lcd_probe_pt(cos(a) * r, sin(a) * r)
5627 5614
               #endif
@@ -5637,7 +5624,6 @@ void home_all_axes() { gcode_G28(true); }
5637 5624
             z_at_pt[axis] /= _7P_STEP  / steps;
5638 5625
       }
5639 5626
 
5640
-
5641 5627
       float S1 = z_at_pt[CEN],
5642 5628
             S2 = sq(z_at_pt[CEN]);
5643 5629
       int16_t N = 1;
@@ -5675,6 +5661,7 @@ void home_all_axes() { gcode_G28(true); }
5675 5661
 
5676 5662
       LOOP_XYZ(axis) {
5677 5663
         delta_endstop_adj[axis] -= 1.0;
5664
+        recalc_delta_settings();
5678 5665
 
5679 5666
         endstops.enable(true);
5680 5667
         if (!home_delta()) return;
@@ -5688,6 +5675,7 @@ void home_all_axes() { gcode_G28(true); }
5688 5675
         LOOP_CAL_ALL(axis) z_at_pt[axis] -= z_at_pt_base[axis];
5689 5676
         print_G33_results(z_at_pt, true, true);
5690 5677
         delta_endstop_adj[axis] += 1.0;
5678
+        recalc_delta_settings();
5691 5679
         switch (axis) {
5692 5680
           case A_AXIS :
5693 5681
             h_fac += 4.0 / (Z03(CEN) +Z01(__A)                               +Z32(_CA) +Z32(_AB)); // Offset by X-tower end-stop
@@ -5705,7 +5693,7 @@ void home_all_axes() { gcode_G28(true); }
5705 5693
 
5706 5694
       for (int8_t zig_zag = -1; zig_zag < 2; zig_zag += 2) {
5707 5695
         delta_radius += 1.0 * zig_zag;
5708
-        recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
5696
+        recalc_delta_settings();
5709 5697
 
5710 5698
         endstops.enable(true);
5711 5699
         if (!home_delta()) return;
@@ -5718,7 +5706,7 @@ void home_all_axes() { gcode_G28(true); }
5718 5706
         LOOP_CAL_ALL(axis) z_at_pt[axis] -= z_at_pt_base[axis];
5719 5707
         print_G33_results(z_at_pt, true, true);
5720 5708
         delta_radius -= 1.0 * zig_zag;
5721
-        recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
5709
+        recalc_delta_settings();
5722 5710
         r_fac -= zig_zag * 6.0 / (Z03(__A) +Z03(__B) +Z03(__C) +Z03(_BC) +Z03(_CA) +Z03(_AB)); // Offset by delta radius
5723 5711
       }
5724 5712
       r_fac /= 2.0;
@@ -5731,7 +5719,7 @@ void home_all_axes() { gcode_G28(true); }
5731 5719
         z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
5732 5720
         delta_height -= z_temp;
5733 5721
         LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
5734
-        recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
5722
+        recalc_delta_settings();
5735 5723
 
5736 5724
         endstops.enable(true);
5737 5725
         if (!home_delta()) return;
@@ -5751,7 +5739,7 @@ void home_all_axes() { gcode_G28(true); }
5751 5739
         z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
5752 5740
         delta_height -= z_temp;
5753 5741
         LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
5754
-        recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
5742
+        recalc_delta_settings();
5755 5743
         switch (axis) {
5756 5744
           case A_AXIS :
5757 5745
           a_fac += 4.0 / (          Z06(__B) -Z06(__C)           +Z06(_CA) -Z06(_AB)); // Offset by alpha tower angle
@@ -6038,7 +6026,7 @@ void home_all_axes() { gcode_G28(true); }
6038 6026
         delta_height -= z_temp;
6039 6027
         LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
6040 6028
       }
6041
-      recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
6029
+      recalc_delta_settings();
6042 6030
       NOMORE(zero_std_dev_min, zero_std_dev);
6043 6031
 
6044 6032
       // print report
@@ -8997,7 +8985,7 @@ inline void gcode_M205() {
8997 8985
     if (parser.seen('X')) delta_tower_angle_trim[A_AXIS] = parser.value_float();
8998 8986
     if (parser.seen('Y')) delta_tower_angle_trim[B_AXIS] = parser.value_float();
8999 8987
     if (parser.seen('Z')) delta_tower_angle_trim[C_AXIS] = parser.value_float();
9000
-    recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
8988
+    recalc_delta_settings();
9001 8989
   }
9002 8990
   /**
9003 8991
    * M666: Set delta endstop adjustment
@@ -9440,8 +9428,6 @@ inline void gcode_M226() {
9440 9428
     if (parser.seen('I')) thermalManager.bedKi = scalePID_i(parser.value_float());
9441 9429
     if (parser.seen('D')) thermalManager.bedKd = scalePID_d(parser.value_float());
9442 9430
 
9443
-    thermalManager.updatePID();
9444
-
9445 9431
     SERIAL_ECHO_START();
9446 9432
     SERIAL_ECHOPAIR(" p:", thermalManager.bedKp);
9447 9433
     SERIAL_ECHOPAIR(" i:", unscalePID_i(thermalManager.bedKi));
@@ -11409,17 +11395,13 @@ void process_parsed_command() {
11409 11395
 
11410 11396
       #endif // HAS_BED_PROBE
11411 11397
 
11412
-      #if PROBE_SELECTED
11413
-
11414
-        #if ENABLED(DELTA_AUTO_CALIBRATION)
11398
+      #if ENABLED(DELTA_AUTO_CALIBRATION)
11415 11399
 
11416
-          case 33: // G33: Delta Auto-Calibration
11417
-            gcode_G33();
11418
-            break;
11419
-
11420
-        #endif // DELTA_AUTO_CALIBRATION
11400
+        case 33: // G33: Delta Auto-Calibration
11401
+          gcode_G33();
11402
+          break;
11421 11403
 
11422
-      #endif // PROBE_SELECTED
11404
+      #endif // DELTA_AUTO_CALIBRATION
11423 11405
 
11424 11406
       #if ENABLED(G38_PROBE_TARGET)
11425 11407
         case 38: // G38.2 & G38.3
@@ -12355,18 +12337,20 @@ void ok_to_send() {
12355 12337
    * Recalculate factors used for delta kinematics whenever
12356 12338
    * settings have been changed (e.g., by M665).
12357 12339
    */
12358
-  void recalc_delta_settings(float radius, float diagonal_rod, float tower_angle_trim[ABC]) {
12340
+  void recalc_delta_settings() {
12359 12341
     const float trt[ABC] = DELTA_RADIUS_TRIM_TOWER,
12360 12342
                 drt[ABC] = DELTA_DIAGONAL_ROD_TRIM_TOWER;
12361
-    delta_tower[A_AXIS][X_AXIS] = cos(RADIANS(210 + tower_angle_trim[A_AXIS])) * (radius + trt[A_AXIS]); // front left tower
12362
-    delta_tower[A_AXIS][Y_AXIS] = sin(RADIANS(210 + tower_angle_trim[A_AXIS])) * (radius + trt[A_AXIS]);
12363
-    delta_tower[B_AXIS][X_AXIS] = cos(RADIANS(330 + tower_angle_trim[B_AXIS])) * (radius + trt[B_AXIS]); // front right tower
12364
-    delta_tower[B_AXIS][Y_AXIS] = sin(RADIANS(330 + tower_angle_trim[B_AXIS])) * (radius + trt[B_AXIS]);
12365
-    delta_tower[C_AXIS][X_AXIS] = cos(RADIANS( 90 + tower_angle_trim[C_AXIS])) * (radius + trt[C_AXIS]); // back middle tower
12366
-    delta_tower[C_AXIS][Y_AXIS] = sin(RADIANS( 90 + tower_angle_trim[C_AXIS])) * (radius + trt[C_AXIS]);
12367
-    delta_diagonal_rod_2_tower[A_AXIS] = sq(diagonal_rod + drt[A_AXIS]);
12368
-    delta_diagonal_rod_2_tower[B_AXIS] = sq(diagonal_rod + drt[B_AXIS]);
12369
-    delta_diagonal_rod_2_tower[C_AXIS] = sq(diagonal_rod + drt[C_AXIS]);
12343
+    delta_tower[A_AXIS][X_AXIS] = cos(RADIANS(210 + delta_tower_angle_trim[A_AXIS])) * (delta_radius + trt[A_AXIS]); // front left tower
12344
+    delta_tower[A_AXIS][Y_AXIS] = sin(RADIANS(210 + delta_tower_angle_trim[A_AXIS])) * (delta_radius + trt[A_AXIS]);
12345
+    delta_tower[B_AXIS][X_AXIS] = cos(RADIANS(330 + delta_tower_angle_trim[B_AXIS])) * (delta_radius + trt[B_AXIS]); // front right tower
12346
+    delta_tower[B_AXIS][Y_AXIS] = sin(RADIANS(330 + delta_tower_angle_trim[B_AXIS])) * (delta_radius + trt[B_AXIS]);
12347
+    delta_tower[C_AXIS][X_AXIS] = cos(RADIANS( 90 + delta_tower_angle_trim[C_AXIS])) * (delta_radius + trt[C_AXIS]); // back middle tower
12348
+    delta_tower[C_AXIS][Y_AXIS] = sin(RADIANS( 90 + delta_tower_angle_trim[C_AXIS])) * (delta_radius + trt[C_AXIS]);
12349
+    delta_diagonal_rod_2_tower[A_AXIS] = sq(delta_diagonal_rod + drt[A_AXIS]);
12350
+    delta_diagonal_rod_2_tower[B_AXIS] = sq(delta_diagonal_rod + drt[B_AXIS]);
12351
+    delta_diagonal_rod_2_tower[C_AXIS] = sq(delta_diagonal_rod + drt[C_AXIS]);
12352
+    update_software_endstops(Z_AXIS);
12353
+    axis_homed[X_AXIS] = axis_homed[Y_AXIS] = axis_homed[Z_AXIS] = false;
12370 12354
   }
12371 12355
 
12372 12356
   #if ENABLED(DELTA_FAST_SQRT)

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

@@ -227,7 +227,7 @@ void MarlinSettings::postprocess() {
227 227
   // Make sure delta kinematics are updated before refreshing the
228 228
   // planner position so the stepper counts will be set correctly.
229 229
   #if ENABLED(DELTA)
230
-    recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
230
+    recalc_delta_settings();
231 231
   #endif
232 232
 
233 233
   // Refresh steps_to_mm with the reciprocal of axis_steps_per_mm

+ 2
- 2
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h Переглянути файл

@@ -487,7 +487,7 @@
487 487
   // Delta calibration menu
488 488
   // uncomment to add three points calibration menu option.
489 489
   // See http://minow.blogspot.com/index.html#4918805519571907051
490
-  #define DELTA_CALIBRATION_MENU
490
+  //#define DELTA_CALIBRATION_MENU
491 491
 
492 492
   // uncomment to add G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
493 493
   #define DELTA_AUTO_CALIBRATION
@@ -506,7 +506,7 @@
506 506
   #endif
507 507
 
508 508
   #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU)
509
-    // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes
509
+    // Set the radius for the calibration probe points - max 0.9 * DELTA_PRINTABLE_RADIUS for non-eccentric probes
510 510
     #define DELTA_CALIBRATION_RADIUS 73.5 // mm
511 511
     // Set the steprate for papertest probing
512 512
     #define PROBE_MANUALLY_STEP 0.025

+ 1
- 1
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h Переглянути файл

@@ -506,7 +506,7 @@
506 506
   #endif
507 507
 
508 508
   #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU)
509
-    // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes
509
+    // Set the radius for the calibration probe points - max 0.9 * DELTA_PRINTABLE_RADIUS for non-eccentric probes
510 510
     #define DELTA_CALIBRATION_RADIUS 73.5 // mm
511 511
     // Set the steprate for papertest probing
512 512
     #define PROBE_MANUALLY_STEP 0.025

+ 1
- 1
Marlin/example_configurations/delta/generic/Configuration.h Переглянути файл

@@ -496,7 +496,7 @@
496 496
   #endif
497 497
 
498 498
   #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU)
499
-    // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes
499
+    // Set the radius for the calibration probe points - max 0.9 * DELTA_PRINTABLE_RADIUS for non-eccentric probes
500 500
     #define DELTA_CALIBRATION_RADIUS 121.5 // mm
501 501
     // Set the steprate for papertest probing
502 502
     #define PROBE_MANUALLY_STEP 0.025

+ 1
- 1
Marlin/example_configurations/delta/kossel_mini/Configuration.h Переглянути файл

@@ -496,7 +496,7 @@
496 496
   #endif
497 497
 
498 498
   #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU)
499
-    // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes
499
+    // Set the radius for the calibration probe points - max 0.9 * DELTA_PRINTABLE_RADIUS for non-eccentric probes
500 500
     #define DELTA_CALIBRATION_RADIUS 78.0 // mm
501 501
     // Set the steprate for papertest probing
502 502
     #define PROBE_MANUALLY_STEP 0.025

+ 1
- 1
Marlin/example_configurations/delta/kossel_pro/Configuration.h Переглянути файл

@@ -482,7 +482,7 @@
482 482
   #endif
483 483
 
484 484
   #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU)
485
-    // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes
485
+    // Set the radius for the calibration probe points - max 0.9 * DELTA_PRINTABLE_RADIUS for non-eccentric probes
486 486
     #define DELTA_CALIBRATION_RADIUS 110.0 // mm
487 487
     // Set the steprate for papertest probing
488 488
     #define PROBE_MANUALLY_STEP 0.025

+ 1
- 1
Marlin/example_configurations/delta/kossel_xl/Configuration.h Переглянути файл

@@ -500,7 +500,7 @@
500 500
   #endif
501 501
 
502 502
   #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU)
503
-    // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes
503
+    // Set the radius for the calibration probe points - max 0.9 * DELTA_PRINTABLE_RADIUS for non-eccentric probes
504 504
     #define DELTA_CALIBRATION_RADIUS 121.5 // mm
505 505
     // Set the steprate for papertest probing
506 506
     #define PROBE_MANUALLY_STEP 0.025

+ 7
- 9
Marlin/temperature.cpp Переглянути файл

@@ -215,6 +215,12 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS],
215 215
 
216 216
 #if HAS_PID_HEATING
217 217
 
218
+  /**
219
+   * PID Autotuning (M303)
220
+   *
221
+   * Alternately heat and cool the nozzle, observing its behavior to
222
+   * determine the best PID values to achieve a stable temperature.
223
+   */
218 224
   void Temperature::PID_autotune(const float temp, const int8_t hotend, const int8_t ncycles, const bool set_result/*=false*/) {
219 225
     float input = 0.0;
220 226
     int cycles = 0;
@@ -466,7 +472,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS],
466 472
           bedKp = workKp; \
467 473
           bedKi = scalePID_i(workKi); \
468 474
           bedKd = scalePID_d(workKd); \
469
-          updatePID(); }while(0)
475
+          }while(0)
470 476
 
471 477
         #define _SET_EXTRUDER_PID() do { \
472 478
           PID_PARAM(Kp, hotend) = workKp; \
@@ -502,14 +508,6 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS],
502 508
 
503 509
 Temperature::Temperature() { }
504 510
 
505
-void Temperature::updatePID() {
506
-  #if ENABLED(PIDTEMP)
507
-    #if ENABLED(PID_EXTRUSION_SCALING)
508
-      last_e_position = 0;
509
-    #endif
510
-  #endif
511
-}
512
-
513 511
 int Temperature::getHeaterPower(int heater) {
514 512
   return heater < 0 ? soft_pwm_amount_bed : soft_pwm_amount[heater];
515 513
 }

+ 12
- 5
Marlin/temperature.h Переглянути файл

@@ -438,12 +438,19 @@ class Temperature {
438 438
      */
439 439
     #if HAS_PID_HEATING
440 440
       static void PID_autotune(const float temp, const int8_t hotend, const int8_t ncycles, const bool set_result=false);
441
-    #endif
442 441
 
443
-    /**
444
-     * Update the temp manager when PID values change
445
-     */
446
-    static void updatePID();
442
+      /**
443
+       * Update the temp manager when PID values change
444
+       */
445
+      #if ENABLED(PIDTEMP)
446
+        FORCE_INLINE static void updatePID() {
447
+          #if ENABLED(PID_EXTRUSION_SCALING)
448
+            last_e_position = 0;
449
+          #endif
450
+        }
451
+      #endif
452
+
453
+    #endif
447 454
 
448 455
     #if ENABLED(BABYSTEPPING)
449 456
 

+ 26
- 24
Marlin/ultralcd.cpp Переглянути файл

@@ -204,7 +204,7 @@ uint16_t max_display_update_time = 0;
204 204
     void lcd_control_retract_menu();
205 205
   #endif
206 206
 
207
-  #if ENABLED(DELTA_CALIBRATION_MENU)
207
+  #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION)
208 208
     void lcd_delta_calibrate_menu();
209 209
   #endif
210 210
 
@@ -2558,7 +2558,7 @@ void kill_screen(const char* lcd_msg) {
2558 2558
     // Move Axis
2559 2559
     //
2560 2560
     #if ENABLED(DELTA)
2561
-      if (axis_homed[Z_AXIS])
2561
+      if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
2562 2562
     #endif
2563 2563
         MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
2564 2564
 
@@ -2673,7 +2673,7 @@ void kill_screen(const char* lcd_msg) {
2673 2673
     //
2674 2674
     // Delta Calibration
2675 2675
     //
2676
-    #if ENABLED(DELTA_CALIBRATION_MENU)
2676
+    #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION)
2677 2677
       MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu);
2678 2678
     #endif
2679 2679
 
@@ -2742,22 +2742,22 @@ void kill_screen(const char* lcd_msg) {
2742 2742
     void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); }
2743 2743
     void _goto_center()  { _man_probe_pt(0,0); }
2744 2744
 
2745
-    void _lcd_set_delta_height() {
2746
-      update_software_endstops(Z_AXIS);
2747
-    }
2745
+  #endif // DELTA_CALIBRATION_MENU
2746
+
2747
+  #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION)
2748 2748
 
2749 2749
     void lcd_delta_settings() {
2750 2750
       START_MENU();
2751 2751
       MENU_BACK(MSG_DELTA_CALIBRATE);
2752
-      MENU_ITEM_EDIT(float52, MSG_DELTA_DIAG_ROG, &delta_diagonal_rod, DELTA_DIAGONAL_ROD - 5.0, DELTA_DIAGONAL_ROD + 5.0);
2753
-      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10.0, delta_height + 10.0, _lcd_set_delta_height);
2754
-      MENU_ITEM_EDIT(float43, "Ex", &delta_endstop_adj[A_AXIS], -5.0, 5.0);
2755
-      MENU_ITEM_EDIT(float43, "Ey", &delta_endstop_adj[B_AXIS], -5.0, 5.0);
2756
-      MENU_ITEM_EDIT(float43, "Ez", &delta_endstop_adj[C_AXIS], -5.0, 5.0);
2757
-      MENU_ITEM_EDIT(float52, MSG_DELTA_RADIUS, &delta_radius, DELTA_RADIUS - 5.0, DELTA_RADIUS + 5.0);
2758
-      MENU_ITEM_EDIT(float43, "Tx", &delta_tower_angle_trim[A_AXIS], -5.0, 5.0);
2759
-      MENU_ITEM_EDIT(float43, "Ty", &delta_tower_angle_trim[B_AXIS], -5.0, 5.0);
2760
-      MENU_ITEM_EDIT(float43, "Tz", &delta_tower_angle_trim[C_AXIS], -5.0, 5.0);
2752
+      MENU_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_DIAG_ROG, &delta_diagonal_rod, delta_diagonal_rod - 5.0, delta_diagonal_rod + 5.0, recalc_delta_settings);
2753
+      MENU_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10.0, delta_height + 10.0, recalc_delta_settings);
2754
+      MENU_ITEM_EDIT_CALLBACK(float43, "Ex", &delta_endstop_adj[A_AXIS], -5.0, 5.0, recalc_delta_settings);
2755
+      MENU_ITEM_EDIT_CALLBACK(float43, "Ey", &delta_endstop_adj[B_AXIS], -5.0, 5.0, recalc_delta_settings);
2756
+      MENU_ITEM_EDIT_CALLBACK(float43, "Ez", &delta_endstop_adj[C_AXIS], -5.0, 5.0, recalc_delta_settings);
2757
+      MENU_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5.0, delta_radius + 5.0, recalc_delta_settings);
2758
+      MENU_ITEM_EDIT_CALLBACK(float43, "Tx", &delta_tower_angle_trim[A_AXIS], -5.0, 5.0, recalc_delta_settings);
2759
+      MENU_ITEM_EDIT_CALLBACK(float43, "Ty", &delta_tower_angle_trim[B_AXIS], -5.0, 5.0, recalc_delta_settings);
2760
+      MENU_ITEM_EDIT_CALLBACK(float43, "Tz", &delta_tower_angle_trim[C_AXIS], -5.0, 5.0, recalc_delta_settings);
2761 2761
       END_MENU();
2762 2762
     }
2763 2763
 
@@ -2765,7 +2765,6 @@ void kill_screen(const char* lcd_msg) {
2765 2765
       START_MENU();
2766 2766
       MENU_BACK(MSG_MAIN);
2767 2767
       #if ENABLED(DELTA_AUTO_CALIBRATION)
2768
-        MENU_ITEM(submenu, MSG_DELTA_SETTINGS, lcd_delta_settings);
2769 2768
         MENU_ITEM(gcode, MSG_DELTA_AUTO_CALIBRATE, PSTR("G33"));
2770 2769
         MENU_ITEM(gcode, MSG_DELTA_HEIGHT_CALIBRATE, PSTR("G33 P1"));
2771 2770
         #if ENABLED(EEPROM_SETTINGS)
@@ -2773,17 +2772,20 @@ void kill_screen(const char* lcd_msg) {
2773 2772
           MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings);
2774 2773
         #endif
2775 2774
       #endif
2776
-      MENU_ITEM(submenu, MSG_AUTO_HOME, _lcd_delta_calibrate_home);
2777
-      if (axis_homed[Z_AXIS]) {
2778
-        MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
2779
-        MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
2780
-        MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Z, _goto_tower_z);
2781
-        MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_CENTER, _goto_center);
2782
-      }
2775
+      MENU_ITEM(submenu, MSG_DELTA_SETTINGS, lcd_delta_settings);
2776
+      #if ENABLED(DELTA_CALIBRATION_MENU)
2777
+        MENU_ITEM(submenu, MSG_AUTO_HOME, _lcd_delta_calibrate_home);
2778
+        if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) {
2779
+          MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
2780
+          MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
2781
+          MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Z, _goto_tower_z);
2782
+          MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_CENTER, _goto_center);
2783
+        }
2784
+      #endif
2783 2785
       END_MENU();
2784 2786
     }
2785 2787
 
2786
-  #endif // DELTA_CALIBRATION_MENU
2788
+  #endif // DELTA_CALIBRATION_MENU || DELTA_AUTO_CALIBRATION
2787 2789
 
2788 2790
   #if IS_KINEMATIC
2789 2791
     extern float feedrate_mm_s;

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