Jump to content

Placing g-code in Cura


Recommended Posts

Posted · Placing g-code in Cura



I saw a video for a nozzle wipe but was done in simplify3D with the tab scripting. 

Where  can I place the following code ("printer startcode" or "extruder startcode") in Cura 3.3.1?


G1 Y-3.0 F500.0 ; move out of print volume

G1 X60.0 E9 F500.0 ; start purge

G1 X100 E12.5 F500.0 ; finish purge line


When placed in "printer startcode" do I need to remove lines, insert beween 2 lines or can I just place it at the end?


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...


Thanks in advance.



  • Link to post
    Share on other sites

    Posted (edited) · Placing g-code in Cura

    I believe I saw the exact same video.  I put my g-code in the "printer startcode" area.  If you look in the generated g-code file, CURA just inserts the code without any modification.  So, I replaced everything put in by default with my own g-code.  You probably want to look at the generated g-code file anyway to verify that it does what you want.


    I also modified the "printer endcode" because I wanted to move the print bed to the front instead of it doing a home when the print was done.  Otherwise on my printer, the bed was always moved to the back and you had to manually move the bed forward to remove the print.


    Here is what I ended up doing:

    ; Prefix G-Code for Creality CR-10 Mini to clean nozzle
    M117 Nozzle Cleaning...    ; Indicate NOZZLE CLEANING on LCD
    M107                       ; Turn layer fan off
    G21                        ; Set units to metric (change to G20 if you want Imperial)
    G90                        ; Set absolute coordinates
    G28                        ; Home X/Y/Z axis
    G0 X5 Y10 Z0.16 F5000      ; Move in 5mm x 10mm from corner and up [z] 0.16mm
    G92 E0                     ; Set extruder to [0] zero
    G1 Y210 E100 F500          ; Extrude 100mm filament 200mm along Y axis to prime and clean the nozzle
    G92 E0                     ; Reset extruder to [0] zero at end of cleaning run
    G1 E-3 F500                ; Retract filament by 3mm to reduce string effect
    G0 Z15 F5000               ; Raise extruder to safe Z height (1st shearing action)
    G0 X5 Y110 Z15 F5000       ; Move to center left of bed (2nd shearing action)
    G1 E3 F500                 ; Prime the extruder since retraction
    M117 Printing...           ; Indicate PRINTING on LCD


    ; Post G-Code for Creality CR-10 Mini
    G1 E-3 F1800
    G1 Z10 F3000
    G0 X0 Y200        ; Eject (move print bed forward)
    M106 S0           ; Turn off cooling fan
    M104 S0           ; Turn off extruder
    M140 S0           ; Turn off bed
    M84               ; Disable motors
    M117 Print Done.  ; Indicate PRINT DONE on LCD


    Edited by MarkF
    • Like 1
    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

      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
      • Ultimaker Cura 5.6 stable released
        Cura now supports Method series printers!
        A year after the merger of Ultimaker and MakerBotQQ, we have unlocked the ability for users of our Method series printers to slice files using UltiMaker Cura. As of this release, users can find profiles for our Method and Method XL printers, as well as material profiles for ABS-R, ABS-CF, and RapidRinse. Meaning it’s now possible to use either Cura or the existing cloud-slicing software CloudPrint when printing with these printers or materials
        • 4 replies
    • Create New...