Jump to content
Ultimaker Community of 3D Printing Experts

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
    • 26 Visiting our virtual showroom

      1. 1. Have you visited our virtual showroom before?

        • Yes
        • No
      2. 2. If yes - what content did you find most interesting?

        • Information about Ultimaker ecosystem
        • Applications & application stories
        • Customer success stories
        • Webinar sessions
        • Material wall & ecosystem partners
        • New product introduction; software subscription plans
      3. 3. What of the below would make you consider visiting (again)?

        • New Live Ultimaker Webinar streams
        • ‘Ask Me Anything’ with industry experts or Ultimaker staff via main stage and public chat
        • New customer success stories
        • New applications
        • Presentations/news from ecosystem partners
        • Opportunity to meet representatives for an interactive tour
        • Helpful videos like Software tutorials
        • Other; leave input in a comment below!

    • Our picks

      • Ultimaker turns 10: A look back
        Ultimaker is turning 10 years old and that means it is story telling time! We'll explore 2010-2014, traveling through the evolution of the business from the Protobox and Ultimaker Original, to the major leaps forward with the Ultimaker 2 and Ultimaker 3.
          • Like
        • 0 replies
      • Ultimaker Transformation Summit
        Visit our virtual showroom and learn more about the Ultimaker ecosystem!
        • 14 replies
      • New here? Register your Ultimaker for free 3D printer onboarding course
        Often getting started is the most difficult part of any process. A good start sets you up for success and saves you time and energy that could be spent elsewhere. That is why we have a onboarding course ready for
        Ultimaker S5 Pro Bundle, Ultimaker S5, Ultimaker S3 Ultimaker 2+ Connect.   
        They're ready for you on the Ultimaker Academy platform. All you need to do to gain access is to register your product to gain free access. 
        Ready? Register your product here in just 60 seconds.
          • Like
        • 0 replies
    • Create New...