Make frequencies default on [resonance_tester] settings (#119)
This commit is contained in:
@@ -17,14 +17,20 @@ from .accelerometer import Accelerometer
|
|||||||
|
|
||||||
|
|
||||||
def axes_shaper_calibration(gcmd, config, st_process: ShakeTuneProcess) -> None:
|
def axes_shaper_calibration(gcmd, config, st_process: ShakeTuneProcess) -> None:
|
||||||
min_freq = gcmd.get_float('FREQ_START', default=5, minval=1)
|
printer = config.get_printer()
|
||||||
max_freq = gcmd.get_float('FREQ_END', default=133.33, minval=1)
|
toolhead = printer.lookup_object('toolhead')
|
||||||
|
res_tester = printer.lookup_object('resonance_tester')
|
||||||
|
systime = printer.get_reactor().monotonic()
|
||||||
|
toolhead_info = toolhead.get_status(systime)
|
||||||
|
|
||||||
|
min_freq = gcmd.get_float('FREQ_START', default=res_tester.test.min_freq, minval=1)
|
||||||
|
max_freq = gcmd.get_float('FREQ_END', default=res_tester.test.max_freq, minval=1)
|
||||||
hz_per_sec = gcmd.get_float('HZ_PER_SEC', default=1, minval=1)
|
hz_per_sec = gcmd.get_float('HZ_PER_SEC', default=1, minval=1)
|
||||||
accel_per_hz = gcmd.get_float('ACCEL_PER_HZ', default=None)
|
accel_per_hz = gcmd.get_float('ACCEL_PER_HZ', default=None)
|
||||||
axis_input = gcmd.get('AXIS', default='all').lower()
|
axis_input = gcmd.get('AXIS', default='all').lower()
|
||||||
if axis_input not in {'x', 'y', 'all'}:
|
if axis_input not in {'x', 'y', 'all'}:
|
||||||
raise gcmd.error('AXIS selection invalid. Should be either x, y, or all!')
|
raise gcmd.error('AXIS selection invalid. Should be either x, y, or all!')
|
||||||
scv = gcmd.get_float('SCV', default=None, minval=0)
|
scv = gcmd.get_float('SCV', default=toolhead_info['square_corner_velocity'], minval=0)
|
||||||
max_sm = gcmd.get_float('MAX_SMOOTHING', default=None, minval=0)
|
max_sm = gcmd.get_float('MAX_SMOOTHING', default=None, minval=0)
|
||||||
feedrate_travel = gcmd.get_float('TRAVEL_SPEED', default=120.0, minval=20.0)
|
feedrate_travel = gcmd.get_float('TRAVEL_SPEED', default=120.0, minval=20.0)
|
||||||
z_height = gcmd.get_float('Z_HEIGHT', default=None, minval=1)
|
z_height = gcmd.get_float('Z_HEIGHT', default=None, minval=1)
|
||||||
@@ -32,18 +38,11 @@ def axes_shaper_calibration(gcmd, config, st_process: ShakeTuneProcess) -> None:
|
|||||||
if accel_per_hz == '':
|
if accel_per_hz == '':
|
||||||
accel_per_hz = None
|
accel_per_hz = None
|
||||||
|
|
||||||
printer = config.get_printer()
|
|
||||||
gcode = printer.lookup_object('gcode')
|
|
||||||
toolhead = printer.lookup_object('toolhead')
|
|
||||||
res_tester = printer.lookup_object('resonance_tester')
|
|
||||||
systime = printer.get_reactor().monotonic()
|
|
||||||
|
|
||||||
if scv is None:
|
|
||||||
toolhead_info = toolhead.get_status(systime)
|
|
||||||
scv = toolhead_info['square_corner_velocity']
|
|
||||||
|
|
||||||
if accel_per_hz is None:
|
if accel_per_hz is None:
|
||||||
accel_per_hz = res_tester.test.accel_per_hz
|
accel_per_hz = res_tester.test.accel_per_hz
|
||||||
|
|
||||||
|
gcode = printer.lookup_object('gcode')
|
||||||
|
|
||||||
max_accel = max_freq * accel_per_hz
|
max_accel = max_freq * accel_per_hz
|
||||||
|
|
||||||
# Move to the starting point
|
# Move to the starting point
|
||||||
|
|||||||
@@ -18,9 +18,14 @@ from .accelerometer import Accelerometer
|
|||||||
|
|
||||||
|
|
||||||
def compare_belts_responses(gcmd, config, st_process: ShakeTuneProcess) -> None:
|
def compare_belts_responses(gcmd, config, st_process: ShakeTuneProcess) -> None:
|
||||||
min_freq = gcmd.get_float('FREQ_START', default=5.0, minval=1)
|
printer = config.get_printer()
|
||||||
max_freq = gcmd.get_float('FREQ_END', default=133.33, minval=1)
|
toolhead = printer.lookup_object('toolhead')
|
||||||
hz_per_sec = gcmd.get_float('HZ_PER_SEC', default=1.0, minval=1)
|
res_tester = printer.lookup_object('resonance_tester')
|
||||||
|
systime = printer.get_reactor().monotonic()
|
||||||
|
|
||||||
|
min_freq = gcmd.get_float('FREQ_START', default=res_tester.test.min_freq, minval=1)
|
||||||
|
max_freq = gcmd.get_float('FREQ_END', default=res_tester.test.max_freq, minval=1)
|
||||||
|
hz_per_sec = gcmd.get_float('HZ_PER_SEC', default=1, minval=1)
|
||||||
accel_per_hz = gcmd.get_float('ACCEL_PER_HZ', default=None)
|
accel_per_hz = gcmd.get_float('ACCEL_PER_HZ', default=None)
|
||||||
feedrate_travel = gcmd.get_float('TRAVEL_SPEED', default=120.0, minval=20.0)
|
feedrate_travel = gcmd.get_float('TRAVEL_SPEED', default=120.0, minval=20.0)
|
||||||
z_height = gcmd.get_float('Z_HEIGHT', default=None, minval=1)
|
z_height = gcmd.get_float('Z_HEIGHT', default=None, minval=1)
|
||||||
@@ -28,14 +33,11 @@ def compare_belts_responses(gcmd, config, st_process: ShakeTuneProcess) -> None:
|
|||||||
if accel_per_hz == '':
|
if accel_per_hz == '':
|
||||||
accel_per_hz = None
|
accel_per_hz = None
|
||||||
|
|
||||||
printer = config.get_printer()
|
|
||||||
gcode = printer.lookup_object('gcode')
|
|
||||||
toolhead = printer.lookup_object('toolhead')
|
|
||||||
res_tester = printer.lookup_object('resonance_tester')
|
|
||||||
systime = printer.get_reactor().monotonic()
|
|
||||||
|
|
||||||
if accel_per_hz is None:
|
if accel_per_hz is None:
|
||||||
accel_per_hz = res_tester.test.accel_per_hz
|
accel_per_hz = res_tester.test.accel_per_hz
|
||||||
|
|
||||||
|
gcode = printer.lookup_object('gcode')
|
||||||
|
|
||||||
max_accel = max_freq * accel_per_hz
|
max_accel = max_freq * accel_per_hz
|
||||||
|
|
||||||
# Configure the graph creator
|
# Configure the graph creator
|
||||||
|
|||||||
@@ -45,15 +45,15 @@ gcode:
|
|||||||
[gcode_macro COMPARE_BELTS_RESPONSES]
|
[gcode_macro COMPARE_BELTS_RESPONSES]
|
||||||
description: dummy
|
description: dummy
|
||||||
gcode:
|
gcode:
|
||||||
{% set freq_start = params.FREQ_START|default(5) %}
|
{% set freq_start = params.FREQ_START %}
|
||||||
{% set freq_end = params.FREQ_END|default(133.33) %}
|
{% set freq_end = params.FREQ_END %}
|
||||||
{% set hz_per_sec = params.HZ_PER_SEC|default(1) %}
|
{% set hz_per_sec = params.HZ_PER_SEC|default(1) %}
|
||||||
{% set accel_per_hz = params.ACCEL_PER_HZ %}
|
{% set accel_per_hz = params.ACCEL_PER_HZ %}
|
||||||
{% set travel_speed = params.TRAVEL_SPEED|default(120) %}
|
{% set travel_speed = params.TRAVEL_SPEED|default(120) %}
|
||||||
{% set z_height = params.Z_HEIGHT %}
|
{% set z_height = params.Z_HEIGHT %}
|
||||||
{% set params_filtered = {
|
{% set params_filtered = {
|
||||||
"FREQ_START": freq_start,
|
"FREQ_START": freq_start if freq_start is not none else '',
|
||||||
"FREQ_END": freq_end,
|
"FREQ_END": freq_end if freq_end is not none else '',
|
||||||
"HZ_PER_SEC": hz_per_sec,
|
"HZ_PER_SEC": hz_per_sec,
|
||||||
"ACCEL_PER_HZ": accel_per_hz if accel_per_hz is not none else '',
|
"ACCEL_PER_HZ": accel_per_hz if accel_per_hz is not none else '',
|
||||||
"TRAVEL_SPEED": travel_speed,
|
"TRAVEL_SPEED": travel_speed,
|
||||||
@@ -65,8 +65,8 @@ gcode:
|
|||||||
[gcode_macro AXES_SHAPER_CALIBRATION]
|
[gcode_macro AXES_SHAPER_CALIBRATION]
|
||||||
description: dummy
|
description: dummy
|
||||||
gcode:
|
gcode:
|
||||||
{% set freq_start = params.FREQ_START|default(5) %}
|
{% set freq_start = params.FREQ_START %}
|
||||||
{% set freq_end = params.FREQ_END|default(133.33) %}
|
{% set freq_end = params.FREQ_END %}
|
||||||
{% set hz_per_sec = params.HZ_PER_SEC|default(1) %}
|
{% set hz_per_sec = params.HZ_PER_SEC|default(1) %}
|
||||||
{% set accel_per_hz = params.ACCEL_PER_HZ %}
|
{% set accel_per_hz = params.ACCEL_PER_HZ %}
|
||||||
{% set axis = params.AXIS|default('all') %}
|
{% set axis = params.AXIS|default('all') %}
|
||||||
@@ -75,8 +75,8 @@ gcode:
|
|||||||
{% set travel_speed = params.TRAVEL_SPEED|default(120) %}
|
{% set travel_speed = params.TRAVEL_SPEED|default(120) %}
|
||||||
{% set z_height = params.Z_HEIGHT %}
|
{% set z_height = params.Z_HEIGHT %}
|
||||||
{% set params_filtered = {
|
{% set params_filtered = {
|
||||||
"FREQ_START": freq_start,
|
"FREQ_START": freq_start if freq_start is not none else '',
|
||||||
"FREQ_END": freq_end,
|
"FREQ_END": freq_end if freq_end is not none else '',
|
||||||
"HZ_PER_SEC": hz_per_sec,
|
"HZ_PER_SEC": hz_per_sec,
|
||||||
"ACCEL_PER_HZ": accel_per_hz if accel_per_hz is not none else '',
|
"ACCEL_PER_HZ": accel_per_hz if accel_per_hz is not none else '',
|
||||||
"AXIS": axis,
|
"AXIS": axis,
|
||||||
|
|||||||
Reference in New Issue
Block a user