Today, I embarked on fine-tuning my extruder motor to achieve peak performance while maintaining minimal heat generation.
Once the tuning was complete, I asked my self what whould Klipper Stock provide me instead:

As illustrated, there's a noticeable drop at the peak of the sine wave. This dip is a result of the default behavior of Klipper's global scaler. By default, Klipper sets the current scaler to its maximum value of 31, which causes the sine wave to extend beyond the optimal range for the driver's RSense. To protect the driver from potential damage, Klipper employs the global scaler to detect when the current exceeds safe levels. It temporarily reduces the current by disabling the flow for a few cycles, leading to the observed drop in the sine wave.
So with Klipper Stock, when you begin tuning your drivers, the primary objective isn't solely to find the best settings for performance. Instead, it's about identifying configurations that limit the current to a level that keeps the global scaler happy
To enhance this process, I've modified my TMC drivers to bypass the need for the global scaler as a safety mechanism. Instead, I utilize the TMC's inherent current scaler to set a maximum current threshold that avoids overshooting. This approach ensures that the global scaler remains inactive, resulting in a smoother sine wave. Here's an example of the sine wave generated by my TMC driver with its auto-tuning algorithm:

While the results are promising, there's still a slight jitter present. Achieving complete optimization would require further fine-tuning with an oscilloscope. Fortunately, the experts at Analog provide an excellent guide that details strategies to maximize driver performance:
π Analog's Comprehensive Driver Optimization Guide
Alex B
2025-01-04 20:51:36 +0000 UTCMatt the Printing Nerd
2025-01-04 20:46:19 +0000 UTCAlex B
2025-01-04 20:33:16 +0000 UTC