Odd GCode Start Commands (Cura - RepRap)

Let me preface all of this with I’ve only had my printer for a few weeks, so it could be something simple. I’m using a Monoprice Maker Select v2 (Wanhao Duplicator v2.1).

I just recently got my AstroBox up and running, and just ran my first cloud print. When I pulled up the monitor screen though, I noticed both my heated bed and extruder were heating up at the same time. Normally, not a big issue, but I’ve just switched over to PETG, and having the extruder primed up before the bed tends to kick out filament that just sticks to the extruder, causing artifacts in my prints.

In my local setup, I’ve been using the CURA version that came w/ my Monoprice Maker Select v2 without issue. When comparing the GCODE spit out by both the local and AstroPrint versions, here’s what I’ve found:

Local:
M190 S75.0
M109 S235.0

AstroPrint:
M140 S75.0
M109 S235.0
M190 S75.0

M140 is used to turn off the heated bed after the print, if I’m not mistaken. And, having M109 come before M190 is what’s heating up the extruder before and/or at the same time.

I’ve pulled up the printer settings in AstroPrint, and the Start Commands aren’t showing this oddball M140 command in them. Not sure how to go about fixing it. It very well could be a difference in the CURA versions I’m using, but wanted to check in here to see if anyone has any solutions or has ran into this issue.

Cheers!

I have this issue too with the Astroprint version of Cura…

I use Slic3r when it is a real problem…(actually I used Slic3r exclusively until about a month ago and this was one of the first things I noticed when switching to Cura.) I also added a priming line off to one side of the bed to ‘recharge’ the extruder to my start code but I still have to manually clean the extruder as it heats to prevent it from dropping goo on the bed where ever it starts the heating cycle…My feeling is there should be two sections of start code once that occurs before the heat up and one after…and in general I think th e slicers should heat the bed before heating the extruder (again this is what slic3r does) as the bed heat up takes a while and serves to heat the chamber while head heating is pretty quick…

I would like to be able to move the head to a ‘safe’ place allow the bed to heat then allow the extruder to heat then execute some more setup code to prime or wipe the nozzle then have the sliced code start to run.

M140 is to start the heating process without waiting for it to finish. The AstroPrint sequence does the following

M140 S75.0 --> Start heating the bed to 75 C
M109 S235.0 --> Wait until the extruder reaches 235 C
M190 S75.0 --> Wait until the bed has reached 75 C

This has the effect of starting both heaters at the same time, waiting for the extruder and then also ensuring the bed has reached its temp.

If your printer profile’s start GCODE includes heating commands, the AstroPrint ones will not be added. Simply add your sequence to you printer’s Start GCode. You can find that under Printer Profile -> Advanced Settings.

unfortunately this seems to mean you have to add temperature information which varies with filament and sometimes print to the printer profile where it really doesn’t belong…I guess you could set up some minimum heating here but then would the slicer set the correct temp for the material at some point after the preheat sequence, now in the printer profile, is complete? Daniels explanation would seem to indicate it would not…

I think it would be better to just put the M109 after the M190…M140 I don’t see the point if you do things in the M190,M109 order unless maybe you wanted to put in an M140 S40, M104 S40 to just set a preheat sequence which might speed up the extruder heat a bit as it could preheat while the bed warms up but no so much it would ooze. But in my experience the time it takes for the extruder to heat once the bed reaches temperature is actually good…It helps stabilize the temp across the surface of the bed in case the thermistor is not in an ideal location, and in an enclosed printer heat the ambient air a bit.

Roger that! I may just have two different printer profiles (for now at least), one for PLA and one for PETG. Good news is, when I came home, it seemed as though the print wasn’t too affected by the early extruder heating. It actually collected itself when it zero’d in at home all prior to print. Sadly, I think this is going to be the exception rather than the rule.

In hindsight, I probably should have waited until after the print to see how it turned out, but I just got my camera in today, and I was too excited with remote printing to wait until I got home. I was actually going to try Slic3r tonight to see how it compares to Cura, so that may be an acceptable alternative.

Also got my IKEA Lack tables in, so whenever I get some solid ME time, an enclosure will eventually get built. I’ve heard mixed reviews on how it helps with bed heating, so we’ll see.

Appreciate the input. Loving this community, and you don’t disappoint.

Cheers!

You can use variables in there such as:

M140 S{print_bed_temperature}
M109 S{print_temperature}
M190 S{print_bed_temperature}

I think I tried that previously without success, but will give it another go…
It would be nice if this solved my preheat problem…It would be more elegant than my current fix.

I’ll report back later.

Problem SOLVED:

I know what went wrong on my previous attempts…I didn’t have the ‘print_’ inside the curly brackets.

So now following Daniels recommendation my start code looks like the following:

;
; *** CUSTOM START CODE ***

M106 S0 ;fan off in case somehow it was left on
M140 S40 ;set extruder temp for light pre heat/cool no wait
G28 ;home all axes gets everything in a known position
G1 X-60 Y-120 Z100 F8000.0 ;quick move to heating position
M190 S{print_bed_temperature} ;sets bed temp and waits
M109 S{print_temperature} ;sets extruder temp and waits

G1 X-60 Y-120 Z.4 F8000.0 ;quick move down to priming position
G92 E0.0 ;set extruder to zero
G1 E12.0 F600 ;extrude a blob for inital prime
G1 X60 E20.0 F600.0 ;extrude a line to get nice flow started
G92 E0.0 ;reset extruder to zero
G1 F600 E-0.2 ;slight retract to reduce stringing on inital start
G1 Z10 X0 F8000 ;quick jerk up and back to break any strings

; *** END CUSTOM START CODE ***
;

This seems to do what I want, which generally heats the bed before the head…see inline comments for other functions.

It generated this code in an Astroprint Cura Sliced G-code file:

;Generated with Cura_SteamEngine 15.04.6
;
; *** CUSTOM START CODE ***

M106 S0 ;fan off in case somehow it was left on
M140 S40 ;set extruder temp for light pre heat/cool no wait
G28 ;home all axes gets everything in a known position
G1 X-60 Y-120 Z100 F8000.0 ;quick move to heating position
M190 S65 ;sets bed temp and waits
M109 S205 ;sets extruder temp and waits

G1 X-60 Y-120 Z.4 F8000.0 ;quick move down to priming position
G92 E0.0 ;set extruder to zero
G1 E12.0 F600 ;extrude a blob for inital prime
G1 X60 E20.0 F600.0 ;extrude a line to get nice flow started
G92 E0.0 ;reset extruder to zero
G1 F600 E-0.2 ;slight retract to reduce stringing on inital start
G1 Z10 X0 F8000 ;quick jerk up and back to break any strings

; *** END CUSTOM START CODE ***
;
;Layer count: 49
;LAYER:0
M107
G0 F9000 X6.400 Y8.600 Z0.250
;TYPE:SKIRT

1 Like

Thanks for sharing this. I wasn’t sure about the S{print_bed_temperature} code yet. With that, I shouldn’t need separate profiles anymore, since I don’t have to manually input the temps for each filament type. Love it!

Hi Daniel!

I try to add a printer with Slic3r slice (instead of cura) and {print_temperature} and {print_bed_temperature} didn’t work. I have to add manually temperature and fan doesn’t work.

@Pablo_Covarrubias,

Start GCode variable syntax is slicer dependent. The Slic3r equivalent would be:

M190 S[bed_temperature] ;sets bed temp and waits
M109 S[temperature] ;sets extruder temp and waits
1 Like

Thank You!
I’ll try!