This is initially brought up because of the Prusa phase stepping.
But looks like this is a completely different solution to motion vibrations.
TMC SPI driver support custom current table for micro steps.
Technically we always assume that everything is not perfect, even decent-quality stepper motors.
So, micro steps are inequal, but this can be “tuned”.
That will increase precision and decrease vibration in theory.
The suggestion from TMC for tuning looks like that:
I made simple CAD calculations. and there is no chance to print something and tune, it because to get 1mm resolution per micro-step on a motor with a 1.8-degree full step, we need a dial indicator around 8 meters long, or a Laser.
The perfect solution is to have some decent encoder, and if the encoder can sense the inequality of 0.007 degrees, there is a chance to automate calibration.
So, I realize all of that is about detecting small signals and amplification of it.
Technically there is already a solution for that resonances for amplification and accelerometer for detection.
Can it work? That is the right question.
I did some hacks like changing driver micro steps to match tested micro steps and making some graph analyzing tools, based on Klippain shake tune (which is based on Klipper internal shaper code).
So, there is a macro:
[gcode_macro PHASE_STEPPING_X]
gcode:
{% set mstep = 32 %}
{% set mstep_size = 40 / 200 / mstep %}
SET_VELOCITY_LIMIT MINIMUM_CRUISE_RATIO=0
SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0
{% set shift = 256 // mstep %}
{% for mscnt in range(0, 256, shift)%}
ACCELEROMETER_MEASURE NAME=phase-stepping_{mscnt}-{mscnt+shift}
# 0.48 / (40 / 200 / 32) = 76.8 HZ
{% set FREQ = 75 %}
{% set FREQ_SPEED = FREQ * (40 / 200 / mstep) %}
RESPOND MSG="microstepping: {mstep} size: {mstep_size} speed: {FREQ_SPEED}mm/s phase-stepping_{mscnt}-{mscnt+shift}"
{% for repeat in range(0, FREQ*2) %} # ~2 seconds
FORCE_MOVE STEPPER=stepper_x DISTANCE={mstep_size*-1} VELOCITY={FREQ_SPEED}
FORCE_MOVE STEPPER=stepper_x DISTANCE={mstep_size} VELOCITY={FREQ_SPEED}
{% endfor %}
ACCELEROMETER_MEASURE NAME=phase-stepping_{mscnt}-{mscnt+shift}
# Shift forward
FORCE_MOVE STEPPER=stepper_x DISTANCE={mstep_size*-1} VELOCITY=0.1
{% endfor %}
There are 2 graphs of micro step oscillation, the same micro steps, and the motor is shifted by ~1.6 mm, so there is also reproducibility.
And on the same position of the shaft, 4 full steps:
So, at least there is a difference in response between microsteps.
But for now, with this graph, I have no clue if the real difference is a match to spectral power density here.
In my simple tests, 32 micro steps is around the lowest limit, where something can be detected by an accelerometer.
Some hacks to do that:
- If the micro-steps of the driver match the tested step, the Klipper has no way to make a trapezoidal ramp here, because this is literally one micro-step. Disabling interpolation also helps in the same way.
- If they are a match and below 256 microsteps, there is a problem of getting MSCNT to zero, at least my attempts were unsuccessful.
- Using 256 driver micro steps allows us to easily get MSCNT to zero, and make some “right” measurements. But looks like there is less oscillation to be detected, even if we try to step with big steps. So, 8/16 works, 32 just does not make measurable oscillation.
For now, there are just my notes and a branch with 2 additional scripts, for the above graph and another for decoding mslut.
IMHO, the next steps here are:
-
Make graphs where PSD peaks are plotted above the MSCNT position instead of Hz - so there is a simple way to compare them. (Done, graphs updated)
-
And if there are some adequate patterns, (I expect a very low distribution of micro-steps PSD like 10%).
-
Try to decode that data back to MSLUT, retest, and compare.
As a last resort, make a lever from the motor shaft to the accelerometer, and oscillate that lever (60 mm long?) instead of the print head, there must be a much more powerful response in my opinion.
Of course, in the end, this madness must be validated somehow, maybe with a laser and a wall