E value Calculation of the G code in Prusa Slicer
 
Notifications
Clear all

E value Calculation of the G code in Prusa Slicer  

Page 2 / 2
  RSS
Heiko
(@heiko)
Active Member
RE: E value Calculation of the G code in Prusa Slicer

ah, very interesting and useful! thank you very much @misan
Currently, im working with this font, because of its spacefilling quality:
https://www.fontspace.com/absinthelyric-print-font-f30853

i'll let you know, when trying out your tool

Posted : 24/05/2022 5:04 pm
misan liked
Sanglae Kim
(@sanglae-kim)
Active Member
RE: E value Calculation of the G code in Prusa Slicer

Yes!

If I understand correctly, what you want to do might work properly!

The difference between prusaslicer and my customized Gcode generator was very small. (maybe in some cases, this might become big)

I'm pretty sure your Gcode also works if you calculate correctly (the equation posted here is right)

Thanks

Posted : 25/05/2022 6:15 am
misan
(@misan)
Member Moderator
RE:

@sanglae-kim: I have followed your numeric example and found a few problems: 

>>> h**2/4*math.pi+w*(w-h)
0.13818583470577037

You were missing PI when calculating the section of the extruded path.

If you calculate the total length needed for the 80.078 mm path at 0.3 mm height and 0.45 mm width you get

def whatL(h,w,K):
    return (4*K*h*w+(pi-4)*K*h**2)/(pi*D**2)

>>> whatL(0.3,0.45,80.074)
3.8512856322385485

Which seems quite close to the E3.85132 in the second marked line. Maybe the small difference is due to the integer raster mentioned above. 

OTOH, extruder axis may be set to absolute or relative values independently of XYZ axis mode. 

I guess in this case it is set to relative(M83, something you can check at the beginning of the Gcode file) rather than absolute as you were assuming (otherwise there would be a significant calculation difference).

This post was modified 2 years ago 2 times by misan
Posted : 25/05/2022 6:53 am
Daniel liked
Daniel
(@daniel-3)
Active Member
RE: E value Calculation of the G code in Prusa Slicer

@misan

@sanglae-kim

we should include in the equation the extrusion multiplier because when this is not equal to 1 will give different results for E

Posted by: @misan

@sanglae-kim: I have followed your numeric example and found a few problems: 

>>> h**2/4*math.pi+w*(w-h)
0.13818583470577037

You were missing PI when calculating the section of the extruded path.

If you calculate the total length needed for the 80.078 mm path at 0.3 mm height and 0.45 mm width you get

def whatL(h,w,K):
    return (4*K*h*w+(pi-4)*K*h**2)/(pi*D**2)

>>> whatL(0.3,0.45,80.074)
3.8512856322385485

Which seems quite close to the E3.85132 in the second marked line. Maybe the small difference is due to the integer raster mentioned above. 

OTOH, extruder axis may be set to absolute or relative values independently of XYZ axis mode. 

I guess in this case it is set to relative(M83, something you can check at the beginning of the Gcode file) rather than absolute as you were assuming (otherwise there would be a significant calculation difference).

 

Posted : 23/04/2024 9:34 pm
Page 2 / 2
Share: