Jump to content

Attempting custom GCode, feeder is unhappy


Recommended Posts

Posted · Attempting custom GCode, feeder is unhappy

My new Ultimaker 2 is running well with provided models but I am attempting to run some custom GCode. The code in question is meant to run continuously and essentially draw a spiral (and ultimately a taller, thin walled cylinder). I have this working well on the Makerbot, my settings are dialed in - but when I run similar code on the Ultimaker the feeder winds up ripping a gash in the filament and I'm forced to throw away a large chunk of filament (the amount going from the feeder to the extruder).

So 2 questions -

Is the feeder motor too tight? Can I loosen it? Should I? Is there any way I can prevent it from chewing up the filament? I'm assuming it's happening because the motor is trying to run too fast?

On the GCode side - Is there a solid guide to ultigcode? I've looked through the reprap wiki and I understand basic GCode but I need to find out which settings will work best with this particular printer. The GCode below is what I've been using with the Makerbot - I've noticed that the files that come with the Ultimaker set E values for each step - I was hoping to 'set it and forget it' via something like this:

M108 R4.0 (Set Extruder Speed)

So it just stays constant - is this possible and how do I find out which numbers are appropriate? According to the reprap wiki this command has been deprecated in favor of M113 but I haven't seen that in any of the example gcode files. Instead it looks like there are maybe machine presets set with 'skirt' or 'wall-outer' - there are also commands to set different layers - and I haven't found documentation for these commands - does it exist?

Is there a way to find out how to set the E value for each step aside from guessing (and potentially blowing through filament)?


M73 P0 (enable build progress)

G21 (set units to mm)

G90 (set positioning to absolute)

G10 P1 X-16.5 Y0 Z0 (Designate T0 Offset)

G55 (Recall offset cooridinate system)

(**** begin homing ****)

G162 X Y F2500 (home XY axes maximum)

G161 Z F1100 (home Z axis minimum)

G92 Z-5 (set Z to -5)

G1 Z0.0 (move Z to ÔøΩ0?)

G161 Z F100 (home Z axis minimum)

M132 X Y Z A B (Recall stored home offsets for XYZAB axis)

(**** end homing ****)

G1 X112 Y-73 Z155 F3300.0 (move to waiting position)

G130 X0 Y0 A0 B0 (Lower stepper Vrefs while heating)

M6 T0 (wait for toolhead, and HBP to reach temperature)

M104 S230 T0 (set extruder temperature)

M6 T0 (wait for toolhead, and HBP to reach temperature)

G130 X127 Y127 A127 B127 (Set Stepper motor Vref to defaults)

M108 R3.0 T0

G0 X112 Y-73 (Position Nozzle)

G0 Z0.2 (Position Height)

M108 R4.0 (Set Extruder Speed)

M101 (Start Extruder)

G4 P1500 (Create Anchor)

G1 X0 Y0 Z0.3 F2000

G1 X0.025189008959740775 Y0.022321046299000193 Z0.3 F2000

G1 X0.0673512530181918 Y-0.008161097250245124 Z0.3 F2000

G1 X0.058292664876501185 Y-0.08438479244185658 Z0.3 F2000


  • Link to post
    Share on other sites

    Posted · Attempting custom GCode, feeder is unhappy

    Hmmm, both the M108 and M101 are probably not appropriate for the UM2.

    Disclaimer: I have a UM1 so my info could be wrong.

    I believe the E values on the UM2 in ultigcode are in mm3. this makes it easier to calculate than the UM1 as the printer firmware adjusts the feed rate based in the filament size setting in the firmware.

    So to calculate the E value, you take the nozzle diameter and assume that will be the line width times the height of the layer times the line length.

    So for your first move from 0,0 to X0.025189008959740775 Y0.022321046299000193, the length value is square root of (delta X squared plus delta Y squared) or if my maths is right 0.03365583575334315261683035076938 times .4 for the nozzle times your layer height which looks to be 0.2mm from the above gcode or 0.002692


  • Link to post
    Share on other sites

    Posted · Attempting custom GCode, feeder is unhappy

    Not an gcode expert... but you can use spiralize from the expert settings in cura to get what you want.... maybe create some using this function .. check first in layer view if its what you want. Then you can also study the generated gcode created by cura..

  • Link to post
    Share on other sites

    Posted · Attempting custom GCode, feeder is unhappy

    I second the suggestion about spiralize in Cura. That should keep you from worrying about learning gcode.

    The UM2 can print gcode the way the UMO does or using "ultigcode" method. I'm not sure what triggers the difference but to get ultigcode mode you have to do something special like add the right comment near the top. So you probably are not in ultigcode mode.

    The big difference is that in regular mode it's mm of filament (we are talking 2.85mm filament, not 1.75mm filament!) in normal mode and mm^3 of filament in ultigcode mode as anon says above.

    There is no way to tell it to "automatically do the E axis". You have to specify how much extrusion for each "line" of filament laid down.


  • Link to post
    Share on other sites

    Posted · Attempting custom GCode, feeder is unhappy

    The UM2 expects the string ';FLAVOR:UltiGCode' in the first or the second line of the file. Otherwise the UM2 assumes RepRap-flavor and displays a warning that the gcode is overriding machine presets. But there is also the possibility to run RepRap flavor with volumetric E-values (choose volumetric RepRap flavor in Cura).

    I recommend http://reprap.org/wiki/G-code as a great source for which codes should be used and which not. A special list for the codes on the UM2 can be found https://github.com/Ultimaker/Ultimaker2Marlin (you have to scroll down).


  • Link to post
    Share on other sites

    Posted · Attempting custom GCode, feeder is unhappy

    Thanks for all the replies! My first problem was that Cura was exporting this instead of GCode:

    ;CURA_PROFILE_STRING:eNrtWk1v20YQvRJGf8QeEzRWSUqKnQi8JLV9aYoAdtHEF2JFrsStSS6xu7QsG/rvfbtcUpQst05jNF/SwQaHM7szb958GFZOl0zGGePzTEf+IPAWNM9jnfHkqmRKQXTsSaYlTTQXZcxKOs1ZdCFr5imR8zTO7QF9g5fejOOMlJWK62UU+l4pbm9zFit+y/B+5FWSlzpWFWNpNPbdo2ZF... etc

    I thought this was some kind of unreadable, compressed GCode - it turns out it didn't like the model I was using. The instructions for calculating the E value were very helpful and my ultimaker is spitting out the models I want with my own custom version of spiralize.

    My last (for now) question is about these lines:




    Is the layer number significant? I also wonder if the ;TYPE is changing settings on the UM2 - maybe the SKIRT setting increases the E or Z value perhaps?




  • Link to post
    Share on other sites

    Posted · Attempting custom GCode, feeder is unhappy

    I dont know if the firmware recognize the ;LAYER to count progression of the print but basically anything starting with ; is a comment.

    Also the layer numbers are splitted by objects. If you use print one at a time every object define its own layer count and reset the layer index.

    Comments like ;TYPE:WALL-OUTER can be useful for post-process plugins to perform special actions or Cura to change the display color in layer view.


  • 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

      • 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
      • UltiMaker Cura 5.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
          • Like
        • 26 replies
    • Create New...