Explorar el Código

Polargraph / Makelangelo kinematics (#22790)

Dan Royer hace 3 años
padre
commit
3344071f24

+ 7
- 0
Marlin/Configuration.h Ver fichero

@@ -761,6 +761,13 @@
761 761
 // Enable for a belt style printer with endless "Z" motion
762 762
 //#define BELTPRINTER
763 763
 
764
+// Enable for Polargraph Kinematics
765
+//#define POLARGRAPH
766
+#if ENABLED(POLARGRAPH)
767
+  #define POLARGRAPH_MAX_BELT_LEN 1035.0
768
+  #define POLAR_SEGMENTS_PER_SECOND 5
769
+#endif
770
+
764 771
 //===========================================================================
765 772
 //============================== Endstop Settings ===========================
766 773
 //===========================================================================

+ 2
- 0
Marlin/src/MarlinCore.cpp Ver fichero

@@ -168,6 +168,8 @@
168 168
 
169 169
 #if ENABLED(DELTA)
170 170
   #include "module/delta.h"
171
+#elif ENABLED(POLARGRAPH)
172
+  #include "module/polargraph.h"
171 173
 #elif IS_SCARA
172 174
   #include "module/scara.h"
173 175
 #endif

+ 4
- 3
Marlin/src/core/language.h Ver fichero

@@ -264,9 +264,10 @@
264 264
 // Settings Report Strings
265 265
 #define STR_Z_AUTO_ALIGN                    "Z Auto-Align"
266 266
 #define STR_BACKLASH_COMPENSATION           "Backlash compensation"
267
-#define STR_DELTA_SETTINGS                  "Delta settings (L<diagonal-rod> R<radius> H<height> S<segments-per-sec> XYZ<tower-angle-trim> ABC<rod-trim>)"
268
-#define STR_SCARA_SETTINGS                  "SCARA settings"
269
-#define STR_SCARA_S                         "S<seg-per-sec>"
267
+#define STR_S_SEG_PER_SEC                   "S<seg-per-sec>"
268
+#define STR_DELTA_SETTINGS                  "Delta (L<diagonal-rod> R<radius> H<height> S<seg-per-sec> XYZ<tower-angle-trim> ABC<rod-trim>)"
269
+#define STR_SCARA_SETTINGS                  "SCARA"
270
+#define STR_POLARGRAPH_SETTINGS             "Polargraph"
270 271
 #define STR_SCARA_P_T_Z                     "P<theta-psi-offset> T<theta-offset> Z<home-offset>"
271 272
 #define STR_ENDSTOP_ADJUSTMENT              "Endstop adjustment"
272 273
 #define STR_SKEW_FACTOR                     "Skew Factor"

+ 2
- 0
Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp Ver fichero

@@ -324,6 +324,8 @@
324 324
     #define DELTA_SEGMENT_MIN_LENGTH 0.25 // SCARA minimum segment size is 0.25mm
325 325
   #elif ENABLED(DELTA)
326 326
     #define DELTA_SEGMENT_MIN_LENGTH 0.10 // mm (still subject to DELTA_SEGMENTS_PER_SECOND)
327
+  #elif ENABLED(POLARGRAPH)
328
+    #define DELTA_SEGMENT_MIN_LENGTH 0.10 // mm (still subject to DELTA_SEGMENTS_PER_SECOND)
327 329
   #else // CARTESIAN
328 330
     #ifdef LEVELED_SEGMENT_LENGTH
329 331
       #define DELTA_SEGMENT_MIN_LENGTH LEVELED_SEGMENT_LENGTH

+ 24
- 1
Marlin/src/gcode/calibrate/M665.cpp Ver fichero

@@ -132,7 +132,7 @@
132 132
   }
133 133
 
134 134
   void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
135
-    report_heading_etc(forReplay, PSTR(STR_SCARA_SETTINGS " (" STR_SCARA_S TERN_(HAS_SCARA_OFFSET, " " STR_SCARA_P_T_Z) ")"));
135
+    report_heading_etc(forReplay, PSTR(STR_SCARA_SETTINGS " (" STR_S_SEG_PER_SEC TERN_(HAS_SCARA_OFFSET, " " STR_SCARA_P_T_Z) ")"));
136 136
     SERIAL_ECHOLNPGM_P(
137 137
       PSTR("  M665 S"), segments_per_second
138 138
       #if HAS_SCARA_OFFSET
@@ -143,6 +143,29 @@
143 143
     );
144 144
   }
145 145
 
