A couple of months ago I attempted to see if the “motion analysis” (motan) tools could be used to facilitate spreadCycle tuning. The high-level idea was to use an adxl345 accelerometer as a substitute for a “current probe” during the tuning process. That is, to see if it is possible to detect mechanical vibrations induced by poor TMC driver settings and use that as a tool for finding good TMC driver settings.
Unfortunately, the experiment didn’t work well, at least on my Voron Zero test printer. No matter what settings I chose, I couldn’t induce a mechanical jitter (or, at least couldn’t find jitter in the data with my simple analysis tools).
The test code is available at: https://github.com/KevinOConnor/klipper-dev/tree/work-motan-20211124
The code is very raw and likely only of interest to other developers.
At a high-level the analysis idea involves creating macros (see config/sample-phase.cfg on that branch) that emit timestamps (via action_call_remote_method("motan_log")
) at the start and end of particular test events. This data is recorded using the ./scripts/motan/data_logger.py
tool. It can then be analyzed by the new ./scripts/motan/phase_graph.py
tool. That tool collates the data by stepper phase, determines the median value for each sensor for each stepper phase, and then graphs the results. Unfortunately, the phase_graph.py
tool is currently pretty slow (on some of my tests it could take a few minutes even when run on a desktop class machine).
@dmbutyugin - FYI. I saw that you did something similar. I haven’t looked closely at your implementation, but I thought I would publish my previous work in this area in case it is interesting to you.
-Kevin