|
|
@ -24,7 +24,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "motion.h"
|
|
|
|
#include "motion.h"
|
|
|
|
#include "planner.h"
|
|
|
|
#include "planner.h"
|
|
|
|
#include "stepper.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "../Marlin.h"
|
|
|
|
#include "../Marlin.h"
|
|
|
|
|
|
|
|
|
|
|
@ -71,7 +70,7 @@
|
|
|
|
void move_extruder_servo(const uint8_t e) {
|
|
|
|
void move_extruder_servo(const uint8_t e) {
|
|
|
|
constexpr int16_t angles[] = SWITCHING_EXTRUDER_SERVO_ANGLES;
|
|
|
|
constexpr int16_t angles[] = SWITCHING_EXTRUDER_SERVO_ANGLES;
|
|
|
|
static_assert(COUNT(angles) == REQ_ANGLES, "SWITCHING_EXTRUDER_SERVO_ANGLES needs " STRINGIFY(REQ_ANGLES) " angles.");
|
|
|
|
static_assert(COUNT(angles) == REQ_ANGLES, "SWITCHING_EXTRUDER_SERVO_ANGLES needs " STRINGIFY(REQ_ANGLES) " angles.");
|
|
|
|
stepper.synchronize();
|
|
|
|
planner.synchronize();
|
|
|
|
#if EXTRUDERS & 1
|
|
|
|
#if EXTRUDERS & 1
|
|
|
|
if (e < EXTRUDERS - 1)
|
|
|
|
if (e < EXTRUDERS - 1)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -87,7 +86,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
void move_nozzle_servo(const uint8_t e) {
|
|
|
|
void move_nozzle_servo(const uint8_t e) {
|
|
|
|
const int16_t angles[2] = SWITCHING_NOZZLE_SERVO_ANGLES;
|
|
|
|
const int16_t angles[2] = SWITCHING_NOZZLE_SERVO_ANGLES;
|
|
|
|
stepper.synchronize();
|
|
|
|
planner.synchronize();
|
|
|
|
MOVE_SERVO(SWITCHING_NOZZLE_SERVO_NR, angles[e]);
|
|
|
|
MOVE_SERVO(SWITCHING_NOZZLE_SERVO_NR, angles[e]);
|
|
|
|
safe_delay(500);
|
|
|
|
safe_delay(500);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -144,7 +143,7 @@
|
|
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("Moving to Raised Z-Position", current_position);
|
|
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("Moving to Raised Z-Position", current_position);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
|
|
|
|
planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
|
|
|
|
stepper.synchronize();
|
|
|
|
planner.synchronize();
|
|
|
|
|
|
|
|
|
|
|
|
// STEP 2
|
|
|
|
// STEP 2
|
|
|
|
current_position[X_AXIS] = parkingposx[active_extruder] + hotend_offset[X_AXIS][active_extruder];
|
|
|
|
current_position[X_AXIS] = parkingposx[active_extruder] + hotend_offset[X_AXIS][active_extruder];
|
|
|
@ -153,7 +152,7 @@
|
|
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("Moving ParkPos", current_position);
|
|
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("Moving ParkPos", current_position);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder);
|
|
|
|
planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder);
|
|
|
|
stepper.synchronize();
|
|
|
|
planner.synchronize();
|
|
|
|
|
|
|
|
|
|
|
|
// STEP 3
|
|
|
|
// STEP 3
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
@ -171,7 +170,7 @@
|
|
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("Moving away from parked extruder", current_position);
|
|
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("Moving away from parked extruder", current_position);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder);
|
|
|
|
planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder);
|
|
|
|
stepper.synchronize();
|
|
|
|
planner.synchronize();
|
|
|
|
|
|
|
|
|
|
|
|
// STEP 5
|
|
|
|
// STEP 5
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
@ -192,7 +191,7 @@
|
|
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("Move UnparkPos", current_position);
|
|
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("Move UnparkPos", current_position);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS]/2, active_extruder);
|
|
|
|
planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS]/2, active_extruder);
|
|
|
|
stepper.synchronize();
|
|
|
|
planner.synchronize();
|
|
|
|
|
|
|
|
|
|
|
|
// Step 7
|
|
|
|
// Step 7
|
|
|
|
current_position[X_AXIS] = midpos - hotend_offset[X_AXIS][tmp_extruder];
|
|
|
|
current_position[X_AXIS] = midpos - hotend_offset[X_AXIS][tmp_extruder];
|
|
|
@ -201,7 +200,7 @@
|
|
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("Move midway to new extruder", current_position);
|
|
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("Move midway to new extruder", current_position);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder);
|
|
|
|
planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder);
|
|
|
|
stepper.synchronize();
|
|
|
|
planner.synchronize();
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
SERIAL_ECHOLNPGM("Autopark done.");
|
|
|
|
SERIAL_ECHOLNPGM("Autopark done.");
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -283,7 +282,7 @@ inline void invalid_extruder_error(const uint8_t e) {
|
|
|
|
planner.max_feedrate_mm_s[i == 1 ? X_AXIS : Z_AXIS],
|
|
|
|
planner.max_feedrate_mm_s[i == 1 ? X_AXIS : Z_AXIS],
|
|
|
|
active_extruder
|
|
|
|
active_extruder
|
|
|
|
);
|
|
|
|
);
|
|
|
|
stepper.synchronize();
|
|
|
|
planner.synchronize();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Apply Y & Z extruder offset (X offset is used as home pos with Dual X)
|
|
|
|
// Apply Y & Z extruder offset (X offset is used as home pos with Dual X)
|
|
|
@ -466,7 +465,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
} // (tmp_extruder != active_extruder)
|
|
|
|
} // (tmp_extruder != active_extruder)
|
|
|
|
|
|
|
|
|
|
|
|
stepper.synchronize();
|
|
|
|
planner.synchronize();
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(EXT_SOLENOID) && !ENABLED(PARKING_EXTRUDER)
|
|
|
|
#if ENABLED(EXT_SOLENOID) && !ENABLED(PARKING_EXTRUDER)
|
|
|
|
disable_all_solenoids();
|
|
|
|
disable_all_solenoids();
|
|
|
@ -493,7 +492,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|
|
|
#endif // HOTENDS <= 1
|
|
|
|
#endif // HOTENDS <= 1
|
|
|
|
|
|
|
|
|
|
|
|
#if DO_SWITCH_EXTRUDER
|
|
|
|
#if DO_SWITCH_EXTRUDER
|
|
|
|
stepper.synchronize();
|
|
|
|
planner.synchronize();
|
|
|
|
move_extruder_servo(active_extruder);
|
|
|
|
move_extruder_servo(active_extruder);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|