Fix VerifyFilamentEnteredPTFE

Test should push filament first and then retract.
This commit is contained in:
Guðni Már Gilbert 2022-11-19 16:58:52 +00:00 committed by DRracer
parent aaebaf163f
commit ef51b5778d
2 changed files with 11 additions and 10 deletions

View File

@ -44,6 +44,9 @@ static constexpr float MMU2_LOAD_TO_NOZZLE_LENGTH = 87.0F + 5.0F;
// The printer intercepts such a call and sets its extra load distance to match the new value as well. // The printer intercepts such a call and sets its extra load distance to match the new value as well.
static constexpr uint8_t MMU2_TOOL_CHANGE_LOAD_LENGTH = 5; // mm static constexpr uint8_t MMU2_TOOL_CHANGE_LOAD_LENGTH = 5; // mm
static constexpr uint8_t MMU2_EXTRUDER_PTFE_LENGTH = 42.3f; // mm
static constexpr uint8_t MMU2_EXTRUDER_HEATBREAK_LENGTH = 17.7f; // mm
static constexpr float MMU2_LOAD_TO_NOZZLE_FEED_RATE = 20.0F; // mm/s static constexpr float MMU2_LOAD_TO_NOZZLE_FEED_RATE = 20.0F; // mm/s
static constexpr float MMU2_UNLOAD_TO_FINDA_FEED_RATE = 120.0F; // mm/s static constexpr float MMU2_UNLOAD_TO_FINDA_FEED_RATE = 120.0F; // mm/s
@ -313,15 +316,14 @@ bool MMU2::VerifyFilamentEnteredPTFE()
if (!fsensor.getFilamentPresent()) return false; if (!fsensor.getFilamentPresent()) return false;
uint8_t fsensorState = 0; uint8_t fsensorState = 0;
// MMU has finished its load, move filament back by ExtraLoadDistance // MMU has finished its load, push the filament further by some defined constant length
// If Fsensor reads 0 at any moment, then report FAILURE // If the filament sensor reads 0 at any moment, then report FAILURE
current_position[E_AXIS] -= logic.ExtraLoadDistance(); current_position[E_AXIS] += MMU2_EXTRUDER_PTFE_LENGTH + MMU2_EXTRUDER_HEATBREAK_LENGTH;
plan_buffer_line_curposXYZE(MMU2_LOAD_TO_NOZZLE_FEED_RATE); plan_buffer_line_curposXYZE(MMU2_LOAD_TO_NOZZLE_FEED_RATE);
while(blocks_queued()) while(blocks_queued())
{ {
// Wait for move to finish and monitor the fsensor the entire time // Wait for move to finish and monitor the fsensor the entire time
// a single 0 (1) reading is enough to fail the test
fsensorState |= !fsensor.getFilamentPresent(); fsensorState |= !fsensor.getFilamentPresent();
} }
@ -332,7 +334,7 @@ bool MMU2::VerifyFilamentEnteredPTFE()
} else { } else {
// else, happy printing! :) // else, happy printing! :)
// Revert the movements // Revert the movements
current_position[E_AXIS] += logic.ExtraLoadDistance(); current_position[E_AXIS] -= MMU2_EXTRUDER_PTFE_LENGTH + MMU2_EXTRUDER_HEATBREAK_LENGTH;
plan_buffer_line_curposXYZE(MMU2_LOAD_TO_NOZZLE_FEED_RATE); plan_buffer_line_curposXYZE(MMU2_LOAD_TO_NOZZLE_FEED_RATE);
st_synchronize(); st_synchronize();
return true; return true;

View File

@ -280,11 +280,10 @@ private:
/// @returns false if the MMU is not ready to perform the command (for whatever reason) /// @returns false if the MMU is not ready to perform the command (for whatever reason)
bool WaitForMMUReady(); bool WaitForMMUReady();
/// Redundancy test. After MMU completes a tool-change command /// After MMU completes a tool-change command
/// the printer will retract the filament by a distance set by the /// the printer will push the filament by a constant distance. If the Fsensor untriggers
// Extra Loading Distance MMU register. If the Fsensor untriggers /// at any moment the test fails. Else the test passes, and the E-motor retracts the
/// at any moment the test fails. Else test passes, and the E-motor retraction /// filament back to its original position.
/// is reverted.
/// @returns false if test fails, true otherwise /// @returns false if test fails, true otherwise
bool VerifyFilamentEnteredPTFE(); bool VerifyFilamentEnteredPTFE();