Browse Source

Add HAS_JUNCTION_DEVIATION

vanilla_fb_2.0.x
Scott Lahteine 5 years ago
parent
commit
55d66fb897
  1. 2
      Marlin/Configuration.h
  2. 4
      Marlin/src/gcode/config/M200-M205.cpp
  3. 4
      Marlin/src/inc/Conditionals_LCD.h
  4. 2
      Marlin/src/inc/Conditionals_post.h
  5. 4
      Marlin/src/inc/SanityCheck.h
  6. 4
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp
  7. 4
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp
  8. 2
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp
  9. 2
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp
  10. 4
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h
  11. 2
      Marlin/src/lcd/extui/ui_api.cpp
  12. 2
      Marlin/src/lcd/extui/ui_api.h
  13. 2
      Marlin/src/lcd/menu/menu_advanced.cpp
  14. 6
      Marlin/src/module/configuration_store.cpp
  15. 14
      Marlin/src/module/planner.cpp
  16. 6
      Marlin/src/module/planner.h

2
Marlin/Configuration.h

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

4
Marlin/src/gcode/config/M200-M205.cpp

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

4
Marlin/src/inc/Conditionals_LCD.h

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

2
Marlin/src/inc/Conditionals_post.h

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

4
Marlin/src/inc/SanityCheck.h

@ -355,7 +355,7 @@
#error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values. Please update your Configuration.h." #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values. Please update your Configuration.h."
#elif defined(BEZIER_JERK_CONTROL) #elif defined(BEZIER_JERK_CONTROL)
#error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION. Please update your configuration." #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION. Please update your configuration."
#elif DISABLED(CLASSIC_JERK) && defined(JUNCTION_DEVIATION_FACTOR) #elif HAS_JUNCTION_DEVIATION && defined(JUNCTION_DEVIATION_FACTOR)
#error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM. Please update your configuration." #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM. Please update your configuration."
#elif defined(JUNCTION_ACCELERATION_FACTOR) #elif defined(JUNCTION_ACCELERATION_FACTOR)
#error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h." #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
/** /**
* Junction deviation is incompatible with kinematic systems. * Junction deviation is incompatible with kinematic systems.
*/ */
#if DISABLED(CLASSIC_JERK) && IS_KINEMATIC #if HAS_JUNCTION_DEVIATION && IS_KINEMATIC
#error "CLASSIC_JERK is required for DELTA and SCARA." #error "CLASSIC_JERK is required for DELTA and SCARA."
#endif #endif

4
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp

