Modification of E-value G-code from slicer
 
Notifications
Clear all

Modification of E-value G-code from slicer  

  RSS
dan
 dan
(@dan-9)
Active Member
Modification of E-value G-code from slicer

Hi everyone,

Is it possible to modify the E-value of the G-code direct from the slicer? 

I have to set for example this value to 150% for all the lines of the G-code. How would you do it?

I think one way is to write a script and change the g-code directly, but I don't have much experience in coding and I wonder if it is possible to do it from PrusaSlicer. 

I appreciate any advice

Thank you!

 

Posted : 28/01/2021 4:11 pm
JoanTabb
(@joantabb)
Veteran Member Moderator
RE: Modification of E-value G-code from slicer

Hi Dan,  why do you want to increase E value?   150% is a large difference... 

regards Joan

 

I try to make safe suggestions,You should understand the context and ensure you are happy that they are safe before attempting to apply my suggestions, what you do, is YOUR responsibility. Location Halifax UK

Posted : 28/01/2021 4:51 pm
bobstro
(@bobstro)
Illustrious Member
RE: Modification of E-value G-code from slicer
Posted by: @dan-30

Is it possible to modify the E-value of the G-code direct from the slicer? 

Yes. The M220 Marlin gcode command can be used to change feed rates for all axis, including E (extruder). If you turn the printer knob mid-print, is applies M220 to X, Y, Z, & E (as I understand it). 

The M221 Marlin gcode command adjusts the flow percentage. This equates to the extrusion multiplier setting in your slicer. I think this might be what you're after.

I have to set for example this value to 150% for all the lines of the G-code. How would you do it?

Your extrusion moves need to be coordinated with your XYZ moves or you're going to throw off the proportions of your extrusions. I wouldn't do it this way at all. I'd determine what speeds, extrusion widths, and heights I want, then let the slicer with all the smarts figure out the appropriate extrusion rates. Tweak the extrusion multiplier setting if you need a bit more or less filament to be extruded on each move.

I think one way is to write a script and change the g-code directly, but I don't have much experience in coding and I wonder if it is possible to do it from PrusaSlicer. 

As Joan notes, this is highly questionable. If you adjust the E rate without compensating the others on normal G0/G1 moves, you're going to produce wider, thicker extrusions and are likely to make a big mess. What exactly are you trying to accomplish?

 

My notes and disclaimers on 3D printing

and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan

Posted : 28/01/2021 5:17 pm
dan
 dan
(@dan-9)
Active Member
Topic starter answered:
RE: Modification of E-value G-code from slicer

@joantabb

Hi joantabb,

because I am printing infill samples and I need to increase the line width of the infill, for example 150%, without changing the cell size.

I think the only way is acting on the E value in the g-code. If I double the E-value I obtain double of the line width if I maintain constant the line height, nozzle and speed, right?

Thanks!

Posted : 28/01/2021 5:43 pm
dan
 dan
(@dan-9)
Active Member
Topic starter answered:
RE: Modification of E-value G-code from slicer

@bobstro

hi thank you for the answer.

Yes the idea is to obtain at the end thicker lines for the infill, as I replied to Joan.

So if I use the M221 command in the prusa slicer can I adjust the E value for all the line of g-code?

Thanks!

 

Posted : 28/01/2021 5:55 pm
JoanTabb
(@joantabb)
Veteran Member Moderator
RE: Modification of E-value G-code from slicer

M221 - Set Flow Percentage

 motion  Set the flow percentage, which applies to all E moves.

Description

Set the flow percentage, which applies to all E moves added to the planner.

Usage

M221 S<percent> [T<index>]

Parameters

S<percent>

Feedrate percentage

[T<index>]

Target extruder (requires multi-extruder). Default is the active extruder.

 

As far as I can see, this command would normally set all extrusions to the new value... 

You could see if you can set the printer as a virtual multifilament printer, and set most features to extruder 1 and set extruder 2, to infill   with the M221 command set against extruder 2, this may cause the effect you seem to be looking for,

regards Joan

I try to make safe suggestions,You should understand the context and ensure you are happy that they are safe before attempting to apply my suggestions, what you do, is YOUR responsibility. Location Halifax UK

Posted : 28/01/2021 7:54 pm
dan
 dan
(@dan-9)
Active Member
Topic starter answered:
RE: Modification of E-value G-code from slicer

@joantabb

@bobstro

I tried with the M221 command and it works for my purpose. Thank you very much!

 

Posted : 29/01/2021 1:56 pm
Share: