fixed CoreXZ kinematics in vibrations measurement tool

This commit is contained in:
Félix Boisselier
2024-05-24 09:26:29 +02:00
parent 339e8a6d7c
commit 0e96b36703
2 changed files with 5 additions and 5 deletions

View File

@@ -43,7 +43,7 @@ def create_vibrations_profile(gcmd, config, st_thread: ShakeTuneThread) -> None:
main_angles = [45, 135]
else:
gcmd.error(
'Only Cartesian and CoreXY kinematics are supported at the moment for the vibrations measurement tool!'
'Only Cartesian, CoreXY and CoreXZ kinematics are supported at the moment for the vibrations measurement tool!'
)
ConsoleOutput.print(f'{motors_config_parser.kinematics.upper()} kinematics mode')

View File

@@ -637,12 +637,12 @@ def vibrations_profile(
global shaper_calibrate
shaper_calibrate = setup_klipper_import(klipperdir)
if kinematics == 'cartesian':
if kinematics == 'cartesian' or kinematics == 'corexz':
main_angles = [0, 90]
elif kinematics == 'corexy':
main_angles = [45, 135]
else:
raise ValueError('Only Cartesian and CoreXY kinematics are supported by this tool at the moment!')
raise ValueError('Only Cartesian, CoreXY and CoreXZ kinematics are supported by this tool at the moment!')
psds = defaultdict(lambda: defaultdict(list))
psds_sum = defaultdict(lambda: defaultdict(list))
@@ -830,8 +830,8 @@ def main():
opts.error('No CSV file(s) to analyse')
if options.output is None:
opts.error('You must specify an output file.png to use the script (option -o)')
if options.kinematics not in ['cartesian', 'corexy']:
opts.error('Only cartesian and corexy kinematics are supported by this tool at the moment!')
if options.kinematics not in ['cartesian', 'corexy', 'corexz']:
opts.error('Only cartesian, corexy and corexz kinematics are supported by this tool at the moment!')
fig = vibrations_profile(args, options.klipperdir, options.kinematics, options.accel, options.max_freq)
fig.savefig(options.output, dpi=150)