Explorar el Código

Merge pull request #6410 from teemuatlut/LVD-Delta

Delta auto-calibration updates
Scott Lahteine hace 8 años
padre
commit
671a44b8aa

+ 10
- 33
Marlin/Conditionals_post.h Ver fichero

693
    * Delta radius/rod trimmers/angle trimmers
693
    * Delta radius/rod trimmers/angle trimmers
694
    */
694
    */
695
   #if ENABLED(DELTA)
695
   #if ENABLED(DELTA)
696
-    #ifndef DELTA_ENDSTOP_ADJ
697
-      #define DELTA_ENDSTOP_ADJ { 0 }
698
-    #endif
699
-    #ifndef DELTA_RADIUS_TRIM_TOWER_1
700
-      #define DELTA_RADIUS_TRIM_TOWER_1 0.0
701
-    #endif
702
-    #ifndef DELTA_RADIUS_TRIM_TOWER_2
703
-      #define DELTA_RADIUS_TRIM_TOWER_2 0.0
704
-    #endif
705
-    #ifndef DELTA_RADIUS_TRIM_TOWER_3
706
-      #define DELTA_RADIUS_TRIM_TOWER_3 0.0
707
-    #endif
708
-    #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER_1
709
-      #define DELTA_DIAGONAL_ROD_TRIM_TOWER_1 0.0
696
+    #ifndef DELTA_CALIBRATION_RADIUS
697
+      #define DELTA_CALIBRATION_RADIUS DELTA_PRINTABLE_RADIUS - 10
710
     #endif
698
     #endif
711
-    #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER_2
712
-      #define DELTA_DIAGONAL_ROD_TRIM_TOWER_2 0.0
713
-    #endif
714
-    #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER_3
715
-      #define DELTA_DIAGONAL_ROD_TRIM_TOWER_3 0.0
716
-    #endif
717
-    #ifndef DELTA_TOWER_ANGLE_TRIM_1
718
-      #define DELTA_TOWER_ANGLE_TRIM_1 0.0
699
+    #ifndef DELTA_ENDSTOP_ADJ
700
+      #define DELTA_ENDSTOP_ADJ { 0, 0, 0 }
719
     #endif
701
     #endif
720
-    #ifndef DELTA_TOWER_ANGLE_TRIM_2
721
-      #define DELTA_TOWER_ANGLE_TRIM_2 0.0
702
+    #ifndef DELTA_TOWER_ANGLE_TRIM
703
+      #define DELTA_TOWER_ANGLE_TRIM {0, 0, 0}
722
     #endif
704
     #endif
723
-    #ifndef DELTA_TOWER_ANGLE_TRIM_3
724
-      #define DELTA_TOWER_ANGLE_TRIM_3 0.0
705
+    #ifndef DELTA_RADIUS_TRIM_TOWER
706
+      #define DELTA_RADIUS_TRIM_TOWER {0, 0, 0}
725
     #endif
707
     #endif
726
-    #if ENABLED(DELTA_AUTO_CALIBRATION)
727
-      #ifndef H_FACTOR
728
-        #define H_FACTOR 1.00
729
-      #endif
730
-      #ifndef R_FACTOR
731
-        #define R_FACTOR -2.25
732
-      #endif
708
+    #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER
709
+      #define DELTA_DIAGONAL_ROD_TRIM_TOWER {0, 0, 0}
733
     #endif
710
     #endif
734
   #endif
711
   #endif
735
 
712
 

+ 2
- 2
Marlin/Marlin.h Ver fichero

302
   extern float endstop_adj[ABC],
302
   extern float endstop_adj[ABC],
303
                delta_radius,
303
                delta_radius,
304
                delta_diagonal_rod,
304
                delta_diagonal_rod,
305
+               delta_calibration_radius,
305
                delta_segments_per_second,
306
                delta_segments_per_second,
306
-               delta_diagonal_rod_trim[ABC],
307
-               delta_tower_angle_trim[ABC],
307
+               delta_tower_angle_trim[2],
308
                delta_clip_start_height;
308
                delta_clip_start_height;
309
   void recalc_delta_settings(float radius, float diagonal_rod);
309
   void recalc_delta_settings(float radius, float diagonal_rod);
310
 #elif IS_SCARA
310
 #elif IS_SCARA

+ 239
- 209
Marlin/Marlin_main.cpp Ver fichero

61
  * G30 - Single Z probe, probes bed at X Y location (defaults to current XY location)
61
  * G30 - Single Z probe, probes bed at X Y location (defaults to current XY location)
62
  * G31 - Dock sled (Z_PROBE_SLED only)
62
  * G31 - Dock sled (Z_PROBE_SLED only)
63
  * G32 - Undock sled (Z_PROBE_SLED only)
63
  * G32 - Undock sled (Z_PROBE_SLED only)
64
- * G33 - Delta '4-point' auto calibration iteration
64
+ * G33 - Delta '1-4-7-point' auto calibration : "G33 V<verbose> P<points> <A> <O> <T>" (Requires DELTA)
65
  * G38 - Probe target - similar to G28 except it uses the Z_MIN_PROBE for all three axes
65
  * G38 - Probe target - similar to G28 except it uses the Z_MIN_PROBE for all three axes
66
  * G90 - Use Absolute Coordinates
66
  * G90 - Use Absolute Coordinates
67
  * G91 - Use Relative Coordinates
67
  * G91 - Use Relative Coordinates
585
   // These values are loaded or reset at boot time when setup() calls
585
   // These values are loaded or reset at boot time when setup() calls
586
   // settings.load(), which calls recalc_delta_settings().
586
   // settings.load(), which calls recalc_delta_settings().
587
   float delta_radius,
587
   float delta_radius,
588
-        delta_tower_angle_trim[ABC],
588
+        delta_tower_angle_trim[2],
589
         delta_tower[ABC][2],
589
         delta_tower[ABC][2],
590
         delta_diagonal_rod,
590
         delta_diagonal_rod,
591
-        delta_diagonal_rod_trim[ABC],
591
+        delta_calibration_radius,
592
         delta_diagonal_rod_2_tower[ABC],
592
         delta_diagonal_rod_2_tower[ABC],
593
         delta_segments_per_second,
593
         delta_segments_per_second,
594
         delta_clip_start_height = Z_MAX_POS;
594
         delta_clip_start_height = Z_MAX_POS;
1830
 
1830
 
1831
     float z_dest = LOGICAL_Z_POSITION(z_raise);
1831
     float z_dest = LOGICAL_Z_POSITION(z_raise);
1832
     if (zprobe_zoffset < 0) z_dest -= zprobe_zoffset;
1832
     if (zprobe_zoffset < 0) z_dest -= zprobe_zoffset;
1833
+    #if ENABLED(DELTA)
1834
+      z_dest -= home_offset[Z_AXIS];
1835
+    #endif
1833
 
1836
 
1834
     if (z_dest > current_position[Z_AXIS])
1837
     if (z_dest > current_position[Z_AXIS])
1835
       do_blocking_move_to_z(z_dest);
1838
       do_blocking_move_to_z(z_dest);
1837
 
1840
 
1838
 #endif //HAS_BED_PROBE
1841
 #endif //HAS_BED_PROBE
1839
 
1842
 
1840
-#if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE)
1843
+#if HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE) || ENABLED(DELTA_AUTO_CALIBRATION)
1844
+
1841
   bool axis_unhomed_error(const bool x, const bool y, const bool z) {
1845
   bool axis_unhomed_error(const bool x, const bool y, const bool z) {
1842
     const bool xx = x && !axis_homed[X_AXIS],
1846
     const bool xx = x && !axis_homed[X_AXIS],
1843
                yy = y && !axis_homed[Y_AXIS],
1847
                yy = y && !axis_homed[Y_AXIS],
1857
     }
1861
     }
1858
     return false;
1862
     return false;
1859
   }
1863
   }
1864
+
1860
 #endif
1865
 #endif
1861
 
1866
 
1862
 #if ENABLED(Z_PROBE_SLED)
1867
 #if ENABLED(Z_PROBE_SLED)
2308
       // move down quickly before doing the slow probe
2313
       // move down quickly before doing the slow probe
2309
       float z = LOGICAL_Z_POSITION(Z_CLEARANCE_BETWEEN_PROBES);
2314
       float z = LOGICAL_Z_POSITION(Z_CLEARANCE_BETWEEN_PROBES);
2310
       if (zprobe_zoffset < 0) z -= zprobe_zoffset;
2315
       if (zprobe_zoffset < 0) z -= zprobe_zoffset;
2316
+      #if ENABLED(DELTA)
2317
+        z -= home_offset[Z_AXIS];
2318
+      #endif
2311
       if (z < current_position[Z_AXIS])
2319
       if (z < current_position[Z_AXIS])
