Why not heating up bed and extruder simultaneously?

Hi,

When starting a print, is there any reason why the bed and the extruder are heated up separately? Why can't both the bed and the extruder be heated up together? What's the possible constraint? Or is this just a simple setting that one has to modify?

Best rgds,
--Geert

That is a function of the slicers g-code output, not Octoprint, if you use the preheat buttons on the Temperature control page you can heat both at once, or turn them off at the same time. Click on the downward pointing arrow to the right of the word Target.
I didn’t spot that feature for ages :wink:

1 Like

Well, thanks to you it won't take me ages! :wink: Much appreciated.

I'm using Cura as a slicer and found a way to change the startup code to heat both at the same time. If I'm getting this to work, I'll post my experiences here + changes needed.

I'll keep you all informed.

Best rgds,
--Geert

Bad news, I'm afraid... I can change the startup code of Cura for my printer. However, there's a "prelude" in the generated code, prior to the location where Cura includes the startup code. An example will make it clear:

;FLAVOR:Marlin
;TIME:8540
;Filament used: 14.2125m
;Layer height: 0.3
;Generated with Cura_SteamEngine 3.4.1
M190 S55
M104 S200
M109 S200
M82 ;absolute extrusion mode
;Sliced at: Wed 28-09-2022 19:40:27
;Basic settings: Layer height: 0.3 Walls: 0.8 Fill: {fill_density}
;Print time: 02:22:20
;Filament used: [14.21]m [42.38953562499999]g
;Filament cost: [0]
;M190 S55 ;Uncomment to add your own bed temperature line
...

This is the gcode generated by Cura for a certain 3D model. The start code you can include, begins at the line ";Sliced at...". But as you can see, there are already a few commands given before. And let those commands now be the ones that set the temperature for both the bed and the extruder.

On its own, that's not bad. However:

  • Code M190 means "set target temperature for bed to 110 degrees and do nothing until reached".

  • Code M104 means "set target temperature for hot end to 210 degrees".

  • Code M109 means "set target temperature for hot end to 210 degrees and do nothing until reached"

