Browse Source

Add HAS_JUNCTION_DEVIATION

Scott Lahteine 4 years ago
parent
commit
55d66fb897

+ 1
- 1
Marlin/Configuration.h View File

@@ -800,7 +800,7 @@
800 800
  *   https://reprap.org/forum/read.php?1,739819
801 801
  *   http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html
802 802
  */
803
-#if DISABLED(CLASSIC_JERK)
803
+#if HAS_JUNCTION_DEVIATION
804 804
   #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge
805 805
 #endif
806 806
 

+ 2
- 2
Marlin/src/gcode/config/M200-M205.cpp View File

@@ -121,7 +121,7 @@ void GcodeSuite::M204() {
121 121
  *    J = Junction Deviation (mm) (If not using CLASSIC_JERK)
122 122
  */
123 123
 void GcodeSuite::M205() {
124
-  #if DISABLED(CLASSIC_JERK)
124
+  #if HAS_JUNCTION_DEVIATION
125 125
     #define J_PARAM  "J"
126 126
   #else
127 127
     #define J_PARAM
@@ -137,7 +137,7 @@ void GcodeSuite::M205() {
137 137
   if (parser.seen('B')) planner.settings.min_segment_time_us = parser.value_ulong();
138 138
   if (parser.seen('S')) planner.settings.min_feedrate_mm_s = parser.value_linear_units();
139 139
   if (parser.seen('T')) planner.settings.min_travel_feedrate_mm_s = parser.value_linear_units();
140
-  #if DISABLED(CLASSIC_JERK)
140
+  #if HAS_JUNCTION_DEVIATION
141 141
     if (parser.seen('J')) {
142 142
       const float junc_dev = parser.value_linear_units();
143 143
       if (WITHIN(junc_dev, 0.01f, 0.3f)) {

+ 4
- 0
Marlin/src/inc/Conditionals_LCD.h View File

@@ -680,6 +680,10 @@
680 680
   #define HAS_CLASSIC_JERK 1
681 681
 #endif
682 682
 
683
+#if DISABLED(CLASSIC_JERK)
684
+  #define HAS_JUNCTION_DEVIATION 1
685
+#endif
686
+
683 687
 // E jerk exists with JD disabled (of course) but also when Linear Advance is disabled on Delta/SCARA
684 688
 #if ENABLED(CLASSIC_JERK) || (IS_KINEMATIC && DISABLED(LIN_ADVANCE))
685 689
   #define HAS_CLASSIC_E_JERK 1

+ 1
- 1
Marlin/src/inc/Conditionals_post.h View File

@@ -31,7 +31,7 @@
31 31
 #endif
32 32
 
33 33
 // Linear advance uses Jerk since E is an isolated axis
34
-#if DISABLED(CLASSIC_JERK) && ENABLED(LIN_ADVANCE)
34
+#if HAS_JUNCTION_DEVIATION && ENABLED(LIN_ADVANCE)
35 35
   #define HAS_LINEAR_E_JERK 1
36 36
 #endif
37 37
 

+ 2
- 2
Marlin/src/inc/SanityCheck.h View File

@@ -355,7 +355,7 @@
355 355
   #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values. Please update your Configuration.h."
356 356
 #elif defined(BEZIER_JERK_CONTROL)
357 357
   #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION. Please update your configuration."
358
-#elif DISABLED(CLASSIC_JERK) && defined(JUNCTION_DEVIATION_FACTOR)
358
+#elif HAS_JUNCTION_DEVIATION && defined(JUNCTION_DEVIATION_FACTOR)
359 359
   #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM. Please update your configuration."
360 360
 #elif defined(JUNCTION_ACCELERATION_FACTOR)
361 361
   #error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h."
@@ -1137,7 +1137,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1137 1137
 /**
1138 1138
  * Junction deviation is incompatible with kinematic systems.
1139 1139
  */
1140
-#if DISABLED(CLASSIC_JERK) && IS_KINEMATIC
1140
+#if HAS_JUNCTION_DEVIATION && IS_KINEMATIC
1141 1141
   #error "CLASSIC_JERK is required for DELTA and SCARA."
1142 1142
 #endif
1143 1143
 

+ 2
- 2
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp View File

@@ -133,7 +133,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
133 133
       .tag(5) .button( VELOCITY_POS,           GET_TEXT_F(MSG_VELOCITY))
134 134
       .tag(6) .button( ACCELERATION_POS,       GET_TEXT_F(MSG_ACCELERATION))
135 135
       .tag(7) .button( JERK_POS,               GET_TEXT_F(
136
-        #if DISABLED(CLASSIC_JERK)
136
+        #if HAS_JUNCTION_DEVIATION
137 137
           MSG_JUNCTION_DEVIATION
138 138
         #else
139 139
           MSG_JERK
@@ -163,7 +163,7 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
163 163
     case 5:  GOTO_SCREEN(MaxVelocityScreen);          break;
164 164
     case 6:  GOTO_SCREEN(DefaultAccelerationScreen);  break;
165 165
     case 7:
166
-      #if DISABLED(CLASSIC_JERK)
166
+      #if HAS_JUNCTION_DEVIATION
167 167
         GOTO_SCREEN(JunctionDeviationScreen);
168 168
       #else
169 169
         GOTO_SCREEN(JerkScreen);

+ 2
- 2
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp View File

@@ -68,7 +68,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
68 68
       .tag(7) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM))
69 69
       .tag(8) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY))
70 70
       .tag(9) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION))
71
-      #if DISABLED(CLASSIC_JERK)
71
+      #if HAS_JUNCTION_DEVIATION
72 72
         .tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION))
