PierreMasselot1 / Material-Switching-Unit

The MSU (Material Switching Unit) is a multi-material upgrade based on the MMU2, with key improvements to improve reliability, price and compatibility.
GNU General Public License v3.0
64 stars 15 forks source link

selecting an already active extruder #19

Closed rozhkovets closed 2 months ago

rozhkovets commented 2 months ago

If you send a command to select an already active extruder, then unloading and loading occurs. This is a useless action. Additional verification needs to be added.

Example: When you turn on the printer for the first time, the active extruder is set to T0. In the slicer, the T0 selection command is automatically added to the beginning of the g-code. At the beginning of printing we get a useless action.

void MSUMP::tool_change(uint8_t index)
{
  if (index != active_extruder) {
  ...
  }
}
rozhkovets commented 1 month ago

I haven't tested it, but it seems to me that the first call to T0 after loading will cause a useless tool change because.

float selected_filament_nbr = -1;
...
void MSUMP::tool_change(uint8_t index) {

 // Check if a toolcahnge is necessary
 if (selected_filament_nbr == index)
rozhkovets commented 1 month ago

I also noticed this. I'll try to describe it step by step. 1)turn on the printer (float selected_filament_nbr = -1;) 2)manually load filament T0 to the nozzle. Ready to print 3)start printing

When the printer first receives the T command I get this:

because selected_filament_nbr = -1 tool change process is started. but when unloading filament

 idler_select_filament_nbr(selected_filament_nbr);
 move_extruder(-MSU_BOWDEN_TUBE_LENGTH * steps_per_mm_correction_factor, MSU_SPEED, MSU_EXTRUDER_NBR);

I get the idler moving to position -1 (parking), because selected_filament_nbr =-1.

then moving the idelr to the required position of the new filament

idler_select_filament_nbr(index);
selected_filament_nbr = index;
move_extruder(MSU_BOWDEN_TUBE_LENGTH * steps_per_mm_correction_factor, MSU_SPEED, MSU_EXTRUDER_NBR);

and I get a collision in merger, because previous filament was not unloaded.

the next tool changes will be without problems