From f9e5d64eac6c3820e0bc8a9502db12d9aec44402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Boisselier?= Date: Tue, 4 Jun 2024 18:45:21 +0200 Subject: [PATCH] added PWM freq targets to vibration graphs --- shaketune/measurement/motorsconfigparser.py | 1 + shaketune/post_processing/graph_vibrations.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/shaketune/measurement/motorsconfigparser.py b/shaketune/measurement/motorsconfigparser.py index 038c508..0275438 100644 --- a/shaketune/measurement/motorsconfigparser.py +++ b/shaketune/measurement/motorsconfigparser.py @@ -146,6 +146,7 @@ class MotorsConfigParser: motor.set_config('autotune_enabled', True) motor.set_config('motor', autotune_object.motor) motor.set_config('voltage', autotune_object.voltage) + motor.set_config('pwm_freq_target', autotune_object.pwm_freq_target) else: motor.set_config('autotune_enabled', False) diff --git a/shaketune/post_processing/graph_vibrations.py b/shaketune/post_processing/graph_vibrations.py index 55009de..712a727 100644 --- a/shaketune/post_processing/graph_vibrations.py +++ b/shaketune/post_processing/graph_vibrations.py @@ -570,7 +570,9 @@ def plot_motor_config_txt(fig, motors, differences): f"| {lbl}: {mot.get_config('motor').upper()} on {mot.get_config('tmc').upper()} @ {mot.get_config('voltage'):0.1f}V {mot.get_config('run_current'):0.2f}A - {mot.get_config('microsteps')}usteps" for mot, lbl in motor_details ] - config_blocks.append('| TMC Autotune enabled') + config_blocks.append( + f'| TMC Autotune enabled (PWM freq target: X={motors[0].get_config('pwm_freq_target')}kHz / Y={motors[1].get_config("pwm_freq_target")}kHz)' + ) else: config_blocks = [ f"| {lbl}: {mot.get_config('tmc').upper()} @ {mot.get_config('run_current'):0.2f}A - {mot.get_config('microsteps')}usteps"