Skip to content

Commit

Permalink
Accept float for frequency in static freq test (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
Frix-x authored Feb 24, 2025
1 parent 689dd80 commit f405abe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions shaketune/commands/excitate_axis_at_freq.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def excitate_axis_at_freq(gcmd, config, st_process: ShakeTuneProcess) -> None:
date = datetime.now().strftime('%Y%m%d_%H%M%S')

create_graph = gcmd.get_int('CREATE_GRAPH', default=0, minval=0, maxval=1) == 1
freq = gcmd.get_int('FREQUENCY', default=25, minval=1)
freq = gcmd.get_float('FREQUENCY', default=25, minval=1)
duration = gcmd.get_int('DURATION', default=30, minval=1)
accel_per_hz = gcmd.get_float('ACCEL_PER_HZ', default=None)
axis = gcmd.get('AXIS', default='x').lower()
Expand Down Expand Up @@ -53,7 +53,7 @@ def excitate_axis_at_freq(gcmd, config, st_process: ShakeTuneProcess) -> None:
st_process.get_st_config().chunk_size, printer.get_reactor(), filename
)

ConsoleOutput.print(f'Excitating {axis.upper()} axis at {freq}Hz for {duration} seconds')
ConsoleOutput.print(f'Excitating {axis.upper()} axis at {freq:.1f}Hz for {duration} seconds')

printer = config.get_printer()
gcode = printer.lookup_object('gcode')
Expand Down
2 changes: 1 addition & 1 deletion shaketune/helpers/resonance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def _run_test_sequence(self, axis_direction, test_seq):
toolhead.move([nX, nY, nZ, E], max(abs_v, abs_last_v))

if math.floor(freq) > math.floor(last_freq):
ConsoleOutput.print(f'Testing frequency: {freq:.0f} Hz')
ConsoleOutput.print(f'Testing frequency: {freq:.1f} Hz')
reactor.pause(reactor.monotonic() + 0.01)

X, Y, Z = nX, nY, nZ
Expand Down

0 comments on commit f405abe

Please sign in to comment.