Before I started digging into code to do this, I wanted to sanity check it with people who are more familiar with Klipper’s architecture than I am …
I have a problem I’ve been trying to solve in various ways. Without getting into too much unnecessary detail, the issue I have is that the minimum possible extrusion length based on 256 microstepping for my particular extruder geometry (0.00001953125mm) is actually about 3x bigger than I really need it to be for some of the stuff I’m using it for. (Yes, its crazy small…) E moves smaller than that just get lost.
I’ve worked around it in a couple of less-than-ideal ways. The “easiest” was to parse the E length in G1 and if its set to something more than zero and less than that, to set it to that. It causes some overextrusion in smaller moves, but the extrusions don’t disappear. A slightly better model has been to apply a linear extrusion modifier such that the extruded amount is boosted to keep the minimum being requested to the physical minimum, and to ease that variance off in a linear fashion to the largest E length. That takes running a pre-processor, though, and still means over-extruding in the fine details.
What I’m thinking might be best is to use arcwelder to convert small moves into arcs, and have the arcs spread the E distance out over a larger number of X/Y moves. The current gcode_arc code calculates the arc and translates it to a bunch of G1 moves. My hope is to have it aggregate a few (or maybe all) of the arc segments into a single extruder move, since (by definition) you know you’re following a smooth path without any corners. That’d get the actual amount being stepped to be much higher. (And, as a side-effect, improve surface finish on arcs.)
I can tell from looking at the MCU documentation that the underlying protocol being sent to the MCU should support that – its not synchronized with any other moves, other than via the timestamp and interval. So it seems like it should be possible to tell the MCU to start the extruder move at the same time as the kinematic moves and have it run through multiple segments of the kinematic moves while a single extruder move is running.
What I can’t figure out is where, in the code, that translation actually happens. It looks like gcode_move.py is just updating its internal state, and something else is introspecting it later to actually do the moves?
My first pass of looking at this makes it look like it might be a very deep set of changes to make this work, as there’s no clear path from a module like gcode_arcs.py to the motion queues for the toolhead and steppers? It’s just passing XYZE down to the toolhead?
Basically, I’m curious what people’s first impression is of the feasibility, based on what everyone knows of the guts of Klipper.
And, yes, I’ve considered using a finer stepper (there aren’t any applicable sized ones less than .9 degrees) and/or gears (far too much slop in afforable gears).