Skip to content

Commit 2d0fac5

Browse files
committed
Updated Marlin shapers
1 parent 740aef3 commit 2d0fac5

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

InputShaping.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ def getSettingDataString(self):
2121
"type": "enum",
2222
"options": {
2323
"is": "M593 (ZV Input Shaping)",
24-
"ftm": "M493 (Fixed-Time Motion)"
24+
"ftm": "M493 (Fixed-Time Motion)",
25+
"oldis": "Beta M593 (ZV Input Shaping)",
26+
"oldftm": "Beta M493 (Fixed-Time Motion)",
27+
"voldftm": "Alpha M493 (Fixed-Time Motion)"
2528
},
2629
"default_value": "is"
2730
},
@@ -55,13 +58,26 @@ def execute(self, data):
5558
elif line.startswith(';LAYER:'):
5659
layer = float(line.strip(';LAYER:'))
5760
hz = 0 if layer < 2 else start_hz + (end_hz-start_hz) * (layer - 2) / (max_layer-3)
58-
if gc == 'ftm':
59-
if layer == 0:
60-
lines[j] += '\n;TYPE:INPUTSHAPING\nM493 S11 D0 ;Enable ZVD Input Shaping'
61+
if layer == 0:
62+
params = ""
63+
if gc == 'voldftm':
64+
params = "S11"
65+
else if gc == 'oldftm':
66+
params = "S1 X11 Y11"
67+
else if gc == 'ftm':
68+
params = "S1 XY C11"
69+
if params:
70+
lines[j] += '\n;TYPE:INPUTSHAPING\nM493 %s D0 ;Enable ZVD Input Shaping' % params
71+
72+
if gc in ('oldftm','voldftm'):
6173
lines[j] += '\n;TYPE:INPUTSHAPING\nM493 A%f ;(Hz) X Input Shaping Test' % hz
6274
lines[j] += '\nM493 B%f ;(Hz) Y Input Shaping Test' % hz
63-
if gc == 'is':
75+
else if gc == 'ftm':
76+
lines[j] += '\n;TYPE:INPUTSHAPING\nM493 XY A%f ;(Hz) XY Input Shaping Test' % hz
77+
else if gc == 'oldis':
6478
lines[j] += '\n;TYPE:INPUTSHAPING\nM593 F%f ;(Hz) Input Shaping Test' % hz
79+
else if gc == 'is':
80+
lines[j] += '\n;TYPE:INPUTSHAPING\nM593 XY F%f ;(Hz) Input Shaping Test' % hz
6581
data[i] = '\n'.join(lines)
6682

6783
return data

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# cura-ringing-tower-script
2-
Cura implementation of custom layer change G-code macro used in slicing *ringing tower STL* for M593 (https://marlinfw.org/docs/gcode/M593.html) or M493 (https://marlinfw.org/docs/gcode/M493.html) based input shaping.
2+
Cura implementation of custom layer change G-code macro used in slicing *ringing tower STL* for [M593](//marlinfw.org/docs/gcode/M593.html) or [M493](//marlinfw.org/docs/gcode/M493.html) based input shaping.
33
Use the script with Post Processing Plugin on Cura Marketplace.
44

5-
Copy .py file into your cura directory as follows:
5+
Copy the `InputShaping.py` file into your cura directory as follows:
66
* (windows) C:\Users\\*username*\AppData\Roaming\cura\\*version*\scripts
77
* (mac) /Users/*username*/Library/Application Support/cura/*version*/scripts
88

0 commit comments

Comments
 (0)