PFW-1439 Compensate load to nozzle extruder sequence for Extra Loading Distance

The Extra Loading Distance is configurable by the user.
We need to compensate the hardcoded sequence
such that it does not extrude too much or
too little. Currently the firmware
extrudes too little.
This commit is contained in:
Guðni Már Gilbert 2022-11-27 11:36:56 +00:00
parent 97ddcc66bb
commit 6ee5f08505
4 changed files with 16 additions and 10 deletions

View File

@ -23,8 +23,6 @@ static_assert(EXTRUDERS==1);
namespace MMU2 {
void execute_extruder_sequence(const E_Step *sequence, int steps);
template<typename F>
void waitForHotendTargetTemp(uint16_t delay, F f){
while (((degTargetHotend(active_extruder) - degHotend(active_extruder)) > 5)) {
@ -357,7 +355,7 @@ bool MMU2::tool_change(char code, uint8_t slot) {
case 'c': {
waitForHotendTargetTemp(100, []{});
execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, sizeof(load_to_nozzle_sequence) / sizeof (load_to_nozzle_sequence[0]));
execute_load_to_nozzle_sequence((const E_Step *)load_to_nozzle_sequence, sizeof(load_to_nozzle_sequence) / sizeof (load_to_nozzle_sequence[0]));
} break;
}
@ -508,7 +506,7 @@ bool MMU2::load_filament_to_nozzle(uint8_t slot) {
ToolChangeCommon(slot);
// Finish loading to the nozzle with finely tuned steps.
execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, sizeof(load_to_nozzle_sequence) / sizeof (load_to_nozzle_sequence[0]));
execute_load_to_nozzle_sequence((const E_Step *)load_to_nozzle_sequence, sizeof(load_to_nozzle_sequence) / sizeof (load_to_nozzle_sequence[0]));
Sound_MakeSound(e_SOUND_TYPE_StandardConfirm);
}
lcd_update_enable(true);
@ -839,6 +837,13 @@ void MMU2::execute_extruder_sequence(const E_Step *sequence, uint8_t steps) {
}
}
void MMU2::execute_load_to_nozzle_sequence(const E_Step *sequence, uint8_t steps) {
st_synchronize();
// Compensate for configurable Extra Loading Distance
current_position[E_AXIS] -= logic.ExtraLoadDistance();
execute_extruder_sequence(sequence, steps);
}
void MMU2::ReportError(ErrorCode ec, ErrorSource res) {
// Due to a potential lossy error reporting layers linked to this hook
// we'd better report everything to make sure especially the error states

View File

@ -239,6 +239,7 @@ private:
void filament_ramming();
void execute_extruder_sequence(const E_Step *sequence, uint8_t steps);
void execute_load_to_nozzle_sequence(const E_Step *sequence, uint8_t steps);
/// Reports an error into attached ExtUIs
/// @param ec error code, see ErrorCode

View File

@ -64,7 +64,7 @@ static constexpr E_Step ramming_sequence[] PROGMEM = {
{ -35.0F, 2000.0F / 60.F},
};
static constexpr E_Step load_to_nozzle_sequence[] PROGMEM = {
{ 10.0F, 810.0F / 60.F}, // feed rate = 13.5mm/s - Load fast until filament reach end of nozzle
{ 25.0F, 198.0F / 60.F}, // feed rate = 3.3mm/s - Load slower once filament is out of the nozzle
static constexpr E_Step load_to_nozzle_sequence[] PROGMEM = {
{ MMU2_EXTRUDER_PTFE_LENGTH, 810.0F / 60.F}, // feed rate = 13.5mm/s - Load fast while not at heatbreak
{ MMU2_EXTRUDER_HEATBREAK_LENGTH, 198.0F / 60.F}, // feed rate = 3.3mm/s - Load slower once filament reaches heatbreak
};

View File

@ -64,7 +64,7 @@ static constexpr E_Step ramming_sequence[] PROGMEM = {
{ -35.0F, 2000.0F / 60.F},
};
static constexpr E_Step load_to_nozzle_sequence[] PROGMEM = {
{ 10.0F, 810.0F / 60.F}, // feed rate = 13.5mm/s - Load fast until filament reach end of nozzle
{ 25.0F, 198.0F / 60.F}, // feed rate = 3.3mm/s - Load slower once filament is out of the nozzle
static constexpr E_Step load_to_nozzle_sequence[] PROGMEM = {
{ MMU2_EXTRUDER_PTFE_LENGTH, 810.0F / 60.F}, // feed rate = 13.5mm/s - Load fast while not at heatbreak
{ MMU2_EXTRUDER_HEATBREAK_LENGTH, 198.0F / 60.F}, // feed rate = 3.3mm/s - Load slower once filament reaches heatbreak
};