Skip to content

Commit

Permalink
added sweeping compatibility (#179)
Browse files Browse the repository at this point in the history
* added compatibility with sweeping test

* fix res_tester missing

* fixed compatibility with Klipper < v0.12.0-239

* added documentation about sweeping mode
  • Loading branch information
Frix-x authored Dec 22, 2024
1 parent 58d4be6 commit bcccdf0
Show file tree
Hide file tree
Showing 4 changed files with 301 additions and 59 deletions.
6 changes: 6 additions & 0 deletions docs/is_tuning_generalities.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ While you should usually try to focus on the toolhead/belts mechanical subsystem
1. **Diagnosis phase**: Begin with the nozzle tip mount to identify and troubleshoot mechanical issues to ensure the printer components are healthy and the assembly is well done and optimized.
1. **Filter selection phase**: If the graphs are mostly clean, you can transition to a mounting point near the toolhead's center of gravity for cleaner data on the main resonance, facilitating accurate Input Shaping filter settings. You can also consider the CANBus integrated accelerometer for its simplicity, especially if the toolhead is particularly rigid and minimally affected by wobble.

### Should I user the sweeping or pulse-only test?

The "sweeping" test superimposes a slow motion sweep on top of the usual back-and-forth pulses of the original test. This causes the toolhead (and stepper motors) to pass through multiple positions, rather than getting stuck on the same motor steps, rotor angle, and kinematic position. The added benefit is that it can help filter out some of the random motor and mechanical noise in the measurement, especially on less rigid machines, which can be problematic with the original test. This can help focus on only the "toolhead on belts" resonance peak, which is the most important one, and prevent the recommendation results from being muddled by extra vibration and noise you might have on the graph. It can be seen as a complementary solution to placing your accelerometer right at the center of gravity of the toolhead: you'll end up with a cleaner signal.

On the other hand, if you're looking for mechanical problems (like a wobbly toolhead, binding axis, loose belts, or other gremlins), the pulse-only mode can actually be more revealing. In fact, because the sweep mode smooths things out, it can hide some of the problems you want to find and fix. So if you're in full diagnostic mode, my advice is to use the pulse-only test and try placing the accelerometer in different places, like the nozzle tip, to better see the problems and fix them. Once everything is fixed, if there's still a bit of noise on your graphs, you can switch back to sweep mode for one last nice, clean reading.


## Theory behind it

Expand Down
2 changes: 1 addition & 1 deletion shaketune/commands/axes_shaper_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def axes_shaper_calibration(gcmd, config, st_process: ShakeTuneProcess) -> None:
# Then do the actual measurements
ConsoleOutput.print(f'Measuring {config["label"]}...')
accelerometer.start_recording(measurements_manager, name=config['label'], append_time=True)
vibrate_axis(toolhead, gcode, config['direction'], min_freq, max_freq, hz_per_sec, accel_per_hz)
vibrate_axis(toolhead, gcode, config['direction'], min_freq, max_freq, hz_per_sec, accel_per_hz, res_tester)
accelerometer.stop_recording()
accelerometer.wait_for_samples()
toolhead.dwell(0.5)
Expand Down
2 changes: 1 addition & 1 deletion shaketune/commands/compare_belts_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def compare_belts_responses(gcmd, config, st_process: ShakeTuneProcess) -> None:
for config in filtered_config:
ConsoleOutput.print(f'Measuring {config["label"]}...')
accelerometer.start_recording(measurements_manager, name=config['label'], append_time=True)
vibrate_axis(toolhead, gcode, config['direction'], min_freq, max_freq, hz_per_sec, accel_per_hz)
vibrate_axis(toolhead, gcode, config['direction'], min_freq, max_freq, hz_per_sec, accel_per_hz, res_tester)
accelerometer.stop_recording()
accelerometer.wait_for_samples()
toolhead.dwell(0.5)
Expand Down
Loading

0 comments on commit bcccdf0

Please sign in to comment.