Welcome! Log In Create A New Profile


Gcode hook just before starting to print.

Posted by glennpierce 
Gcode hook just before starting to print.
March 03, 2019 11:31AM
I have the G12 (nozzle cleaning) enabled in Marlin. Is there a way that I can call this command in Slicer3r just before the print begins.
Ie after the nozzle has heated ?

Putting in under Printer settings -> Custom gcode > start gcode is before heating takes place.

Re: Gcode hook just before starting to print.
March 14, 2019 01:35PM
If there are any heating commands in the custom start gcode Slic3r won't put them in by itself. So you can do something like

M109 S[first_layer_temperature_0] ; heat up nozzle
G12 ; clean nozzle

in your startup code so you can get the behavior you want. I use this on my printer so the bed heats up before I home (I use an inductive sensor in the middle of the bed so I want the bed to do any warping before probing). The relevant section of my start gcode looks like this:

M190 S[first_layer_bed_temperature]
G4 S30 ; Wait for bed temperature to stabilize
G28 ; home all axes
M420 L0 ; Load UBL matrix
M420 S1 ; Activate UBL
M420 Z10.0 ; 10mm fade height

G0 F6000 X40 Y-5 Z0.5 ; Somewhere ooze isn't a problem
M109 S[first_layer_temperature]
M150 R255 B255 U255 W255 ; Let there be light!
; Extrude a bit so we end up knocking it off with the edge of the bed
M83  ;Extruder relative
G0 F200 E7.5 ; Extrude a bit (should end up extruding about 15cm with a 0.4 nozzle)
G0 E-0-.5; retract
Sorry, only registered users may post in this forum.

Click here to login