You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using PrusaSlicer and old i3 clone and have a problem - the extruded amount doesn't calculate correctly.
I use absolute extruder position in G-Code, so at the end of a layer the value of E in command can reach several tenth of mm, for example: (all examples from the same 2cm cube sliced with same settings except Fuzzyficator script on or off)
The problem is in generated E values. They should be in the same range as values generated by slicer (around 31mm in this example), but they are all over the place (4, 6, 10mm, the longer XY travel, the smaller E values).
I checked the code and found an issue in interpolate_with_constant_resolution() function, which generates interpolated points.
The X and Y coordinates are calculated accurately, its something like this:
Xi = Xstart + (Xdelta * i / nsegments) , where i is the number of current interpolated point.
Basically the stating point of a movement is saved and the only thing that being interpolated is delta between start and end of a movement.
However, when function calculates E value, it interpolates the whole E value, not a delta between start and end of E, something like this
Ei = Estart * i / nsegments
The result is that instead of extruding 30mm on filament on top layer, the code barely extrudes anything on top layer.
This function will be working correctly if before every move the slicer resets extruder position (i.e. G92 E0 command), but it doesn't work with absolute positioning. I couldn't manage to get slicer and printer to cooperate in relative extrusion mode.
Here's the screenshot of a preview of g-code in the middle of the 2cm cube, the extruded amount between start and end of a move is 0.00mm, basically the only variance in E value is a z_displacement_compensation, while original G-code extruded 0.7mm
The thing I suggest to implement is E calculation similar to X calculation.
Ei = Estart + ( Edelta * i / nsegments ) * compensation_factor
This calculation will work in both relative and absolute mode (in relative mode Estart is equal to zero)
This need some rework of interpolate_with_constant_resolution(), and the way original E value is transferred into function (not as a number, but as part of start and end points). I think I'll do that sometime later on my end, but I don't know how to use git to transfer these changes to you.
Also, on line 63-64 the function saves "compensated_extrusion" value, but logging shows uncompensated value of "extrusion_per_segment".
Sorry if explanation is hard to follow, English isn't my native language.
The text was updated successfully, but these errors were encountered:
Hello!
I am using PrusaSlicer and old i3 clone and have a problem - the extruded amount doesn't calculate correctly.
I use absolute extruder position in G-Code, so at the end of a layer the value of E in command can reach several tenth of mm, for example: (all examples from the same 2cm cube sliced with same settings except Fuzzyficator script on or off)
after script I got the next g-code
The problem is in generated E values. They should be in the same range as values generated by slicer (around 31mm in this example), but they are all over the place (4, 6, 10mm, the longer XY travel, the smaller E values).
I checked the code and found an issue in interpolate_with_constant_resolution() function, which generates interpolated points.
The X and Y coordinates are calculated accurately, its something like this:
Xi = Xstart + (Xdelta * i / nsegments) , where
i
is the number of current interpolated point.Basically the stating point of a movement is saved and the only thing that being interpolated is delta between start and end of a movement.
However, when function calculates E value, it interpolates the whole E value, not a delta between start and end of E, something like this
Ei = Estart * i / nsegments
The result is that instead of extruding 30mm on filament on top layer, the code barely extrudes anything on top layer.
This function will be working correctly if before every move the slicer resets extruder position (i.e. G92 E0 command), but it doesn't work with absolute positioning. I couldn't manage to get slicer and printer to cooperate in relative extrusion mode.
Here's the screenshot of a preview of g-code in the middle of the 2cm cube, the extruded amount between start and end of a move is 0.00mm, basically the only variance in E value is a z_displacement_compensation, while original G-code extruded 0.7mm

The thing I suggest to implement is E calculation similar to X calculation.
Ei = Estart + ( Edelta * i / nsegments ) * compensation_factor
This calculation will work in both relative and absolute mode (in relative mode Estart is equal to zero)
This need some rework of interpolate_with_constant_resolution(), and the way original E value is transferred into function (not as a number, but as part of start and end points). I think I'll do that sometime later on my end, but I don't know how to use git to transfer these changes to you.
Also, on line 63-64 the function saves "compensated_extrusion" value, but logging shows uncompensated value of "extrusion_per_segment".
Sorry if explanation is hard to follow, English isn't my native language.
The text was updated successfully, but these errors were encountered: