Or where hold_current
can actually be useful.
Lets start with something all of us can agree on. We like printing things as fast and accurate as possible. We also like our printers to not catch fire, be louder than an engine, or be extremely expensive and finicky. We often have to make a trade off between those.
However, sometimes we can have speed, accuracy, and lower volume / heat!
I have tried to find if this was discussed previously, but was unsuccessful. The idea is conceptually simple though. Klipper always needs to know where the toolhead is, but it does not always need the toolhead to be at the exact position the GCode says it should be. The easiest example is a “parked” toolhead, but I believe “drip” mode in toolhead.py is another one. However, I do not know the code well enough to say for certain.
How does this relate to hold_current
? The reason I have seen for not using it is drift / jerk when the driver transitions between hold and run currents. However, that can be compensated for or eliminated in certain circumstances. Allowing hold_current or even full shutdown at certain times.
There are several ways to deal with the drift / jerk problem. The obvious is to switch to closed loop control. Klipper has support for rotary encoders,* and can use those to keep track of position even when steppers are turned off. That works for parked toolheads and possibly even extruders / AMS steppers. However, there is a second option that does not require separate hardware.
Quoting from the TMC 2209 Datasheet (rev 1.09)
3.6.1 Restart the Stepper Motor Without Position Loss
A self-locking drive allows switching off the motor completely without loss of position. Locking can result from mechanical friction and from the stepper motor cogging torque. Most stepper motors have a cogging torque in the range of a few percent of their nominal torque, which also will contribute to the motor locking in a certain position. Due to their construction, most motors lock at a fullstep position. A fullstep position is characterized by the position yielded with both coils at identical absolute current. To take advantage of this behavior, stop the motor on a fullstep position.
tl;dr: As long as the stepper is at a fullstep position, there should not be any jerk when transitioning between hold_current
and the regular drive current. If Klipper can end moves on those fullstep positions, then motor power can be reduced.
This could be especially useful for printers which use lead screws for the Z-axis. Especially if a model is sliced so each layer is a multiple of the printer’s fullstep. Klipper could adjust a few early layer heights by the needed microsteps so every layer is at that height.**
As I said, let’s talk about it. I’ll admit my use for this feature is a bit different than outlined above. I realized that if I parked the linear motors of my Magneto X at exactly the right spot, relative to the 20mm magnet spacing, I could cut the idle noise of the printer in half.
* I’d like to add support for linear encoders at some point, but different topic.
** Technically, this would work for extrusion and even some motion moves, but would require slicer modification.