I was annoyed about the over-and underextrusion as well as the filament residues after end of extrusion.
I checked all available resources and came to the following conclusion:
- The paper from Stratasys about the filament flow can be taken as fundamental basic to work on.
- I found an option for pressure advance in the firmware, when I activated this option, the printer doesn*t work anymore.
Furthermore, the approach for this implementation finally seems to be wrong, since it doesn’t respect the regular flow.
Reviewing the extrusion process, I made the following assumptions:
- to get a constant extrusion flow of a fluid, you have to provide a constant pressure on it. The flow itself is depending furthermore on the nozzle diameter and the viscosity of the fluid: f ~ pVd with d the nozzle diameter (machine constant), p the pressure and V the viscousity (ref : Ford viscosity cup )
- The viscosity itself is in the case of the used filament a function of temperature and different for each material. For a fixed set of extrusion parameters this can be treated as a constant (nominal extrusion temperature shall be constant)
- To build up the pressure you have to apply a force on the filament: p = F/A with A the area of the filament. This is a simplification of the pressure condition in the nozzle tip, where the pressure is not constant over the whole radius. Nevertheless, it can be assumed valid in a small distance from the liquefier point. Since A is a machine constant, the relation above an be rewritten to f ~ F*V(T).
- The force in the nozzle tip finally is generated within the extruder. The slicer software is calculating the extrusion rate re and is giving targets for the extruder, respecting the diameters for nozzle and filament: f = A(filament)/A(nozzle)re.
This is valid in a settled condition. But at the beginning the force has to be build up, which is impacted by the mechanical environment of the printer. To get a force to a filament a simple equation can be taken: F = xAE/l (spring constant of a rod) with x the offset at extruder side, A the cross section area of the filament, E the E-modulus of the used filament and l the distance between extruder and nozzle tip. Once again, l and A are machine constants, we have to respect mainly the e-modulo of the filament.
The final relationship can be written as re ~ xV(T)E. Finally substituting re with dx/dt we get
dx/dt ~ xV(T)*E
This differential equation can be solved, giving a logarithmic approach for the final flow in the nozzle, like it is described in the paper from Stratasys.
The solution for this problem was presented too, one have to advance and relax the filament feed at the begin and the end of a extrusion cycle.
But how much?
For my approach I looked at the system theory for signals. The extrusion system is working like a low path filter, a step function at the input (start of filament velocity) is generating a ramping up of the output (filament flow at the nozzle).
This kind of low pass filter has an interesting output, when a Dirac kick is applied: it provides an immediate output with a slope down to zero.
Adding the Dirac kick to the step function, the output will have the form of a step function too, if the Dirac kick adapted to the height of the step function.
In other words: the “height” of the Dirac kick (the x shift for pressure generation) is proportional to the extrusion rate(filament velocity), as it can be seen already in the last equation above.
The implementation of this approach in the firmware is quite easy. Since it can be treated as completely add-on, no internal procedure of the firmware needs to be altered. There are four main modifications:
- At line planning the extrusion rate is calculated for each line segment, using a variable factor the advance steps are defined and stored in the move block: initial advance: + advance steps, final_advance: - advance steps. For each block move the overall steps are not changed.
- During the optimisation of the extrusion for each block pair it is checked, if the final advance steps of the former block can be compensated with the initial advance steps of the following block.
- During extrusion run in the interrupt routine the initial advance is added as one loop where all advance steps are done with maximum extraction speed, the same is introduced for the final advance at the end of the move block. This was found the most practical solution.
- Introduction of a new command to set the factor for the advance calculation.
This implementation is running on my K8400 with two nozzles, where I checked with different materials the impact/improvement of this approach. It is still experimental and I couldn’t completely overcome the effects, but improve a lot.
I will check how I can provide the modified source code (in case somebody is interested in that topic).