73 73
       #else
74 74
         .tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK))
@@ -113,7 +113,7 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
113 113
     case 8: GOTO_SCREEN(MaxVelocityScreen);                break;
114 114
     case 9: GOTO_SCREEN(DefaultAccelerationScreen);        break;
115 115
     case 10:
116
-      #if DISABLED(CLASSIC_JERK)
116
+      #if HAS_JUNCTION_DEVIATION
117 117
         GOTO_SCREEN(JunctionDeviationScreen);
118 118
       #else
119 119
         GOTO_SCREEN(JerkScreen);

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 #include "../config.h"
24 24
 
25
-#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(CLASSIC_JERK)
25
+#if ENABLED(TOUCH_UI_FTDI_EVE) && HAS_JUNCTION_DEVIATION
26 26
 
27 27
 #include "screens.h"
28 28
 

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp View File

@@ -78,7 +78,7 @@ SCREEN_TABLE {
78 78
   DECL_SCREEN(MaxVelocityScreen),
79 79
   DECL_SCREEN(MaxAccelerationScreen),
80 80
   DECL_SCREEN(DefaultAccelerationScreen),
81
-#if DISABLED(CLASSIC_JERK)
81
+#if HAS_JUNCTION_DEVIATION
82 82
   DECL_SCREEN(JunctionDeviationScreen),
83 83
 #else
84 84
   DECL_SCREEN(JerkScreen),

+ 2
- 2
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h View File

@@ -58,7 +58,7 @@ enum {
58 58
 #if HAS_MESH
59 59
   BED_MESH_SCREEN_CACHE,
60 60
 #endif
61
-#if DISABLED(CLASSIC_JERK)
61
+#if HAS_JUNCTION_DEVIATION
62 62
   JUNC_DEV_SCREEN_CACHE,
63 63
 #else
64 64
   JERK_SCREEN_CACHE,
@@ -566,7 +566,7 @@ class DefaultAccelerationScreen : public BaseNumericAdjustmentScreen, public Cac
566 566
     static bool onTouchHeld(uint8_t tag);
567 567
 };
568 568
 
569
-#if DISABLED(CLASSIC_JERK)
569
+#if HAS_JUNCTION_DEVIATION
570 570
   class JunctionDeviationScreen : public BaseNumericAdjustmentScreen, public CachedScreen<JUNC_DEV_SCREEN_CACHE> {
571 571
     public:
572 572
       static void onRedraw(draw_mode_t);

+ 1
- 1
Marlin/src/lcd/extui/ui_api.cpp View File

@@ -631,7 +631,7 @@ namespace ExtUI {
631 631
     }
632 632
   #endif
633 633
 
634
-  #if DISABLED(CLASSIC_JERK)
634
+  #if HAS_JUNCTION_DEVIATION
635 635
 
636 636
     float getJunctionDeviation_mm() {
637 637
       return planner.junction_deviation_mm;

+ 1
- 1
Marlin/src/lcd/extui/ui_api.h View File

@@ -186,7 +186,7 @@ namespace ExtUI {
186 186
     void setLinearAdvance_mm_mm_s(const float, const extruder_t);
187 187
   #endif
188 188
 
189
-  #if DISABLED(CLASSIC_JERK)
189
+  #if HAS_JUNCTION_DEVIATION
190 190
     float getJunctionDeviation_mm();
191 191
     void setJunctionDeviation_mm(const float);
192 192
   #else

+ 1
- 1
Marlin/src/lcd/menu/menu_advanced.cpp View File

@@ -423,7 +423,7 @@ void menu_cancelobject();
423 423
     START_MENU();
424 424
     BACK_ITEM(MSG_ADVANCED_SETTINGS);
425 425
 
426
-    #if DISABLED(CLASSIC_JERK)
426
+    #if HAS_JUNCTION_DEVIATION
427 427
       #if ENABLED(LIN_ADVANCE)
428 428
         EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, 0.3f, planner.recalculate_max_e_jerk);
429 429
       #else

+ 3
- 3
Marlin/src/module/configuration_store.cpp View File

@@ -2393,7 +2393,7 @@ void MarlinSettings::reset() {
2393 2393
     TERN_(HAS_CLASSIC_E_JERK, planner.max_jerk.e = DEFAULT_EJERK;);
2394 2394
   #endif
2395 2395
 
2396
-  #if DISABLED(CLASSIC_JERK)
2396
+  #if HAS_JUNCTION_DEVIATION
2397 2397
     planner.junction_deviation_mm = float(JUNCTION_DEVIATION_MM);
2398 2398
   #endif
2399 2399
 
@@ -2862,7 +2862,7 @@ void MarlinSettings::reset() {
2862 2862
 
2863 2863
     CONFIG_ECHO_HEADING(
2864 2864
       "Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>"
2865
-      #if DISABLED(CLASSIC_JERK)
2865
+      #if HAS_JUNCTION_DEVIATION
2866 2866
         " J<junc_dev>"
2867 2867
       #endif
2868 2868
       #if HAS_CLASSIC_JERK
@@ -2875,7 +2875,7 @@ void MarlinSettings::reset() {
2875 2875
         PSTR("  M205 B"), LINEAR_UNIT(planner.settings.min_segment_time_us)
2876 2876
       , PSTR(" S"), LINEAR_UNIT(planner.settings.min_feedrate_mm_s)
2877 2877
       , SP_T_STR, LINEAR_UNIT(planner.settings.min_travel_feedrate_mm_s)
2878
-      #if DISABLED(CLASSIC_JERK)
2878
+      #if HAS_JUNCTION_DEVIATION
2879 2879
         , PSTR(" J"), LINEAR_UNIT(planner.junction_deviation_mm)
2880 2880
       #endif
2881 2881
       #if HAS_CLASSIC_JERK

+ 7
- 7
Marlin/src/module/planner.cpp View File

@@ -132,7 +132,7 @@ uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N]; // (steps/s^2) Derived
132 132
 
133 133
 float Planner::steps_to_mm[XYZE_N];           // (mm) Millimeters per step
134 134
 
135
-#if DISABLED(CLASSIC_JERK)
135
+#if HAS_JUNCTION_DEVIATION
136 136
   float Planner::junction_deviation_mm;       // (mm) M205 J
137 137
   #if ENABLED(LIN_ADVANCE)
138 138
     #if ENABLED(DISTINCT_E_FACTORS)
@@ -2151,7 +2151,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2151 2151
 
2152 2152
     #if ENABLED(LIN_ADVANCE)
2153 2153
 
2154
-      #if DISABLED(CLASSIC_JERK)
2154
+      #if HAS_JUNCTION_DEVIATION
2155 2155
         #if ENABLED(DISTINCT_E_FACTORS)
2156 2156
           #define MAX_E_JERK max_e_jerk[extruder]
2157 2157
         #else
@@ -2238,7 +2238,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2238 2238
 
2239 2239
   float vmax_junction_sqr; // Initial limit on the segment entry velocity (mm/s)^2
2240 2240
 
2241
-  #if DISABLED(CLASSIC_JERK)
2241
+  #if HAS_JUNCTION_DEVIATION
2242 2242
     /**
2243 2243
      * Compute maximum allowable entry speed at junction by centripetal acceleration approximation.
2244 2244
      * Let a circle be tangent to both previous and current path line segments, where the junction
@@ -2285,7 +2285,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2285 2285
     ;
2286 2286
     unit_vec *= inverse_millimeters;
2287 2287
 
2288
-    #if IS_CORE && DISABLED(CLASSIC_JERK)
2288
+    #if IS_CORE && HAS_JUNCTION_DEVIATION
2289 2289
       /**
2290 2290
        * On CoreXY the length of the vector [A,B] is SQRT(2) times the length of the head movement vector [X,Y].
2291 2291
        * So taking Z and E into account, we cannot scale to a unit vector with "inverse_millimeters".
@@ -2460,7 +2460,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2460 2460
 
2461 2461
     previous_safe_speed = safe_speed;
2462 2462
 
2463
-    #if DISABLED(CLASSIC_JERK)
2463
+    #if HAS_JUNCTION_DEVIATION
2464 2464
       vmax_junction_sqr = _MIN(vmax_junction_sqr, sq(vmax_junction));
2465 2465
     #else
2466 2466
       vmax_junction_sqr = sq(vmax_junction);
@@ -2649,7 +2649,7 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con
2649 2649
 
2650 2650
   #if IS_KINEMATIC
2651 2651
 
2652
-    #if DISABLED(CLASSIC_JERK)
2652
+    #if HAS_JUNCTION_DEVIATION
2653 2653
       const xyze_pos_t cart_dist_mm = {
2654 2654
         rx - position_cart.x, ry - position_cart.y,
2655 2655
         rz - position_cart.z, e  - position_cart.e
@@ -2675,7 +2675,7 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con
2675 2675
       const feedRate_t feedrate = fr_mm_s;
2676 2676
     #endif
2677 2677
     if (buffer_segment(delta.a, delta.b, delta.c, machine.e
2678
-      #if DISABLED(CLASSIC_JERK)
2678
+      #if HAS_JUNCTION_DEVIATION
2679 2679
         , cart_dist_mm
2680 2680
       #endif
2681 2681
       , feedrate, extruder, mm

+ 3
- 3
Marlin/src/module/planner.h View File

@@ -61,7 +61,7 @@
61 61
                             manual_feedrate_mm_s { _mf.x / 60.0f, _mf.y / 60.0f, _mf.z / 60.0f, _mf.e / 60.0f };
62 62
 #endif
63 63
 
64
-#if IS_KINEMATIC && DISABLED(CLASSIC_JERK)
64
+#if IS_KINEMATIC && HAS_JUNCTION_DEVIATION
65 65
   #define HAS_DIST_MM_ARG 1
66 66
 #endif
67 67
 
@@ -304,7 +304,7 @@ class Planner {
304 304
     static uint32_t max_acceleration_steps_per_s2[XYZE_N]; // (steps/s^2) Derived from mm_per_s2
305 305
     static float steps_to_mm[XYZE_N];           // Millimeters per step
306 306
 
307
-    #if DISABLED(CLASSIC_JERK)
307
+    #if HAS_JUNCTION_DEVIATION
308 308
       static float junction_deviation_mm;       // (mm) M205 J
309 309
       #if ENABLED(LIN_ADVANCE)
310 310
         static float max_e_jerk                 // Calculated from junction_deviation_mm
@@ -900,7 +900,7 @@ class Planner {
900 900
 
901 901
     static void recalculate();
902 902
 
903
-    #if DISABLED(CLASSIC_JERK)
903
+    #if HAS_JUNCTION_DEVIATION
904 904
 
905 905
       FORCE_INLINE static void normalize_junction_vector(xyze_float_t &vector) {
906 906
         float magnitude_sq = 0;

Loading…
Cancel
Save