CuraEngine icon indicating copy to clipboard operation
CuraEngine copied to clipboard

Initial extruder other than T0 causes an unnecessary switch

Open stuartpb opened this issue 6 years ago • 12 comments

If I set up a print that only uses extruder T1 and never uses my T0 extruder at all, the T1 switch at the beginning of the procedure is preceded with a massive G1 F1200 E-16 retraction on the initial T0, which makes a very unpleasant noise from the stepper motor, as that filament is not able to move with a cooled-off hotend:

;FLAVOR:RepRap
;TIME:1074
;Filament used: 0m
;Layer height: 0.15
;Generated with Cura_SteamEngine 3.1.0
M190 S60
M104 T1 S200
M109 S0
M109 T1 S200
M82 ; absolute extrusion mode
; BEGIN START G-CODE
G90 ;  set positioning to absolute
G28 X Y Z ; home XYZ at default_value home feedrates
T0 ; home on the right extruder
G92 X0 Y0 Z0 A0 B0 ; define zeroes
M132 X Y Z  ; Recall stored home offsets
; END START G-CODE
M83 ; relative extrusion mode
;LAYER_COUNT:50
;LAYER:0
G1 F1200 E-16 ; <=================== !!!
T1
M109 S200
M107
G0 F1200 X6.54 Y4.837 Z0.3
;TYPE:SKIRT
G1 F600 X6.488 Y4.979 E0.00754
G1 X4.989 Y8.802 E0.20487
G1 X4.949 Y8.899 E0.00523
G1 X3.643 Y11.964 E0.16622
; ...etc...

Essentially, this code needs to recognize that the first extruder isn't one you need to "switch" to.

stuartpb avatar Jan 01 '18 22:01 stuartpb

Indeed, now that I think about it, it seems like this assumption that the active extruder will be 0 will be even more of a problem in 3.2, as #640 sets the G-code to start with a T command switching to the real initial extruder.

stuartpb avatar Jan 02 '18 00:01 stuartpb

The other way to fix this (short of initializing current_extruder to the start_extruder_nr in the GCodeExport constructor, which looks like it'd require significant refactoring?) would be to initialize current_extruder to -1, then add an else if (current_extruder < 0) {startExtruder(new_extruder); return;} here to initialize on the first call to switchExtruder.

stuartpb avatar Jan 02 '18 00:01 stuartpb

@stuartpb Thanks for reporting and analysis. Devs, see: CURA-4751

jackha avatar Jan 02 '18 10:01 jackha

This E-16 comes from putting the nozzle into parking position, because Cura assumes that T0 is active, heated up and the filament is in position for printing after the start g-code is completed.

There is an assumption there that T0 is active, which has been brought up before: https://github.com/Ultimaker/Cura/issues/1819 and several other times that I remember. But barring that, I think assuming that the active extruder is heated up and brought in position to print is fair. Instead we'd rather need a way for the printer to say which toolchain is active at the beginning of a print, either via the printer definition file or an active (wifi/USB) connection. But this is much more complex.

Or did I understand your problem wrongly?

Ghostkeeper avatar Jan 17 '18 15:01 Ghostkeeper

Yeah, no, I'm just describing that the problem is the slicer assuming the initial extruder of the routine is T0, which isn't necessarily the case (as mentioned here).

stuartpb avatar Jan 17 '18 18:01 stuartpb

It would be great if this retraction could be turned off completly since it can be a problem for some printers

s00500 avatar May 27 '18 18:05 s00500

Our manager removed this from the planning. It won't be fixed soon.

diegopradogesto avatar May 29 '18 10:05 diegopradogesto

This causes me a problem because I load one extruder with one material, and one with another... and the models I choose to print are using one extruder or the other - not both (I have no need/interest in dual extruding single prints). So when I start a print using only extruder 2, it goes through its start Gcode, then unexpectedly snorts back a whole length of filament and starts printing!

The resulting code:

   ;Put printing message on LCD screen
   M117 Printing...
   G92 E0
   G1 F1800 E-4
   ;LAYER_COUNT:140
   ;LAYER:0
   G1 F1200 E-16
   G92 E0
   T1
   G92 E0
   M107
   G0 F3600 X119.408 Y64.625 Z0.3
   ...

See how my start Gcode ends (after "Printing..."), then it goes on and makes an E-4 call, then an E-16? I'd been trying to debug why the printer primes itself (with my start Gcode), but then retracts and prints an empty brim for almost a whole minute. :(

No way to avoid this?

FalconFour avatar Mar 06 '19 06:03 FalconFour

The Search-and-Replace post-processing script always works for that sort of thing.

I'm not able to reproduce that though. Here's the start of the g-code I get when slicing with a Custom FDM Printer using only the second extruder:

;FLAVOR:Marlin
;TIME:625
;Filament used: 0m, 0.111376m
;Layer height: 0.1
;Generated with Cura_SteamEngine master
T1
M104 S200
M105
M109 S200
M82 ;absolute extrusion mode
G28 ;Home
G1 Z15.0 F6000 ;Move the platform down 15mm
;Prime the extruder
G92 E0
G1 F200 E3
G92 E0
G92 E0
G1 F1500 E-6.5
;LAYER_COUNT:99
;LAYER:0
M107
G0 F3600 X39.623 Y39.349 Z0.3
;TYPE:SKIRT
G1 F1500 E0
G1 F1800 X40.222 Y38.834 E0.01486
G1 X40.87 Y38.383 E0.02971
G1 X41.561 Y37.999 E0.04458
...

It immediately switches to T1. Nothing done on T0. It resets the E a few times too many but that should not make a difference to the printer. Here's a project file: CFFFP_cube.zip

Maybe you could share a project file? It looks like something in your configuration is still doing something with the first extruder.

Ghostkeeper avatar Mar 06 '19 08:03 Ghostkeeper

Hello everyone. Could anyone find the answer to this question?

DIMI-PIMI69 avatar Oct 29 '20 20:10 DIMI-PIMI69

The last comment here requests a project file that reproduces the issue, DIMI-PIMI69. Can you provide such a project file?

Ghostkeeper avatar Nov 02 '20 12:11 Ghostkeeper

I have noticed this, not sure what is causing this issue.. thanks

tommylux avatar Jan 03 '21 19:01 tommylux