|
@ -122,7 +122,6 @@ |
|
|
grabpos = parkingposx[tmp_extruder] + hotend_offset[X_AXIS][active_extruder] |
|
|
grabpos = parkingposx[tmp_extruder] + hotend_offset[X_AXIS][active_extruder] |
|
|
+ (tmp_extruder == 0 ? -(PARKING_EXTRUDER_GRAB_DISTANCE) : PARKING_EXTRUDER_GRAB_DISTANCE); |
|
|
+ (tmp_extruder == 0 ? -(PARKING_EXTRUDER_GRAB_DISTANCE) : PARKING_EXTRUDER_GRAB_DISTANCE); |
|
|
/**
|
|
|
/**
|
|
|
* Steps: |
|
|
|
|
|
* 1. Raise Z-Axis to give enough clearance |
|
|
* 1. Raise Z-Axis to give enough clearance |
|
|
* 2. Move to park position of old extruder |
|
|
* 2. Move to park position of old extruder |
|
|
* 3. Disengage magnetic field, wait for delay |
|
|
* 3. Disengage magnetic field, wait for delay |
|
@ -134,13 +133,11 @@ |
|
|
|
|
|
|
|
|
// STEP 1
|
|
|
// STEP 1
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
SERIAL_ECHOLNPGM("Starting Autopark"); |
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("Start Autopark", current_position); |
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("current position:", current_position); |
|
|
|
|
|
#endif |
|
|
#endif |
|
|
current_position[Z_AXIS] += PARKING_EXTRUDER_SECURITY_RAISE; |
|
|
current_position[Z_AXIS] += PARKING_EXTRUDER_SECURITY_RAISE; |
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
SERIAL_ECHOLNPGM("(1) Raise Z-Axis "); |
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("(1) Raise Z-Axis", 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); |
|
|
planner.synchronize(); |
|
|
planner.synchronize(); |
|
@ -148,33 +145,35 @@ |
|
|
// 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]; |
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
SERIAL_ECHOLNPAIR("(2) Park extruder ", active_extruder); |
|
|
if (DEBUGGING(LEVELING)) { |
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("Moving ParkPos", current_position); |
|
|
SERIAL_ECHOLNPAIR("(2) Park extruder ", int(active_extruder)); |
|
|
|
|
|
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); |
|
|
planner.synchronize(); |
|
|
planner.synchronize(); |
|
|
|
|
|
|
|
|
// STEP 3
|
|
|
// STEP 3
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
SERIAL_ECHOLNPGM("(3) Disengage magnet "); |
|
|
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("(3) Disengage magnet "); |
|
|
#endif |
|
|
#endif |
|
|
pe_deactivate_magnet(active_extruder); |
|
|
pe_deactivate_magnet(active_extruder); |
|
|
|
|
|
|
|
|
// STEP 4
|
|
|
// STEP 4
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
SERIAL_ECHOLNPGM("(4) Move to position near new extruder"); |
|
|
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("(4) Move to position near new extruder"); |
|
|
#endif |
|
|
#endif |
|
|
current_position[X_AXIS] += (active_extruder == 0 ? 10 : -10); // move 10mm away from parked extruder
|
|
|
current_position[X_AXIS] += (active_extruder == 0 ? 10 : -10); // move 10mm away from parked extruder
|
|
|
|
|
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("Moving away from parked extruder", current_position); |
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("Move 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); |
|
|
planner.synchronize(); |
|
|
planner.synchronize(); |
|
|
|
|
|
|
|
|
// STEP 5
|
|
|
// STEP 5
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
SERIAL_ECHOLNPGM("(5) Engage magnetic field"); |
|
|
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("(5) Engage magnetic field"); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) |
|
|
#if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) |
|
@ -187,8 +186,7 @@ |
|
|
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); |
|
|
current_position[X_AXIS] = grabpos; |
|
|
current_position[X_AXIS] = grabpos; |
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
SERIAL_ECHOLNPAIR("(6) Unpark extruder ", tmp_extruder); |
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("(6) Unpark extruder", 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); |
|
|
planner.synchronize(); |
|
|
planner.synchronize(); |
|
@ -196,8 +194,7 @@ |
|
|
// 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]; |
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
SERIAL_ECHOLNPGM("(7) Move midway between hotends"); |
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("(7) Move midway between hotends", 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); |
|
|
planner.synchronize(); |
|
|
planner.synchronize(); |
|
|