Compatibility with Klipper < v0.12.0-239 (#129)
This commit is contained in:
@@ -41,11 +41,15 @@ def axes_map_calibration(gcmd, config, st_process: ShakeTuneProcess) -> None:
|
|||||||
|
|
||||||
toolhead_info = toolhead.get_status(systime)
|
toolhead_info = toolhead.get_status(systime)
|
||||||
old_accel = toolhead_info['max_accel']
|
old_accel = toolhead_info['max_accel']
|
||||||
old_mcr = toolhead_info['minimum_cruise_ratio']
|
|
||||||
old_sqv = toolhead_info['square_corner_velocity']
|
old_sqv = toolhead_info['square_corner_velocity']
|
||||||
|
|
||||||
# set the wanted acceleration values
|
# set the wanted acceleration values
|
||||||
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY=5.0')
|
if 'minimum_cruise_ratio' in toolhead_info:
|
||||||
|
old_mcr = toolhead_info['minimum_cruise_ratio'] # minimum_cruise_ratio found: Klipper >= v0.12.0-239
|
||||||
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY=5.0')
|
||||||
|
else: # minimum_cruise_ratio not found: Klipper < v0.12.0-239
|
||||||
|
old_mcr = None
|
||||||
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={accel} SQUARE_CORNER_VELOCITY=5.0')
|
||||||
|
|
||||||
# Deactivate input shaper if it is active to get raw movements
|
# Deactivate input shaper if it is active to get raw movements
|
||||||
input_shaper = printer.lookup_object('input_shaper', None)
|
input_shaper = printer.lookup_object('input_shaper', None)
|
||||||
@@ -89,9 +93,11 @@ def axes_map_calibration(gcmd, config, st_process: ShakeTuneProcess) -> None:
|
|||||||
input_shaper.enable_shaping()
|
input_shaper.enable_shaping()
|
||||||
|
|
||||||
# Restore the previous acceleration values
|
# Restore the previous acceleration values
|
||||||
gcode.run_script_from_command(
|
if old_mcr is not None: # minimum_cruise_ratio found: Klipper >= v0.12.0-239
|
||||||
f'SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_mcr} SQUARE_CORNER_VELOCITY={old_sqv}'
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_mcr} SQUARE_CORNER_VELOCITY={old_sqv}')
|
||||||
)
|
else: # minimum_cruise_ratio not found: Klipper < v0.12.0-239
|
||||||
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={old_accel} SQUARE_CORNER_VELOCITY={old_sqv}')
|
||||||
|
|
||||||
toolhead.wait_moves()
|
toolhead.wait_moves()
|
||||||
|
|
||||||
# Run post-processing
|
# Run post-processing
|
||||||
|
|||||||
@@ -76,8 +76,12 @@ def axes_shaper_calibration(gcmd, config, st_process: ShakeTuneProcess) -> None:
|
|||||||
# set the needed acceleration values for the test
|
# set the needed acceleration values for the test
|
||||||
toolhead_info = toolhead.get_status(systime)
|
toolhead_info = toolhead.get_status(systime)
|
||||||
old_accel = toolhead_info['max_accel']
|
old_accel = toolhead_info['max_accel']
|
||||||
old_mcr = toolhead_info['minimum_cruise_ratio']
|
if 'minimum_cruise_ratio' in toolhead_info: # minimum_cruise_ratio found: Klipper >= v0.12.0-239
|
||||||
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={max_accel} MINIMUM_CRUISE_RATIO=0')
|
old_mcr = toolhead_info['minimum_cruise_ratio']
|
||||||
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={max_accel} MINIMUM_CRUISE_RATIO=0')
|
||||||
|
else: # minimum_cruise_ratio not found: Klipper < v0.12.0-239
|
||||||
|
old_mcr = None
|
||||||
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={max_accel}')
|
||||||
|
|
||||||
# Deactivate input shaper if it is active to get raw movements
|
# Deactivate input shaper if it is active to get raw movements
|
||||||
input_shaper = printer.lookup_object('input_shaper', None)
|
input_shaper = printer.lookup_object('input_shaper', None)
|
||||||
@@ -115,6 +119,9 @@ def axes_shaper_calibration(gcmd, config, st_process: ShakeTuneProcess) -> None:
|
|||||||
# Re-enable the input shaper if it was active
|
# Re-enable the input shaper if it was active
|
||||||
if input_shaper is not None:
|
if input_shaper is not None:
|
||||||
input_shaper.enable_shaping()
|
input_shaper.enable_shaping()
|
||||||
|
|
||||||
# Restore the previous acceleration values
|
# Restore the previous acceleration values
|
||||||
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_mcr}')
|
if old_mcr is not None: # minimum_cruise_ratio found: Klipper >= v0.12.0-239
|
||||||
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_mcr}')
|
||||||
|
else: # minimum_cruise_ratio not found: Klipper < v0.12.0-239
|
||||||
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={old_accel}')
|
||||||
|
|||||||
@@ -88,9 +88,13 @@ def compare_belts_responses(gcmd, config, st_process: ShakeTuneProcess) -> None:
|
|||||||
|
|
||||||
# set the needed acceleration values for the test
|
# set the needed acceleration values for the test
|
||||||
toolhead_info = toolhead.get_status(systime)
|
toolhead_info = toolhead.get_status(systime)
|
||||||
old_accel = toolhead_info['max_accel']
|
old_accel = toolhead_info['max_accel']
|
||||||
old_mcr = toolhead_info['minimum_cruise_ratio']
|
if 'minimum_cruise_ratio' in toolhead_info: # minimum_cruise_ratio found: Klipper >= v0.12.0-239
|
||||||
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={max_accel} MINIMUM_CRUISE_RATIO=0')
|
old_mcr = toolhead_info['minimum_cruise_ratio']
|
||||||
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={max_accel} MINIMUM_CRUISE_RATIO=0')
|
||||||
|
else: # minimum_cruise_ratio not found: Klipper < v0.12.0-239
|
||||||
|
old_mcr = None
|
||||||
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={max_accel}')
|
||||||
|
|
||||||
# Deactivate input shaper if it is active to get raw movements
|
# Deactivate input shaper if it is active to get raw movements
|
||||||
input_shaper = printer.lookup_object('input_shaper', None)
|
input_shaper = printer.lookup_object('input_shaper', None)
|
||||||
@@ -112,7 +116,10 @@ def compare_belts_responses(gcmd, config, st_process: ShakeTuneProcess) -> None:
|
|||||||
input_shaper.enable_shaping()
|
input_shaper.enable_shaping()
|
||||||
|
|
||||||
# Restore the previous acceleration values
|
# Restore the previous acceleration values
|
||||||
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_mcr}')
|
if old_mcr is not None: # minimum_cruise_ratio found: Klipper >= v0.12.0-239
|
||||||
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_mcr}')
|
||||||
|
else: # minimum_cruise_ratio not found: Klipper < v0.12.0-239
|
||||||
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={old_accel}')
|
||||||
|
|
||||||
# Run post-processing
|
# Run post-processing
|
||||||
ConsoleOutput.print('Belts comparative frequency profile generation...')
|
ConsoleOutput.print('Belts comparative frequency profile generation...')
|
||||||
|
|||||||
@@ -59,11 +59,15 @@ def create_vibrations_profile(gcmd, config, st_process: ShakeTuneProcess) -> Non
|
|||||||
|
|
||||||
toolhead_info = toolhead.get_status(systime)
|
toolhead_info = toolhead.get_status(systime)
|
||||||
old_accel = toolhead_info['max_accel']
|
old_accel = toolhead_info['max_accel']
|
||||||
old_mcr = toolhead_info['minimum_cruise_ratio']
|
|
||||||
old_sqv = toolhead_info['square_corner_velocity']
|
old_sqv = toolhead_info['square_corner_velocity']
|
||||||
|
|
||||||
# set the wanted acceleration values
|
# set the wanted acceleration values
|
||||||
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY=5.0')
|
if 'minimum_cruise_ratio' in toolhead_info: # minimum_cruise_ratio found: Klipper >= v0.12.0-239
|
||||||
|
old_mcr = toolhead_info['minimum_cruise_ratio']
|
||||||
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY=5.0')
|
||||||
|
else: # minimum_cruise_ratio not found: Klipper < v0.12.0-239
|
||||||
|
old_mcr = None
|
||||||
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={accel} SQUARE_CORNER_VELOCITY=5.0')
|
||||||
|
|
||||||
kin_info = toolhead.kin.get_status(systime)
|
kin_info = toolhead.kin.get_status(systime)
|
||||||
mid_x = (kin_info['axis_minimum'].x + kin_info['axis_maximum'].x) / 2
|
mid_x = (kin_info['axis_minimum'].x + kin_info['axis_maximum'].x) / 2
|
||||||
@@ -133,10 +137,11 @@ def create_vibrations_profile(gcmd, config, st_process: ShakeTuneProcess) -> Non
|
|||||||
|
|
||||||
accelerometer.wait_for_file_writes()
|
accelerometer.wait_for_file_writes()
|
||||||
|
|
||||||
# Restore the previous acceleration values
|
# Restore the previous acceleration values
|
||||||
gcode.run_script_from_command(
|
if old_mcr is not None: # minimum_cruise_ratio found: Klipper >= v0.12.0-239
|
||||||
f'SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_mcr} SQUARE_CORNER_VELOCITY={old_sqv}'
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_mcr} SQUARE_CORNER_VELOCITY={old_sqv}')
|
||||||
)
|
else: # minimum_cruise_ratio not found: Klipper < v0.12.0-239
|
||||||
|
gcode.run_script_from_command(f'SET_VELOCITY_LIMIT ACCEL={old_accel} SQUARE_CORNER_VELOCITY={old_sqv}')
|
||||||
toolhead.wait_moves()
|
toolhead.wait_moves()
|
||||||
|
|
||||||
# Run post-processing
|
# Run post-processing
|
||||||
|
|||||||
Reference in New Issue
Block a user