Skip to content

avoid some MK2_MULTIPLEXER pitfalls #8544

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1492,4 +1492,38 @@
// tweaks made to the configuration are affecting the printer in real-time.
#endif


// some MK2_MUXER requirements
#if ENABLED(MK2_MULTIPLEXER)

#undef DISABLE_INACTIVE_EXTRUDER
#define DISABLE_INACTIVE_EXTRUDER false // Keep only the active extruder enabled. MK2_MULTIPLEXER won't work otherwise.

// all extruders use E0 stepper
#undef E1_STEP_PIN
#undef E1_DIR_PIN
#undef E1_ENABLE_PIN

#undef E2_STEP_PIN
#undef E2_DIR_PIN
#undef E2_ENABLE_PIN

#undef E3_STEP_PIN
#undef E3_DIR_PIN
#undef E3_ENABLE_PIN

#define E1_STEP_PIN E0_STEP_PIN
#define E1_DIR_PIN E0_DIR_PIN
#define E1_ENABLE_PIN E0_ENABLE_PIN

#define E2_STEP_PIN E0_STEP_PIN
#define E2_DIR_PIN E0_DIR_PIN
#define E2_ENABLE_PIN E0_ENABLE_PIN

#define E3_STEP_PIN E0_STEP_PIN
#define E3_DIR_PIN E0_DIR_PIN
#define E3_ENABLE_PIN E0_ENABLE_PIN

#endif
Copy link
Member

@thinkyhead thinkyhead Nov 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a workaround for a bug elsewhere. When MK2_MULTIPLEXER is set, all E movement should be tailored for that system. This is handled by the stepper_indirection.h code, so let's see if it matches up…

/**
 * Extruder indirection for the single E axis
 */
#if ENABLED(SWITCHING_EXTRUDER)
  . . .
#elif EXTRUDERS > 4
  . . .
#elif EXTRUDERS > 3
  . . .
#elif EXTRUDERS > 2
  . . .
#elif EXTRUDERS > 1
  #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
    . . .
  #else
    . . .
  #endif
#elif ENABLED(MIXING_EXTRUDER)
  . . .
#else
  #define E_STEP_WRITE(v) E0_STEP_WRITE(v)
  #if ENABLED(MK2_MULTIPLEXER)
    // Even-numbered steppers are reversed
    #define NORM_E_DIR() E0_DIR_WRITE(TEST(current_block->active_extruder, 0) ? !INVERT_E0_DIR: INVERT_E0_DIR)
    #define REV_E_DIR() E0_DIR_WRITE(TEST(current_block->active_extruder, 0) ? INVERT_E0_DIR: !INVERT_E0_DIR)
  #else
    #define NORM_E_DIR() E0_DIR_WRITE(!INVERT_E0_DIR)
    #define REV_E_DIR() E0_DIR_WRITE(INVERT_E0_DIR)
  #endif
#endif

The bug seems to be that if the value for EXTRUDERS isn't "1" the MK2_MULTIPLEXER code will never be applied. So that should be fixed! The correct code should be…

/**
 * Extruder indirection for the single E axis
 */
#if ENABLED(SWITCHING_EXTRUDER)
  . . .
#elif ENABLED(MK2_MULTIPLEXER)   // Even-numbered steppers are reversed
  #define E_STEP_WRITE(v) E0_STEP_WRITE(v)
  #define NORM_E_DIR() E0_DIR_WRITE(TEST(current_block->active_extruder, 0) ? !INVERT_E0_DIR: INVERT_E0_DIR)
  #define REV_E_DIR() E0_DIR_WRITE(TEST(current_block->active_extruder, 0) ? INVERT_E0_DIR: !INVERT_E0_DIR)
#elif EXTRUDERS > 4
  . . .
#elif EXTRUDERS > 3
  . . .
#elif EXTRUDERS > 2
  . . .
#elif EXTRUDERS > 1
  #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
    . . .
  #else
    . . .
  #endif
#elif ENABLED(MIXING_EXTRUDER)
  . . .
#else
  #define E_STEP_WRITE(v) E0_STEP_WRITE(v)
  #define NORM_E_DIR() E0_DIR_WRITE(!INVERT_E0_DIR)
  #define REV_E_DIR() E0_DIR_WRITE(INVERT_E0_DIR)
#endif


#endif // CONFIGURATION_ADV_H
11 changes: 7 additions & 4 deletions Marlin/src/pins/pins_RAMPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,13 @@
#define E0_ENABLE_PIN 24
#define E0_CS_PIN 42

#define E1_STEP_PIN 36
#define E1_DIR_PIN 34
#define E1_ENABLE_PIN 30
#define E1_CS_PIN 44
#if DISABLED(MK2_MULTIPLEXER)
// MK2_MUXER does not use E1 stepper
#define E1_STEP_PIN 36
#define E1_DIR_PIN 34
#define E1_ENABLE_PIN 30
#define E1_CS_PIN 44
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this with above fix.


//
// Temperature Sensors
Expand Down