Ver código fonte

Fix G26 Circles... (#9641)

* Fix G26 Circles...
Roxy-3D 6 anos atrás
pai
commit
c78e1c0f23
Nenhuma conta vinculada ao e-mail do autor do commit

+ 13
- 13
Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h Ver arquivo

@@ -132,13 +132,13 @@
132 132
 // The following define selects which electronics board you have.
133 133
 // Please choose the name from boards.h that matches your setup
134 134
 #ifndef MOTHERBOARD
135
-  #define MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB   // For people switching over to the Panucatt Re-ARM board
136
-//#define MOTHERBOARD BOARD_RAMPS_14_EFB          // For unmodified printers using Atmega-2560 and RAMPS boards.
135
+//#define MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB   // For people switching over to the Panucatt Re-ARM board
136
+  #define MOTHERBOARD BOARD_RAMPS_14_EFB          // For unmodified printers using Atmega-2560 and RAMPS boards.
137 137
 #endif
138 138
 
139 139
 // Optional custom name for your RepStrap or other custom machine
140 140
 // Displayed in the LCD "Ready" message
141
-#define CUSTOM_MACHINE_NAME "FT-2020 v5"
141
+#define CUSTOM_MACHINE_NAME "FT-2020 v9"
142 142
 
143 143
 // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines)
144 144
 // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
@@ -565,7 +565,7 @@
565 565
  * Override with M203
566 566
  *                                      X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]]
567 567
  */
568
-#define DEFAULT_MAX_FEEDRATE          { 250, 250, 6, 17 }
568
+#define DEFAULT_MAX_FEEDRATE          { 250, 250, 2, 17 }
569 569
 
570 570
 /**
571 571
  * Default Max Acceleration (change/s) change = mm/s
@@ -573,7 +573,7 @@
573 573
  * Override with M201
574 574
  *                                      X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]]
575 575
  */
576
-#define DEFAULT_MAX_ACCELERATION      { 1000, 1000, 10, 750 }
576
+#define DEFAULT_MAX_ACCELERATION      { 1000, 1000, 4, 750 }
577 577
 
578 578
 /**
579 579
  * Default Acceleration (change/s) change = mm/s
@@ -714,7 +714,7 @@
714 714
  */
715 715
 #define X_PROBE_OFFSET_FROM_EXTRUDER 38     // X offset: -left  +right  [of the nozzle]
716 716
 #define Y_PROBE_OFFSET_FROM_EXTRUDER -7     // Y offset: -front +behind [the nozzle]
717
-#define Z_PROBE_OFFSET_FROM_EXTRUDER -10.4  // Z offset: -below +above  [the nozzle]
717
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -10.35 // Z offset: -below +above  [the nozzle]
718 718
 
719 719
 // X and Y axis travel speed (mm/m) between probes
720 720
 #define XY_PROBE_SPEED 7500
@@ -744,8 +744,8 @@
744 744
  * Example: `M851 Z-5` with a CLEARANCE of 4  =>  9mm from bed to nozzle.
745 745
  *     But: `M851 Z+1` with a CLEARANCE of 2  =>  2mm from bed to nozzle.
746 746
  */
747
-#define Z_CLEARANCE_DEPLOY_PROBE    5 // Z Clearance for Deploy/Stow
748
-#define Z_CLEARANCE_BETWEEN_PROBES  5 // Z Clearance between probe points
747
+#define Z_CLEARANCE_DEPLOY_PROBE    3 // Z Clearance for Deploy/Stow
748
+#define Z_CLEARANCE_BETWEEN_PROBES  3 // Z Clearance between probe points
749 749
 
750 750
 // For M851 give a range for adjusting the Z probe offset
751 751
 #define Z_PROBE_OFFSET_RANGE_MIN -20
@@ -816,8 +816,8 @@
816 816
 #define X_MIN_POS 6
817 817
 #define Y_MIN_POS 3
818 818
 #define Z_MIN_POS 0
819
-#define X_MAX_POS 212
820
-#define Y_MAX_POS 190
819
+#define X_MAX_POS 207
820
+#define Y_MAX_POS 182
821 821
 #define Z_MAX_POS 175
822 822
 
823 823
 /**
@@ -920,7 +920,7 @@
920 920
   // For Cartesian machines, instead of dividing moves on mesh boundaries,
921 921
   // split up moves into short segments like a Delta. This follows the
922 922
   // contours of the bed more closely than edge-to-edge straight moves.
923
-  #define SEGMENT_LEVELED_MOVES
923
+//#define SEGMENT_LEVELED_MOVES
924 924
   #define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one)
925 925
 
926 926
   /**
@@ -1159,7 +1159,7 @@
1159 1159
 //
1160 1160
 // M100 Free Memory Watcher
1161 1161
 //
1162
-//#define M100_FREE_MEMORY_WATCHER    // Add M100 (Free Memory Watcher) to debug memory usage
1162
+#define M100_FREE_MEMORY_WATCHER    // Add M100 (Free Memory Watcher) to debug memory usage
1163 1163
 
1164 1164
 //
1165 1165
 // G20/G21 Inch mode support
@@ -1199,7 +1199,7 @@
1199 1199
   // Specify a park position as { X, Y, Z }
1200 1200
   #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
1201 1201
   #define NOZZLE_PARK_XY_FEEDRATE 100   // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
1202
-  #define NOZZLE_PARK_Z_FEEDRATE 8      // Z axis feedrate in mm/s (not used for delta printers)
1202
+  #define NOZZLE_PARK_Z_FEEDRATE 5      // Z axis feedrate in mm/s (not used for delta printers)
1203 1203
 #endif
1204 1204
 
1205 1205
 /**

+ 6
- 6
Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h Ver arquivo

@@ -1581,17 +1581,17 @@
1581 1581
  */
1582 1582
 #define MAX7219_DEBUG
1583 1583
 #if ENABLED(MAX7219_DEBUG)
1584
-//#define MAX7219_CLK_PIN   64  // on RAMPS       // Configuration of the 3 pins to control the display
1585
-//#define MAX7219_DIN_PIN   57  // on RAMPS
1586
-//#define MAX7219_LOAD_PIN  44  // on RAMPS
1584
+#define MAX7219_CLK_PIN   64  // on RAMPS       // Configuration of the 3 pins to control the display
1585
+#define MAX7219_DIN_PIN   57  // on RAMPS
1586
+#define MAX7219_LOAD_PIN  44  // on RAMPS
1587 1587
 
1588 1588
 //#define MAX7219_CLK_PIN   77 // on Re-ARM       // Configuration of the 3 pins to control the display
1589 1589
 //#define MAX7219_DIN_PIN   78 // on Re-ARM
1590 1590
 //#define MAX7219_LOAD_PIN  79 // on Re-ARM
1591 1591
 
1592
-  #define MAX7219_CLK_PIN   30 // for RAMPS E1     // Configuration of the 3 pins to control the display
1593
-  #define MAX7219_DIN_PIN   34 // for RAMPS E1
1594
-  #define MAX7219_LOAD_PIN  36 // for RAMPS E1
1592
+//#define MAX7219_CLK_PIN   30 // for RAMPS E1     // Configuration of the 3 pins to control the display
1593
+//#define MAX7219_DIN_PIN   34 // for RAMPS E1
1594
+//#define MAX7219_LOAD_PIN  36 // for RAMPS E1
1595 1595
 
1596 1596
   /**
1597 1597
    * Sample debug features

+ 22
- 37
Marlin/src/gcode/bedlevel/G26.cpp Ver arquivo

@@ -586,8 +586,8 @@ void GcodeSuite::G26() {
586 586
 
587 587
   if (parser.seenval('B')) {
588 588
     g26_bed_temp = parser.value_celsius();
589
-    if (!WITHIN(g26_bed_temp, 15, 140)) {
590
-      SERIAL_PROTOCOLLNPGM("?Specified bed temperature not plausible.");
589
+    if (g26_bed_temp && !WITHIN(g26_bed_temp, 40, 140)) {
590
+      SERIAL_PROTOCOLLNPGM("?Specified bed temperature not plausible (40-140C).");
591 591
       return;
592 592
     }
593 593
   }
@@ -737,14 +737,15 @@ void GcodeSuite::G26() {
737 737
 
738 738
   /**
739 739
    * Pre-generate radius offset values at 30 degree intervals to reduce CPU load.
740
-   * All angles are offset by 15 degrees to allow for a smaller table.
741 740
    */
742
-  #define A_CNT ((360 / 30) / 2)
743
-  #define _COS(A) (trig_table[((A + A_CNT * 8) % A_CNT)] * (A >= A_CNT ? -1 : 1))
741
+
742
+  #define A_CNT ((360 / 30) / 2)  // must be a multiple of 2 for _COS() and _SIN() macro to work correctly!
743
+  #define NEGATION_of_COS_TABLE(A) (((A + A_CNT * 16) % (A_CNT * 2)) >= A_CNT ? -1 : 1) 
744
+  #define _COS(A) (trig_table[(A + A_CNT * 16) % A_CNT] * NEGATION_of_COS_TABLE(A))
744 745
   #define _SIN(A) (-_COS((A + A_CNT / 2) % (A_CNT * 2)))
