-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Marlin M3 support - inch.pp
208 lines (172 loc) · 6.57 KB
/
Marlin M3 support - inch.pp
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
+===========================================================================
|
| gCode - Vectric machine output post-processor for vCarve and Aspire
|
+===========================================================================
|
| History
|
| Who When What
| ======== ========== =====================================================
| EdwardW 01/13/2020 Initial authoring
| Added status messages (M117)
| Enabled Arc movements (G2/G3)
| Added ending presentation
| EdwardW 02/28/2020
| Added G54 (CNC) coordinate support
| EdwardW 10/26/2021
| Added router control (M3/M5)
| EdwardW 12/14/2021
| Added helical-arc support
| Changed to unix line endings
| Improved comments
| Increased plunge speed when above material
| Now uses machine default rapid move speed
| Disabled PLUNGE_RATE section to avoid slowdowns
| Comments now report carved Z depth, not material Z
| EdwardW 1/22/2022
| Minor tweaks and comment updates
+===========================================================================
POST_NAME = "Marlin w/G54 M3 (inch) (*.gcode)"
FILE_EXTENSION = "gcode"
UNITS = "inches"
+---------------------------------------------------------------------------
| Configurable items based on your CNC
+---------------------------------------------------------------------------
+ Use 1-100 (%) for spindle speeds instead of true speeds of 10000-27500 (rpm)
SPINDLE_SPEED_RANGE = 1 100 10000 27500
+ Replace all () with <> to avoid gCode interpretation errors
SUBSTITUTE = "([91])[93]"
+ Plunge moves to Plunge (Z2) height are rapid moves
RAPID_PLUNGE_TO_STARTZ = "YES"
+---------------------------------------------------------------------------
| Line terminating characters
+---------------------------------------------------------------------------
+ Use windows-based line endings \r\n
+ LINE_ENDING = "[13][10]"
+ Use unix-based line endings \n
LINE_ENDING = "[10]"
+---------------------------------------------------------------------------
| Block numbering
+---------------------------------------------------------------------------
LINE_NUMBER_START = 0
LINE_NUMBER_INCREMENT = 1
LINE_NUMBER_MAXIMUM = 999999
+===========================================================================
|
| Formatting for variables
|
+===========================================================================
VAR LINE_NUMBER = [N|A|N|1.0]
VAR SPINDLE_SPEED = [S|A|S|1.0]
VAR CUT_RATE = [FC|C|F|1.0]
VAR PLUNGE_RATE = [FP|C|F|1.0]
VAR X_POSITION = [X|C| X|1.4]
VAR Y_POSITION = [Y|C| Y|1.4]
VAR Z_POSITION = [Z|C| Z|1.4]
VAR ARC_CENTRE_I_INC_POSITION = [I|A| I|1.4]
VAR ARC_CENTRE_J_INC_POSITION = [J|A| J|1.4]
VAR X_HOME_POSITION = [XH|A| X|1.4]
VAR Y_HOME_POSITION = [YH|A| Y|1.4]
VAR Z_HOME_POSITION = [ZH|A| Z|1.4]
+ VAR X_LENGTH = [XLENGTH|A|W:|1.1]
+ VAR Y_LENGTH = [YLENGTH|A|H:|1.1]
+ VAR Z_LENGTH = [ZLENGTH|A|Z:|1.2]
VAR X_LENGTH = [XLENGTH|A||1.1]
VAR Y_LENGTH = [YLENGTH|A||1.1]
VAR Z_LENGTH = [ZLENGTH|A||1.2]
VAR Z_MIN = [ZMIN|A||1.2]
VAR SAFE_Z_HEIGHT = [SAFEZ|A||1.4]
VAR DWELL_TIME = [DWELL|A|S|1.2]
+===========================================================================
|
| Block definitions for toolpath output
|
+===========================================================================
+---------------------------------------------------------------------------
| Start of file output
+---------------------------------------------------------------------------
begin HEADER
"; [TP_FILENAME]"
"; Material size: [YLENGTH] x [XLENGTH] x [ZMIN][34]"
"; Tools: [TOOLS_USED]"
"; Paths: [TOOLPATHS_OUTPUT]"
"; Safe Z: [SAFEZ][34]"
"; Generated on [DATE] [TIME] by [PRODUCT]"
"G90"
"G20"
"M117 [YLENGTH][34]x[XLENGTH][34]x[ZMIN][34] Bit #[T]"
"M117 Load [TOOLNAME]"
"M0 Load [TOOLNAME]"
"G54"
"G0 [ZH]"
"G0 [XH][YH]"
"M3 [S]"
";==========================================================================="
";"
"; Path: [TOOLPATH_NAME]"
"; Tool: #[T] : [TOOLNAME]"
";"
";==========================================================================="
"M117 [TOOLPATH_NAME] - Bit #[T]"
+---------------------------------------------------------------------------
| Rapid (no load) move
+---------------------------------------------------------------------------
begin RAPID_MOVE
"G0 [X][Y][Z]"
+---------------------------------------------------------------------------
| Carving move
+---------------------------------------------------------------------------
begin FEED_MOVE
"G1 [X][Y][Z] [FC]"
+---------------------------------------------------------------------------
| Plunging move - Only enable if necessary. Can cause huge slowdowns
+---------------------------------------------------------------------------
+begin PLUNGE_MOVE
+"G1 [X][Y][Z] [FP]"
+---------------------------------------------------------------------------
| Clockwise arc move
+---------------------------------------------------------------------------
begin CW_ARC_MOVE
"G2 [X][Y][I][J] [FC]"
+---------------------------------------------------------------------------
| Counterclockwise arc move
+---------------------------------------------------------------------------
begin CCW_ARC_MOVE
"G3 [X][Y][I][J] [FC]"
+---------------------------------------------------
+ Clockwise helical-arc move
+---------------------------------------------------
begin CW_HELICAL_ARC_MOVE
"G2 [X][Y][Z][I][J] [FC]"
+---------------------------------------------------
+ Counterclockwise helical-arc move
+---------------------------------------------------
begin CCW_HELICAL_ARC_MOVE
"G3 [X][Y][Z][I][J] [FC]"
+---------------------------------------------------------------------------
| Begin new toolpath
+---------------------------------------------------------------------------
begin NEW_SEGMENT
";==========================================================================="
";"
"; Path: [TOOLPATH_NAME]"
";"
";==========================================================================="
"M117 [TOOLPATH_NAME] - Bit #[T]"
"M3 [S]"
+---------------------------------------------
+ Dwell (momentary pause)
+---------------------------------------------
begin DWELL_MOVE
"G4 [DWELL]"
+---------------------------------------------------------------------------
| End of file output
+---------------------------------------------------------------------------
begin FOOTER
"G0 [ZH]"
"M5"
"G4 S3"
"M117 Returning home"
"G0 [XH][YH]"
"M117 Routing complete."