Automatic Sweeping Vacuum Routine for CNC

Before starting, or after completing a job on the CNC, it is useful to pass over the table with the vacuum extractor to remove any sawdust or debris.

To automate this task, I hacked the Gcode of a machining operation. I made a model of my spoil board in fusion360, created a faux facing tool with a diameter of 80mm which was to stand in for the vacuum. The facing operation parameters were set with 50% stepover.

The feedrate was cranked up to 10,000 mm/min and the speed of the spindle dropped way down to 5 RPM. 5 RPM was the lowest the software would allow the operation to be generated.

The code was generated and then with a bit of experimentation, edited to meet my needs. I have shown the generated code below as outputed from Fusion360 with deletions shown in (brackets) and additions shown in bold.

(2018-09-22 VACUUM 2400X1200)
(2018-09-22 VACUUM 2400X1200)
(T80  D=60. CR=0. - ZMIN=10. - FLAT END MILL)
G90 G94 G91.1 G40 G49 G17
G28 G91 Z0.

T80 M6
G10 L2 P5 X70 Y45 Z-95 
(S5 M3)
G0 X2459. Y28.471
G43 Z16. (H80)
G18 G3 X2453. Z10. I-6. K0. F10000
G3 Y1185.9 I0. J28.936
G1 X0.
G18 G3 X-6. Z16. I0. K6. F3100.

G28 G91 Z0.
G28 G91 X0. Y0.

I wanted the vacuum operation to work directly form the absolute co-ordinates without the need to manually set the WCS prior to running the operation. I also wanted to guard against the WCS being accidentily overriden manually so the WCS is set and declared within the GCODE with the lines

G10 L2 P5 X70 Y45 Z-95

As we dont need the spindle running for this operation, the lines below were deleted.

(S5 M3)

G54 can be deleted as we are using the G58 offset.


Mach3 Vacuum.png

To wrap it up, I added a button on the default Mach3 screen that would automatically open and load the vacuum gcode. The button script was as follows.

'Load the vacuum file
LoadFile("C:\Mach3\GCode\Vacuum 2400x1200.tap")
'Now run it

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s