Jump to content
Ultimaker Community of 3D Printing Experts
rhino5fan

cura 15.04.4 extrusion parameter in UltiGcode

Recommended Posts

HI. I'm slicing stl models with Cura 15.04.4, set to output UltiGcode. When I read the gcode, the G01 commands have x,y, and e parameters. The e parameter in each individual command is expressed in total mm from the beginning of the print. The documentation I've found only refers to mm per move instruction. Is there some way to get Cura to generate gcode with the mm per move instead of cumulative mm?

Also, under Machine Settings, E-steps per 1mm filament is set = 0. What is an E-step and how do I set this parameter?

Thanks

Share this post


Link to post
Share on other sites

In ultigcode mode the E values are *cubic* mm. This is so you can have 1 gcode file work with either 1.75mm filament or 2.85mm filament or 2.95mm filament and not have to reslice.

In regular "rep rap" mode the E values are in mm.

If your printer has Marlin you should know it has 2 modes: relative and absolute.

If the extruder is in relative mode then the below 2 statements move the extruder 2mm. In absolute mode they move the extruder to the 1mm position (possibly moving backwards).

G1 E1

G1 E1

I don't know if Cura supports "relative" mode extrusion but your printer should certainly support absolute mode. There is a gcode to switch between these 2 modes. More info on Marlin gcodes (and a few other firmwares such as sprinter) here:

http://reprap.org/wiki/G-code

I'm 80% sure cura can't output relative moves but one could easily write a plugin to do this.

regarding steps/mm - this value is simply sent out as a gcode command at the start of the gcode file. Hovering over Cura parameters always tells you more details. There is a gcode to set steps/mm. This tells marlin (or other firmware) how many times to pulse a stepper motor to move 1mm.

What kind of printer do you have and what kind of firmware is on the printer?

Share this post


Link to post
Share on other sites

Thanks gr5. My printer is a brand new (like 10 days old) Ultimaker 2 Extended Plus. It's a great machine and prints very well out of the box. I installed the firmware upgrade recommended, but I really don't know what's under the hood. I've played with g-code to do some cnc machine work, but this is my first time with UltiGcode and 3d printing.

1) Maybe first I should ask: what are the detailed specs of this printer as it came from the factory? What is the firmware? RepRap wiki refers to FiveD, sprinter, marlin, teacup, reprap firmware, etc. Is it Marlin? What version? Does it use Arduino? (All of this is new to me. Do I even need to know what Arduino is?) So, is there a reference page I can go to that will tell me exactly what my machine is? Thanks much.

2) My real interest is in adding if-then logic and do-until loops to the g-code that's generated by Cura, as well as write and call subroutines. (I've done this in my cnc experimentation.) Is this even possible in UltiGcode? If so, where can I find the documentation?

3) This leads to how the extrusion parameter works. Right now the g-code looks like this, which I now understand to be absolute mode:

G1 X..... Y..... E0.21000

G1 X..... Y..... E0.83816

G1 X..... Y..... E0.15971

G1 X..... Y..... E0.95161

...

G1 X..... Y..... E4690.69623 starting from the first G1 move of the program.

My question is how do I get Cura to output the E parameter in relative mode? And will my firmware interpret it correctly? I just generated a new code with a machine setting of 10 steps per mm, but it didn't change the E parameter. Also looked at files that came from Ultimaker-- Coffin's Cube and Earring Circle -- both generated by Cura Steam Engine 13.10 and they also are in absolute mode.

Thanks again for any guidance you can give me.

Share this post


Link to post
Share on other sites

All ultimakers have Marlin. They are all slightly different versions of Marlin but they all support the same gcodes. The older UMO printers don't support ultigcode mode but there are only 2 important differences. In "ultigcode" the machine retracts and unretracts with G10 and G11. In "ultigcode" mode E values are in cubic mm instead of linear mm. In ultigcode certain parameters are not sent to the printer (but they could be): bed temperature, nozzle temperature.

Arduino is the hardware - it's a single chip computer. All Ultimakers use arduinos. It was a good choice 4 years ago but now they should move onto a cell phone based computer. The arduino is not very powerful. Not powerful enough to analyze video for example. Marlin only runs I believe on arduino processors. I could be wrong on that detail but it's probalby 99% arduino out in the real world if not 100%.

You can write relative gcode but cura can't. See G91 and G90 in link in my previous post of gcodes.

