Skip to content

Fix JD / HAS_LINEAR_E_JERK #27717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: bugfix-2.1.x
Choose a base branch
from

Conversation

classicrocker883
Copy link
Contributor

@classicrocker883 classicrocker883 commented Mar 1, 2025

Description

Here is the issue

When DISABLED(CLASSIC_JERK) and if ENABLED(LIN_ADVANCE), naturally you will have HAS_JUNCTION_DEVIATION and HAS_LINEAR_E_JERK, like so:

In Conditionals-4-adv.h

#if ALL(HAS_JUNCTION_DEVIATION, LIN_ADVANCE)
  #define HAS_LINEAR_E_JERK 1
#endif

Except that it doesn't make sense in the following files.

In module/planner.h (and .cpp likewise)

    #if HAS_JUNCTION_DEVIATION
      static float junction_deviation_mm;             // (mm) M205 J
      #if HAS_LINEAR_E_JERK
        static float max_e_jerk[DISTINCT_E];          // Calculated from junction_deviation_mm
      #endif
    #else // CLASSIC_JERK
      // (mm/s^2) M205 XYZ(E) - The largest speed change requiring no acceleration.
      static TERN(HAS_LINEAR_E_JERK, xyz_pos_t, xyze_pos_t) max_jerk;
    #endif

static TERN(HAS_LINEAR_E_JERK, xyz_pos_t, xyze_pos_t) max_jerk; will never use this TERN as intended.


(and similarly where CLASSIC_JERK is enabled, this code will never be utilized)

In module/settings.cpp

        #if ENABLED(CLASSIC_JERK)
          EEPROM_READ(planner.max_jerk);
          #if HAS_LINEAR_E_JERK
            EEPROM_READ(dummyf);
          #endif
        #else
          for (uint8_t q = LOGICAL_AXES; q--;) EEPROM_READ(dummyf);
        #endif

// and also where HAS_LINEAR_E_JERK uses EEPROM_WRITE()

So what this PR aims fix any issues associated with JD enabled.

Apparently this causes "Warning:EEPROM Corrupt" message.

Image

Requirements

  • Disable CLASSIC_JERK
  • Enable LIN_ADVANCE

Benefits

  • Fixes confusing code that seems to go back and forth like it doesn't know where to go
  • Stops any EEPROM warnings

Configurations

Related Issues

@thinkyhead thinkyhead force-pushed the bugfix-2.1.x branch 3 times, most recently from 4354891 to efa1758 Compare March 28, 2025 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant