Merge pull request #10772 from GMagician/2.0.x-address-#10766
[2.0.x] Fix switching extruder
This commit is contained in:
commit
fe7aea7bf6
@ -146,7 +146,7 @@
|
|||||||
#include "feature/fanmux.h"
|
#include "feature/fanmux.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (ENABLED(SWITCHING_EXTRUDER) && !DONT_SWITCH) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)
|
#if DO_SWITCH_EXTRUDER || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)
|
||||||
#include "module/tool_change.h"
|
#include "module/tool_change.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -864,7 +864,7 @@ void setup() {
|
|||||||
setup_endstop_interrupts();
|
setup_endstop_interrupts();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(SWITCHING_EXTRUDER) && !DONT_SWITCH
|
#if DO_SWITCH_EXTRUDER
|
||||||
move_extruder_servo(0); // Initialize extruder servo
|
move_extruder_servo(0); // Initialize extruder servo
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
* T<tool>
|
* T<tool>
|
||||||
* X<xoffset>
|
* X<xoffset>
|
||||||
* Y<yoffset>
|
* Y<yoffset>
|
||||||
* Z<zoffset> - Available with DUAL_X_CARRIAGE and SWITCHING_NOZZLE
|
* Z<zoffset> - Available with DUAL_X_CARRIAGE, SWITCHING_NOZZLE and PARKING_EXTRUDER
|
||||||
*/
|
*/
|
||||||
void GcodeSuite::M218() {
|
void GcodeSuite::M218() {
|
||||||
if (get_target_extruder_from_command() || target_extruder == 0) return;
|
if (get_target_extruder_from_command() || target_extruder == 0) return;
|
||||||
@ -52,7 +52,7 @@ void GcodeSuite::M218() {
|
|||||||
report = false;
|
report = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)
|
#if HAS_HOTEND_OFFSET_Z
|
||||||
if (parser.seenval('Z')) {
|
if (parser.seenval('Z')) {
|
||||||
hotend_offset[Z_AXIS][target_extruder] = parser.value_linear_units();
|
hotend_offset[Z_AXIS][target_extruder] = parser.value_linear_units();
|
||||||
report = false;
|
report = false;
|
||||||
@ -67,7 +67,7 @@ void GcodeSuite::M218() {
|
|||||||
SERIAL_ECHO(hotend_offset[X_AXIS][e]);
|
SERIAL_ECHO(hotend_offset[X_AXIS][e]);
|
||||||
SERIAL_CHAR(',');
|
SERIAL_CHAR(',');
|
||||||
SERIAL_ECHO(hotend_offset[Y_AXIS][e]);
|
SERIAL_ECHO(hotend_offset[Y_AXIS][e]);
|
||||||
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)
|
#if HAS_HOTEND_OFFSET_Z
|
||||||
SERIAL_CHAR(',');
|
SERIAL_CHAR(',');
|
||||||
SERIAL_ECHO(hotend_offset[Z_AXIS][e]);
|
SERIAL_ECHO(hotend_offset[Z_AXIS][e]);
|
||||||
#endif
|
#endif
|
||||||
|
@ -413,9 +413,6 @@
|
|||||||
#undef HOTEND_OFFSET_Y
|
#undef HOTEND_OFFSET_Y
|
||||||
#else // Two hotends
|
#else // Two hotends
|
||||||
#define HOTENDS EXTRUDERS
|
#define HOTENDS EXTRUDERS
|
||||||
#if ENABLED(SWITCHING_NOZZLE) && !defined(HOTEND_OFFSET_Z)
|
|
||||||
#define HOTEND_OFFSET_Z { 0 }
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++)
|
#define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++)
|
||||||
@ -445,6 +442,8 @@
|
|||||||
#define E_MANUAL EXTRUDERS
|
#define E_MANUAL EXTRUDERS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define DO_SWITCH_EXTRUDER (ENABLED(SWITCHING_EXTRUDER) && (DISABLED(SWITCHING_NOZZLE) || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DISTINCT_E_FACTORS affects how some E factors are accessed
|
* DISTINCT_E_FACTORS affects how some E factors are accessed
|
||||||
*/
|
*/
|
||||||
|
@ -434,6 +434,7 @@
|
|||||||
/**
|
/**
|
||||||
* Default hotend offsets, if not defined
|
* Default hotend offsets, if not defined
|
||||||
*/
|
*/
|
||||||
|
#define HAS_HOTEND_OFFSET_Z (HOTENDS > 1 && (ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)))
|
||||||
#if HOTENDS > 1
|
#if HOTENDS > 1
|
||||||
#ifndef HOTEND_OFFSET_X
|
#ifndef HOTEND_OFFSET_X
|
||||||
#define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
|
#define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
|
||||||
@ -441,7 +442,7 @@
|
|||||||
#ifndef HOTEND_OFFSET_Y
|
#ifndef HOTEND_OFFSET_Y
|
||||||
#define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder
|
#define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HOTEND_OFFSET_Z) && (ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE))
|
#if HAS_HOTEND_OFFSET_Z && !defined(HOTEND_OFFSET_Z)
|
||||||
#define HOTEND_OFFSET_Z { 0 }
|
#define HOTEND_OFFSET_Z { 0 }
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -3270,7 +3270,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
|||||||
else
|
else
|
||||||
MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
|
MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
|
||||||
|
|
||||||
#if ENABLED(SWITCHING_EXTRUDER)
|
#if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE)
|
||||||
|
|
||||||
#if EXTRUDERS == 4
|
#if EXTRUDERS == 4
|
||||||
switch (active_extruder) {
|
switch (active_extruder) {
|
||||||
|
@ -2126,7 +2126,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
|
|||||||
SERIAL_ECHOPAIR_P(port, " M218 T", (int)e);
|
SERIAL_ECHOPAIR_P(port, " M218 T", (int)e);
|
||||||
SERIAL_ECHOPAIR_P(port, " X", LINEAR_UNIT(hotend_offset[X_AXIS][e]));
|
SERIAL_ECHOPAIR_P(port, " X", LINEAR_UNIT(hotend_offset[X_AXIS][e]));
|
||||||
SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(hotend_offset[Y_AXIS][e]));
|
SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(hotend_offset[Y_AXIS][e]));
|
||||||
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) ||ENABLED(PARKING_EXTRUDER)
|
#if HAS_HOTEND_OFFSET_Z
|
||||||
SERIAL_ECHOPAIR_P(port, " Z", LINEAR_UNIT(hotend_offset[Z_AXIS][e]));
|
SERIAL_ECHOPAIR_P(port, " Z", LINEAR_UNIT(hotend_offset[Z_AXIS][e]));
|
||||||
#endif
|
#endif
|
||||||
SERIAL_EOL_P(port);
|
SERIAL_EOL_P(port);
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
#include "../feature/fanmux.h"
|
#include "../feature/fanmux.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(SWITCHING_EXTRUDER)
|
#if DO_SWITCH_EXTRUDER
|
||||||
|
|
||||||
#if EXTRUDERS > 3
|
#if EXTRUDERS > 3
|
||||||
#define REQ_ANGLES 4
|
#define REQ_ANGLES 4
|
||||||
@ -347,8 +347,6 @@ inline void invalid_extruder_error(const uint8_t e) {
|
|||||||
|
|
||||||
#endif // DUAL_X_CARRIAGE
|
#endif // DUAL_X_CARRIAGE
|
||||||
|
|
||||||
#define DO_SWITCH_EXTRUDER (SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a tool-change, which may result in moving the
|
* Perform a tool-change, which may result in moving the
|
||||||
* previous tool out of the way and the new tool into place.
|
* previous tool out of the way and the new tool into place.
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include "../inc/MarlinConfig.h"
|
#include "../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if ENABLED(SWITCHING_EXTRUDER)
|
#if DO_SWITCH_EXTRUDER
|
||||||
void move_extruder_servo(const uint8_t e);
|
void move_extruder_servo(const uint8_t e);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user