@ -133,7 +133,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
.tag(5) .button( VELOCITY_POS, GET_TEXT_F(MSG_VELOCITY)) .tag(5) .button( VELOCITY_POS, GET_TEXT_F(MSG_VELOCITY))
.tag(6) .button( ACCELERATION_POS, GET_TEXT_F(MSG_ACCELERATION)) .tag(6) .button( ACCELERATION_POS, GET_TEXT_F(MSG_ACCELERATION))
.tag(7) .button( JERK_POS, GET_TEXT_F( .tag(7) .button( JERK_POS, GET_TEXT_F(
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
MSG_JUNCTION_DEVIATION MSG_JUNCTION_DEVIATION
#else #else
MSG_JERK MSG_JERK
@ -163,7 +163,7 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
case 5: GOTO_SCREEN(MaxVelocityScreen); break; case 5: GOTO_SCREEN(MaxVelocityScreen); break;
case 6: GOTO_SCREEN(DefaultAccelerationScreen); break; case 6: GOTO_SCREEN(DefaultAccelerationScreen); break;
case 7: case 7:
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
GOTO_SCREEN(JunctionDeviationScreen); GOTO_SCREEN(JunctionDeviationScreen);
#else #else
GOTO_SCREEN(JerkScreen); GOTO_SCREEN(JerkScreen);

4
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp

@ -68,7 +68,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
.tag(7) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM)) .tag(7) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM))
.tag(8) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY)) .tag(8) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY))
.tag(9) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION)) .tag(9) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION))
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
.tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION)) .tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION))
#else #else
.tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK)) .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) {
case 8: GOTO_SCREEN(MaxVelocityScreen); break; case 8: GOTO_SCREEN(MaxVelocityScreen); break;
case 9: GOTO_SCREEN(DefaultAccelerationScreen); break; case 9: GOTO_SCREEN(DefaultAccelerationScreen); break;
case 10: case 10:
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
GOTO_SCREEN(JunctionDeviationScreen); GOTO_SCREEN(JunctionDeviationScreen);
#else #else
GOTO_SCREEN(JerkScreen); GOTO_SCREEN(JerkScreen);

2
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp

@ -22,7 +22,7 @@
#include "../config.h" #include "../config.h"
#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(CLASSIC_JERK) #if ENABLED(TOUCH_UI_FTDI_EVE) && HAS_JUNCTION_DEVIATION
#include "screens.h" #include "screens.h"

2
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp

@ -78,7 +78,7 @@ SCREEN_TABLE {
DECL_SCREEN(MaxVelocityScreen), DECL_SCREEN(MaxVelocityScreen),
DECL_SCREEN(MaxAccelerationScreen), DECL_SCREEN(MaxAccelerationScreen),
DECL_SCREEN(DefaultAccelerationScreen), DECL_SCREEN(DefaultAccelerationScreen),
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
DECL_SCREEN(JunctionDeviationScreen), DECL_SCREEN(JunctionDeviationScreen),
#else #else
DECL_SCREEN(JerkScreen), DECL_SCREEN(JerkScreen),

4
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h

@ -58,7 +58,7 @@ enum {
#if HAS_MESH #if HAS_MESH
BED_MESH_SCREEN_CACHE, BED_MESH_SCREEN_CACHE,
#endif #endif
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
JUNC_DEV_SCREEN_CACHE, JUNC_DEV_SCREEN_CACHE,
#else #else
JERK_SCREEN_CACHE, JERK_SCREEN_CACHE,
@ -566,7 +566,7 @@ class DefaultAccelerationScreen : public BaseNumericAdjustmentScreen, public Cac
static bool onTouchHeld(uint8_t tag); static bool onTouchHeld(uint8_t tag);
}; };
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
class JunctionDeviationScreen : public BaseNumericAdjustmentScreen, public CachedScreen<JUNC_DEV_SCREEN_CACHE> { class JunctionDeviationScreen : public BaseNumericAdjustmentScreen, public CachedScreen<JUNC_DEV_SCREEN_CACHE> {
public: public:
static void onRedraw(draw_mode_t); static void onRedraw(draw_mode_t);

2
Marlin/src/lcd/extui/ui_api.cpp

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

2
Marlin/src/lcd/extui/ui_api.h

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

2
Marlin/src/lcd/menu/menu_advanced.cpp

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

6
Marlin/src/module/configuration_store.cpp

@ -2393,7 +2393,7 @@ void MarlinSettings::reset() {
TERN_(HAS_CLASSIC_E_JERK, planner.max_jerk.e = DEFAULT_EJERK;); TERN_(HAS_CLASSIC_E_JERK, planner.max_jerk.e = DEFAULT_EJERK;);
#endif #endif
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
planner.junction_deviation_mm = float(JUNCTION_DEVIATION_MM); planner.junction_deviation_mm = float(JUNCTION_DEVIATION_MM);
#endif #endif
@ -2862,7 +2862,7 @@ void MarlinSettings::reset() {
CONFIG_ECHO_HEADING( CONFIG_ECHO_HEADING(
"Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>" "Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>"
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
" J<junc_dev>" " J<junc_dev>"
#endif #endif
#if HAS_CLASSIC_JERK #if HAS_CLASSIC_JERK
@ -2875,7 +2875,7 @@ void MarlinSettings::reset() {
PSTR(" M205 B"), LINEAR_UNIT(planner.settings.min_segment_time_us) PSTR(" M205 B"), LINEAR_UNIT(planner.settings.min_segment_time_us)
, PSTR(" S"), LINEAR_UNIT(planner.settings.min_feedrate_mm_s) , PSTR(" S"), LINEAR_UNIT(planner.settings.min_feedrate_mm_s)
, SP_T_STR, LINEAR_UNIT(planner.settings.min_travel_feedrate_mm_s) , SP_T_STR, LINEAR_UNIT(planner.settings.min_travel_feedrate_mm_s)
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
, PSTR(" J"), LINEAR_UNIT(planner.junction_deviation_mm) , PSTR(" J"), LINEAR_UNIT(planner.junction_deviation_mm)
#endif #endif
#if HAS_CLASSIC_JERK #if HAS_CLASSIC_JERK

14
Marlin/src/module/planner.cpp

@ -132,7 +132,7 @@ uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N]; // (steps/s^2) Derived
float Planner::steps_to_mm[XYZE_N]; // (mm) Millimeters per step float Planner::steps_to_mm[XYZE_N]; // (mm) Millimeters per step
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
float Planner::junction_deviation_mm; // (mm) M205 J float Planner::junction_deviation_mm; // (mm) M205 J
#if ENABLED(LIN_ADVANCE) #if ENABLED(LIN_ADVANCE)
#if ENABLED(DISTINCT_E_FACTORS) #if ENABLED(DISTINCT_E_FACTORS)
@ -2151,7 +2151,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
#if ENABLED(LIN_ADVANCE) #if ENABLED(LIN_ADVANCE)
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
#if ENABLED(DISTINCT_E_FACTORS) #if ENABLED(DISTINCT_E_FACTORS)
#define MAX_E_JERK max_e_jerk[extruder] #define MAX_E_JERK max_e_jerk[extruder]
#else #else
@ -2238,7 +2238,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
float vmax_junction_sqr; // Initial limit on the segment entry velocity (mm/s)^2 float vmax_junction_sqr; // Initial limit on the segment entry velocity (mm/s)^2
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
/** /**
* Compute maximum allowable entry speed at junction by centripetal acceleration approximation. * Compute maximum allowable entry speed at junction by centripetal acceleration approximation.
* Let a circle be tangent to both previous and current path line segments, where the junction * 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,
; ;
unit_vec *= inverse_millimeters; unit_vec *= inverse_millimeters;
#if IS_CORE && DISABLED(CLASSIC_JERK) #if IS_CORE && HAS_JUNCTION_DEVIATION
/** /**
* On CoreXY the length of the vector [A,B] is SQRT(2) times the length of the head movement vector [X,Y]. * On CoreXY the length of the vector [A,B] is SQRT(2) times the length of the head movement vector [X,Y].
* So taking Z and E into account, we cannot scale to a unit vector with "inverse_millimeters". * 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,
previous_safe_speed = safe_speed; previous_safe_speed = safe_speed;
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
vmax_junction_sqr = _MIN(vmax_junction_sqr, sq(vmax_junction)); vmax_junction_sqr = _MIN(vmax_junction_sqr, sq(vmax_junction));
#else #else
vmax_junction_sqr = sq(vmax_junction); vmax_junction_sqr = sq(vmax_junction);
@ -2649,7 +2649,7 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con
#if IS_KINEMATIC #if IS_KINEMATIC
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
const xyze_pos_t cart_dist_mm = { const xyze_pos_t cart_dist_mm = {
rx - position_cart.x, ry - position_cart.y, rx - position_cart.x, ry - position_cart.y,
rz - position_cart.z, e - position_cart.e 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
const feedRate_t feedrate = fr_mm_s; const feedRate_t feedrate = fr_mm_s;
#endif #endif
if (buffer_segment(delta.a, delta.b, delta.c, machine.e if (buffer_segment(delta.a, delta.b, delta.c, machine.e
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
, cart_dist_mm , cart_dist_mm
#endif #endif
, feedrate, extruder, mm , feedrate, extruder, mm

6
Marlin/src/module/planner.h

@ -61,7 +61,7 @@
manual_feedrate_mm_s { _mf.x / 60.0f, _mf.y / 60.0f, _mf.z / 60.0f, _mf.e / 60.0f }; manual_feedrate_mm_s { _mf.x / 60.0f, _mf.y / 60.0f, _mf.z / 60.0f, _mf.e / 60.0f };
#endif #endif
#if IS_KINEMATIC && DISABLED(CLASSIC_JERK) #if IS_KINEMATIC && HAS_JUNCTION_DEVIATION
#define HAS_DIST_MM_ARG 1 #define HAS_DIST_MM_ARG 1
#endif #endif
@ -304,7 +304,7 @@ class Planner {
static uint32_t max_acceleration_steps_per_s2[XYZE_N]; // (steps/s^2) Derived from mm_per_s2 static uint32_t max_acceleration_steps_per_s2[XYZE_N]; // (steps/s^2) Derived from mm_per_s2
static float steps_to_mm[XYZE_N]; // Millimeters per step static float steps_to_mm[XYZE_N]; // Millimeters per step
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
static float junction_deviation_mm; // (mm) M205 J static float junction_deviation_mm; // (mm) M205 J
#if ENABLED(LIN_ADVANCE) #if ENABLED(LIN_ADVANCE)
static float max_e_jerk // Calculated from junction_deviation_mm static float max_e_jerk // Calculated from junction_deviation_mm
@ -900,7 +900,7 @@ class Planner {
static void recalculate(); static void recalculate();
#if DISABLED(CLASSIC_JERK) #if HAS_JUNCTION_DEVIATION
FORCE_INLINE static void normalize_junction_vector(xyze_float_t &vector) { FORCE_INLINE static void normalize_junction_vector(xyze_float_t &vector) {
float magnitude_sq = 0; float magnitude_sq = 0;

Loading…
Cancel
Save