Tempature code sent then drops out with control preheat

First of all, that looks like completely expected behaviour and I'm going to tell you why:

Based on the log, that is because you set the bed heat using M190, which is a blocking heatup, meaning the printer won't return control to the host until the heatup is completed:

2018-05-30 12:34:09,217 - Changing monitoring state from "Operational" to "Printing"
2018-05-30 12:34:09,233 - Send: N0 M110 N0*125
2018-05-30 12:34:09,239 - Recv: ok
2018-05-30 12:34:09,241 - Send: N1 M190 S50*92
2018-05-30 12:34:09,248 - Recv:  T:80.51 /0.00 B:23.50 /50.00 @:0 B@:0 W:?
2018-05-30 12:34:10,249 - Recv:  T:80.27 /0.00 B:23.50 /50.00 @:0 B@:0 W:?
2018-05-30 12:34:10,793 - Recv:  T:80.26 /0.00 B:23.50 /50.00 @:0 B@:0
2018-05-30 12:34:11,248 - Recv:  T:80.13 /0.00 B:23.50 /50.00 @:0 B@:0 W:?
[...]
2018-05-30 12:34:25,248 - Recv:  T:77.33 /0.00 B:26.28 /50.00 @:0 B@:127 W:?
2018-05-30 12:34:26,147 - Changing monitoring state from "Printing" to "Cancelling"
2018-05-30 12:34:26,248 - Recv:  T:77.18 /0.00 B:26.50 /50.00 @:0 B@:127 W:?
[...]
2018-05-30 12:34:55,248 - Recv:  T:72.11 /0.00 B:34.83 /50.00 @:0 B@:127 W:?
2018-05-30 12:34:56,248 - Recv:  T:71.97 /0.00 B:34.91 /50.00 @:0 B@:127 W:?
2018-05-30 12:34:56,792 - Recv:  T:71.94 /0.00 B:35.17 /50.00 @:0 B@:127
2018-05-30 12:34:57,247 - Recv:  T:71.83 /0.00 B:35.17 /50.00 @:0 B@:127 W:?

Note how your bed had only reached 35Β°C when you aborted.

So OctoPrint will not send any commands following that blocking heatup command until your printer signals that it is done (since doing so could cause issues with the printer ignoring the commands or even locking up). No green light from the printer, no commands sent to the printer.

You then cancelled during the blocking heatup. Same issue. Control is only returned to OctoPrint once the blocking heatup is done, so it can't run the cancel script and hence not finish the cancel routine until your bed is at temperature. See also

To fix this you probably want to adjust your start GCODE in your slicer. Instead of setting and awaiting the bed temperature with M190 and then the hotend temperature with M109 like this:

M190 S60
M109 S210

set the bed temperature with M140, then set and wait for the hotend with M109, then finally wait for the bed with M190 like this:

M140 S60
M109 S210
M190 S60

That way both heaters can heat up simultanously and you reduce the wait times significantly (and hence also the "can't cancel because waiting" time frame).

As a side note, when your printer is in some blocking routine and you are in a hurry, simple disconnecting and reconnecting will usually suffice (since a serial connect causes most printer controllers to reset, effectively cancelling any blocking commands), you don't need to restart the OctoPrint server.

1 Like

I use Cura and have looked at my start Gcode and none of that code it there. Where else may I find it sending this code? I also took a look in Octoprint Gcode scripts and there is nothing in there for before the job begins

Unless one of your installed plugins is adding it (unlikely) it must be in either Cura's or OctoPrint's defined start GCODE. Check the GCODE file. If it's not in there, it's coming from OctoPrint (scripts or some plugin). If it is in there it's coming from your slicer.

One thing I thought of is that if I send that gcode to the printer just after startup both the hotend and bed will start to heat at the same time. If I resend that same gcode after then I get the result shown.

Ok, was just looking at a piece of Gcode and see what you are saying there. Talked to a friend who also uses Cura and he says it just can't be changed.

It is a defined start code with Cura...bummer! The world around to this is to set tempature in the tempature GUI prior to starting the print. I forget sometimes and get the problem we have been talking about. So, how do I mark this as solved?

Look at "Preferences" -> "Configure" -> "Printers" -> "Machine Settings". Here's mine for my CR-10S

Maybe not changed easily, but Cura's Extensions -> Post Processing -> Modify G-Code -> Add a script -> Search and Replace menu area allows you to post-process what's been sliced.

I really have no idea if this would work since I haven't tested it and the Internet doesn't have any great examples for Cura's regex yet.

Search:                  M190 S([0-9]*)\nM109 S([0-9]*)\n
Replace:                 M140 S$1\nM109 S$2\nM190 S$1\n
Use Regular Expressions: [x]

The machine settings that @Norman mentioned should work, plus this:

1 Like

Nope, no M190 there. That's the first place I looked. Seems to be a part of Marlin sourcecode

when looking at the code in comparison to my start code in cura it runs the following lines:This is a typical gcode header:
;FLAVOR:Marlin
;TIME:8225
;Filament used: 8.51902m
;Layer height: 0.2
;Generated with Cura_SteamEngine 3.3.1
M190 S50
M104 S200
M109 S200
M82 ;absolute extrusion mode
the remainder below is my machine start G-code has. so the M190 is run before that.
G21 ;metric values
G90 ;absolute positioning
M82 ;set extruder to absolute mode
M107 ;start with the fan off
G28 X0 Y0 ;move X/Y to min endstops
G28 Z0 ;move Z to min endstops
G1 Z25.0 F9000 ;move the platform down 15mm
G92 E0 ;zero the extruded length
G1 F200 E20 ;extrude 20mm of feed stock
G92 E0 ;zero the extruded length again
G1 F9000
M117 Printing...PI3_calibration_cylinder.gcode (955.3 KB)

I do see what you are saying now. Went to that posting. Added the lines to my startup G-code. I will see what happens when I get home and will update you all

Thanks Gina that works perfect.