-
-
Notifications
You must be signed in to change notification settings - Fork 136
/
shell-macros.cfg
111 lines (86 loc) · 3.82 KB
/
shell-macros.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
[gcode_macro GENERATE_SHAPER_GRAPHS]
description: Genarates input shaper resonances graphs for analysis. Uses the AXIS parameter for if you only want to do one axis at a time, (eg. GENERATE_SHAPER_GRAPHS AXIS=X)
gcode:
# Handle toolhead settings
CACHE_TOOLHEAD_SETTINGS KEY="generate_shaper_graphs"
SET_MACRO_TRAVEL_SETTINGS
# cache the current graph files
CACHE_IS_GRAPH_FILES
# visual feedback
_LED_INPUT_SHAPER_START
# parameters
{% set axis = params.AXIS|default('')|lower %}
{% set freq_start = params.FREQUENCY_START|default(10)|int %}
{% set freq_end = params.FREQUENCY_END|default(133)|int %}
{% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %}
# generate shaper graphs
{% if axis != '' %}
{% if axis == 'x' %}
MAYBE_HOME
TEST_RESONANCES AXIS=X FREQ_START={freq_start} FREQ_END={freq_end} HZ_PER_SEC={hz_per_sec}
RUN_SHELL_COMMAND CMD=generate_shaper_graph_x
# RATOS_ECHO MSG="Input shaper graph generated for the X axis. You'll find it in the input_shaper folder in the machine tab!"
{% elif axis == 'y' %}
MAYBE_HOME
TEST_RESONANCES AXIS=Y FREQ_START={freq_start} FREQ_END={freq_end} HZ_PER_SEC={hz_per_sec}
RUN_SHELL_COMMAND CMD=generate_shaper_graph_y
# RATOS_ECHO MSG="Input shaper graph generated for the Y axis. You'll find it in the input_shaper folder in the machine tab!"
{% else %}
{action_raise_error("Unknown axis specified. Expected X or Y.")}
{% endif %}
{% else %}
MAYBE_HOME
TEST_RESONANCES AXIS=X FREQ_START={freq_start} FREQ_END={freq_end} HZ_PER_SEC={hz_per_sec}
TEST_RESONANCES AXIS=Y FREQ_START={freq_start} FREQ_END={freq_end} HZ_PER_SEC={hz_per_sec}
RUN_SHELL_COMMAND CMD=generate_shaper_graph_x
RUN_SHELL_COMMAND CMD=generate_shaper_graph_y
# RATOS_ECHO MSG="Input shaper graphs generated for X and Y. You'll find them in the input_shaper folder in the machine tab!"
{% endif %}
# visual feedback
_LED_INPUT_SHAPER_END
# Handle toolhead settings
RESTORE_TOOLHEAD_SETTINGS KEY="generate_shaper_graphs"
# show documentation link
_LEARN_MORE_CALIBRATION
# show the last generated graphs
SHOW_IS_GRAPH_FILES TITLE="Shaper graph"
[gcode_shell_command generate_shaper_graph_x]
command: /home/pi/printer_data/config/RatOS/scripts/generate-shaper-graph-x.sh
timeout: 60.
verbose: True
[gcode_shell_command generate_shaper_graph_y]
command: /home/pi/printer_data/config/RatOS/scripts/generate-shaper-graph-y.sh
timeout: 60.
verbose: True
[gcode_macro MEASURE_COREXY_BELT_TENSION]
description: Generates resonance graph used to ensure belts are equally tensioned.
gcode:
# Handle toolhead settings
CACHE_TOOLHEAD_SETTINGS KEY="measure_corexy_belt_tension"
SET_MACRO_TRAVEL_SETTINGS
# cache the current graph files
CACHE_IS_GRAPH_FILES
# visual feedback
_LED_INPUT_SHAPER_START
# parameters
{% set freq_start = params.FREQUENCY_START|default(10)|int %}
{% set freq_end = params.FREQUENCY_END|default(133)|int %}
{% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %}
# measure corexy belt tension
MAYBE_HOME
TEST_RESONANCES AXIS=1,1 OUTPUT=raw_data NAME=belt-tension-upper FREQ_START={freq_start} FREQ_END={freq_end} HZ_PER_SEC={hz_per_sec}
TEST_RESONANCES AXIS=1,-1 OUTPUT=raw_data NAME=belt-tension-lower FREQ_START={freq_start} FREQ_END={freq_end} HZ_PER_SEC={hz_per_sec}
RUN_SHELL_COMMAND CMD=generate_belt_tension_graph
# RATOS_ECHO MSG="Belt tension graphs generated. You'll find them in the input_shaper folder in the machine tab!"
# visual feedback
_LED_INPUT_SHAPER_END
# Handle toolhead settings
RESTORE_TOOLHEAD_SETTINGS KEY="measure_corexy_belt_tension"
# show documentation link
_LEARN_MORE_CALIBRATION
# show the last generated graphs
SHOW_IS_GRAPH_FILES TITLE="Belt Tension Graph"
[gcode_shell_command generate_belt_tension_graph]
command: /home/pi/printer_data/config/RatOS/scripts/generate-belt-tension-graph.sh
timeout: 90.
verbose: True