Marlin doesn't support conditionals (if statements) nor loops. The processor can't hold more than a few codes in memory and has no way to go backwards and re-read a file. So for example I have a gcode program that prints bracelets - they take about 6 minutes each. After each bracelet I have some gcodes the move the head back then down and then push the bracelet off the bed and then it starts over to print the next bracelet (there's a plow I add to my print head to keep the nozzle from melting the bracelet while pushing it off the bed).

Anyway there's no "start over" gcode (well M41 but not implemented in Marlin). So I cut and pasted my code 50 times to make 50 bradelets, lol. There are no variables either. So you can't write much in gcode.

But Cura does support plugins. They are very easy to write and modify even if you don't know python. Start with an existing plugin and look at the code and modify it to suit your needs. All the plugins are open source and python isn't compiled anyway so all the code is visible in anyone else's plugin.

Or you can write gcode using excel or just a text editor. Excel is nice because you can put formulas in the cells - like if you want a circle.

Share this post


Link to post
Share on other sites
My question is how do I get Cura to output the E parameter in relative mode? And will my firmware interpret it correctly?

Again - the only way to do this is with a plugin and use the M83 command to go to extruder relative mode. A plugin can easily subtract the 2 e values and output the difference (relative mode). I don't know why you would want to though.

Share this post


Link to post
Share on other sites

gr5, I appreciate the clear, concise answer. I’m printing a 5.5” high piece with vertical, curved surfaces. I noticed some shallow, narrow grooves running vertically in the printed piece. When I looked at the code (in ms Word), and compared several layers that (I thought) should have been identical, it was obvious they were not. The coordinates for the start of the inner wall were X107.889, Y92.268 on the first level and X11.830, Y130.877 on the second. I assumed this was a random variation generated by Cura. However, I just now looked more closely and found that the gcode alternates between these two microscopically different layers on a consistent basis, so it must be intentional. The variation between similar layers is very much smaller: on the range of 0.015 or so.

Still, I was off and running. It occurred to me that I could copy the gcode describing one layer into a subroutine. The main program, after printing the base as specified by Cura, would then call the subroutine a specific number of times to print truly identical layers. (This could be done with the layer pairs Cura actually produces.) The control logic of the loop would permit easy changes to the printed height of the item. I also wanted to put in control logic to print a test version, one that would print the brim, skip the base, and print the inner and outer walls a limited number of times, and skip the top cap. This way, I could identify a layer that did not have the groove flaw, or repair one that did, and replicate it in the final program. X and Y coordinates would be stacked with mathematical precision.

The problem was the extrusion amount per individual move command. If it were expressed in relative amounts, each layer would be coded identically, with each move allocated the proper amount of filament by Cura, and being the same on every layer. Pretty simple. Being stuck in absolute mode is a huge problem, because each G0 command would have to be supplied its E-value through a variable… or better yet … calculated by an expression containing a variable, such as:

X Y E0.21000+Cumulative_Length_of_Previous_Layers

X Y E3.83816+Cumulative_Length_of_Previous_Layers

This would still require a cut and paste into each command on the replicated layer, but you’d get the advantages of program logic. Unfortunately, this is all hypothetical given that Marlin does not do conditionals or loops. When I experimented with CNC for plasma cutting, I built a library of subroutines that gave a lot of flexibility. Anyway … that was my reasoning for wanting absolute mode.

Will be looking into plugins, Excel, etc. Very clever idea with the plow. Thanks very much for the time and effort of your replies. I couldn’t be happier with my decision to buy Ultimake—it was the right choice.

Share this post


Link to post
Share on other sites

Oh.  Okay.  Well there is a simple solution.  But first this "starting inner shell at different spot" is because Cura tries to save time by starting the inner shell as close as possible to where it left off last which is probably a different spot on each layer depending on what it just finished.  Um, it's hard to explain in just a few sentences - much easier to show in a drawing - but the point is it is trying to save a little time.

Now - there is a cool gcode command: G92.  This resets any axis to any position!  It does just what you need.  For example if you do:

G92 E100

Then it is telling the extruder that "now you are at position 100!".  If you then do a move to 101 it will only move the extruder 1mm (cubic of course).

So what you can do is at the start of each layer reset the extruder position back to where the previous layer started.  e.g. if the layer is like this:

 

G1 Z1.1  /* move Z up */G1 X 5 Y 5 E7.3114G1 X 6 Y 5 E7.4114...

 

Then add a G92 and set extruder to 7.3114

 

G1 Z1.1G92 E7.3114 /* tell extruder that it is now at 7.3114mm (cubic) */

 

Edited by Guest

Share this post


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

[[Template core/front/global/_customFooter does not exist. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]
×

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!