Jump to content
Ultimaker Community of 3D Printing Experts

Adding code to print cycle


Carlbosson
 Share

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
     Share

    • Our picks

      • New here? Get ahead with a free onboarding course
        Hi,
         
        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
        • 11 replies
    ×
    ×
    • Create New...