Jump to content

Adding code to print cycle


Recommended Posts

Posted · Adding code to print cycle

Sorry I did not see a search to look to see if this has been asked before and I am sure it has. When my print is finished the hot end stays on the print and cools so it is stuck to the print. I would like to add a line of code to the sliced file to tell the printer to home all once the print is complete. I would also like to add a swipe before the print starts. Were do I add this in Cura? Thank in advance for all your help.

  • Link to post
    Share on other sites

    Posted · Adding code to print cycle

    I only looked at the end gcode as that's the critical part.  You put the printer into relative mode but I believe that only affects the E axis (extruder).  Instead use G92 which sets the current position.  Like this:

    G92 Z0 E0    <--- without actually moving any axis - now declare the Z and E axes to be at zero.

    G1 E-1 F1000   <-- retract 1mm

    G1 Z5  <-- move nozzle 5mm farther from print - note this may violate software end stops if your print used the full height

    G1 E-10    <-- retract another 9mm

    G1 X0 Y0 F6000  <-- move nozzle to corner at 100mm/sec


    G28   <-- optional - home all axes - don't do this if it means moving the nozzle to touch the build plate


  • Link to post
    Share on other sites

    Posted · Adding code to print cycle

    By the way, some versions of Marlin seem to ignore that last 1000 or so characters in the gcode file.  This is a bug only in certain versions.  One solution is to add a lot of comments at the end


    Also - did you look at the resulting gcode to see if it correctly added your code at the end?


    Next time please just paste in the code - don't attach a pdf containing a photo of a screenshot.

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.4 stable released
        The full stable release of UltiMaker Cura 5.4 is here and it makes it easier than ever to remove brims and supports from your finished prints. UltiMaker S series users can also look forward to print profiles for our newest UltiMaker PET CF composite material!
          • Like
        • 58 replies
    • Create New...