Jump to content
UltiMaker Community of 3D Printing Experts

Cura Start and End code


Recommended Posts

Posted · Cura Start and End code

Hi everyone,

I am new to 3D printing and would like to change the start and end settings of my prints.

How can I make it so that the extruder positions itself 15mm above the bed in the front right corner, pushes out 20 mm of filament and then starts the print. And once the print is done it moves back to front right corner but moves the extruder to the top height, like 150mm above the bed or something.

This is the Current start and End Code that I have in Marlin.


G21 ;metric values

G90 ;absolute positioning

M82 ;set extruder to absolute mode

M107 ;start with the fan off

G28 X0 Y0 ;move X/Y to min endstops

G28 Z0 ;move Z to min endstops

G1 Z15.0 F9000 ;move the platform down 15mm

G92 E0 ;zero the extruded length

G1 F200 E3 ;extrude 3mm of feed stock

G92 E0 ;zero the extruded length again

G1 F9000

;Put printing message on LCD screen

M117 Printing...


M104 S0 ;extruder heater off

M140 S0 ;heated bed heater off (if you have it)

G91 ;relative positioning

G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure

G1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more

G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way

M84 ;steppers off

G90 ;absolute positioning

Btw, I am using a Maker Select V2. I don't know if that makes a difference.



  • Link to post
    Share on other sites

    Posted · Cura Start and End code

    G0 and G1 are identical commands and tell the printer to "go" or "go to" some location. You can specify all 4 axes or just one axes or anything in between. So

    G0 X50 Y50 Z15

    Moves to that location with the nozzle 15mm above the bed. I don't know how wide your bed is and I don't know where 0,0 is for you. On UM printers 0,0 is front left and they are a little over 215mm wide so:

    G0 X200 Y0 Z15 is safe for a UM printer.

    To extrude it's the part where it does this:

    G92 E0 ;zero the extruded length

    G1 F200 E3 ;extrude 3mm of feed stock

    G92 E0 ;zero the extruded length again

    The G92's are important - that sets current position for an axis (in this case E axis to position zero). Without that you don't know where the E axis will move to - it depends where the E axis left off which might be at the 10 meter point from a previous print.

    The G1 F200 E3 moves 3mm of filament. The F200 is the feedrate which stays in effect for all subsequent G0 or G1 comnmands until F is mentioned again. It's in mm/minute so divide by 60 to get mm/sec. Or take your mm/sec value you want and multiply by 60.

    Does that answer all your questions?

  • 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

      • New here? Get ahead with a free 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
        • 14 replies
    • Create New...