146
+#elif ENABLED(POLARGRAPH)
147
+
148
+  #include "../../module/polargraph.h"
149
+
150
+  /**
151
+   * M665: Set POLARGRAPH settings
152
+   *
153
+   * Parameters:
154
+   *
155
+   *   S[segments-per-second] - Segments-per-second
156
+   */
157
+  void GcodeSuite::M665() {
158
+    if (parser.seenval('S'))
159
+      segments_per_second = parser.value_float();
160
+    else
161
+      M665_report();
162
+  }
163
+
164
+  void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
165
+    report_heading_etc(forReplay, PSTR(STR_POLARGRAPH_SETTINGS " (" STR_S_SEG_PER_SEC ")"));
166
+    SERIAL_ECHOLNPGM("  M665 S", segments_per_second);
167
+  }
168
+
146 169
 #endif
147 170
 
148 171
 #endif // IS_KINEMATIC

+ 29
- 7
Marlin/src/gcode/control/M280.cpp Ver fichero

@@ -26,22 +26,44 @@
26 26
 
27 27
 #include "../gcode.h"
28 28
 #include "../../module/servo.h"
29
+#include "../../module/planner.h"
29 30
 
30 31
 /**
31
- * M280: Get or set servo position. P<index> [S<angle>]
32
+ * M280: Get or set servo position.
33
+ *  P<index> - Servo index
34
+ *  S<angle> - Angle to set, omit to read current angle, or use -1 to detach
35
+ *
36
+ * With POLARGRAPH:
37
+ *  T<ms>    - Duration of servo move
32 38
  */
