mushoo
Posts: 20
Joined: Thu Jul 24, 2014 5:34 pm

[DONE] Run custom G-code Script BEFORE temperature settings?

I just put a capacitive bed leveling/tramming/whatever sensor on my printer, and sometimes I like to run it in a very detailed grid mode (7-8 'points' which means a lot of sensor positions). I'd like to be able to run the bed leveling G28 + G29 code, and then once that's complete, begin heating up the extruders - so that I don't have hot filament sitting in or oozing from the extruders during that whole process.

Is this possible without hand-modifying the GCode files? If not, I'd love to see an extra Scripts slot, for 'Init' or some such, which occurs before temperature settings are initialized.
JoeJ
Posts: 1435
Joined: Sun Feb 16, 2014 10:52 am

Re: Run custom G-code Script BEFORE temperature settings?

By default the software will automatically include all of the necessary temperate commands at the beginning of your gcode file (before the starting script). However, if you want these commands to take place AFTER something in your starting script, you just need to move the temperature commands into the appropriate location in the starting script. The software detects that the temperature commands are already present in your starting script, so it won't automatically include them at the beginning because that would be redundant.

For example, if your starting script was only "G28" then the gcode file might looks like this.

M104 S220 T0
M140 S80 T0
G28
...start of print

But if you edit your starting script to look like this:
G28
M104 S[extruder0_temperature] T0
M140 S[bed0_temperature] T0

now it will place those commands right where you want them (note: the [extruder0_temperature] and [bed0_temperature] placeholder variables will be replaced by the first layer temperature of your extruder and bed, assuming they are both referenced by tool 0, which most are)

You can read more about the various scripting options here: http://forum.simplify3d.com/viewtopic.php?f=8&t=1959

Return to “Feature Requests”