-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMach3_Laser _mm_cstewart000.pp
179 lines (129 loc) · 5.25 KB
/
Mach3_Laser _mm_cstewart000.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
+================================================
+ Original code from: https://jtechphotonics.com/?p=3851
+ Vectric machine output configuration file
+ C:\ProgramData\Vectric\Aspire\V8.0\My_Post
+================================================
+
+ History
+
+ Who When What
+ ======== ========== ===========================
+ PaulW 01/20/2016 turn Spindle off during rapids
+ EdwardP 11/02/2015 Written from Grbl_mm.pp but
+ set G20
+ EdwardP 11/02/2015 Commented out arcs as these
+ slow GRBL performance appear
+ interpolated anyway
+ Jay 16/6/2016 Laser support and remove Z
+ C. Stew 07/01/2018 Added comments - Added G55 work offset to the header, Updated laser on/off M301/M302
+================================================
+ LASER WIRING AND CONFIGURATION NOTES:
+ M301/M302 are custom 'M' Codes for turing a relay on/off supplying a laser module with power
+ M303/M304 are custom 'M' Codes activating/deactivating an ouput pin on the CNC driver board and signaling the laser module PWM.
+ In mach3 you must configure the outputs to match the output names called in the 'M' scripts
POST_NAME = "Mach3 Laser / Modified No Z / M301 M302 M303 M304 - MechMate #74 (mm) (*.txt)"
FILE_EXTENSION = ".txt"
UNITS = "MM"
+------------------------------------------------
+ Line terminating characters
+------------------------------------------------
LINE_ENDING = "[13][10]"
+------------------------------------------------
+ Block numbering
+------------------------------------------------
LINE_NUMBER_START = 0
LINE_NUMBER_INCREMENT = 10
LINE_NUMBER_MAXIMUM = 999999
+================================================
+
+ Formating for variables
+
+================================================
VAR LINE_NUMBER = [N|A|N|1.0]
VAR SPINDLE_SPEED = [S|A|S|1.0]
VAR FEED_RATE = [F|C|F|1.1]
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]
+================================================
+
+ Block definitions for toolpath output
+
+================================================
+---------------------------------------------------
+ Commands output at the start of the file
+---------------------------------------------------
begin HEADER
("Turn on laser relay")
"M301"
"T1"
"G17"
"G21"
"(Best Path Speed)"
"G64"
"(G55 = Co-ordinate offset for the laser on the table)"
"(X - distance from homed head to corner of table PLUS x offset )"
+"G0[ZH]"
"G0[XH][YH]"
"(clear old G92 offset)"
"G92.1"
"(set G92 offset - LASER)"
"G92 X252 Y-83.5"
+---------------------------------------------------
+ Commands output for rapid moves
+---------------------------------------------------
begin RAPID_MOVE
"G0[X][Y]"
+---------------------------------------------------
+ Commands output for the first feed rate move
+---------------------------------------------------
begin FIRST_FEED_MOVE
"G1[X][Y][F]M303"
+---------------------------------------------------
+ Commands output for feed rate moves
+---------------------------------------------------
begin FEED_MOVE
"G1[X][Y]M303"
+---------------------------------------------------
+ Commands output for the first clockwise arc move
+---------------------------------------------------
+begin FIRST_CW_ARC_MOVE
+"G2[X][Y][I][J][F]M303"
+---------------------------------------------------
+ Commands output for clockwise arc move
+---------------------------------------------------
+begin CW_ARC_MOVE
+"G2[X][Y][I][J]M303"
+---------------------------------------------------
+ Commands output for the first counterclockwise arc move
+---------------------------------------------------
+begin FIRST_CCW_ARC_MOVE
+"G3[X][Y][I][J][F]M303"
+---------------------------------------------------
+ Commands output for counterclockwise arc move
+---------------------------------------------------
+begin CCW_ARC_MOVE
+"G3[X][Y][I][J]M303"
+ ---------------------------------------------------
+ Commands output for Retract Moves
+ ---------------------------------------------------
begin RETRACT_MOVE
"M304"
"G4 P0"
+---------------------------------------------------
+ Commands output at the end of the file
+---------------------------------------------------
begin FOOTER
"M304"
"(Reset offset co-ordinates)"
"G92.1"
+"G0[ZH]"
"G0[XH][YH]"
"(Turn off Laser relay)"
"M302"
"M30"