I am trying to develop a way to limit print speed and adjust extruder temperature in real time based on a predefined extruder temperature vs. max flowrate curve.
I already have some working code that I temporarily added to PrinterExtruder.check_move(). My current code calculates the flowrate for a move using the Move.max_cruise_v2 variable, then reduces the move speed if the flowrate is too high using Move.limit_speed(), and adjusts the extruder heater temperature for the given flowrate (with some averaging over multiple movements to prevent temperature target from changing too fast for the real system to track the target).
This method works well and from brief testing I have done, it has greatly reduced the glossy and matte finish differences seen on parts where flowrate is high for some layers and low for other layers.
One problem with the current method is that the flowrate for short zig-zag movements (ex: small infill areas) is greatly overestimated since max_cruise_v2 is not actually reached during these movements. My current plan to resolve this is to calculate the average flowrate for each movement using the actual start_v2, cruise_v2, and end_v2 and apply the speed limitation and extruder temperature adjustment after that. I have looked at the LookAheadQueue class and the “Code flow of a move command” section in the documentation, but I do not have a great understanding of how the movement chaining works in the actual code. Does anyone have knowledge on where the best place would be to implement this code or have input on a better way to implement it?
1 - Prevent glossy and matte surface finish differences on parts where some layers have much higher flowrate than others
2 - Can I improve print speed while maintaining small detail quality and preventing degradation of the filament by allowing extruder temperature to be set higher for high speed sections of the print and lower for slow sections of the print? Ex: 240C for PLA during high flow rates and 205C for PLA during really low flow rates
Other info:
I have been thinking more about this and it might make more since to only implement the flowrate limiting as something that would be done real time during the print. Adjustment of the extruder temperature based on desired flowrate might be done better by using a preprocessing script that simulates the gcode file and adds lines to adjust the extruder temperature (I’m thinking of how the exclude_object works with Moonraker). In that case, the temperature could be adjusted a certain number of seconds in the future to account for the thermal mass of the hotend.
IMO this should be slicer functions.
Such settings depend on what I want to achieve also in terms of other material properties like layer bounding etc and the given geometry of the model.
In fact, 1) is available at least in Orca Slicer 2.1.1 and up, under material properties, “do not slow down external perimeters”. Not exactly what you ask, but same final result.
is something I think some Orca developers are working on, but you should go to their Discord to ask about it.
alone is already a great improvement, check the release notes with images and you’ll see.
I posted a message in the OrcaSlicer discord asking about the flow rate based temperature adjustment to see if anyone can provide me with more information.
I also found this issue on the OrcaSlicer Github: link
In that issue, similar points to what I have mentioned were brought up and the “do not slow down external perimeters” was mentioned. The extruder thermal mass needing time to heat up or cool down was also mentioned as a problem.
The “do not slow down external perimeters” fixes the glossy/matte issue. However, it does not do much for the problem of filament degradation at slow print speeds and does not account for slower print speeds caused by lots of accel/decel for turns/corners in the outer surface of the model.
I would agree now that the temperature adjustment would be better implemented in the Slicer. From my perspective, firmware based flow rate limiting combined with Slicer temperature adjustment would be the ideal solution that could both provide a uniform surface finish and prevent degradation of filament at slow print speeds. It would also prevent issues related to under extrusion caused by printing too fast before the extruder thermal mass has time to heat up and could open up the possibility for the Slicer to prioritize quality of certain features over speed by setting the temperature lower a significant amount of time ahead of time to ensure that an aggressive corner overhang or some very small detail can print successfully. Firmware flow rate limiting would slowly decrease and increase the print speed as the extruder temperature decreased and increased.
Here is an issue from the SuperSlicer GitHub that it looks like ended up not going anywhere because of the need for temperature dependent firmware flow rate limiting: https://github.com/supermerill/SuperSlicer/issues/2923
It’s funny I was just noodling this very issue myself tonight, not knowing it was being discussed here. One solution I was considering was a hardware solution in which the hotend heater was a stacked/layered design in which some subset of multiple layers was independently controllable thermally as a zone of thermal mass. The lower set or zone closest to the nozzle would be fully heated to the correct normal temp for the material being used, and the other zones above would be at some pre-full-heated temp, but just sub material melting point. Based on the code coming out of the slicer, a post processor would insert temp changes going up the stack of zones before it was actually needed, to minimize any hysteresis as flow changed. It would also minimize the molten mass needed to be kept molten at any given time. This makes drool control simpler, and reduces energy use.
In a nutshell, the algo is to increase the buffer size of molten material slightly ahead of use, never by over-temping a small thermal mass to compensate for flow, but instead increase the thermal mass to add a larger molten material buffer that can satisfy the volumes the flow requires.
I’m seeing a stack of thermal elements, washers essentially, each independently energized, and potentially stack-sets, or zones are insulated between each other with a dielectric layer. It seems doable to also have a nozzle thermocouple that reads exit temp in real-time, and smooths out the inevitable thermal bouncing that may occur. This would allow the entire thermal mass to dynamically adjust to flow in a way that does not endanger damaging the material by overheating, as well as not having to have a large buffer of molten material when it’s not needed.
Hopefully E3D is listening here Seems like a new Revo nozzle heater waiting to be swapped in. 3 zones might be the sweet-spot.
Cheers
That’s definitely a cool idea. Injection molding machines are setup similarly, where several different heater sections control the temperature as the pellets are fed from the hopper, melted/compressed, and metered as molten plastic into an area in front of the screw before being injected into the mold. I can’t find it right now, but I know people have experimented with multiple heater zone hotends before. Not sure what the conclusions were.
While a higher flow rate hotend, or one with multiple heater zones might be a “better” solution, I was approaching the problem from the perspective of “how can I improve quality/print speed through software only, without having to modify existing hardware?” A higher flow rate hotend or multiple heater hotend will also have the same issue as a lower flowrate hotend. Eventually you reach a flowrate limit, and if you increase the temperature, you can raise that flowrate limit by 10%-20%. In my case, that could make a big difference. I spend some of my free time managing the print farm at the engineering consulting company I work for and recently we were printing some parts that had large flat areas accompanied by a taller, smaller feature at one side of the part. A higher print temperature for the large flat areas that automatically reduced for the tall/small feature would have meant a 10%-20% quicker print time on a 3hr-4hr part with the same quality being achievable on the small feature. I know I could have just used the slicer to add a temperature change where the small feature started, but some of the other engineers aren’t that familiar with 3D printers or very tech savvy.
I think I have come up with a way to better demonstrate the problem I am trying to solve and the Klipper flow rate limiting solution to it. I also think the solution can just use the existing Move.limit_speed() without needing to modify any of the trapezoidal motion planning like I originally thought. I will post that here as soon as I am done with it.
Awesome, thanks! This should help a lot. I was already planning to try to use klipper_estimator to do the temperature changes to prove the concept. Looks like that is what they are doing.