looking for good starting gcode



  • I'm working on a start gcode (I use Prusa slicer) that will move the nozzle out to the beginning of the print at +10 Z or so then lowering it. Trying to solve the problem of dragging cross the bed at first layer height to the beginning of the print. What I have (below) doesn't work even though I move the Z up at the end. IDeas?

    Working with this:
    ;prepare positions
    G21 ;metric values
    G90 ;absolute positioning
    M82 ;set extruder to absolute mode
    M107 ;start with the fan off

    M104 S[first_layer_temperature_0]; heat hotend (no wait)

    G28 X0 Y0 ;move X/Y to min endstops

    M190 S[bed_temperature]; heat bed (wait)
    M109 S[first_layer_temperature_0]; heat hotend (wait)

    G92 E0 ;zero the extruded length
    G1 F200 E8 ;extrude 8mm of feed stock
    G92 E0 ;zero the extruded length again

    G28 Z10 ;move Z up

    M420 S1 ; ensures auto leveling is enabled

    M117 Printing...



  • @Co3get said in looking for good starting gcode:

    G28 Z10 ;move Z up

    G28 is homing command, not just moving. So you should use here G1 Z10 (if your nozzle is not at that high or more already). If you want to move Z up 10 from current position, you should also use relative mode first, so commands should be :
    G91
    G1 Z10
    G90


  • Moderator

    @Co3get said in looking for good starting gcode:

    M420 S1 ; ensures auto leveling is enabled

    M420 isn't implemented in RRF. What you want is G29 S1.



  • @Co3get
    If I got you right, you would like to move to the starting point in a diagonal Z path.
    Like in Cura? I would prefere that too.
    That's related to the code Prusaslicer is writing after the start sequence.
    So it's not posible to do it in that way.

    What I have done, is to edit the gcode manually.

    For example:

    G1 Z0.195 F9600.000
    G1 X217.576 Y47.012 F9600.000

    Put the Z and XY part together
    G1 X217.576 Y47.012 Z0.195 F9600.000

    (For clarity I have removed some lines of original code)



  • @DIY-O-Sphere said in looking for good starting gcode:

    @Co3get
    If I got you right, you would like to move to the starting point in a diagonal Z path.
    Like in Cura? I would prefere that too.
    That's related to the code Prusaslicer is writing after the start sequence.
    So it's not posible to do it in that way.

    What I have done, is to edit the gcode manually.

    For example:

    G1 Z0.195 F9600.000
    G1 X217.576 Y47.012 F9600.000

    Put the Z and XY part together
    G1 X217.576 Y47.012 Z0.195 F9600.000

    (For clarity I have removed some lines of original code)

    Yes that is it in a nutshell... might be reason enough to use Cura even though I like PrusaSlicer so much.


  • Moderator

    If you're dragging across the bed to get to the start of the print that may be related to using M420 to enable the mesh compensation. G29 S1 should work and if your mesh is done properly it shouldn't be touching the bed at all.



  • @Phaedrux I'm printing on a textured sheet and its very very close.


  • Moderator

    As a work around if you don't want to switch slicers could be to use baby stepping manually while you are watching the start of the print. Simply up the baby stepping while it's moving to position and then reduce it after it's in position.



  • @Co3get said in looking for good starting gcode:

    G28 Z10 ;move Z up

    That is not doing what you want. Do a G1 Z10 F6000, or similar G1 command. That will fix a lot of things; do that first and adjust from there.


Log in to reply