2312
         do_blocking_move_to_z(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
2320
         do_blocking_move_to_z(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
2313
 
2321
 
5009
 
5017
 
5010
   /**
5018
   /**
5011
    * G30: Do a single Z probe at the current XY
5019
    * G30: Do a single Z probe at the current XY
5012
-   * Usage:
5013
-   *   G30 <X#> <Y#> <S#>
5014
-   *     X = Probe X position (default=current probe position)
5015
-   *     Y = Probe Y position (default=current probe position)
5016
-   *     S = Stows the probe if 1 (default=1)
5020
+   *
5021
+   * Parameters:
5022
+   *
5023
+   *   X   Probe X position (default current X)
5024
+   *   Y   Probe Y position (default current Y)
5025
+   *   S0  Leave the probe deployed
5017
    */
5026
    */
5018
   inline void gcode_G30() {
5027
   inline void gcode_G30() {
5019
     const float xpos = code_seen('X') ? code_value_linear_units() : current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER,
5028
     const float xpos = code_seen('X') ? code_value_linear_units() : current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER,
5056
 
5065
 
5057
   #if ENABLED(DELTA_AUTO_CALIBRATION)
5066
   #if ENABLED(DELTA_AUTO_CALIBRATION)
5058
     /**
5067
     /**
5059
-     * G33: Delta '4-point' auto calibration iteration
5060
-     *
5061
-     * Usage: G33 <Cn> <Vn>
5062
-     *
5063
-     *  C  (default) = Calibrate endstops, height and delta radius
5064
-     *
5065
-     *  -2, 1-4: n x n probe points, default 3 x 3
5066
-     *
5067
-     *    1: probe center
5068
-     *       set height only - useful when z_offset is changed
5069
-     *    2: probe center and towers
5070
-     *       solve one '4 point' calibration
5071
-     *   -2: probe center and opposite the towers
5072
-     *       solve one '4 point' calibration
5073
-     *    3: probe 3 center points, towers and opposite-towers
5074
-     *       averages between 2 '4 point' calibrations
5075
-     *    4: probe 4 center points, towers, opposite-towers and itermediate points
5076
-     *       averages between 4 '4 point' calibrations
5077
-     *
5078
-     *  V  Verbose level (0-3, default 1)
5079
-     *
5080
-     *    0: Dry-run mode: no calibration
5081
-     *    1: Settings
5082
-     *    2: Setting + probe results
5083
-     *    3: Expert mode: setting + iteration factors (see Configuration_adv.h)
5084
-     *       This prematurely stops the iteration process when factors are found
5068
+     * G33 - Delta '1-4-7-point' auto calibration (Requires DELTA)
5069
+     * 
5070
+     * Usage:
5071
+     *   G33 <Vn> <Pn> <A> <O> <T>
5072
+     *   
5073
+     *     Vn = verbose level (n=0-2 default 1)
5074
+     *          n=0 dry-run mode: setting + probe results / no calibration
5075
+     *          n=1 settings 
5076
+     *          n=2 setting + probe results 
5077
+     *     Pn = n=-7 -> +7 : n*n probe points
5078
+     *          calibrates height ('1 point'), endstops, and delta radius ('4 points') 
5079
+     *          and tower angles with n > 2 ('7+ points')
5080
+     *          n=1  probes center / sets height only
5081
+     *          n=2  probes center and towers / sets height, endstops and delta radius
5082
+     *          n=3  probes all points: center, towers and opposite towers / sets all
5083
+     *          n>3  probes all points multiple times and averages
5084
+     *     A  = abort 1 point delta height calibration after 1 probe
5085
+     *     O  = use oposite tower points instead of tower points with 4 point calibration
5086
+     *     T  = do not calibrate tower angles with 7+ point calibration
5085
      */
5087
      */
5086
     inline void gcode_G33() {
5088
     inline void gcode_G33() {
5087
 
5089
 
5091
         set_bed_leveling_enabled(false);
5093
         set_bed_leveling_enabled(false);
5092
       #endif
5094
       #endif
5093
 
5095
 
5094
-      const int8_t pp = code_seen('C') ? code_value_int() : DELTA_CALIBRATION_DEFAULT_POINTS,
5095
-                   probe_points = (WITHIN(pp, 1, 4) || pp == -2) ? pp : DELTA_CALIBRATION_DEFAULT_POINTS;
5096
-
5097
-      int8_t verbose_level = code_seen('V') ? code_value_byte() : 1;
5098
-
5099
-      #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
5100
-        #define _MAX_M33_V 3
5101
-        if (verbose_level == 3 && probe_points == 1) verbose_level--; // needs at least 4 points
5102
-      #else
5103
-        #define _MAX_M33_V 2
5104
-        if (verbose_level > 2)
5105
-          SERIAL_PROTOCOLLNPGM("Enable DELTA_CALIBRATE_EXPERT_MODE in Configuration_adv.h");
5106
-      #endif
5096
+      int8_t pp = (code_seen('P') ? code_value_int() : DELTA_CALIBRATION_DEFAULT_POINTS),
5097
+             probe_mode = (WITHIN(pp, 1, 7) ? pp : DELTA_CALIBRATION_DEFAULT_POINTS);
5107
 
5098
 
5108
-      if (!WITHIN(verbose_level, 0, _MAX_M33_V)) verbose_level = 1;
5099
+      probe_mode = (code_seen('A') && probe_mode == 1 ? -probe_mode : probe_mode);
5100
+      probe_mode = (code_seen('O') && probe_mode == 2 ? -probe_mode : probe_mode);
5101
+      probe_mode = (code_seen('T') && probe_mode > 2 ? -probe_mode : probe_mode);
5102
+      
5103
+      int8_t verbose_level = (code_seen('V') ? code_value_byte() : 1);
5109
 
5104
 
5110
-      float zero_std_dev = verbose_level ? 999.0 : 0.0; // 0.0 in dry-run mode : forced end
5105
+      if (!WITHIN(verbose_level, 0, 2)) verbose_level = 1;
5111
 
5106
 
5112
       gcode_G28();
5107
       gcode_G28();
5113
 
5108
 
5114
-      float e_old[XYZ],
5109
+      const static char save_message[] PROGMEM = "Save with M500 and/or copy to Configuration.h";
5110
+      float test_precision,
5111
+            zero_std_dev = (verbose_level ? 999.0 : 0.0), // 0.0 in dry-run mode : forced end
5112
+            e_old[XYZ] = {
5113
+              endstop_adj[A_AXIS],
5114
+              endstop_adj[B_AXIS],
5115
+              endstop_adj[C_AXIS]
5116
+            },
5115
             dr_old = delta_radius,
5117
             dr_old = delta_radius,
5116
-            zh_old = home_offset[Z_AXIS];
5117
-      COPY(e_old,endstop_adj);
5118
-      #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
5119
-        // expert variables
5120
-        float h_f_old = 1.00, r_f_old = 0.00,
5121
-              h_diff_min = 1.00, r_diff_max = 0.10;
5122
-      #endif
5123
-
5118
+            zh_old = home_offset[Z_AXIS],
5119
+            alpha_old = delta_tower_angle_trim[A_AXIS],
5120
+            beta_old = delta_tower_angle_trim[B_AXIS]; 
5121
+      int8_t iterations = 0,
5122
+             probe_points = abs(probe_mode);
5123
+      const bool pp_equals_1 = (probe_points == 1),
5124
+                 pp_equals_2 = (probe_points == 2),
5125
+                 pp_equals_3 = (probe_points == 3),
5126
+                 pp_equals_4 = (probe_points == 4),
5127
+                 pp_equals_5 = (probe_points == 5),
5128
+                 pp_equals_6 = (probe_points == 6),
5129
+                 pp_equals_7 = (probe_points == 7),
5130
+                 pp_greather_2 = (probe_points > 2),
5131
+                 pp_greather_3 = (probe_points > 3),
5132
+                 pp_greather_4 = (probe_points > 4),
5133
+                 pp_greather_5 = (probe_points > 5);
5134
+ 
5124
       // print settings
5135
       // print settings
5125
 
5136
 
5126
       SERIAL_PROTOCOLLNPGM("G33 Auto Calibrate");
5137
       SERIAL_PROTOCOLLNPGM("G33 Auto Calibrate");
5127
       SERIAL_PROTOCOLPGM("Checking... AC");
5138
       SERIAL_PROTOCOLPGM("Checking... AC");
5128
       if (verbose_level == 0) SERIAL_PROTOCOLPGM(" (DRY-RUN)");
5139
       if (verbose_level == 0) SERIAL_PROTOCOLPGM(" (DRY-RUN)");
5129
-      #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
5130
-        if (verbose_level == 3) SERIAL_PROTOCOLPGM(" (EXPERT)");
5131
-      #endif
5132
       SERIAL_EOL;
5140
       SERIAL_EOL;
5133
       LCD_MESSAGEPGM("Checking... AC");
5141
       LCD_MESSAGEPGM("Checking... AC");
5134
 
5142
 
5135
-      SERIAL_PROTOCOLPAIR("Height:", DELTA_HEIGHT + home_offset[Z_AXIS]);
5136
-      if (abs(probe_points) > 1) {
5143
+      SERIAL_PROTOCOLPAIR(".Height:", DELTA_HEIGHT + home_offset[Z_AXIS]);
5144
+      if (!pp_equals_1) {
5137
         SERIAL_PROTOCOLPGM("    Ex:");
5145
         SERIAL_PROTOCOLPGM("    Ex:");
5138
         if (endstop_adj[A_AXIS] >= 0) SERIAL_CHAR('+');
5146
         if (endstop_adj[A_AXIS] >= 0) SERIAL_CHAR('+');
5139
         SERIAL_PROTOCOL_F(endstop_adj[A_AXIS], 2);
5147
         SERIAL_PROTOCOL_F(endstop_adj[A_AXIS], 2);
5146
         SERIAL_PROTOCOLPAIR("    Radius:", delta_radius);
5154
         SERIAL_PROTOCOLPAIR("    Radius:", delta_radius);
5147
       }
5155
       }
5148
       SERIAL_EOL;
5156
       SERIAL_EOL;
5157
+      if (probe_mode > 2) { // negative disables tower angles
5158
+        SERIAL_PROTOCOLPGM(".Tower angle :    Tx:");
5159
+        if (delta_tower_angle_trim[A_AXIS] >= 0) SERIAL_CHAR('+');
5160
+        SERIAL_PROTOCOL_F(delta_tower_angle_trim[A_AXIS], 2);
5161
+        SERIAL_PROTOCOLPGM("  Ty:");
5162
+        if (delta_tower_angle_trim[B_AXIS] >= 0) SERIAL_CHAR('+');
5163
+        SERIAL_PROTOCOL_F(delta_tower_angle_trim[B_AXIS], 2);
5164
+        SERIAL_PROTOCOLPGM("  Tz:+0.00");
5165
+        SERIAL_EOL;
5166
+      }
5149
 
5167
 
5150
       #if ENABLED(Z_PROBE_SLED)
5168
       #if ENABLED(Z_PROBE_SLED)
5151
         DEPLOY_PROBE();
5169
         DEPLOY_PROBE();
5152
       #endif
5170
       #endif
5153
 
5171
 
5154
-      float test_precision;
5155
-      int8_t iterations = 0;
5156
-
5157
-      do { // start iterations
5158
-
5159
-        setup_for_endstop_or_probe_move();
5160
-
5161
-        test_precision =
5162
-          #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
5163
-            // Expert mode : forced end at std_dev < 0.1
5164
-            (verbose_level == 3 && zero_std_dev < 0.1) ? 0.0 :
5165
-          #endif
5166
-          zero_std_dev
5167
-        ;
5172
+      do {
5168
 
5173
 
5169
-        float z_at_pt[13] = { 0 };
5174
+        float z_at_pt[13] = { 0 },
5175
+              S1 = 0.0,
5176
+              S2 = 0.0;
5177
+        int16_t N = 0;
5170
 
5178
 
5179
+        test_precision = zero_std_dev;
5171
         iterations++;
5180
         iterations++;
5172
 
5181
 
5173
         // probe the points
5182
         // probe the points
5174
 
5183
 
5175
-        int16_t center_points = 0;
5176
-
5177
-        if (probe_points != 3) {
5184
+        if (!pp_equals_3 && !pp_equals_6) { // probe the centre
5185
+          setup_for_endstop_or_probe_move();
5178
           z_at_pt[0] += probe_pt(0.0, 0.0 , true, 1);
5186
           z_at_pt[0] += probe_pt(0.0, 0.0 , true, 1);
5179
-          center_points = 1;
5187
+          clean_up_after_endstop_or_probe_move();
5180
         }
5188
         }
5181
-
5182
-        int16_t step_axis = 4;
5183
-        if (probe_points >= 3) {
5184
-          for (int8_t axis = 9; axis > 0; axis -= step_axis) { // uint8_t starts endless loop
5189
+        if (pp_greather_2) { // probe extra centre points
5190
+          for (int8_t axis = (pp_greather_4 ? 11 : 9); axis > 0; axis -= (pp_greather_4 ? 2 : 4)) {              
5191
+            setup_for_endstop_or_probe_move();
5185
             z_at_pt[0] += probe_pt(
5192
             z_at_pt[0] += probe_pt(
5186
-              0.1 * cos(RADIANS(180 + 30 * axis)) * (DELTA_CALIBRATION_RADIUS),
5187
-              0.1 * sin(RADIANS(180 + 30 * axis)) * (DELTA_CALIBRATION_RADIUS), true, 1);
5193
+              cos(RADIANS(180 + 30 * axis)) * (0.1 * delta_calibration_radius),
5194
+              sin(RADIANS(180 + 30 * axis)) * (0.1 * delta_calibration_radius), true, 1);
5195
+            clean_up_after_endstop_or_probe_move();
5188
           }
5196
           }
5189
-          center_points += 3;
5190
-          z_at_pt[0] /= center_points;
5197
+          z_at_pt[0] /= (pp_equals_5 ? 7 : probe_points);
5191
         }
5198
         }
5192
-
5193
-        float S1 = z_at_pt[0], S2 = sq(S1);
5194
-
5195
-        int16_t N = 1, start = (probe_points == -2) ? 3 : 1;
5196
-        step_axis = (abs(probe_points) == 2) ? 4 : (probe_points == 3) ? 2 : 1;
5197
-
5198
-        if (probe_points != 1) {
5199
-          for (uint8_t axis = start; axis < 13; axis += step_axis)
5200
-            z_at_pt[axis] += probe_pt(
5201
-              cos(RADIANS(180 + 30 * axis)) * (DELTA_CALIBRATION_RADIUS),
5202
-              sin(RADIANS(180 + 30 * axis)) * (DELTA_CALIBRATION_RADIUS), true, 1
5203
-            );
5204
-
5205
-          if (probe_points == 4) step_axis = 2;
5199
+        if (!pp_equals_1) {  // probe the radius
5200
+          float start_circles = (pp_equals_7 ? -1.5 : pp_equals_6 || pp_equals_5 ? -1 : 0),
5201
+                end_circles = -start_circles;
5202
+          bool zig_zag = true;
5203
+          for (uint8_t axis = (probe_mode == -2 ? 3 : 1); axis < 13; 
5204
+               axis += (pp_equals_2 ? 4 : pp_equals_3 || pp_equals_5 ? 2 : 1)) {
5205
+            for (float circles = start_circles ; circles <= end_circles; circles++) {
5206
+              setup_for_endstop_or_probe_move();
5207
+              z_at_pt[axis] += probe_pt(
5208
+                cos(RADIANS(180 + 30 * axis)) * 
5209
+                (1 + circles * 0.1 * (zig_zag ? 1 : -1)) * delta_calibration_radius, 
5210
+                sin(RADIANS(180 + 30 * axis)) * 
5211
+                (1 + circles * 0.1 * (zig_zag ? 1 : -1)) * delta_calibration_radius, true, 1);
5212
+              clean_up_after_endstop_or_probe_move();
5213
+            }
5214
+            start_circles += (pp_greather_5 ? (zig_zag ? 0.5 : -0.5) : 0);
5215
+            end_circles = -start_circles;
5216
+            zig_zag = !zig_zag;
5217
+            z_at_pt[axis] /= (pp_equals_7 ? (zig_zag ? 4.0 : 3.0) :
5218
+                              pp_equals_6 ? (zig_zag ? 3.0 : 2.0) : pp_equals_5 ? 3 : 1);
5219
+          }
5206
         }
5220
         }
5207
-
5208
-        for (uint8_t axis = start; axis < 13; axis += step_axis) {
5209
-          if (probe_points == 4)
5221
+        if (pp_greather_3 && !pp_equals_5) // average intermediates to tower and opposites
5222
+          for (uint8_t axis = 1; axis < 13; axis += 2)
5210
             z_at_pt[axis] = (z_at_pt[axis] + (z_at_pt[axis + 1] + z_at_pt[(axis + 10) % 12 + 1]) / 2.0) / 2.0;
5223
             z_at_pt[axis] = (z_at_pt[axis] + (z_at_pt[axis + 1] + z_at_pt[(axis + 10) % 12 + 1]) / 2.0) / 2.0;
5211
 
5224
 
5212
-          S1 += z_at_pt[axis];
5213
-          S2 += sq(z_at_pt[axis]);
5214
-          N++;
5215
-        }
5216
-        zero_std_dev = round(sqrt(S2 / N) * 1000.0) / 1000.0 + 0.00001; // deviation from zero plane
5225
+        S1 += z_at_pt[0];
5226
+        S2 += sq(z_at_pt[0]);
5227
+        N++;
5228
+        if (!pp_equals_1) // std dev from zero plane
5229
+          for (uint8_t axis = (probe_mode == -2 ? 3 : 1); axis < 13; axis += (pp_equals_2 ? 4 : 2)) {
5230
+            S1 += z_at_pt[axis];
5231
+            S2 += sq(z_at_pt[axis]);
5232
+            N++;
5233
+          }
5234
+        zero_std_dev = round(sqrt(S2 / N) * 1000.0) / 1000.0 + 0.00001;
5217
 
5235
 
5218
         // Solve matrices
5236
         // Solve matrices
5219
 
5237
 
5221
           COPY(e_old, endstop_adj);
5239
           COPY(e_old, endstop_adj);
5222
           dr_old = delta_radius;
5240
           dr_old = delta_radius;
5223
           zh_old = home_offset[Z_AXIS];
5241
           zh_old = home_offset[Z_AXIS];
5242
+          alpha_old = delta_tower_angle_trim[A_AXIS];
5243
+          beta_old = delta_tower_angle_trim[B_AXIS];
5224
 
5244
 
5225
-          float e_delta[XYZ] = { 0.0 }, r_delta = 0.0;
5226
-
5227
-          #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
5228
-            float h_f_new = 0.0, r_f_new = 0.0 , t_f_new = 0.0,
5229
-                  h_diff = 0.00, r_diff = 0.00;
5230
-          #endif
5245
+          float e_delta[XYZ] = { 0.0 }, r_delta = 0.0,
5246
+                t_alpha = 0.0, t_beta = 0.0;
5247
+          const float r_diff = delta_radius - delta_calibration_radius,
5248
+                      h_factor = 1.00 + r_diff * 0.001,                          //1.02 for r_diff = 20mm
5249
+                      r_factor = -(1.75 + 0.005 * r_diff + 0.001 * sq(r_diff)),  //2.25 for r_diff = 20mm
5250
+                      a_factor = 100.0 / delta_calibration_radius;               //1.25 for cal_rd = 80mm
5231
 
5251
 
5232
           #define ZP(N,I) ((N) * z_at_pt[I])
5252
           #define ZP(N,I) ((N) * z_at_pt[I])
5233
           #define Z1000(I) ZP(1.00, I)
5253
           #define Z1000(I) ZP(1.00, I)
5234
-          #define Z1050(I) ZP(H_FACTOR, I)
5235
-          #define Z0700(I) ZP((H_FACTOR) * 2.0 / 3.00, I)
5236
-          #define Z0350(I) ZP((H_FACTOR) / 3.00, I)
5237
-          #define Z0175(I) ZP((H_FACTOR) / 6.00, I)
5238
-          #define Z2250(I) ZP(R_FACTOR, I)
5239
-          #define Z0750(I) ZP((R_FACTOR) / 3.00, I)
5240
-          #define Z0375(I) ZP((R_FACTOR) / 6.00, I)
5241
-
5242
-          switch (probe_points) {
5254
+          #define Z1050(I) ZP(h_factor, I)
5255
+          #define Z0700(I) ZP(h_factor * 2.0 / 3.00, I)
5256
+          #define Z0350(I) ZP(h_factor / 3.00, I)
5257
+          #define Z0175(I) ZP(h_factor / 6.00, I)
5258
+          #define Z2250(I) ZP(r_factor, I)
5259
+          #define Z0750(I) ZP(r_factor / 3.00, I)
5260
+          #define Z0375(I) ZP(r_factor / 6.00, I)
5261
+          #define Z0444(I) ZP(a_factor * 4.0 / 9.0, I)
5262
+          #define Z0888(I) ZP(a_factor * 8.0 / 9.0, I)
5263
+
5264
+          switch (probe_mode) {
5265
+            case -1:
5266
+              test_precision = 0.00;
5243
             case 1:
5267
             case 1:
5244
               LOOP_XYZ(i) e_delta[i] = Z1000(0);
5268
               LOOP_XYZ(i) e_delta[i] = Z1000(0);
5245
-              r_delta = 0.00;
5246
               break;
5269
               break;
5247
 
5270
 
5248
             case 2:
5271
             case 2:
5264
               e_delta[Y_AXIS] = Z1050(0) - Z0175(1) + Z0350(5) - Z0175(9) + Z0175(7) - Z0350(11) + Z0175(3);
5287
               e_delta[Y_AXIS] = Z1050(0) - Z0175(1) + Z0350(5) - Z0175(9) + Z0175(7) - Z0350(11) + Z0175(3);
5265
               e_delta[Z_AXIS] = Z1050(0) - Z0175(1) - Z0175(5) + Z0350(9) + Z0175(7) + Z0175(11) - Z0350(3);
5288
               e_delta[Z_AXIS] = Z1050(0) - Z0175(1) - Z0175(5) + Z0350(9) + Z0175(7) + Z0175(11) - Z0350(3);
5266
               r_delta         = Z2250(0) - Z0375(1) - Z0375(5) - Z0375(9) - Z0375(7) - Z0375(11) - Z0375(3);
5289
               r_delta         = Z2250(0) - Z0375(1) - Z0375(5) - Z0375(9) - Z0375(7) - Z0375(11) - Z0375(3);
5290
+              
5291
+              if (probe_mode > 0) {  // negative disables tower angles
5292
+                t_alpha = + Z0444(1) - Z0888(5) + Z0444(9) + Z0444(7) - Z0888(11) + Z0444(3);
5293
+                t_beta  = - Z0888(1) + Z0444(5) + Z0444(9) - Z0888(7) + Z0444(11) + Z0444(3);
5294
+              }
5267
               break;
5295
               break;
5268
           }
5296
           }
5269
 
5297
 
5270
-          #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
5271
-            // Calculate h & r factors
5272
-            if (verbose_level == 3) {
5273
-              LOOP_XYZ(axis) h_f_new += e_delta[axis] / 3;
5274
-              r_f_new = r_delta;
5275
-              h_diff = (1.0 / H_FACTOR) * (h_f_old - h_f_new) / h_f_old;
5276
-              if (h_diff < h_diff_min && h_diff > 0.9) h_diff_min = h_diff;
5277
-              if (r_f_old != 0)
5278
-                r_diff = (   0.0301 * sq(R_FACTOR) * R_FACTOR
5279
-                           + 0.311  * sq(R_FACTOR)
5280
-                           + 1.1493 * R_FACTOR
5281
-                           + 1.7952
5282
-                         ) * (r_f_old - r_f_new) / r_f_old;
5283
-              if (r_diff > r_diff_max && r_diff < 0.4444) r_diff_max = r_diff;
5284
-              SERIAL_EOL;
5285
-
5286
-              h_f_old = h_f_new;
5287
-              r_f_old = r_f_new;
5288
-            }
5289
-          #endif // DELTA_CALIBRATE_EXPERT_MODE
5290
-
5291
-          // Adjust delta_height and endstops by the max amount
5292
           LOOP_XYZ(axis) endstop_adj[axis] += e_delta[axis];
5298
           LOOP_XYZ(axis) endstop_adj[axis] += e_delta[axis];
5293
           delta_radius += r_delta;
5299
           delta_radius += r_delta;
5300
+          delta_tower_angle_trim[A_AXIS] += t_alpha;
5301
+          delta_tower_angle_trim[B_AXIS] -= t_beta;
5294
 
5302
 
5295
-          const float z_temp = MAX3(endstop_adj[0], endstop_adj[1], endstop_adj[2]);
5303
+          // adjust delta_height and endstops by the max amount
5304
+          const float z_temp = MAX3(endstop_adj[A_AXIS], endstop_adj[B_AXIS], endstop_adj[C_AXIS]);
5296
           home_offset[Z_AXIS] -= z_temp;
5305
           home_offset[Z_AXIS] -= z_temp;
5297
           LOOP_XYZ(i) endstop_adj[i] -= z_temp;
5306
           LOOP_XYZ(i) endstop_adj[i] -= z_temp;
5298
 
5307
 
5299
           recalc_delta_settings(delta_radius, delta_diagonal_rod);
5308
           recalc_delta_settings(delta_radius, delta_diagonal_rod);
5300
         }
5309
         }
5301
-        else { // !iterate
5302
-          // step one back
5310
+        else {   // step one back
5303
           COPY(endstop_adj, e_old);
5311
           COPY(endstop_adj, e_old);
5304
           delta_radius = dr_old;
5312
           delta_radius = dr_old;
5305
           home_offset[Z_AXIS] = zh_old;
5313
           home_offset[Z_AXIS] = zh_old;
5314
+          delta_tower_angle_trim[A_AXIS] = alpha_old;
5315
+          delta_tower_angle_trim[B_AXIS] = beta_old;
5306
 
5316
 
5307
           recalc_delta_settings(delta_radius, delta_diagonal_rod);
5317
           recalc_delta_settings(delta_radius, delta_diagonal_rod);
5308
         }
5318
         }
5309
 
5319
 
5310
-        // print report
5320
+         // print report
5311
 
5321
 
5312
-        #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
5313
-          if (verbose_level == 3) {
5314
-            const float r_factor =   22.902 * sq(r_diff_max) * r_diff_max
5315
-                                   - 44.988 * sq(r_diff_max)
5316
-                                   + 31.697 * r_diff_max
5317
-                                   - 9.4439;
5318
-            SERIAL_PROTOCOLPAIR("h_factor:", 1.0 / h_diff_min);
5319
-            SERIAL_PROTOCOLPAIR("              r_factor:", r_factor);
5320
-            SERIAL_EOL;
5321
-          }
5322
-        #endif
5323
-        if (verbose_level == 2) {
5324
-          SERIAL_PROTOCOLPGM(".     c:");
5322
+        if (verbose_level != 1) {
5323
+          SERIAL_PROTOCOLPGM(".      c:");
5325
           if (z_at_pt[0] > 0) SERIAL_CHAR('+');
5324
           if (z_at_pt[0] > 0) SERIAL_CHAR('+');
5326
           SERIAL_PROTOCOL_F(z_at_pt[0], 2);
5325
           SERIAL_PROTOCOL_F(z_at_pt[0], 2);
5327
-          if (probe_points > 1) {
5326
+          if (probe_mode == 2 || pp_greather_2) {
5328
             SERIAL_PROTOCOLPGM("     x:");
5327
             SERIAL_PROTOCOLPGM("     x:");
5329
             if (z_at_pt[1] >= 0) SERIAL_CHAR('+');
5328
             if (z_at_pt[1] >= 0) SERIAL_CHAR('+');
5330
             SERIAL_PROTOCOL_F(z_at_pt[1], 2);
5329
             SERIAL_PROTOCOL_F(z_at_pt[1], 2);
5335
             if (z_at_pt[9] >= 0) SERIAL_CHAR('+');
5334
             if (z_at_pt[9] >= 0) SERIAL_CHAR('+');
5336
             SERIAL_PROTOCOL_F(z_at_pt[9], 2);
5335
             SERIAL_PROTOCOL_F(z_at_pt[9], 2);
5337
           }
5336
           }
5338
-          if (probe_points > 0) SERIAL_EOL;
5339
-          if (probe_points > 2 || probe_points == -2) {
5340
-            if (probe_points > 2) SERIAL_PROTOCOLPGM(".            ");
5337
+          if (probe_mode != -2) SERIAL_EOL;
5338
+          if (probe_mode == -2 || pp_greather_2) {
5339
+            if (pp_greather_2) {
5340
+              SERIAL_CHAR('.');
5341
+              SERIAL_PROTOCOL_SP(13);
5342
+            }
5341
             SERIAL_PROTOCOLPGM("    yz:");
5343
             SERIAL_PROTOCOLPGM("    yz:");
5342
             if (z_at_pt[7] >= 0) SERIAL_CHAR('+');
5344
             if (z_at_pt[7] >= 0) SERIAL_CHAR('+');
5343
             SERIAL_PROTOCOL_F(z_at_pt[7], 2);
5345
             SERIAL_PROTOCOL_F(z_at_pt[7], 2);
5350
             SERIAL_EOL;
5352
             SERIAL_EOL;
5351
           }
5353
           }
5352
         }
5354
         }
5353
-        if (test_precision != 0.0) {            // !forced end
5354
-          if (zero_std_dev >= test_precision) {
5355
+        if (test_precision != 0.0) {                                 // !forced end
5356
+          if (zero_std_dev >= test_precision) {                      // end iterations
5355
             SERIAL_PROTOCOLPGM("Calibration OK");
5357
             SERIAL_PROTOCOLPGM("Calibration OK");
5356
-            SERIAL_PROTOCOLLNPGM("                                   rolling back 1");
5357
-            LCD_MESSAGEPGM("Calibration OK");
5358
+            SERIAL_PROTOCOL_SP(36);
5359
+            SERIAL_PROTOCOLPGM("rolling back.");
5358
             SERIAL_EOL;
5360
             SERIAL_EOL;
5361
+            LCD_MESSAGEPGM("Calibration OK");
5359
           }
5362
           }
5360
-          else {                                // !end iterations
5363
+          else {                                                     // !end iterations
5361
             char mess[15] = "No convergence";
5364
             char mess[15] = "No convergence";
5362
             if (iterations < 31)
5365
             if (iterations < 31)
5363
               sprintf_P(mess, PSTR("Iteration : %02i"), (int)iterations);
5366
               sprintf_P(mess, PSTR("Iteration : %02i"), (int)iterations);
5364
             SERIAL_PROTOCOL(mess);
5367
             SERIAL_PROTOCOL(mess);
5365
-            SERIAL_PROTOCOLPGM("                                   std dev:");
5368
+            SERIAL_PROTOCOL_SP(36);
5369
+            SERIAL_PROTOCOLPGM("std dev:");
5366
             SERIAL_PROTOCOL_F(zero_std_dev, 3);
5370
             SERIAL_PROTOCOL_F(zero_std_dev, 3);
5367
             SERIAL_EOL;
5371
             SERIAL_EOL;
5368
             lcd_setstatus(mess);
5372
             lcd_setstatus(mess);
5369
           }
5373
           }
5370
-          SERIAL_PROTOCOLPAIR("Height:", DELTA_HEIGHT + home_offset[Z_AXIS]);
5371
-          if (abs(probe_points) > 1) {
5374
+          SERIAL_PROTOCOLPAIR(".Height:", DELTA_HEIGHT + home_offset[Z_AXIS]);
5375
+          if (!pp_equals_1) {
5372
             SERIAL_PROTOCOLPGM("    Ex:");
5376
             SERIAL_PROTOCOLPGM("    Ex:");
5373
             if (endstop_adj[A_AXIS] >= 0) SERIAL_CHAR('+');
5377
             if (endstop_adj[A_AXIS] >= 0) SERIAL_CHAR('+');
5374
             SERIAL_PROTOCOL_F(endstop_adj[A_AXIS], 2);
5378
             SERIAL_PROTOCOL_F(endstop_adj[A_AXIS], 2);
5381
             SERIAL_PROTOCOLPAIR("    Radius:", delta_radius);
5385
             SERIAL_PROTOCOLPAIR("    Radius:", delta_radius);
5382
           }
5386
           }
5383
           SERIAL_EOL;
5387
           SERIAL_EOL;
5388
+          if (probe_mode > 2) { // negative disables tower angles
5389
+            SERIAL_PROTOCOLPGM(".Tower angle :    Tx:");
5390
+            if (delta_tower_angle_trim[A_AXIS] >= 0) SERIAL_CHAR('+');
5391
+            SERIAL_PROTOCOL_F(delta_tower_angle_trim[A_AXIS], 2);
5392
+            SERIAL_PROTOCOLPGM("  Ty:");
5393
+            if (delta_tower_angle_trim[B_AXIS] >= 0) SERIAL_CHAR('+');
5394
+            SERIAL_PROTOCOL_F(delta_tower_angle_trim[B_AXIS], 2);
5395
+            SERIAL_PROTOCOLPGM("  Tz:+0.00");
5396
+            SERIAL_EOL;
5397
+          }
5384
           if (zero_std_dev >= test_precision)
5398
           if (zero_std_dev >= test_precision)
5385
-            SERIAL_PROTOCOLLNPGM("Save with M500");
5399
+            serialprintPGM(save_message);
5400
+            SERIAL_EOL;
5386
         }
5401
         }
5387
-        else {                                  // forced end
5388
-          #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
5389
-            if (verbose_level == 3)
5390
-              SERIAL_PROTOCOLLNPGM("Copy to Configuration_adv.h");
5391
-            else
5392
-          #endif
5393
-            {
5394
-              SERIAL_PROTOCOLPGM("End DRY-RUN                                      std dev:");
5395
-              SERIAL_PROTOCOL_F(zero_std_dev, 3);
5396
-              SERIAL_EOL;
5397
-            }
5402
+        else {                                                       // forced end
5403
+          if (verbose_level == 0) {
5404
+            SERIAL_PROTOCOLPGM("End DRY-RUN");
5405
+            SERIAL_PROTOCOL_SP(39);
5406
+            SERIAL_PROTOCOLPGM("std dev:");
5407
+            SERIAL_PROTOCOL_F(zero_std_dev, 3);
5408
+            SERIAL_EOL;
5409
+          }
5410
+          else {
5411
+            SERIAL_PROTOCOLLNPGM("Calibration OK");
5412
+            LCD_MESSAGEPGM("Calibration OK");
5413
+            SERIAL_PROTOCOLPAIR(".Height:", DELTA_HEIGHT + home_offset[Z_AXIS]);
5414
+            SERIAL_EOL;
5415
+            serialprintPGM(save_message);
5416
+            SERIAL_EOL;
5417
+          }
5398
         }
5418
         }
5399
 
5419
 
5400
-        clean_up_after_endstop_or_probe_move();
5401
         stepper.synchronize();
5420
         stepper.synchronize();
5402
 
5421
 
5403
         gcode_G28();
5422
         gcode_G28();
7620
     if (code_seen('L')) delta_diagonal_rod = code_value_linear_units();
7639
     if (code_seen('L')) delta_diagonal_rod = code_value_linear_units();
7621
     if (code_seen('R')) delta_radius = code_value_linear_units();
7640
     if (code_seen('R')) delta_radius = code_value_linear_units();
7622
     if (code_seen('S')) delta_segments_per_second = code_value_float();
7641
     if (code_seen('S')) delta_segments_per_second = code_value_float();
7623
-    if (code_seen('A')) delta_diagonal_rod_trim[A_AXIS] = code_value_linear_units();
7624
-    if (code_seen('B')) delta_diagonal_rod_trim[B_AXIS] = code_value_linear_units();
7625
-    if (code_seen('C')) delta_diagonal_rod_trim[C_AXIS] = code_value_linear_units();
7626
-    if (code_seen('I')) delta_tower_angle_trim[A_AXIS] = code_value_linear_units();
7627
-    if (code_seen('J')) delta_tower_angle_trim[B_AXIS] = code_value_linear_units();
7628
-    if (code_seen('K')) delta_tower_angle_trim[C_AXIS] = code_value_linear_units();
7642
+    if (code_seen('B')) delta_calibration_radius = code_value_float();
7643
+    if (code_seen('X')) delta_tower_angle_trim[A_AXIS] = code_value_linear_units();
7644
+    if (code_seen('Y')) delta_tower_angle_trim[B_AXIS] = code_value_linear_units();
7645
+    if (code_seen('Z')) { // rotate all 3 axis for Z = 0
7646
+      delta_tower_angle_trim[A_AXIS] -= code_value_linear_units();
7647
+      delta_tower_angle_trim[B_AXIS] -= code_value_linear_units();
7648
+    }
7629
     recalc_delta_settings(delta_radius, delta_diagonal_rod);
7649
     recalc_delta_settings(delta_radius, delta_diagonal_rod);
7630
   }
7650
   }
7631
   /**
7651
   /**
7653
         SERIAL_ECHOLNPGM("<<< gcode_M666");
7673
         SERIAL_ECHOLNPGM("<<< gcode_M666");
7654
       }
7674
       }
7655
     #endif
7675
     #endif
7676
+    // normalize endstops so all are <=0; set the residue to delta height
7677
+    const float z_temp = MAX3(endstop_adj[A_AXIS], endstop_adj[B_AXIS], endstop_adj[C_AXIS]);
7678
+    home_offset[Z_AXIS] -= z_temp;
7679
+    LOOP_XYZ(i) endstop_adj[i] -= z_temp;
7656
   }
7680
   }
7657
 
7681
 
7658
 #elif ENABLED(Z_DUAL_ENDSTOPS) // !DELTA && ENABLED(Z_DUAL_ENDSTOPS)
7682
 #elif ENABLED(Z_DUAL_ENDSTOPS) // !DELTA && ENABLED(Z_DUAL_ENDSTOPS)
8564
 
8588
 
8565
     if (!isnan(last_zoffset)) {
8589
     if (!isnan(last_zoffset)) {
8566
 
8590
 
8567
-      #if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(BABYSTEP_ZPROBE_OFFSET)
8591
+      #if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(BABYSTEP_ZPROBE_OFFSET) || ENABLED(DELTA)
8568
         const float diff = zprobe_zoffset - last_zoffset;
8592
         const float diff = zprobe_zoffset - last_zoffset;
8569
       #endif
8593
       #endif
8570
 
8594
 
8586
       #else
8610
       #else
8587
         UNUSED(no_babystep);
8611
         UNUSED(no_babystep);
8588
       #endif
8612
       #endif
8613
+ 
8614
+      #if ENABLED(DELTA) // correct the delta_height
8615
+        home_offset[Z_AXIS] -= diff;
8616
+      #endif
8589
     }
8617
     }
8590
 
8618
 
8591
     last_zoffset = zprobe_zoffset;
8619
     last_zoffset = zprobe_zoffset;
10651
    * settings have been changed (e.g., by M665).
10679
    * settings have been changed (e.g., by M665).
10652
    */
10680
    */
10653
   void recalc_delta_settings(float radius, float diagonal_rod) {
10681
   void recalc_delta_settings(float radius, float diagonal_rod) {
10654
-    delta_tower[A_AXIS][X_AXIS] = -sin(RADIANS(60 - delta_tower_angle_trim[A_AXIS])) * (radius + DELTA_RADIUS_TRIM_TOWER_1); // front left tower
10655
-    delta_tower[A_AXIS][Y_AXIS] = -cos(RADIANS(60 - delta_tower_angle_trim[A_AXIS])) * (radius + DELTA_RADIUS_TRIM_TOWER_1);
10656
-    delta_tower[B_AXIS][X_AXIS] =  sin(RADIANS(60 + delta_tower_angle_trim[B_AXIS])) * (radius + DELTA_RADIUS_TRIM_TOWER_2); // front right tower
10657
-    delta_tower[B_AXIS][Y_AXIS] = -cos(RADIANS(60 + delta_tower_angle_trim[B_AXIS])) * (radius + DELTA_RADIUS_TRIM_TOWER_2);
10658
-    delta_tower[C_AXIS][X_AXIS] = -sin(RADIANS(     delta_tower_angle_trim[C_AXIS])) * (radius + DELTA_RADIUS_TRIM_TOWER_3); // back middle tower
10659
-    delta_tower[C_AXIS][Y_AXIS] =  cos(RADIANS(     delta_tower_angle_trim[C_AXIS])) * (radius + DELTA_RADIUS_TRIM_TOWER_3);
10660
-    delta_diagonal_rod_2_tower[A_AXIS] = sq(diagonal_rod + delta_diagonal_rod_trim[A_AXIS]);
10661
-    delta_diagonal_rod_2_tower[B_AXIS] = sq(diagonal_rod + delta_diagonal_rod_trim[B_AXIS]);
10662
-    delta_diagonal_rod_2_tower[C_AXIS] = sq(diagonal_rod + delta_diagonal_rod_trim[C_AXIS]);
10682
+    const float trt[ABC] = DELTA_RADIUS_TRIM_TOWER,
10683
+                drt[ABC] = DELTA_DIAGONAL_ROD_TRIM_TOWER;
10684
+    delta_tower[A_AXIS][X_AXIS] = cos(RADIANS(210 + delta_tower_angle_trim[A_AXIS])) * (radius + trt[A_AXIS]); // front left tower
10685
+    delta_tower[A_AXIS][Y_AXIS] = sin(RADIANS(210 + delta_tower_angle_trim[A_AXIS])) * (radius + trt[A_AXIS]);
10686
+    delta_tower[B_AXIS][X_AXIS] = cos(RADIANS(330 + delta_tower_angle_trim[B_AXIS])) * (radius + trt[B_AXIS]); // front right tower
10687
+    delta_tower[B_AXIS][Y_AXIS] = sin(RADIANS(330 + delta_tower_angle_trim[B_AXIS])) * (radius + trt[B_AXIS]);
10688
+    delta_tower[C_AXIS][X_AXIS] = 0.0; // back middle tower
10689
+    delta_tower[C_AXIS][Y_AXIS] = (radius + trt[C_AXIS]);
10690
+    delta_diagonal_rod_2_tower[A_AXIS] = sq(diagonal_rod + drt[A_AXIS]);
10691
+    delta_diagonal_rod_2_tower[B_AXIS] = sq(diagonal_rod + drt[B_AXIS]);
10692
+    delta_diagonal_rod_2_tower[C_AXIS] = sq(diagonal_rod + drt[C_AXIS]);
10663
   }
10693
   }
10664
 
10694
 
10665
   #if ENABLED(DELTA_FAST_SQRT)
10695
   #if ENABLED(DELTA_FAST_SQRT)

+ 23
- 22
Marlin/configuration_store.cpp Ver fichero

42
 #define EEPROM_OFFSET 100
42
 #define EEPROM_OFFSET 100
43
 
43
 
44
 /**
44
 /**
45
- * V33 EEPROM Layout:
45
+ * V35 EEPROM Layout:
46
  *
46
  *
47
  *  100  Version                                    (char x4)
47
  *  100  Version                                    (char x4)
48
  *  104  EEPROM Checksum                            (uint16_t)
48
  *  104  EEPROM Checksum                            (uint16_t)
97
  *  360  M665 R    delta_radius                     (float)
97
  *  360  M665 R    delta_radius                     (float)
98
  *  364  M665 L    delta_diagonal_rod               (float)
98
  *  364  M665 L    delta_diagonal_rod               (float)
99
  *  368  M665 S    delta_segments_per_second        (float)
99
  *  368  M665 S    delta_segments_per_second        (float)
100
- *  372  M665 A    delta_diagonal_rod_trim[A]       (float)
101
- *  376  M665 B    delta_diagonal_rod_trim[B]       (float)
102
- *  380  M665 C    delta_diagonal_rod_trim[C]       (float)
103
- *  384  M665 I    delta_tower_angle_trim[A]        (float)
104
- *  388  M665 J    delta_tower_angle_trim[B]        (float)
105
- *  392  M665 K    delta_tower_angle_trim[C]        (float)
100
+ *  372  M665 B    delta_calibration_radius         (float)
101
+ *  376  M665 X    delta_tower_angle_trim[A]        (float)
102
+ *  380  M665 Y    delta_tower_angle_trim[B]        (float)
103
+ *  ---  M665 Z    delta_tower_angle_trim[C]        (float) is always 0.0
106
  *
104
  *
107
  * Z_DUAL_ENDSTOPS:                                 48 bytes
105
  * Z_DUAL_ENDSTOPS:                                 48 bytes
108
  *  348  M666 Z    z_endstop_adj                    (float)
106
  *  348  M666 Z    z_endstop_adj                    (float)
428
       EEPROM_WRITE(delta_radius);              // 1 float
426
       EEPROM_WRITE(delta_radius);              // 1 float
429
       EEPROM_WRITE(delta_diagonal_rod);        // 1 float
427
       EEPROM_WRITE(delta_diagonal_rod);        // 1 float
430
       EEPROM_WRITE(delta_segments_per_second); // 1 float
428
       EEPROM_WRITE(delta_segments_per_second); // 1 float
431
-      EEPROM_WRITE(delta_diagonal_rod_trim);   // 3 floats
432
-      EEPROM_WRITE(delta_tower_angle_trim);    // 3 floats
429
+      EEPROM_WRITE(delta_calibration_radius);  // 1 float
430
+      EEPROM_WRITE(delta_tower_angle_trim);    // 2 floats
431
+      dummy = 0.0f;
432
+      for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy);
433
     #elif ENABLED(Z_DUAL_ENDSTOPS)
433
     #elif ENABLED(Z_DUAL_ENDSTOPS)
434
       EEPROM_WRITE(z_endstop_adj);             // 1 float
434
       EEPROM_WRITE(z_endstop_adj);             // 1 float
435
       dummy = 0.0f;
435
       dummy = 0.0f;
802
         EEPROM_READ(delta_radius);              // 1 float
802
         EEPROM_READ(delta_radius);              // 1 float
803
         EEPROM_READ(delta_diagonal_rod);        // 1 float
803
         EEPROM_READ(delta_diagonal_rod);        // 1 float
804
         EEPROM_READ(delta_segments_per_second); // 1 float
804
         EEPROM_READ(delta_segments_per_second); // 1 float
805
-        EEPROM_READ(delta_diagonal_rod_trim);   // 3 floats
806
-        EEPROM_READ(delta_tower_angle_trim);    // 3 floats
805
+        EEPROM_READ(delta_calibration_radius);  // 1 float
806
+        EEPROM_READ(delta_tower_angle_trim);    // 2 floats
807
+        dummy = 0.0f;
808
+        for (uint8_t q=3; q--;) EEPROM_READ(dummy);
807
       #elif ENABLED(Z_DUAL_ENDSTOPS)
809
       #elif ENABLED(Z_DUAL_ENDSTOPS)
808
         EEPROM_READ(z_endstop_adj);
810
         EEPROM_READ(z_endstop_adj);
809
         dummy = 0.0f;
811
         dummy = 0.0f;
1079
 
1081
 
1080
   #if ENABLED(DELTA)
1082
   #if ENABLED(DELTA)
1081
     const float adj[ABC] = DELTA_ENDSTOP_ADJ,
1083
     const float adj[ABC] = DELTA_ENDSTOP_ADJ,
1082
-                drt[ABC] = { DELTA_DIAGONAL_ROD_TRIM_TOWER_1, DELTA_DIAGONAL_ROD_TRIM_TOWER_2, DELTA_DIAGONAL_ROD_TRIM_TOWER_3 },
1083
-                dta[ABC] = { DELTA_TOWER_ANGLE_TRIM_1, DELTA_TOWER_ANGLE_TRIM_2, DELTA_TOWER_ANGLE_TRIM_3 };
1084
+                dta[ABC] = DELTA_TOWER_ANGLE_TRIM;
1084
     COPY(endstop_adj, adj);
1085
     COPY(endstop_adj, adj);
1085
     delta_radius = DELTA_RADIUS;
1086
     delta_radius = DELTA_RADIUS;
1086
     delta_diagonal_rod = DELTA_DIAGONAL_ROD;
1087
     delta_diagonal_rod = DELTA_DIAGONAL_ROD;
1087
     delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND;
1088
     delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND;
1088
-    COPY(delta_diagonal_rod_trim, drt);
1089
-    COPY(delta_tower_angle_trim, dta);
1089
+    delta_calibration_radius = DELTA_CALIBRATION_RADIUS;
1090
+    delta_tower_angle_trim[A_AXIS] = dta[A_AXIS] - dta[C_AXIS];
1091
+    delta_tower_angle_trim[B_AXIS] = dta[B_AXIS] - dta[C_AXIS];
1090
     home_offset[Z_AXIS] = 0;
1092
     home_offset[Z_AXIS] = 0;
1091
 
1093
 
1092
   #elif ENABLED(Z_DUAL_ENDSTOPS)
1094
   #elif ENABLED(Z_DUAL_ENDSTOPS)
1488
       SERIAL_ECHOLNPAIR(" Z", LINEAR_UNIT(endstop_adj[Z_AXIS]));
1490
       SERIAL_ECHOLNPAIR(" Z", LINEAR_UNIT(endstop_adj[Z_AXIS]));
1489
       if (!forReplay) {
1491
       if (!forReplay) {
1490
         CONFIG_ECHO_START;
1492
         CONFIG_ECHO_START;
1491
-        SERIAL_ECHOLNPGM("Delta settings: L<diagonal_rod> R<radius> H<height> S<segments_per_s> ABC<diagonal_rod_[123]_trim>");
1493
+        SERIAL_ECHOLNPGM("Delta settings: L<diagonal_rod> R<radius> H<height> S<segments_per_s> B<calibration radius> XYZ<tower angle corrections>");
1492
       }
1494
       }
1493
       CONFIG_ECHO_START;
1495
       CONFIG_ECHO_START;
1494
       SERIAL_ECHOPAIR("  M665 L", LINEAR_UNIT(delta_diagonal_rod));
1496
       SERIAL_ECHOPAIR("  M665 L", LINEAR_UNIT(delta_diagonal_rod));
1495
       SERIAL_ECHOPAIR(" R", LINEAR_UNIT(delta_radius));
1497
       SERIAL_ECHOPAIR(" R", LINEAR_UNIT(delta_radius));
1496
       SERIAL_ECHOPAIR(" H", LINEAR_UNIT(DELTA_HEIGHT + home_offset[Z_AXIS]));
1498
       SERIAL_ECHOPAIR(" H", LINEAR_UNIT(DELTA_HEIGHT + home_offset[Z_AXIS]));
1497
       SERIAL_ECHOPAIR(" S", delta_segments_per_second);
1499
       SERIAL_ECHOPAIR(" S", delta_segments_per_second);
1498
-      SERIAL_ECHOPAIR(" A", LINEAR_UNIT(delta_diagonal_rod_trim[A_AXIS]));
1499
-      SERIAL_ECHOPAIR(" B", LINEAR_UNIT(delta_diagonal_rod_trim[B_AXIS]));
1500
-      SERIAL_ECHOPAIR(" C", LINEAR_UNIT(delta_diagonal_rod_trim[C_AXIS]));
1501
-      SERIAL_ECHOPAIR(" I", LINEAR_UNIT(delta_tower_angle_trim[A_AXIS]));
1502
-      SERIAL_ECHOPAIR(" J", LINEAR_UNIT(delta_tower_angle_trim[B_AXIS]));
1503
-      SERIAL_ECHOLNPAIR(" K", LINEAR_UNIT(delta_tower_angle_trim[C_AXIS]));
1500
+      SERIAL_ECHOPAIR(" B", LINEAR_UNIT(delta_calibration_radius));
1501
+      SERIAL_ECHOPAIR(" X", LINEAR_UNIT(delta_tower_angle_trim[A_AXIS]));
1502
+      SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(delta_tower_angle_trim[B_AXIS]));
1503
+      SERIAL_ECHOPAIR(" Z", 0.00);
1504
+      SERIAL_EOL;
1504
     #elif ENABLED(Z_DUAL_ENDSTOPS)
1505
     #elif ENABLED(Z_DUAL_ENDSTOPS)
1505
       if (!forReplay) {
1506
       if (!forReplay) {
1506
         CONFIG_ECHO_START;
1507
         CONFIG_ECHO_START;

+ 37
- 42
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h Ver fichero

1
-/**
1
+/**
2
  * Marlin 3D Printer Firmware
2
  * Marlin 3D Printer Firmware
3
  * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
3
  * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
  *
4
  *
431
   // and processor overload (too many expensive sqrt calls).
431
   // and processor overload (too many expensive sqrt calls).
432
   #define DELTA_SEGMENTS_PER_SECOND 160
432
   #define DELTA_SEGMENTS_PER_SECOND 160
433
 
433
 
434
+  // NOTE NB all values for DELTA_* values MUST be floating point, so always have a decimal point in them
435
+
434
   // Center-to-center distance of the holes in the diagonal push rods.
436
   // Center-to-center distance of the holes in the diagonal push rods.
435
   #define DELTA_DIAGONAL_ROD 218.0 // mm
437
   #define DELTA_DIAGONAL_ROD 218.0 // mm
436
 
438
 
437
-  // Horizontal offset from middle of printer to smooth rod center.
438
-  //#define DELTA_SMOOTH_ROD_OFFSET 150.0 // mm
439
-
440
-  // Horizontal offset of the universal joints on the end effector.
441
-  //#define DELTA_EFFECTOR_OFFSET 24.0 // mm
442
-
443
-  // Horizontal offset of the universal joints on the carriages.
444
-  //#define DELTA_CARRIAGE_OFFSET 22.0 // mm
445
-
446
   // Horizontal distance bridged by diagonal push rods when effector is centered.
439
   // Horizontal distance bridged by diagonal push rods when effector is centered.
447
-  #define DELTA_RADIUS 100.59 //mm // get this value from auto calibrate
440
+  #define DELTA_RADIUS 100.00 //mm // get this value from auto calibrate
448
 
441
 
449
-  // height from z=0.00 to home position
450
-  #define DELTA_HEIGHT 298.95 // get this value from auto calibrate
442
+  // height from z=0 to home position
443
+  #define DELTA_HEIGHT 295.00 // get this value from auto calibrate - use G33 P1 A at 1st time calibration
451
 
444
 
452
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
445
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
453
-  #define DELTA_PRINTABLE_RADIUS 90.0
446
+  #define DELTA_PRINTABLE_RADIUS 85.0
454
 
447
 
455
   // Delta calibration menu
448
   // Delta calibration menu
449
+  // uncomment to add three points calibration menu option.
456
   // See http://minow.blogspot.com/index.html#4918805519571907051
450
   // See http://minow.blogspot.com/index.html#4918805519571907051
457
   #define DELTA_CALIBRATION_MENU
451
   #define DELTA_CALIBRATION_MENU
458
 
452
 
453
+  // set the radius for the calibration probe points - max 0.8 * DELTA_PRINTABLE_RADIUS if DELTA_AUTO_CALIBRATION enabled
454
+  #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 17) // mm
455
+  
459
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
456
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
460
   #define DELTA_AUTO_CALIBRATION
457
   #define DELTA_AUTO_CALIBRATION
461
   #if ENABLED(DELTA_AUTO_CALIBRATION)
458
   #if ENABLED(DELTA_AUTO_CALIBRATION)
462
-    #define DELTA_CALIBRATION_DEFAULT_POINTS 3 // set the default number of probe points : n*n (1-4)
463
-    #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 15) // set the radius for the calibration probe points
459
+    #define DELTA_CALIBRATION_DEFAULT_POINTS 4 // set the default number of probe points : n*n (-7 -> +7)
464
   #endif
460
   #endif
465
 
461
 
466
   // After homing move down to a height where XY movement is unconstrained
462
   // After homing move down to a height where XY movement is unconstrained
467
   #define DELTA_HOME_TO_SAFE_ZONE
463
   #define DELTA_HOME_TO_SAFE_ZONE
468
 
464
 
469
-  #define DELTA_ENDSTOP_ADJ { -0.05, -0.00, -0.02 } // get these from auto calibrate
465
+  #define DELTA_ENDSTOP_ADJ { 0, 0, 0 } // get these from auto calibrate
470
 
466
 
471
   // Trim adjustments for individual towers
467
   // Trim adjustments for individual towers
472
-  #define DELTA_RADIUS_TRIM_TOWER_1 0.0
473
-  #define DELTA_RADIUS_TRIM_TOWER_2 0.0
474
-  #define DELTA_RADIUS_TRIM_TOWER_3 0.0
475
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_1 0.0
476
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_2 0.0
477
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_3 0.0
478
-  #define DELTA_TOWER_ANGLE_TRIM_1 0.0
479
-  #define DELTA_TOWER_ANGLE_TRIM_2 0.0
480
-  #define DELTA_TOWER_ANGLE_TRIM_3 0.0
468
+  // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0
469
+  // measured in degrees anticlockwise looking from above the printer
470
+  #define DELTA_TOWER_ANGLE_TRIM { 0, 0, 0 } // get these from auto calibrate
471
+
472
+  // delta radius and diaginal rod adjustments measured in mm
473
+  //#define DELTA_RADIUS_TRIM_TOWER {0, 0, 0}
474
+  //#define DELTA_DIAGONAL_ROD_TRIM_TOWER {0, 0, 0}
481
 
475
 
482
 #endif
476
 #endif
483
 
477
 
514
 // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
508
 // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
515
 #define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
509
 #define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
516
 #define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
510
 #define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
517
-#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
511
+#define Z_MIN_ENDSTOP_INVERTING true  // set to true to invert the logic of the endstop.
518
 #define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
512
 #define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
519
 #define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
513
 #define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
520
 #define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
514
 #define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
696
  *    (0,0)
690
  *    (0,0)
697
  */
691
  */
698
 #define X_PROBE_OFFSET_FROM_EXTRUDER 0     // X offset: -left  +right  [of the nozzle]
692
 #define X_PROBE_OFFSET_FROM_EXTRUDER 0     // X offset: -left  +right  [of the nozzle]
699
-#define Y_PROBE_OFFSET_FROM_EXTRUDER 0   // Y offset: -front +behind [the nozzle]
700
-#define Z_PROBE_OFFSET_FROM_EXTRUDER 0.25  // Z offset: -below +above  [the nozzle]
693
+#define Y_PROBE_OFFSET_FROM_EXTRUDER 0     // Y offset: -front +behind [the nozzle]
694
+#define Z_PROBE_OFFSET_FROM_EXTRUDER 0.10  // Z offset: -below +above  [the nozzle]
701
 
695
 
702
 // X and Y axis travel speed (mm/m) between probes
696
 // X and Y axis travel speed (mm/m) between probes
703
 #define XY_PROBE_SPEED 5000
697
 #define XY_PROBE_SPEED 5000
706
 #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
700
 #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
707
 
701
 
708
 // Speed for the "accurate" probe of each point
702
 // Speed for the "accurate" probe of each point
709
-#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 4)
703
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST) / 6
710
 
704
 
711
 // Use double touch for probing
705
 // Use double touch for probing
712
 //#define PROBE_DOUBLE_TOUCH
706
 //#define PROBE_DOUBLE_TOUCH
775
  * Example: `M851 Z-5` with a CLEARANCE of 4  =>  9mm from bed to nozzle.
769
  * Example: `M851 Z-5` with a CLEARANCE of 4  =>  9mm from bed to nozzle.
776
  *     But: `M851 Z+1` with a CLEARANCE of 2  =>  2mm from bed to nozzle.
770
  *     But: `M851 Z+1` with a CLEARANCE of 2  =>  2mm from bed to nozzle.
777
  */
771
  */
778
-#define Z_CLEARANCE_DEPLOY_PROBE   10 // Z Clearance for Deploy/Stow
779
-#define Z_CLEARANCE_BETWEEN_PROBES  3 // Z Clearance between probe points
772
+#define Z_CLEARANCE_DEPLOY_PROBE    5 // Z Clearance for Deploy/Stow
773
+#define Z_CLEARANCE_BETWEEN_PROBES  2 // Z Clearance between probe points
780
 
774
 
781
 // For M851 give a range for adjusting the Z probe offset
775
 // For M851 give a range for adjusting the Z probe offset
782
 #define Z_PROBE_OFFSET_RANGE_MIN -20
776
 #define Z_PROBE_OFFSET_RANGE_MIN -20
808
 // @section machine
802
 // @section machine
809
 
803
 
810
 // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
804
 // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
811
-#define INVERT_X_DIR true
805
+#define INVERT_X_DIR true // DELTA does not invert
812
 #define INVERT_Y_DIR true
806
 #define INVERT_Y_DIR true
813
 #define INVERT_Z_DIR true
807
 #define INVERT_Z_DIR true
814
 
808
 
815
-// Enable this option for Toshiba stepper drivers
809
+// Enable this option for Toshiba steppers drivers
816
 //#define CONFIG_STEPPERS_TOSHIBA
810
 //#define CONFIG_STEPPERS_TOSHIBA
817
 
811
 
818
 // @section extruder
812
 // @section extruder
910
  */
904
  */
911
 //#define AUTO_BED_LEVELING_3POINT
905
 //#define AUTO_BED_LEVELING_3POINT
912
 //#define AUTO_BED_LEVELING_LINEAR
906
 //#define AUTO_BED_LEVELING_LINEAR
913
-#define AUTO_BED_LEVELING_BILINEAR
907
+//#define AUTO_BED_LEVELING_BILINEAR
914
 //#define AUTO_BED_LEVELING_UBL
908
 //#define AUTO_BED_LEVELING_UBL
915
 //#define MESH_BED_LEVELING
909
 //#define MESH_BED_LEVELING
916
 
910
 
931
 #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
925
 #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
932
 
926
 
933
   // Set the number of grid points per dimension.
927
   // Set the number of grid points per dimension.
934
-  // Works best with 5 or more points in each dimension.
935
-  #define GRID_MAX_POINTS_X 9
928
+  #define GRID_MAX_POINTS_X 7
936
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
929
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
937
 
930
 
938
   // Set the boundaries for probing (where the probe can reach).
931
   // Set the boundaries for probing (where the probe can reach).
943
   #define BACK_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS
936
   #define BACK_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS
944
 
937
 
945
   // The Z probe minimum outer margin (to validate G29 parameters).
938
   // The Z probe minimum outer margin (to validate G29 parameters).
946
-  #define MIN_PROBE_EDGE 10
939
+  #define MIN_PROBE_EDGE 20
947
 
940
 
948
   // Probe along the Y axis, advancing X after each column
941
   // Probe along the Y axis, advancing X after each column
949
   //#define PROBE_Y_FIRST
942
   //#define PROBE_Y_FIRST
950
 
943
 
951
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
944
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
945
+
952
     //
946
     //
953
     // Experimental Subdivision of the grid by Catmull-Rom method.
947
     // Experimental Subdivision of the grid by Catmull-Rom method.
954
     // Synthesizes intermediate points to produce a more detailed mesh.
948
     // Synthesizes intermediate points to produce a more detailed mesh.
1098
 // @section temperature
1092
 // @section temperature
1099
 
1093
 
1100
 // Preheat Constants
1094
 // Preheat Constants
1101
-#define PREHEAT_1_TEMP_HOTEND 185
1102
-#define PREHEAT_1_TEMP_BED     70
1095
+#define PREHEAT_1_TEMP_HOTEND 195
1096
+#define PREHEAT_1_TEMP_BED     60
1103
 #define PREHEAT_1_FAN_SPEED     0 // Value from 0 to 255
1097
 #define PREHEAT_1_FAN_SPEED     0 // Value from 0 to 255
1104
 
1098
 
1105
 #define PREHEAT_2_TEMP_HOTEND 240
1099
 #define PREHEAT_2_TEMP_HOTEND 240
1345
 //
1339
 //
1346
 // Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu.
1340
 // Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu.
1347
 //
1341
 //
1342
+// INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics.
1348
 //#define INDIVIDUAL_AXIS_HOMING_MENU
1343
 //#define INDIVIDUAL_AXIS_HOMING_MENU
1349
 
1344
 
1350
 //
1345
 //
1673
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0    // Index of the extruder that has the filament sensor (0,1,2,3)
1668
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0    // Index of the extruder that has the filament sensor (0,1,2,3)
1674
   #define MEASUREMENT_DELAY_CM        14    // (cm) The distance from the filament sensor to the melting chamber
1669
   #define MEASUREMENT_DELAY_CM        14    // (cm) The distance from the filament sensor to the melting chamber
1675
 
1670
 
1676
-  #define MEASURED_UPPER_LIMIT         3.30 // (mm) Upper limit used to validate sensor reading
1677
-  #define MEASURED_LOWER_LIMIT         1.90 // (mm) Lower limit used to validate sensor reading
1671
+  #define MEASURED_UPPER_LIMIT         1.95 // (mm) Upper limit used to validate sensor reading
1672
+  #define MEASURED_LOWER_LIMIT         1.20 // (mm) Lower limit used to validate sensor reading
1678
   #define MAX_MEASUREMENT_DELAY       20    // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM.
1673
   #define MAX_MEASUREMENT_DELAY       20    // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM.
1679
 
1674
 
1680
   #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially
1675
   #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially

+ 0
- 19
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h Ver fichero

420
 #define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
420
 #define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
421
 
421
 
422
 //===========================================================================
422
 //===========================================================================
423
-//============================== Delta Settings =============================
424
-//===========================================================================
425
-
426
-#if ENABLED(DELTA_AUTO_CALIBRATION)
427
-  /**
428
-   * Set the height short (H-10) with M665 Hx.xx.
429
-   * Set the delta_radius offset (R-5, R-10, R+5, R+10) with M665 Rx.xx.
430
-   * Run G33 Cx V3 (C2, C-2) with different values for C and R
431
-   * Take the average for R_FACTOR and maximum for H_FACTOR.
432
-   * Run the tests with default values!!!
433
-   */
434
-  //#define DELTA_CALIBRATE_EXPERT_MODE
435
-
436
-  // Remove the comments of the folling 2 lines to overide default values
437
-  #define H_FACTOR  1.02 //  1.0 < H_FACTOR <  1.11, default  1.00
438
-  #define R_FACTOR -3.95 // -6.7 < R_FACTOR < -2.25, default -2.25
439
-#endif
440
-
441
-//===========================================================================
442
 //=============================Additional Features===========================
423
 //=============================Additional Features===========================
443
 //===========================================================================
424
 //===========================================================================
444
 
425
 

+ 14
- 14
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h Ver fichero

444
   #define DELTA_CARRIAGE_OFFSET 22.0 // mm
444
   #define DELTA_CARRIAGE_OFFSET 22.0 // mm
445
 
445
 
446
   // Horizontal distance bridged by diagonal push rods when effector is centered.
446
   // Horizontal distance bridged by diagonal push rods when effector is centered.
447
-  #define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET-(DELTA_EFFECTOR_OFFSET)-(DELTA_CARRIAGE_OFFSET))
447
+  #define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET - DELTA_EFFECTOR_OFFSET - DELTA_CARRIAGE_OFFSET) //mm // get this value from auto calibrate
448
 
448
 
449
   // height from z=0.00 to home position
449
   // height from z=0.00 to home position
450
-  #define DELTA_HEIGHT 280 // get this value from auto calibrate
450
+  #define DELTA_HEIGHT 280 // get this value from auto calibrate - use G33 C-1 at 1st time calibration
451
 
451
 
452
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
452
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
453
   #define DELTA_PRINTABLE_RADIUS 85.0
453
   #define DELTA_PRINTABLE_RADIUS 85.0
457
   // See http://minow.blogspot.com/index.html#4918805519571907051
457
   // See http://minow.blogspot.com/index.html#4918805519571907051
458
   //#define DELTA_CALIBRATION_MENU
458
   //#define DELTA_CALIBRATION_MENU
459
 
459
 
460
+  // set the radius for the calibration probe points - max 0.8 * DELTA_PRINTABLE_RADIUS if DELTA_AUTO_CALIBRATION enabled
461
+  #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 17) // mm
462
+  
460
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
463
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
461
   //#define DELTA_AUTO_CALIBRATION
464
   //#define DELTA_AUTO_CALIBRATION
462
   #if ENABLED(DELTA_AUTO_CALIBRATION)
465
   #if ENABLED(DELTA_AUTO_CALIBRATION)
463
-    #define DELTA_CALIBRATION_DEFAULT_POINTS 3 // set the default number of probe points : n*n (1-4)
464
-    #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 15) // set the radius for the calibration probe points
466
+    #define DELTA_CALIBRATION_DEFAULT_POINTS 3 // set the default number of probe points : n*n (-7 -> +7)
465
   #endif
467
   #endif
466
 
468
 
467
   // After homing move down to a height where XY movement is unconstrained
469
   // After homing move down to a height where XY movement is unconstrained
468
   //#define DELTA_HOME_TO_SAFE_ZONE
470
   //#define DELTA_HOME_TO_SAFE_ZONE
469
 
471
 
470
-  //#define DELTA_ENDSTOP_ADJ { 0, 0, 0 }
472
+  #define DELTA_ENDSTOP_ADJ { 0, 0, 0 } // get these from auto calibrate
471
 
473
 
472
   // Trim adjustments for individual towers
474
   // Trim adjustments for individual towers
473
-  #define DELTA_RADIUS_TRIM_TOWER_1 0.0
474
-  #define DELTA_RADIUS_TRIM_TOWER_2 0.0
475
-  #define DELTA_RADIUS_TRIM_TOWER_3 0.0
476
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_1 0.0
477
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_2 0.0
478
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_3 0.0
479
-  #define DELTA_TOWER_ANGLE_TRIM_1 0.0
480
-  #define DELTA_TOWER_ANGLE_TRIM_2 0.0
481
-  #define DELTA_TOWER_ANGLE_TRIM_3 0.0
475
+  // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0
476
+  // measured in degrees anticlockwise looking from above the printer
477
+  #define DELTA_TOWER_ANGLE_TRIM { 0, 0, 0 } // get these from auto calibrate
478
+
479
+  // delta radius and diaginal rod adjustments measured in mm
480
+  //#define DELTA_RADIUS_TRIM_TOWER {0, 0, 0}
481
+  //#define DELTA_DIAGONAL_ROD_TRIM_TOWER {0, 0, 0}
482
 
482
 
483
 #endif
483
 #endif
484
 
484
 

+ 1
- 20
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h Ver fichero

1
-/**
1
+/**
2
  * Marlin 3D Printer Firmware
2
  * Marlin 3D Printer Firmware
3
  * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
3
  * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
  *
4
  *
420
 #define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
420
 #define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
421
 
421
 
422
 //===========================================================================
422
 //===========================================================================
423
-//============================== Delta Settings =============================
424
-//===========================================================================
425
-
426
-#if ENABLED(DELTA_AUTO_CALIBRATION)
427
-  /**
428
-   * Set the height short (H-10) with M665 Hx.xx.
429
-   * Set the delta_radius offset (R-5, R-10, R+5, R+10) with M665 Rx.xx.
430
-   * Run G33 Cx V3 (C2, C-2) with different values for C and R
431
-   * Take the average for R_FACTOR and maximum for H_FACTOR.
432
-   * Run the tests with default values!!!
433
-   */
434
-  //#define DELTA_CALIBRATE_EXPERT_MODE
435
-
436
-  // Remove the comments of the folling 2 lines to overide default values
437
-  #define H_FACTOR  1.02 //  1.0 < H_FACTOR <  1.11, default  1.00
438
-  #define R_FACTOR -3.95 // -6.7 < R_FACTOR < -2.25, default -2.25
439
-#endif
440
-
441
-//===========================================================================
442
 //=============================Additional Features===========================
423
 //=============================Additional Features===========================
443
 //===========================================================================
424
 //===========================================================================
444
 
425
 

+ 15
- 15
Marlin/example_configurations/delta/generic/Configuration.h Ver fichero

434
   #define DELTA_CARRIAGE_OFFSET 18.0 // mm
434
   #define DELTA_CARRIAGE_OFFSET 18.0 // mm
435
 
435
 
436
   // Horizontal distance bridged by diagonal push rods when effector is centered.
436
   // Horizontal distance bridged by diagonal push rods when effector is centered.
437
-  #define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET-(DELTA_EFFECTOR_OFFSET)-(DELTA_CARRIAGE_OFFSET))
437
+  #define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET - DELTA_EFFECTOR_OFFSET - DELTA_CARRIAGE_OFFSET) //mm // get this value from auto calibrate  // height from z=0.00 to home position
438
 
438
 
439
   // height from z=0.00 to home position
439
   // height from z=0.00 to home position
440
-  #define DELTA_HEIGHT 250 // get this value from auto calibrate
440
+  #define DELTA_HEIGHT 250 // get this value from auto calibrate - use G33 C-1 at 1st time calibration
441
 
441
 
442
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
442
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
443
   #define DELTA_PRINTABLE_RADIUS 140.0
443
   #define DELTA_PRINTABLE_RADIUS 140.0
446
   // See http://minow.blogspot.com/index.html#4918805519571907051
446
   // See http://minow.blogspot.com/index.html#4918805519571907051
447
   //#define DELTA_CALIBRATION_MENU
447
   //#define DELTA_CALIBRATION_MENU
448
 
448
 
449
+  // set the radius for the calibration probe points - max 0.8 * DELTA_PRINTABLE_RADIUS if DELTA_AUTO_CALIBRATION enabled
450
+  #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 28) // mm
451
+  
449
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
452
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
450
   //#define DELTA_AUTO_CALIBRATION
453
   //#define DELTA_AUTO_CALIBRATION
451
   #if ENABLED(DELTA_AUTO_CALIBRATION)
454
   #if ENABLED(DELTA_AUTO_CALIBRATION)
452
-    #define DELTA_CALIBRATION_DEFAULT_POINTS 3 // set the default number of probe points : n*n (1-4)
453
-    #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 15) // set the radius for the calibration probe points
455
+    #define DELTA_CALIBRATION_DEFAULT_POINTS 3 // set the default number of probe points : n*n (-7 -> +7)
454
   #endif
456
   #endif
455
 
457
 
456
   // After homing move down to a height where XY movement is unconstrained
458
   // After homing move down to a height where XY movement is unconstrained
457
-  #define DELTA_HOME_TO_SAFE_ZONE
459
+  //#define DELTA_HOME_TO_SAFE_ZONE
458
 
460
 
459
-  //#define DELTA_ENDSTOP_ADJ { 0, 0, 0 }
461
+  #define DELTA_ENDSTOP_ADJ { 0, 0, 0 } // get these from auto calibrate
460
 
462
 
461
   // Trim adjustments for individual towers
463
   // Trim adjustments for individual towers
462
-  #define DELTA_RADIUS_TRIM_TOWER_1 0.0
463
-  #define DELTA_RADIUS_TRIM_TOWER_2 0.0
464
-  #define DELTA_RADIUS_TRIM_TOWER_3 0.0
465
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_1 0.0
466
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_2 0.0
467
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_3 0.0
468
-  #define DELTA_TOWER_ANGLE_TRIM_1 0.0
469
-  #define DELTA_TOWER_ANGLE_TRIM_2 0.0
470
-  #define DELTA_TOWER_ANGLE_TRIM_3 0.0
464
+  // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0
465
+  // measured in degrees anticlockwise looking from above the printer
466
+  #define DELTA_TOWER_ANGLE_TRIM { 0, 0, 0 } // get these from auto calibrate
467
+
468
+  // delta radius and diaginal rod adjustments measured in mm
469
+  //#define DELTA_RADIUS_TRIM_TOWER {0, 0, 0}
470
+  //#define DELTA_DIAGONAL_ROD_TRIM_TOWER {0, 0, 0}
471
 
471
 
472
 #endif
472
 #endif
473
 
473
 

+ 1
- 20
Marlin/example_configurations/delta/generic/Configuration_adv.h Ver fichero

1
-/**
1
+/**
2
  * Marlin 3D Printer Firmware
2
  * Marlin 3D Printer Firmware
3
  * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
3
  * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
  *
4
  *
420
 #define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
420
 #define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
421
 
421
 
422
 //===========================================================================
422
 //===========================================================================
423
-//============================== Delta Settings =============================
424
-//===========================================================================
425
-
426
-#if ENABLED(DELTA_AUTO_CALIBRATION)
427
-  /**
428
-   * Set the height short (H-10) with M665 Hx.xx.
429
-   * Set the delta_radius offset (R-5, R-10, R+5, R+10) with M665 Rx.xx.
430
-   * Run G33 Cx V3 (C2, C-2) with different values for C and R
431
-   * Take the average for R_FACTOR and maximum for H_FACTOR.
432
-   * Run the tests with default values!!!
433
-   */
434
-  //#define DELTA_CALIBRATE_EXPERT_MODE
435
-
436
-  // Remove the comments of the folling 2 lines to overide default values
437
-  //#define H_FACTOR  1.02 //  1.0 < H_FACTOR <  1.11, default  1.00
438
-  //#define R_FACTOR -3.95 // -6.7 < R_FACTOR < -2.25, default -2.25
439
-#endif
440
-
441
-//===========================================================================
442
 //=============================Additional Features===========================
423
 //=============================Additional Features===========================
443
 //===========================================================================
424
 //===========================================================================
444
 
425
 

+ 15
- 15
Marlin/example_configurations/delta/kossel_mini/Configuration.h Ver fichero

434
   #define DELTA_CARRIAGE_OFFSET 19.5 // mm
434
   #define DELTA_CARRIAGE_OFFSET 19.5 // mm
435
 
435
 
436
   // Horizontal distance bridged by diagonal push rods when effector is centered.
436
   // Horizontal distance bridged by diagonal push rods when effector is centered.
437
-  #define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET-(DELTA_EFFECTOR_OFFSET)-(DELTA_CARRIAGE_OFFSET))
437
+  #define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET - DELTA_EFFECTOR_OFFSET - DELTA_CARRIAGE_OFFSET) //mm // get this value from auto calibrate
438
 
438
 
439
   // height from z=0.00 to home position
439
   // height from z=0.00 to home position
440
-  #define DELTA_HEIGHT 250 // get this value from auto calibrate
440
+  #define DELTA_HEIGHT 250 // get this value from auto calibrate - use G33 C-1 at 1st time calibration
441
 
441
 
442
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
442
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
443
   #define DELTA_PRINTABLE_RADIUS 90.0
443
   #define DELTA_PRINTABLE_RADIUS 90.0
446
   // See http://minow.blogspot.com/index.html#4918805519571907051
446
   // See http://minow.blogspot.com/index.html#4918805519571907051
447
   //#define DELTA_CALIBRATION_MENU
447
   //#define DELTA_CALIBRATION_MENU
448
 
448
 
449
+  // set the radius for the calibration probe points - max 0.8 * DELTA_PRINTABLE_RADIUS if DELTA_AUTO_CALIBRATION enabled
450
+  #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 18) // mm
451
+  
449
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
452
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
450
   //#define DELTA_AUTO_CALIBRATION
453
   //#define DELTA_AUTO_CALIBRATION
451
   #if ENABLED(DELTA_AUTO_CALIBRATION)
454
   #if ENABLED(DELTA_AUTO_CALIBRATION)
452
-    #define DELTA_CALIBRATION_DEFAULT_POINTS 3 // set the default number of probe points : n*n (1-4)
453
-    #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 15) // set the radius for the calibration probe points
455
+    #define DELTA_CALIBRATION_DEFAULT_POINTS 3 // set the default number of probe points : n*n (-7 -> +7)
454
   #endif
456
   #endif
455
 
457
 
456
   // After homing move down to a height where XY movement is unconstrained
458
   // After homing move down to a height where XY movement is unconstrained
457
-  #define DELTA_HOME_TO_SAFE_ZONE
459
+  //#define DELTA_HOME_TO_SAFE_ZONE
458
 
460
 
459
-  //#define DELTA_ENDSTOP_ADJ { 0, 0, 0 }
461
+  #define DELTA_ENDSTOP_ADJ { 0, 0, 0 } // get these from auto calibrate
460
 
462
 
461
   // Trim adjustments for individual towers
463
   // Trim adjustments for individual towers
462
-  #define DELTA_RADIUS_TRIM_TOWER_1 0.0
463
-  #define DELTA_RADIUS_TRIM_TOWER_2 0.0
464
-  #define DELTA_RADIUS_TRIM_TOWER_3 0.0
465
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_1 0.0
466
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_2 0.0
467
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_3 0.0
468
-  #define DELTA_TOWER_ANGLE_TRIM_1 0.0
469
-  #define DELTA_TOWER_ANGLE_TRIM_2 0.0
470
-  #define DELTA_TOWER_ANGLE_TRIM_3 0.0
464
+  // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0
465
+  // measured in degrees anticlockwise looking from above the printer
466
+  #define DELTA_TOWER_ANGLE_TRIM { 0, 0, 0 } // get these from auto calibrate
467
+
468
+  // delta radius and diaginal rod adjustments measured in mm
469
+  //#define DELTA_RADIUS_TRIM_TOWER {0, 0, 0}
470
+  //#define DELTA_DIAGONAL_ROD_TRIM_TOWER {0, 0, 0}
471
 
471
 
472
 #endif
472
 #endif
473
 
473
 

+ 1
- 20
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h Ver fichero

1
-/**
1
+/**
2
  * Marlin 3D Printer Firmware
2
  * Marlin 3D Printer Firmware
3
  * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
3
  * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
  *
4
  *
420
 #define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
420
 #define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
421
 
421
 
422
 //===========================================================================
422
 //===========================================================================
423
-//============================== Delta Settings =============================
424
-//===========================================================================
425
-
426
-#if ENABLED(DELTA_AUTO_CALIBRATION)
427
-  /**
428
-   * Set the height short (H-10) with M665 Hx.xx.
429
-   * Set the delta_radius offset (R-5, R-10, R+5, R+10) with M665 Rx.xx.
430
-   * Run G33 Cx V3 (C2, C-2) with different values for C and R
431
-   * Take the average for R_FACTOR and maximum for H_FACTOR.
432
-   * Run the tests with default values!!!
433
-   */
434
-  //#define DELTA_CALIBRATE_EXPERT_MODE
435
-
436
-  // Remove the comments of the folling 2 lines to overide default values
437
-  //#define H_FACTOR  1.02 //  1.0 < H_FACTOR <  1.11, default  1.00
438
-  //#define R_FACTOR -3.95 // -6.7 < R_FACTOR < -2.25, default -2.25
439
-#endif
440
-
441
-//===========================================================================
442
 //=============================Additional Features===========================
423
 //=============================Additional Features===========================
443
 //===========================================================================
424
 //===========================================================================
444
 
425
 

+ 15
- 15
Marlin/example_configurations/delta/kossel_pro/Configuration.h Ver fichero

421
   #define DELTA_CARRIAGE_OFFSET 30.0 // mm
421
   #define DELTA_CARRIAGE_OFFSET 30.0 // mm
422
 
422
 
423
   // Horizontal distance bridged by diagonal push rods when effector is centered.
423
   // Horizontal distance bridged by diagonal push rods when effector is centered.
424
-  #define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET-(DELTA_EFFECTOR_OFFSET)-(DELTA_CARRIAGE_OFFSET))
424
+  #define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET - DELTA_EFFECTOR_OFFSET - DELTA_CARRIAGE_OFFSET) //mm // get this value from auto calibrate
425
 
425
 
426
   // height from z=0.00 to home position
426
   // height from z=0.00 to home position
427
-  #define DELTA_HEIGHT 277 // get this value from auto calibrate
427
+  #define DELTA_HEIGHT 277 // get this value from auto calibrate - use G33 C-1 at 1st time calibration
428
 
428
 
429
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
429
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
430
   #define DELTA_PRINTABLE_RADIUS 127.0
430
   #define DELTA_PRINTABLE_RADIUS 127.0
433
   // See http://minow.blogspot.com/index.html#4918805519571907051
433
   // See http://minow.blogspot.com/index.html#4918805519571907051
434
   //#define DELTA_CALIBRATION_MENU
434
   //#define DELTA_CALIBRATION_MENU
435
 
435
 
436
+  // set the radius for the calibration probe points - max 0.8 * DELTA_PRINTABLE_RADIUS if DELTA_AUTO_CALIBRATION enabled
437
+  #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 25.4) // mm
438
+  
436
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
439
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
437
   //#define DELTA_AUTO_CALIBRATION
440
   //#define DELTA_AUTO_CALIBRATION
438
   #if ENABLED(DELTA_AUTO_CALIBRATION)
441
   #if ENABLED(DELTA_AUTO_CALIBRATION)
439
-    #define DELTA_CALIBRATION_DEFAULT_POINTS 3 // set the default number of probe points : n*n (1-4)
440
-    #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 15) // set the radius for the calibration probe points
442
+    #define DELTA_CALIBRATION_DEFAULT_POINTS 3 // set the default number of probe points : n*n (-7 -> +7)
441
   #endif
443
   #endif
442
 
444
 
443
   // After homing move down to a height where XY movement is unconstrained
445
   // After homing move down to a height where XY movement is unconstrained
444
-  #define DELTA_HOME_TO_SAFE_ZONE
446
+  //#define DELTA_HOME_TO_SAFE_ZONE
445
 
447
 
446
-  //#define DELTA_ENDSTOP_ADJ { 0, 0, 0 }
448
+  #define DELTA_ENDSTOP_ADJ { 0, 0, 0 } // get these from auto calibrate
447
 
449
 
448
   // Trim adjustments for individual towers
450
   // Trim adjustments for individual towers
449
-  #define DELTA_RADIUS_TRIM_TOWER_1 0.0
450
-  #define DELTA_RADIUS_TRIM_TOWER_2 0.0
451
-  #define DELTA_RADIUS_TRIM_TOWER_3 0.0
452
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_1 0.0
453
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_2 0.0
454
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_3 0.0
455
-  #define DELTA_TOWER_ANGLE_TRIM_1 0.0
456
-  #define DELTA_TOWER_ANGLE_TRIM_2 0.0
457
-  #define DELTA_TOWER_ANGLE_TRIM_3 0.0
451
+  // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0
452
+  // measured in degrees anticlockwise looking from above the printer
453
+  #define DELTA_TOWER_ANGLE_TRIM { 0, 0, 0 } // get these from auto calibrate
454
+
455
+  // delta radius and diaginal rod adjustments measured in mm
456
+  //#define DELTA_RADIUS_TRIM_TOWER {0, 0, 0}
457
+  //#define DELTA_DIAGONAL_ROD_TRIM_TOWER {0, 0, 0}
458
 
458
 
459
 #endif
459
 #endif
460
 
460
 

+ 1
- 21
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h Ver fichero

1
-/**
1
+/**
2
  * Marlin 3D Printer Firmware
2
  * Marlin 3D Printer Firmware
3
  * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
3
  * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
  *
4
  *
425
 #define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
425
 #define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
426
 
426
 
427
 //===========================================================================
427
 //===========================================================================
428
-//============================== Delta Settings =============================
429
-//===========================================================================
430
-
431
-#if ENABLED(DELTA_AUTO_CALIBRATION)
432
-  /**
433
-   * Set the height short (H-10) with M665 Hx.xx.
434
-   * Set the delta_radius offset (R-5, R-10, R+5, R+10) with M665 Rx.xx.
435
-   * Run G33 Cx V3 (C2, C-2) with different values for C and R
436
-   * Take the average for R_FACTOR and maximum for H_FACTOR.
437
-   * Run the tests with default values!!!
438
-   */
439
-  //#define DELTA_CALIBRATE_EXPERT_MODE
440
-
441
-  // Remove the comments of the folling 2 lines to overide default values
442
-  //#define H_FACTOR  1.02 //  1.0 < H_FACTOR <  1.11, default  1.00
443
-  //#define R_FACTOR -3.95 // -6.7 < R_FACTOR < -2.25, default -2.25
444
-#endif
445
-
446
-
447
-//===========================================================================
448
 //=============================Additional Features===========================
428
 //=============================Additional Features===========================
449
 //===========================================================================
429
 //===========================================================================
450
 
430
 

+ 15
- 15
Marlin/example_configurations/delta/kossel_xl/Configuration.h Ver fichero

439
   #define DELTA_CARRIAGE_OFFSET 22.0 // mm
439
   #define DELTA_CARRIAGE_OFFSET 22.0 // mm
440
 
440
 
441
   // Horizontal distance bridged by diagonal push rods when effector is centered.
441
   // Horizontal distance bridged by diagonal push rods when effector is centered.
442
-  #define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET-(DELTA_EFFECTOR_OFFSET)-(DELTA_CARRIAGE_OFFSET) + 1)
442
+  #define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET - DELTA_EFFECTOR_OFFSET - DELTA_CARRIAGE_OFFSET) //mm // get this value from auto calibrate
443
 
443
 
444
   // height from z=0.00 to home position
444
   // height from z=0.00 to home position
445
-  #define DELTA_HEIGHT 380 // get this value from auto calibrate
445
+  #define DELTA_HEIGHT 380 // get this value from auto calibrate - use G33 C-1 at 1st time calibration
446
 
446
 
447
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
447
   // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
448
   #define DELTA_PRINTABLE_RADIUS 140.0
448
   #define DELTA_PRINTABLE_RADIUS 140.0
451
   // See http://minow.blogspot.com/index.html#4918805519571907051
451
   // See http://minow.blogspot.com/index.html#4918805519571907051
452
   //#define DELTA_CALIBRATION_MENU
452
   //#define DELTA_CALIBRATION_MENU
453
 
453
 
454
+  // set the radius for the calibration probe points - max 0.8 * DELTA_PRINTABLE_RADIUS if DELTA_AUTO_CALIBRATION enabled
455
+  #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 28) // mm
456
+  
454
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
457
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
455
   //#define DELTA_AUTO_CALIBRATION
458
   //#define DELTA_AUTO_CALIBRATION
456
   #if ENABLED(DELTA_AUTO_CALIBRATION)
459
   #if ENABLED(DELTA_AUTO_CALIBRATION)
457
-    #define DELTA_CALIBRATION_DEFAULT_POINTS 3 // set the default number of probe points : n*n (1-4)
458
-    #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 15) // set the radius for the calibration probe points
460
+    #define DELTA_CALIBRATION_DEFAULT_POINTS 3 // set the default number of probe points : n*n (-7 -> +7)
459
   #endif
461
   #endif
460
 
462
 
461
   // After homing move down to a height where XY movement is unconstrained
463
   // After homing move down to a height where XY movement is unconstrained
462
-  #define DELTA_HOME_TO_SAFE_ZONE
464
+  //#define DELTA_HOME_TO_SAFE_ZONE
463
 
465
 
464
-  //#define DELTA_ENDSTOP_ADJ { 0, 0, 0 }
466
+  #define DELTA_ENDSTOP_ADJ { 0, 0, 0 } // get these from auto calibrate
465
 
467
 
466
   // Trim adjustments for individual towers
468
   // Trim adjustments for individual towers
467
-  #define DELTA_RADIUS_TRIM_TOWER_1 0.0
468
-  #define DELTA_RADIUS_TRIM_TOWER_2 0.0
469
-  #define DELTA_RADIUS_TRIM_TOWER_3 0.0
470
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_1 0.0
471
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_2 0.0
472
-  #define DELTA_DIAGONAL_ROD_TRIM_TOWER_3 0.0
473
-  #define DELTA_TOWER_ANGLE_TRIM_1 0.0
474
-  #define DELTA_TOWER_ANGLE_TRIM_2 0.0
475
-  #define DELTA_TOWER_ANGLE_TRIM_3 0.0
469
+  // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0
470
+  // measured in degrees anticlockwise looking from above the printer
471
+  #define DELTA_TOWER_ANGLE_TRIM { 0, 0, 0 } // get these from auto calibrate
472
+
473
+  // delta radius and diaginal rod adjustments measured in mm
474
+  //#define DELTA_RADIUS_TRIM_TOWER {0, 0, 0}
475
+  //#define DELTA_DIAGONAL_ROD_TRIM_TOWER {0, 0, 0}
476
 
476
 
477
 #endif
477
 #endif
478
 
478
 

+ 0
- 19
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h Ver fichero

420
 #define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
420
 #define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
421
 
421
 
422
 //===========================================================================
422
 //===========================================================================
423
-//============================== Delta Settings =============================
424
-//===========================================================================
425
-
426
-#if ENABLED(DELTA_AUTO_CALIBRATION)
427
-  /**
428
-   * Set the height short (H-10) with M665 Hx.xx.
429
-   * Set the delta_radius offset (R-5, R-10, R+5, R+10) with M665 Rx.xx.
430
-   * Run G33 Cx V3 (C2, C-2) with different values for C and R
431
-   * Take the average for R_FACTOR and maximum for H_FACTOR.
432
-   * Run the tests with default values!!!
433
-   */
434
-  //#define DELTA_CALIBRATE_EXPERT_MODE
435
-
436
-  // Remove the comments of the folling 2 lines to overide default values
437
-  //#define H_FACTOR  1.02 //  1.0 < H_FACTOR <  1.11, default  1.00
438
-  //#define R_FACTOR -3.95 // -6.7 < R_FACTOR < -2.25, default -2.25
439
-#endif
440
-
441
-//===========================================================================
442
 //=============================Additional Features===========================
423
 //=============================Additional Features===========================
443
 //===========================================================================
424
 //===========================================================================
444
 
425
 

+ 2
- 0
Marlin/serial.cpp Ver fichero

32
 void serial_echopair_P(const char* s_P, float v)         { serialprintPGM(s_P); SERIAL_ECHO(v); }
32
 void serial_echopair_P(const char* s_P, float v)         { serialprintPGM(s_P); SERIAL_ECHO(v); }
33
 void serial_echopair_P(const char* s_P, double v)        { serialprintPGM(s_P); SERIAL_ECHO(v); }
33
 void serial_echopair_P(const char* s_P, double v)        { serialprintPGM(s_P); SERIAL_ECHO(v); }
34
 void serial_echopair_P(const char* s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
34
 void serial_echopair_P(const char* s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
35
+
36
+void serial_spaces(uint8_t count) { while (count--) MYSERIAL.write(' '); }

+ 5
- 0
Marlin/serial.h Ver fichero

84
 FORCE_INLINE void serial_echopair_P(const char* s_P, bool v) { serial_echopair_P(s_P, (int)v); }
84
 FORCE_INLINE void serial_echopair_P(const char* s_P, bool v) { serial_echopair_P(s_P, (int)v); }
85
 FORCE_INLINE void serial_echopair_P(const char* s_P, void *v) { serial_echopair_P(s_P, (unsigned long)v); }
85
 FORCE_INLINE void serial_echopair_P(const char* s_P, void *v) { serial_echopair_P(s_P, (unsigned long)v); }
86
 
86
 
87
+void serial_spaces(uint8_t count);
88
+#define SERIAL_ECHO_SP(C)     serial_spaces(C)
89
+#define SERIAL_ERROR_SP(C)    serial_spaces(C)
90
+#define SERIAL_PROTOCOL_SP(C) serial_spaces(C)
91
+
87
 //
92
 //
88
 // Functions for serial printing from PROGMEM. (Saves loads of SRAM.)
93
 // Functions for serial printing from PROGMEM. (Saves loads of SRAM.)
89
 //
94
 //

+ 7
- 13
Marlin/ultralcd.cpp Ver fichero

1816
       lcd_goto_screen(_lcd_calibrate_homing);
1816
       lcd_goto_screen(_lcd_calibrate_homing);
1817
     }
1817
     }
1818
 
1818
 
1819
-    #if ENABLED(DELTA_AUTO_CALIBRATION)
1820
-      #define _DELTA_TOWER_MOVE_RADIUS DELTA_CALIBRATION_RADIUS
1821
-    #else
1822
-      #define _DELTA_TOWER_MOVE_RADIUS DELTA_PRINTABLE_RADIUS
1823
-    #endif
1824
-
1825
     // Move directly to the tower position with uninterpolated moves
1819
     // Move directly to the tower position with uninterpolated moves
1826
     // If we used interpolated moves it would cause this to become re-entrant
1820
     // If we used interpolated moves it would cause this to become re-entrant
1827
     void _goto_tower_pos(const float &a) {
1821
     void _goto_tower_pos(const float &a) {
1828
       current_position[Z_AXIS] = max(Z_HOMING_HEIGHT, Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5;
1822
       current_position[Z_AXIS] = max(Z_HOMING_HEIGHT, Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5;
1829
       line_to_current(Z_AXIS);
1823
       line_to_current(Z_AXIS);
1830
 
1824
 
1831
-      current_position[X_AXIS] = a < 0 ? LOGICAL_X_POSITION(X_HOME_POS) : sin(a) * -(_DELTA_TOWER_MOVE_RADIUS);
1832
-      current_position[Y_AXIS] = a < 0 ? LOGICAL_Y_POSITION(Y_HOME_POS) : cos(a) *  (_DELTA_TOWER_MOVE_RADIUS);
1825
+      current_position[X_AXIS] = a < 0 ? LOGICAL_X_POSITION(X_HOME_POS) : cos(RADIANS(a)) * delta_calibration_radius;
1826
+      current_position[Y_AXIS] = a < 0 ? LOGICAL_Y_POSITION(Y_HOME_POS) : sin(RADIANS(a)) * delta_calibration_radius;
1833
       line_to_current(Z_AXIS);
1827
       line_to_current(Z_AXIS);
1834
 
1828
 
1835
       current_position[Z_AXIS] = 4.0;
1829
       current_position[Z_AXIS] = 4.0;
1841
       lcd_goto_screen(lcd_move_z);
1835
       lcd_goto_screen(lcd_move_z);
1842
     }
1836
     }
1843
 
1837
 
1844
-    void _goto_tower_x() { _goto_tower_pos(RADIANS(120)); }
1845
-    void _goto_tower_y() { _goto_tower_pos(RADIANS(240)); }
1846
-    void _goto_tower_z() { _goto_tower_pos(0); }
1838
+    void _goto_tower_x() { _goto_tower_pos(210); }
1839
+    void _goto_tower_y() { _goto_tower_pos(330); }
1840
+    void _goto_tower_z() { _goto_tower_pos(90); }
1847
     void _goto_center()  { _goto_tower_pos(-1); }
1841
     void _goto_center()  { _goto_tower_pos(-1); }
1848
 
1842
 
1849
     void lcd_delta_calibrate_menu() {
1843
     void lcd_delta_calibrate_menu() {
1850
       START_MENU();
1844
       START_MENU();
1851
       MENU_BACK(MSG_MAIN);
1845
       MENU_BACK(MSG_MAIN);
1852
       #if ENABLED(DELTA_AUTO_CALIBRATION)
1846
       #if ENABLED(DELTA_AUTO_CALIBRATION)
1853
-        MENU_ITEM(gcode, MSG_DELTA_AUTO_CALIBRATE, PSTR("G33 C"));
1854
-        MENU_ITEM(gcode, MSG_DELTA_HEIGHT_CALIBRATE, PSTR("G33 C1"));
1847
+        MENU_ITEM(gcode, MSG_DELTA_AUTO_CALIBRATE, PSTR("G33"));
1848
+        MENU_ITEM(gcode, MSG_DELTA_HEIGHT_CALIBRATE, PSTR("G33 P1 A"));
1855
       #endif
1849
       #endif
1856
       MENU_ITEM(submenu, MSG_AUTO_HOME, _lcd_delta_calibrate_home);
1850
       MENU_ITEM(submenu, MSG_AUTO_HOME, _lcd_delta_calibrate_home);
1857
       if (axis_homed[Z_AXIS]) {
1851
       if (axis_homed[Z_AXIS]) {

Loading…
Cancelar
Guardar