Few thoughts here:

  • Why is Cura first setting code M104 (heat hot end and do not wait...), immediately followed by sending code M109 (heat hot end + do nothing until reached)?

  • Using code M190 means "heat bed and wait", code M140 means "heat bed" (and don't wait)

  • It doesn't help if I modify the startup code, since first those other commands will be executed (and thus will wait until the individual temperatures are reached before continuing).

The only solution I see so far is to manually edit the generated g-code and change the way the bed and hot end are instructed to be heated.

Unless someone else has another idea?

Best rgds,
--Geert

Since this is much more a Cura question than an OctoPrint question, I'll link to an answer on the Ultimaker forum: Cura generating gcodes before start gcode - Ultimaker Cura - Ultimaker Community of 3D Printing Experts

1 Like

You may try:

and/or:

1 Like

That is fantastic! Just tried and works like a charm.

Code before I modified my startup script:

;FLAVOR:Marlin
;TIME:8540
;Filament used: 14.2125m
;Layer height: 0.3
;Generated with Cura_SteamEngine 3.4.1
M190 S55
M104 S200
M109 S200
M82 ;absolute extrusion mode
;Sliced at: Wed 28-09-2022 19:40:27
;Basic settings: Layer height: 0.3 Walls: 0.8 Fill: {fill_density}
;Print time: 02:22:20
;Filament used: [14.21]m [42.38953562499999]g
;Filament cost: [0]
;M190 S55 ;Uncomment to add your own bed temperature line
;M109 S200 ;Uncomment to add your own temperature line
G21        ;metric values
G90        ;absolute positioning
M82        ;set extruder to absolute mode
...

Code after I modified my startup script:

;FLAVOR:Marlin
;TIME:16762
;Filament used: 26.8607m
;Layer height: 0.3
;Generated with Cura_SteamEngine 3.4.1
M82 ;absolute extrusion mode
;Sliced at: Sun 02-10-2022 14:51:49
;Basic settings: Layer height: 0.3 Walls: 2 Fill: {fill_density}
;Print time: 04:39:23
;Filament used: [26.86]m [80.113319375]g
;Filament cost: [0]
;M190 S55 ;Uncomment to add your own bed temperature line
;M109 S200 ;Uncomment to add your own temperature line
; Added by GVC
M140 S55   ;Start heating bed
M104 S200 ;Start heating extruder
M190 S55   ;Wait for bed to reach temp before proceeding
M109 S200 ;Wait for extruder to reach temp before proceeding
; End added by GVC
G21        ;metric values
G90        ;absolute positioning
M82        ;set extruder to absolute mode
...

As you can see, in the modified code, the initial heating params are gone and "mine" are in (see ; Added... and ; End added...)

Great tip, thanks!

Best rgds,
--Geert

I do the simultaneous heating on my Ender 3.
The reason it wasn't done, is that historically, the printer PSUs were undersized and not capable of delivering the current to do both together.
Nowadays, the PSUs will just current limit if there is too much demand, but the Ender 3 copes nicely with it.

My Gcode out of Cura, comes out with these lines at the start...

; start preheat 1
M140 S60; start preheating the bed
M104 S195.0 T0; start preheating hotend

M190 S60; heat to bed setting in Cura and WAIT
M109 S195.0 T0; heat hotend to setting in Cura and WAIT
; end preheating

Hope this helps

This code gives me a problem.
Heating the bed is slow and the M190 is necessary.
First heating the extruder with M104 followed by the M190 is the problem

For me the M109 following the M104 and the M190 delay is the issue since there is a slight error in the control. The M104 overshoots the setpoint by 1 to 1.5 degrees and since the M109 only releases control at exactly the setpoint it never sees that setpoint and waits forever.

I use settings such as
M104 S195
M190 S50
M109 S200
because of the slight variances.
The M140 followed that quickly by the M190 seems unnecessary (although not really an issue) due to the inherent delay in heating the bed.

Within octoprint I instead use the preheat targets of 185 for the extruder and 50 for the bed then I only have a few seconds delay as the extruder heats from 185 to 200.

It won't wait forever if you have a correctly PID (or otherwise) tuned heater. Stock settings with Marlin require the temperature to be stable for around 8-10 seconds I believe. If your temperature is not stable and is continuously over/undershooting the target and oscillating, then you should perform a PID tune.

Temperature is stable, merely at ~1 degree above the setpoint. It fluctuates +0.5 degrees with less than 1 degree total variance. To me that is not worth the effort of tuning the pid within the firmware because it is simple to manage it the way I do.

PID tuning is always worth the effort.
Also for the bed. If the waveform is not smooth enough, it can ruin your prints due to over exaggerated expansion and shrinkage.

I have not been able to do a pid tune on my bed. Although the temp is stable within + 1 degree, it runs +10 degrees when set at 40 for PLA and +1 degree when set at 100 for ABS..
The controller board is MKS Gen L 2.1 with repetier firmware.

I have tried the method here but the E-1 seems to not apply to the bed heater but to the extruder (E0) so the command given (M303 E-1 S60 C10) does not work on the bed. In fact, if the extruder is above the temp given in that command octoprint disconnects with a high temp error.

What should I use for the bed heater instead of "E-1" ?

Referring to this:

https://reprap.org/wiki/G-code#M303:_Run_PID_tuning

Repetier uses P1 as parameter for bed, so

M303 P1

If this does not work either, it seems, the firmware version you have does not implement it.

1 Like

Thanks for that link. I had not seen that and the P1 did work.
:+1:

1 Like

Not sure if I follow correctly, but I first start heating the bed, only then the extruder. And indeed, then I add the M190 to wait for the bed until it reaches its wanted temperature.

I have even changed my startup sequence a bit. Since the hot end is heating up much faster than the bed, I added a "wait" of 30 seconds before I start heating the hot end. Like this, they are reaching their expected values at almost exact the same time. Before I added the wait, the extruder had long reached its setpoint before the bed did.

This is now my startup code (at least, the heating part of it); mind the G4 parameter with a time delay of 30000 ms:

; Added by GVC
M140 S55   ;Start heating bed
G4 P30000  ;Wait 30 seconds before heating up the hot end (hot end heats up much faster than bed)
M104 S200  ;Start heating extruder
M190 S55   ;Wait for bed to reach temp before proceeding
M109 S200  ;Wait for extruder to reach temp before proceeding
; End added by GVC

The only thing I find strange when looking to the temperature curve in OctoPi, is that OctoPi also has a stand still for 30 seconds before it continues to show the temperature graphs. See image below:

The red arrow points to the starting point. The magenta ellipse is where the strange thing happens: you can see there's no change in graph for the first 30 seconds. After that, the bed temperature "jumps" to a certain temperature which is a proof the bed already started to heat up (only OctoPi didn't follow with its temp graph for the bed). Also at that timepoint is the moment (the moment of the "jump" in the temp graph of the bed temperature) the hot end starts to heat up (which is the purpose, hence the delay of 30 seconds).

And as you can see, both the hot end as well as the bed reach their end temperature at the same time (green ellipse).

This is the most optimal setting for me, no extra time wasted.

Best rgds,
--Geert

Other than the delay in the graph that seems good. I think that the pause command pauses octoprint updates in the graph (or sending & receiving data to/from the printer) but does not interfere with the temp control. When the pause ends everything is updated at once.

Different printers may have different heat-up times so the delay might be different but that seems to work for you. My printer has a glass bed top and needs a couple minutes to heat up plus about 5 minutes heat soak so the glass is evenly heated through before I print, especially when printing ABS.

I would omit the G4 command. It stops everything.

If you want a smooth and efficient heat up, you may use

The energy expended to maintain heat in the bed or the nozzle is negligible compared to the energy expended to heat them so I'm not sure there's much to be gained by adding a delay.

Well, it's not so much about saving energy. It's more about having both items (bed and hot end) at their expected temperature at about the same time...