33 39
 void GcodeSuite::M280() {
34 40
 
35
-  if (!parser.seen('P')) return;
41
+  if (!parser.seenval('P')) return;
42
+
43
+  TERN_(POLARGRAPH, planner.synchronize());
36 44
 
37 45
   const int servo_index = parser.value_int();
38 46
   if (WITHIN(servo_index, 0, NUM_SERVOS - 1)) {
39
-    if (parser.seen('S')) {
40
-      const int a = parser.value_int();
41
-      if (a == -1)
42
-        DETACH_SERVO(servo_index);
47
+    if (parser.seenval('S')) {
48
+      const int anew = parser.value_int();
49
+      if (anew >= 0) {
50
+        #if ENABLED(POLARGRAPH)
51
+          if (parser.seen('T')) { // (ms) Total duration of servo move
52
+            const int16_t t = constrain(parser.value_int(), 0, 10000);
53
+            const int aold = servo[servo_index].read();
54
+            millis_t now = millis();
55
+            const millis_t start = now, end = start + t;
56
+            while (PENDING(now, end)) {
57
+              safe_delay(50);
58
+              now = _MIN(millis(), end);
59
+              MOVE_SERVO(servo_index, LROUND(aold + (anew - aold) * (float(now - start) / t)));
60
+            }
61
+          }
62
+        #endif // POLARGRAPH
63
+        MOVE_SERVO(servo_index, anew);
64
+      }
43 65
       else
44
-        MOVE_SERVO(servo_index, a);
66
+        DETACH_SERVO(servo_index);
45 67
     }
46 68
     else
47 69
       SERIAL_ECHO_MSG(" Servo ", servo_index, ": ", servo[servo_index].read());

+ 1
- 1
Marlin/src/gcode/control/M282.cpp Ver fichero

@@ -32,7 +32,7 @@
32 32
  */
33 33
 void GcodeSuite::M282() {
34 34
 
35
-  if (!parser.seen('P')) return;
35
+  if (!parser.seenval('P')) return;
36 36
 
37 37
   const int servo_index = parser.value_int();
38 38
   if (WITHIN(servo_index, 0, NUM_SERVOS - 1))

+ 2
- 2
Marlin/src/gcode/gcode.cpp Ver fichero

@@ -885,8 +885,8 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
885 885
         case 605: M605(); break;                                  // M605: Set Dual X Carriage movement mode
886 886
       #endif
887 887
 
888
-      #if ENABLED(DELTA)
889
-        case 665: M665(); break;                                  // M665: Set delta configurations
888
+      #if IS_KINEMATIC
889
+        case 665: M665(); break;                                  // M665: Set Delta/SCARA parameters
890 890
       #endif
891 891
 
892 892
       #if ENABLED(DELTA) || HAS_EXTRA_ENDSTOPS

+ 1
- 0
Marlin/src/gcode/gcode.h Ver fichero

@@ -244,6 +244,7 @@
244 244
  * M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE)
245 245
  * M605 - Set Dual X-Carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE)
246 246
  * M665 - Set delta configurations: "M665 H<delta height> L<diagonal rod> R<delta radius> S<segments/s> B<calibration radius> X<Alpha angle trim> Y<Beta angle trim> Z<Gamma angle trim> (Requires DELTA)
247
+ *        Set SCARA configurations: "M665 S<segments-per-second> P<theta-psi-offset> T<theta-offset> Z<z-offset> (Requires MORGAN_SCARA or MP_SCARA)
247 248
  * M666 - Set/get offsets for delta (Requires DELTA) or dual endstops. (Requires [XYZ]_DUAL_ENDSTOPS)
248 249
  * M672 - Set/Reset Duet Smart Effector's sensitivity. (Requires DUET_SMART_EFFECTOR and SMART_EFFECTOR_MOD_PIN)
249 250
  * M701 - Load filament (Requires FILAMENT_LOAD_UNLOAD_GCODES)

+ 1
- 1
Marlin/src/inc/Conditionals_LCD.h Ver fichero

@@ -1061,7 +1061,7 @@
1061 1061
 #if ANY(MORGAN_SCARA, MP_SCARA, AXEL_TPARA)
1062 1062
   #define IS_SCARA 1
1063 1063
   #define IS_KINEMATIC 1
1064
-#elif ENABLED(DELTA)
1064
+#elif EITHER(DELTA, POLARGRAPH)
1065 1065
   #define IS_KINEMATIC 1
1066 1066
 #else
1067 1067
   #define IS_CARTESIAN 1

+ 2
- 2
Marlin/src/inc/SanityCheck.h Ver fichero

@@ -1340,8 +1340,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1340 1340
 /**
1341 1341
  * Servo deactivation depends on servo endstops, switching nozzle, or switching extruder
1342 1342
  */
1343
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_PROBE && !defined(SWITCHING_NOZZLE_SERVO_NR) && !defined(SWITCHING_EXTRUDER_SERVO_NR) && !defined(SWITCHING_TOOLHEAD_SERVO_NR)
1344
-  #error "Z_PROBE_SERVO_NR, switching nozzle, switching toolhead or switching extruder is required for DEACTIVATE_SERVOS_AFTER_MOVE."
1343
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && NONE(HAS_Z_SERVO_PROBE, POLARGRAPH) && !defined(SWITCHING_NOZZLE_SERVO_NR) && !defined(SWITCHING_EXTRUDER_SERVO_NR) && !defined(SWITCHING_TOOLHEAD_SERVO_NR)
1344
+  #error "Z_PROBE_SERVO_NR, switching nozzle, switching toolhead, switching extruder, or POLARGRAPH is required for DEACTIVATE_SERVOS_AFTER_MOVE."
1345 1345
 #endif
1346 1346
 
1347 1347
 /**

+ 4
- 2
Marlin/src/lcd/menu/menu_advanced.cpp Ver fichero

@@ -466,9 +466,11 @@ void menu_backlash();
466 466
         #ifdef MAX_JERK_EDIT_VALUES
467 467
           MAX_JERK_EDIT_VALUES
468 468
         #elif ENABLED(LIMITED_JERK_EDITING)
469
-          { (DEFAULT_XJERK) * 2, (DEFAULT_YJERK) * 2, (DEFAULT_ZJERK) * 2, (DEFAULT_EJERK) * 2 }
469
+          { LOGICAL_AXIS_LIST((DEFAULT_EJERK) * 2,
470
+                              (DEFAULT_XJERK) * 2, (DEFAULT_YJERK) * 2, (DEFAULT_ZJERK) * 2,
471
+                              (DEFAULT_IJERK) * 2, (DEFAULT_JJERK) * 2, (DEFAULT_KJERK) * 2) }
470 472
         #else
471
-          { 990, 990, 990, 990 }
473
+          { LOGICAL_AXIS_LIST(990, 990, 990, 990, 990, 990, 990) }
472 474
         #endif
473 475
       ;
474 476
       #define EDIT_JERK(N) EDIT_ITEM_FAST(float3, MSG_V##N##_JERK, &planner.max_jerk[_AXIS(N)], 1, max_jerk_edit[_AXIS(N)])

+ 1
- 1
Marlin/src/module/motion.cpp Ver fichero

@@ -489,7 +489,7 @@ void do_blocking_move_to(LINEAR_AXIS_ARGS(const float), const_feedRate_t fr_mm_s
489 489
     const feedRate_t z_feedrate = fr_mm_s ?: homing_feedrate(Z_AXIS);
490 490
   #endif
491 491
 
492
-  #if EITHER(DELTA, IS_SCARA)
492
+  #if IS_KINEMATIC
493 493
     if (!position_is_reachable(x, y)) return;
494 494
     destination = current_position;          // sync destination at the start
495 495
   #endif

+ 8
- 0
Marlin/src/module/motion.h Ver fichero

@@ -504,6 +504,14 @@ void home_if_needed(const bool keeplev=false);
504 504
 
505 505
       return HYPOT2(rx, ry) <= sq(DELTA_PRINTABLE_RADIUS - inset + fslop);
506 506
 
507
+    #elif ENABLED(POLARGRAPH)
508
+
509
+      const float x1 = rx - (X_MIN_POS), x2 = (X_MAX_POS) - rx, y = ry - (Y_MAX_POS),
510
+                  a = HYPOT(x1, y), b = HYPOT(x2, y);
511
+      return a < (POLARGRAPH_MAX_BELT_LEN) + 1
512
+          && b < (POLARGRAPH_MAX_BELT_LEN) + 1
513
+          && (a + b) > _MIN(X_BED_SIZE, Y_BED_SIZE);
514
+
507 515
     #elif ENABLED(AXEL_TPARA)
508 516
 
509 517
       const float R2 = HYPOT2(rx - TPARA_OFFSET_X, ry - TPARA_OFFSET_Y);

+ 2
- 2
Marlin/src/module/planner.cpp Ver fichero

@@ -3021,7 +3021,7 @@ bool Planner::buffer_line(const xyze_pos_t &cart, const_feedRate_t fr_mm_s, cons
3021 3021
     #else
3022 3022
       const feedRate_t feedrate = fr_mm_s;
3023 3023
     #endif
3024
-    delta.e = machine.e;
3024
+    TERN_(HAS_EXTRUDERS, delta.e = machine.e);
3025 3025
     if (buffer_segment(delta OPTARG(HAS_DIST_MM_ARG, cart_dist_mm), feedrate, extruder, mm)) {
3026 3026
       position_cart = cart;
3027 3027
       return true;
@@ -3126,7 +3126,7 @@ void Planner::set_position_mm(const xyze_pos_t &xyze) {
3126 3126
   #if IS_KINEMATIC
3127 3127
     position_cart = xyze;
3128 3128
     inverse_kinematics(machine);
3129
-    delta.e = machine.e;
3129
+    TERN_(HAS_EXTRUDERS, delta.e = machine.e);
3130 3130
     set_machine_position_mm(delta);
3131 3131
   #else
3132 3132
     set_machine_position_mm(machine);

+ 2
- 0
Marlin/src/module/planner.h Ver fichero

@@ -48,6 +48,8 @@
48 48
 
49 49
 #if ENABLED(DELTA)
50 50
   #include "delta.h"
51
+#elif ENABLED(POLARGRAPH)
52
+  #include "polargraph.h"
51 53
 #endif
52 54
 
53 55
 #if ABL_PLANAR

+ 47
- 0
Marlin/src/module/polargraph.cpp Ver fichero

@@ -0,0 +1,47 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * polargraph.cpp
25
+ */
26
+
27
+#include "../inc/MarlinConfig.h"
28
+
29
+#if ENABLED(POLARGRAPH)
30
+
31
+#include "polargraph.h"
32
+#include "motion.h"
33
+
34
+// For homing:
35
+#include "planner.h"
36
+#include "endstops.h"
37
+#include "../lcd/marlinui.h"
38
+#include "../MarlinCore.h"
39
+
40
+float segments_per_second; // Initialized by settings.load()
41
+
42
+void inverse_kinematics(const xyz_pos_t &raw) {
43
+  const float x1 = raw.x - (X_MIN_POS), x2 = (X_MAX_POS) - raw.x, y = raw.y - (Y_MAX_POS);
44
+  delta.set(HYPOT(x1, y), HYPOT(x2, y), raw.z);
45
+}
46
+
47
+#endif // POLARGRAPH

+ 33
- 0
Marlin/src/module/polargraph.h Ver fichero

@@ -0,0 +1,33 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+/**
25
+ * polargraph.h - Polargraph-specific functions
26
+ */
27
+
28
+#include "../core/types.h"
29
+#include "../core/macros.h"
30
+
31
+extern float segments_per_second;
32
+
33
+void inverse_kinematics(const xyz_pos_t &raw);

+ 91
- 66
Marlin/src/module/settings.cpp Ver fichero

@@ -36,7 +36,7 @@
36 36
  */
37 37
 
38 38
 // Change EEPROM version if the structure changes
39
-#define EEPROM_VERSION "V84"
39
+#define EEPROM_VERSION "V85"
40 40
 #define EEPROM_OFFSET 100
41 41
 
42 42
 // Check the integrity of data offsets.
@@ -279,17 +279,24 @@ typedef struct SettingsDataStruct {
279 279
   bool bltouch_last_written_mode;
280 280
 
281 281
   //
282
-  // DELTA / [XYZ]_DUAL_ENDSTOPS
282
+  // Kinematic Settings
283 283
   //
284
-  #if ENABLED(DELTA)
285
-    float delta_height;                                 // M666 H
286
-    abc_float_t delta_endstop_adj;                      // M666 X Y Z
287
-    float delta_radius,                                 // M665 R
288
-          delta_diagonal_rod,                           // M665 L
289
-          segments_per_second;                          // M665 S
290
-    abc_float_t delta_tower_angle_trim,                 // M665 X Y Z
291
-                delta_diagonal_rod_trim;                // M665 A B C
292
-  #elif HAS_EXTRA_ENDSTOPS
284
+  #if IS_KINEMATIC
285
+    float segments_per_second;                          // M665 S
286
+    #if ENABLED(DELTA)
287
+      float delta_height;                               // M666 H
288
+      abc_float_t delta_endstop_adj;                    // M666 X Y Z
289
+      float delta_radius,                               // M665 R
290
+            delta_diagonal_rod;                         // M665 L
291
+      abc_float_t delta_tower_angle_trim,               // M665 X Y Z
292
+                  delta_diagonal_rod_trim;              // M665 A B C
293
+    #endif
294
+  #endif
295
+
296
+  //
297
+  // Extra Endstops offsets
298
+  //
299
+  #if HAS_EXTRA_ENDSTOPS
293 300
     float x2_endstop_adj,                               // M666 X
294 301
           y2_endstop_adj,                               // M666 Y
295 302
           z2_endstop_adj,                               // M666 (S2) Z
@@ -857,45 +864,49 @@ void MarlinSettings::postprocess() {
857 864
     }
858 865
 
859 866
     //
860
-    // DELTA Geometry or Dual Endstops offsets
867
+    // Kinematic Settings
861 868
     //
869
+    #if IS_KINEMATIC
862 870
     {
871
+      EEPROM_WRITE(segments_per_second);
863 872
       #if ENABLED(DELTA)
864
-
865 873
         _FIELD_TEST(delta_height);
866
-
867 874
         EEPROM_WRITE(delta_height);              // 1 float
868 875
         EEPROM_WRITE(delta_endstop_adj);         // 3 floats
869 876
         EEPROM_WRITE(delta_radius);              // 1 float
870 877
         EEPROM_WRITE(delta_diagonal_rod);        // 1 float
871
-        EEPROM_WRITE(segments_per_second);       // 1 float
872 878
         EEPROM_WRITE(delta_tower_angle_trim);    // 3 floats
873 879
         EEPROM_WRITE(delta_diagonal_rod_trim);   // 3 floats
880
+      #endif
881
+    }
882
+    #endif
874 883
 
875
-      #elif HAS_EXTRA_ENDSTOPS
876
-
877
-        _FIELD_TEST(x2_endstop_adj);
878
-
879
-        // Write dual endstops in X, Y, Z order. Unused = 0.0
880
-        dummyf = 0;
881
-        EEPROM_WRITE(TERN(X_DUAL_ENDSTOPS, endstops.x2_endstop_adj, dummyf));   // 1 float
882
-        EEPROM_WRITE(TERN(Y_DUAL_ENDSTOPS, endstops.y2_endstop_adj, dummyf));   // 1 float
883
-        EEPROM_WRITE(TERN(Z_MULTI_ENDSTOPS, endstops.z2_endstop_adj, dummyf));  // 1 float
884
+    //
885
+    // Extra Endstops offsets
886
+    //
887
+    #if HAS_EXTRA_ENDSTOPS
888
+    {
889
+      _FIELD_TEST(x2_endstop_adj);
884 890
 
885
-        #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3
886
-          EEPROM_WRITE(endstops.z3_endstop_adj);   // 1 float
887
-        #else
888
-          EEPROM_WRITE(dummyf);
889
-        #endif
891
+      // Write dual endstops in X, Y, Z order. Unused = 0.0
892
+      dummyf = 0;
893
+      EEPROM_WRITE(TERN(X_DUAL_ENDSTOPS, endstops.x2_endstop_adj, dummyf));   // 1 float
894
+      EEPROM_WRITE(TERN(Y_DUAL_ENDSTOPS, endstops.y2_endstop_adj, dummyf));   // 1 float
895
+      EEPROM_WRITE(TERN(Z_MULTI_ENDSTOPS, endstops.z2_endstop_adj, dummyf));  // 1 float
890 896
 
891
-        #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4
892
-          EEPROM_WRITE(endstops.z4_endstop_adj);   // 1 float
893
-        #else
894
-          EEPROM_WRITE(dummyf);
895
-        #endif
897
+      #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3
898
+        EEPROM_WRITE(endstops.z3_endstop_adj);   // 1 float
899
+      #else
900
+        EEPROM_WRITE(dummyf);
901
+      #endif
896 902
 
903
+      #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4
904
+        EEPROM_WRITE(endstops.z4_endstop_adj);   // 1 float
905
+      #else
906
+        EEPROM_WRITE(dummyf);
897 907
       #endif
898 908
     }
909
+    #endif
899 910
 
900 911
     #if ENABLED(Z_STEPPER_AUTO_ALIGN)
901 912
       EEPROM_WRITE(z_stepper_align.xy);
@@ -1724,42 +1735,46 @@ void MarlinSettings::postprocess() {
1724 1735
       }
1725 1736
 
1726 1737
       //
1727
-      // DELTA Geometry or Dual Endstops offsets
1738
+      // Kinematic Segments-per-second
1728 1739
       //
1740
+      #if IS_KINEMATIC
1729 1741
       {
1742
+        EEPROM_READ(segments_per_second);
1730 1743
         #if ENABLED(DELTA)
1731
-
1732 1744
           _FIELD_TEST(delta_height);
1733
-
1734 1745
           EEPROM_READ(delta_height);              // 1 float
1735 1746
           EEPROM_READ(delta_endstop_adj);         // 3 floats
1736 1747
           EEPROM_READ(delta_radius);              // 1 float
1737 1748
           EEPROM_READ(delta_diagonal_rod);        // 1 float
1738
-          EEPROM_READ(segments_per_second);       // 1 float
1739 1749
           EEPROM_READ(delta_tower_angle_trim);    // 3 floats
1740 1750
           EEPROM_READ(delta_diagonal_rod_trim);   // 3 floats
1751
+        #endif
1752
+      }
1753
+      #endif
1741 1754
 
1742
-        #elif HAS_EXTRA_ENDSTOPS
1743
-
1744
-          _FIELD_TEST(x2_endstop_adj);
1755
+      //
1756
+      // Extra Endstops offsets
1757
+      //
1758
+      #if HAS_EXTRA_ENDSTOPS
1759
+      {
1760
+        _FIELD_TEST(x2_endstop_adj);
1745 1761
 
1746
-          EEPROM_READ(TERN(X_DUAL_ENDSTOPS, endstops.x2_endstop_adj, dummyf));  // 1 float
1747
-          EEPROM_READ(TERN(Y_DUAL_ENDSTOPS, endstops.y2_endstop_adj, dummyf));  // 1 float
1748
-          EEPROM_READ(TERN(Z_MULTI_ENDSTOPS, endstops.z2_endstop_adj, dummyf)); // 1 float
1749
-
1750
-          #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3
1751
-            EEPROM_READ(endstops.z3_endstop_adj); // 1 float
1752
-          #else
1753
-            EEPROM_READ(dummyf);
1754
-          #endif
1755
-          #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4
1756
-            EEPROM_READ(endstops.z4_endstop_adj); // 1 float
1757
-          #else
1758
-            EEPROM_READ(dummyf);
1759
-          #endif
1762
+        EEPROM_READ(TERN(X_DUAL_ENDSTOPS, endstops.x2_endstop_adj, dummyf));  // 1 float
1763
+        EEPROM_READ(TERN(Y_DUAL_ENDSTOPS, endstops.y2_endstop_adj, dummyf));  // 1 float
1764
+        EEPROM_READ(TERN(Z_MULTI_ENDSTOPS, endstops.z2_endstop_adj, dummyf)); // 1 float
1760 1765
 
1766
+        #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3
1767
+          EEPROM_READ(endstops.z3_endstop_adj); // 1 float
1768
+        #else
1769
+          EEPROM_READ(dummyf);
1770
+        #endif
1771
+        #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4
1772
+          EEPROM_READ(endstops.z4_endstop_adj); // 1 float
1773
+        #else
1774
+          EEPROM_READ(dummyf);
1761 1775
         #endif
1762 1776
       }
1777
+      #endif
1763 1778
 
1764 1779
       #if ENABLED(Z_STEPPER_AUTO_ALIGN)
1765 1780
         EEPROM_READ(z_stepper_align.xy);
@@ -2721,20 +2736,30 @@ void MarlinSettings::reset() {
2721 2736
   //#endif
2722 2737
 
2723 2738
   //
2724
-  // Endstop Adjustments
2739
+  // Kinematic settings
2725 2740
   //
2726 2741
 
2727
-  #if ENABLED(DELTA)
2728
-    const abc_float_t adj = DELTA_ENDSTOP_ADJ, dta = DELTA_TOWER_ANGLE_TRIM, ddr = DELTA_DIAGONAL_ROD_TRIM_TOWER;
2729
-    delta_height = DELTA_HEIGHT;
2730
-    delta_endstop_adj = adj;
2731
-    delta_radius = DELTA_RADIUS;
2732
-    delta_diagonal_rod = DELTA_DIAGONAL_ROD;
2733
-    segments_per_second = DELTA_SEGMENTS_PER_SECOND;
2734
-    delta_tower_angle_trim = dta;
2735
-    delta_diagonal_rod_trim = ddr;
2742
+  #if IS_KINEMATIC
2743
+    segments_per_second = (
2744
+      TERN_(DELTA, DELTA_SEGMENTS_PER_SECOND)
2745
+      TERN_(IS_SCARA, SCARA_SEGMENTS_PER_SECOND)
2746
+      TERN_(POLARGRAPH, POLAR_SEGMENTS_PER_SECOND)
2747
+    );
2748
+    #if ENABLED(DELTA)
2749
+      const abc_float_t adj = DELTA_ENDSTOP_ADJ, dta = DELTA_TOWER_ANGLE_TRIM, ddr = DELTA_DIAGONAL_ROD_TRIM_TOWER;
2750
+      delta_height = DELTA_HEIGHT;
2751
+      delta_endstop_adj = adj;
2752
+      delta_radius = DELTA_RADIUS;
2753
+      delta_diagonal_rod = DELTA_DIAGONAL_ROD;
2754
+      delta_tower_angle_trim = dta;
2755
+      delta_diagonal_rod_trim = ddr;
2756
+    #endif
2736 2757
   #endif
2737 2758
 
2759
+  //
2760
+  // Endstop Adjustments
2761
+  //
2762
+
2738 2763
   #if ENABLED(X_DUAL_ENDSTOPS)
2739 2764
     #ifndef X2_ENDSTOP_ADJUSTMENT
2740 2765
       #define X2_ENDSTOP_ADJUSTMENT 0
@@ -3137,7 +3162,7 @@ void MarlinSettings::reset() {
3137 3162
     TERN_(EDITABLE_SERVO_ANGLES, gcode.M281_report(forReplay));
3138 3163
 
3139 3164
     //
3140
-    // Delta / SCARA Kinematics
3165
+    // Kinematic Settings
3141 3166
     //
3142 3167
     TERN_(IS_KINEMATIC, gcode.M665_report(forReplay));
3143 3168
 

+ 21
- 6
Marlin/src/pins/ramps/pins_RUMBA.h Ver fichero

@@ -47,12 +47,27 @@
47 47
 //
48 48
 // Limit Switches
49 49
 //
50
-#define X_MIN_PIN                             37
51
-#define X_MAX_PIN                             36
52
-#define Y_MIN_PIN                             35
53
-#define Y_MAX_PIN                             34
54
-#define Z_MIN_PIN                             33
55
-#define Z_MAX_PIN                             32
50
+#ifndef X_MIN_PIN
51
+  #define X_MIN_PIN                           37
52
+#endif
53
+#ifndef X_MIN_PIN
54
+  #define X_MIN_PIN                           37
55
+#endif
56
+#ifndef X_MAX_PIN
57
+  #define X_MAX_PIN                           36
58
+#endif
59
+#ifndef Y_MIN_PIN
60
+  #define Y_MIN_PIN                           35
61
+#endif
62
+#ifndef Y_MAX_PIN
63
+  #define Y_MAX_PIN                           34
64
+#endif
65
+#ifndef Z_MIN_PIN
66
+  #define Z_MIN_PIN                           33
67
+#endif
68
+#ifndef Z_MAX_PIN
69
+  #define Z_MAX_PIN                           32
70
+#endif
56 71
 
57 72
 //
58 73
 // Z Probe (when not Z_MIN_PIN)

+ 1
- 0
buildroot/tests/mega1280 Ver fichero

@@ -46,6 +46,7 @@ exec_test $1 $2 "RAMPS | DELTA | RRD LCD | DELTA_AUTO_CALIBRATION | DELTA_CALIBR
46 46
 
47 47
 #
48 48
 # Delta Config (generic) + ABL bilinear + BLTOUCH
49
+#
49 50
 use_example_configs delta/generic
50 51
 opt_set LCD_LANGUAGE cz \
51 52
         Z_MIN_PROBE_ENDSTOP_INVERTING false \

+ 8
- 2
buildroot/tests/mega2560 Ver fichero

@@ -182,7 +182,7 @@ opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_C
182 182
 opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT \
183 183
            LASER_FEATURE AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN LASER_COOLANT_FLOW_METER MEATPACK_ON_SERIAL_PORT_1
184 184
 
185
-exec_test $1 $2 "REPRAP MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Flowmeter | 12864 LCD | meatpack | SERIAL_PORT_2 " "$3"
185
+exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Flowmeter | 12864 LCD | meatpack | SERIAL_PORT_2 " "$3"
186 186
 
187 187
 #
188 188
 # Test Laser features with 44780 LCD
@@ -197,7 +197,7 @@ opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_C
197 197
 opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT \
198 198
            LASER_FEATURE AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN LASER_COOLANT_FLOW_METER I2C_AMMETER
199 199
 
200
-exec_test $1 $2 "REPRAP MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Flowmeter | 44780 LCD " "$3"
200
+exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Flowmeter | 44780 LCD " "$3"
201 201
 
202 202
 #
203 203
 # Test redundant temperature sensors + MAX TC
@@ -211,6 +211,12 @@ opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 1 \
211 211
 exec_test $1 $2 "MEGA2560 RAMPS | Redundant temperature sensor | 2x MAX6675" "$3"
212 212
 
213 213
 #
214
+# Polargraph Config
215
+#
216
+use_example_configs Polargraph
217
+exec_test $1 $2 "RUMBA | POLARGRAPH | RRD LCD" "$3"
218
+
219
+#
214 220
 # Language files test with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
215 221
 #
216 222
 #restore_configs

+ 1
- 0
ini/features.ini Ver fichero

@@ -219,6 +219,7 @@ NEED_LSF                               = src_filter=+<src/libs/least_squares_fit
219 219
 NOZZLE_PARK_FEATURE                    = src_filter=+<src/libs/nozzle.cpp> +<src/gcode/feature/pause/G27.cpp>
220 220
 NOZZLE_CLEAN_FEATURE                   = src_filter=+<src/libs/nozzle.cpp> +<src/gcode/feature/clean>
221 221
 DELTA                                  = src_filter=+<src/module/delta.cpp> +<src/gcode/calibrate/M666.cpp>
222
+POLARGRAPH                             = src_filter=+<src/module/polargraph.cpp>
222 223
 BEZIER_CURVE_SUPPORT                   = src_filter=+<src/module/planner_bezier.cpp> +<src/gcode/motion/G5.cpp>
223 224
 PRINTCOUNTER                           = src_filter=+<src/module/printcounter.cpp>
224 225
 HAS_BED_PROBE                          = src_filter=+<src/module/probe.cpp> +<src/gcode/probe/G30.cpp> +<src/gcode/probe/M401_M402.cpp> +<src/gcode/probe/M851.cpp>

+ 3
- 1
platformio.ini Ver fichero

@@ -158,6 +158,7 @@ default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
158 158
   -<src/gcode/calibrate/M48.cpp>
159 159
   -<src/gcode/calibrate/M100.cpp>
160 160
   -<src/gcode/calibrate/M425.cpp>
161
+  -<src/gcode/calibrate/M665.cpp>
161 162
   -<src/gcode/calibrate/M666.cpp>
162 163
   -<src/gcode/calibrate/M852.cpp>
163 164
   -<src/gcode/control/M10-M11.cpp>
@@ -239,9 +240,10 @@ default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
239 240
   -<src/libs/nozzle.cpp> -<src/gcode/feature/clean>
240 241
   -<src/module/delta.cpp>
241 242
   -<src/module/planner_bezier.cpp>
243
+  -<src/module/polargraph.cpp>
242 244
   -<src/module/printcounter.cpp>
243 245
   -<src/module/probe.cpp>
244
-  -<src/module/scara.cpp> -<src/gcode/calibrate/M665.cpp>
246
+  -<src/module/scara.cpp>
245 247
   -<src/module/servo.cpp> -<src/gcode/control/M280.cpp> -<src/gcode/config/M281.cpp> -<src/gcode/control/M282.cpp>
246 248
   -<src/module/stepper/TMC26X.cpp>
247 249
 

Loading…
Cancelar
Guardar