Jump to content

Successful Result : Octopi Start and End GCode for UM2


Recommended Posts

Posted · Successful Result : Octopi Start and End GCode for UM2

Hi Folks.

I have been using UM2 for nearly 2 years and for most of that time I used Octopi to control the UM2 remotely. After a recent Cura / Firmware update the Octopi seemed to be failing to print properly and today I got around to fixing that.

I got the latest Octopi image and then I started messing around with the Start and End GCode in Cura. Since I sometimes use Octopi and sometimes print with SD card from the front of the UM2, I wanted to make sure that using these 2 modes were compatible. In particular, the 'extrude after print' and 'prime before print' needs to match up reasonably well when switching between the 2 different control modes.

Also, I like the way the UM2 primes material on top of the front right metal clip, and I wanted Octopi to do the same. Pouring over forums, I didn't find a definitive answer so I did a lot of trial and error, and here are the results I have finalised.

Of course, to clarify- In Cura you need to have 2 machines setup, one for UM2 native using UltiGCode and another one using REPRAP (although maybe with this extra start / end stuff, Octopi might work with standard UltiGCode??) - anyway assume you need RepRap (Marlin/Sprinter) mode in your second Machine "UM2 via Octopi".

Now, put in the following in the Start and End GCode sections in Cura:



G21 ;metric valuesG90 ;absolute positioningM82 ;set extruder to absolute modeM107 ;start with the fan offG28 ; home all axesG1 F12000 X5 Y10M109 S{print_temperature} ;Uncomment to add your own temperature lineG1 Z30 ; lowerG92 E0 ; zero the extruded lengthG1 F100 E40; purge nozzle with 50mm of filamentG1 X80 Y60 F3000 ; move aside of the puddle of primed plasticG92 E0 ; zero the extruded length againG1 F{travel_speed}M117 Printing...




M104 S0 ;extruder heater offM140 S0 ;heated bed heater off (if you have it)G91 ;relative positioningG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressureG1 Z+0.5 E-15 F100 ;move Z up a bit and retract filament even moreG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the wayG28 Z0	;platform downM84 ;steppers offG90 ;absolute positioning


I tested combinations of starting with a UM2 SD card print, then Octopi and the other way around, and whilst the retraction / extrusion at the end and start of prints aren't exactly the same, they do seem to be compatible with enough primed in both modes to start the print with a clear run of filament. The Octopi now moves the head to the front left (after the bed heats up) and starts heating the head in that position so it drips down to the front left. Then when its hot, it primes (quite a lot) and gets you started with a decent flow.

I am using Cura and UM2 Firmware version 15.04.2

Hope this helps someone else doing the same thing.


  • Like 1
Link to post
Share on other sites

  • 5 months later...
  • 1 month later...
Posted · Successful Result : Octopi Start and End GCode for UM2

Anything that works for pause and resume?

On resume I'd like to extrude, then go to the last XY position, then lower the head again.

Of cause in the resume-script for Octoprint I have no idea what the last XY positon was.

  • 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.8 beta released
        Another Cura release has arrived and in this 5.8 beta release, the focus is on improving Z seams, as well as completing support for the full Method series of printers by introducing a profile for the UltiMaker Method.
          • Like
        • 1 reply
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Thanks
          • Like
        • 3 replies
    • Create New...