745 746
   float trig_table[A_CNT];
746 747
   for (uint8_t i = 0; i < A_CNT; i++)
747
-    trig_table[i] = INTERSECTION_CIRCLE_RADIUS * cos(RADIANS(i * 30 + 15));
748
+    trig_table[i] = INTERSECTION_CIRCLE_RADIUS * cos(RADIANS(i * 30));
748 749
 
749 750
   mesh_index_pair location;
750 751
   do {
@@ -762,32 +763,26 @@ void GcodeSuite::G26() {
762 763
       // Determine where to start and end the circle,
763 764
       // which is always drawn counter-clockwise.
764 765
       const uint8_t xi = location.x_index, yi = location.y_index;
765
-      const bool f = yi == 0, r = xi == GRID_MAX_POINTS_X - 1, b = yi == GRID_MAX_POINTS_Y - 1;
766
-      int8_t start_ind = -2, end_ind = 10;  // Assume a full circle (from 4:30 to 4:30)
767
-      if (xi == 0) {                        // Left edge? Just right half.
768
-        start_ind = f ?  0 : -3;            // 05:30 (02:30 for front-left)
769
-        end_ind   = b ? -1 :  2;            // 12:30 (03:30 for back-left)
770
-      }
771
-      else if (r) {                         // Right edge? Just left half.
772
-        start_ind = f ? 5 : 3;              // 11:30 (09:30 for front-right)
773
-        end_ind   = b ? 6 : 8;              // 06:30 (08:30 for back-right)
766
+        const bool f = yi == 0, r = xi >= GRID_MAX_POINTS_X - 1, b = yi >= GRID_MAX_POINTS_Y - 1;
767
+        int8_t start_ind = -2, end_ind = 9;  // Assume a full circle (from 5:00 to 5:00)
768
+      if (xi == 0) {                     // Left edge? Just right half.
769
+        start_ind = f ? 0 : -3;          //  03:00 to 12:00 for front-left
770
+        end_ind   = b ? 0 :  2;          //  06:00 to 03:00 for back-left
774 771
       }
775
-      else if (f) {                         // Front edge? Just back half.
776
-        start_ind = 0;                      // 02:30
777
-        end_ind   = 5;                      // 09:30
772
+      else if (r) {                      // Right edge? Just left half.
773
+        start_ind = b ? 6 : 3;           //  12:00 to 09:00 for front-right
774
+        end_ind   = f ? 5 : 8;           //  09:00 to 06:00 for back-right
778 775
       }
779
-      else if (b) {                         // Back edge? Just front half.
780
-        start_ind =  6;                     // 08:30
781
-        end_ind   = 11;                     // 03:30
776
+      else if (f) {                      // Front edge? Just back half.
777
+        start_ind = 0;                   //  03:00
778
+        end_ind   = 5;                   //  09:00
782 779
       }
783
-      if (g26_debug_flag) {
784
-        SERIAL_ECHOPAIR("   Doing circle at: (xi=", xi);
785
-        SERIAL_ECHOPAIR(", yi=", yi);
786
-        SERIAL_CHAR(')');
787
-        SERIAL_EOL();
780
+      else if (b) {                      // Back edge? Just front half.
781
+        start_ind =  6;                  //  09:00
782
+        end_ind   = 11;                  //  03:00
788 783
       }
789 784
 
790
-      for (int8_t ind = start_ind; ind < end_ind; ind++) {
785
+      for (int8_t ind = start_ind; ind <= end_ind; ind++) {
791 786
 
792 787
         #if ENABLED(NEWPANEL)
793 788
           if (user_canceled()) goto LEAVE;          // Check if the user wants to stop the Mesh Validation
@@ -808,16 +803,6 @@ void GcodeSuite::G26() {
808 803
           ye = constrain(ye, Y_MIN_POS + 1, Y_MAX_POS - 1);
809 804
         #endif
810 805
 
811
-        //if (g26_debug_flag) {
812
-        //  char ccc, *cptr, seg_msg[50], seg_num[10];
813
-        //  strcpy(seg_msg, "   segment: ");
814
-        //  strcpy(seg_num, "    \n");
815
-        //  cptr = (char*) "01234567890ABCDEF????????";
816
-        //  ccc = cptr[tmp_div_30];
817
-        //  seg_num[1] = ccc;
818
-        //  strcat(seg_msg, seg_num);
819
-        //  debug_current_and_destination(seg_msg);
820
-        //}
821 806
 
822 807
         print_line_from_here_to_there(rx, ry, g26_layer_height, xe, ye, g26_layer_height);
823 808
         MYSERIAL0.flush(); // Prevent host M105 buffer overrun.

Carregando…
Cancelar
Salvar