Ian M's Adventures in CNC

From richmondmakerlabs.uk
Jump to navigation Jump to search

Back to Ian M's profile

I am interested in CNC machining at RML, but progress with commissioning our various CNC machines has been slow, due to existing hardware issues, and lack of space, time and personnel to work on them. Then the opportunity to up-skill outside of RML dropped into my lap . . .

Haysam's 3018 CNC

A friend recently acquired an older Mostics 3018 Pro CNC machine, with the optional 5.5W blue diode laser module, and standalone controller, and I got roped in to set it up. Here's a good review of exactly the same machine: https://www.homofaciens.de/technics-machines-cnc-3018Pro-Mostics_en.htm

Unfortunately the original owner had lost the assembly notes, but it did appear to be mostly assembled correctly, apart from the routing of some of the wiring, and the X gantry being mounted too far back, so the spindle couldn't reach the front of the bed.

Mostics aren't particularly helpful as they purge old product pages from their site, don't have any manuals visible on their site, and don't offer any support except through Facebook! "3018 CNC" is a very generic term used by many manufacturers and suppliers for their version of am entry level three axis milling machine or CNC router with a nominal 30 cm x 18 cm bed, so its often difficult to find machine specific stuff if the brand 'manufacturer' sucks. Fortunately its a direct knockoff of the Sainsmart Genmitsu 3018 Pro CNC, and Sainsmart are much more customer/user friendly.

They've gained us as an actual customer - if you need 1/4" (3.175 mm) bits for an ER11 or similar spindle, their MC40A 40 bit set is a good deal with 10 each 3.175mm two flute flat and ball end endmills, and two sets of burr type endmills 0.6mm to 3.0mm with nano blue and TiN coatings.

Hardware

GRBL Controller

The controller is Sainsmart's clone of the 'Woodpecker' CAMXTOOL-V3.5 CNC GRBL board, running GRBL v1.1 on an ATmega328P, with on-board stepper drivers.

Its identifiable by the clear plastic enclosure with fan, the 8x2 pin header for limit switches and Z probe, the 4x2 box header for the offline controller, and the red three pin laser connector. Newer versions have individual black SIL headers for the limit switches and Z probe and don't colour code the laser connector.

Our specific board came with the Reset button (usually next to the power switch) replaced with a two pin header for an external E-stop button.

Its powered from 24V which it uses direct for the spindle PWM and stepper drivers, and bucks to 12V for the fan, external Laser driver (max. 2A) and to feed its 5V regulator. Unfortunately it doesn't break out the PC0-PC3 pins, GRBL's RESET/ABORT, FEED HOLD/PAUSE, and CYCLE START/RESUME inputs, COOLANT ENABLE output and SPINDLE DIRECTION on PC4 is only available on the (unpopulated) ISP header.

ToDo: Check the firmware supports them, then make up a little board with a 6x2 header for PC0-PC5, with RC filtering on the input pins, mount it to the board enclosure and mod-wire it direct to the ATmega328P, so when we commission the laser module, we can add GRBL controlled air assist.

Enclosure

The 3018 throws fine dust and chips everywhere so an enclosure is essential. We lucked upon a square section steel tube bedside table frame about the right size, laid on its side and reconstructed it to remove a former leg across the middle bottom of the enclosure and braced an open corner with part of it. We clad it with a cut up [Proplex] floor protector, attached with double sided foam tape along all the tubes. The front and two/thirds of the top fold up and back for access. The bottom is open so the whole enclosure can simply be lifted off for cleaning and better access. Proplex probably wont stop the beam from the blue 5.5W diode laser head, so lining it with aluminium foil painted matte black to reduce the risk of reflections is on our ToDo list.

We've added a 24V white LED strip across the whole width on the top tube of the frame (where the top folds back), with a switch on the side powered by a plug tapping the 24V DC in, before the motor inhibit switch.

Motor Inhibit Switch

The E-stop switch is connected to the GRBL board's ATmega328P Reset input, so hitting E-stop looses all machine state - you cannot resume from it. However when changing bits or inspecting the work or moving clamps, it is desirable to lock out all motors for safety without loosing machine state. Provided the GRBL board is connected to a PC, this can be achieved by removing the board's 24V input power, as the ATmega328P will draw power from USB to maintain its state. All motion must be paused/stopped and remain stopped and the spindle must be off while 24V power is off otherwise GRBL will get very confused!

The GRBL board's On/Off switch can be used, but it is in a fairly inaccessible location and is rather fragile so an external switch is preferable. As the switch should never be operated with the motors running, it doesn't need a high DC current rating as it wont be breaking the circuit under load, but its AC current rating needs to exceed the max DC load current to guarantee its closed contacts wont overheat.

Make up an extender cable for the DC in jack with a SPDT 18 mm x 11 mm snap-in rocker switch in series with the center pin, near the socket end. Simply feed the cable through one of the holes in the side plate below the E-stop, and push the switch into the hole, where it is a firm fit. Cable tie the socket to the frame, facing the rear. Plug the PSU into the extender socket and the extender plug into the board, and its ready to use.

Z probe target

The supplied Z probe target is fractionally under 20 mm tall, which is a major limitation on a machine with only 38 mm usable Z travel, limiting the stock thickness to about 10 mm if you probe on top of it. I therefore decided to make a Z probe target 5 mm thick, to increase the max. stock thickness to about 25 mm.

A chunk of nom. 5 mm black acrylic was drilled so it could be mounted on a mandrel, roughly shaped and chucked on the RML lathe where its OD was turned down till it was circular. It was then re-chucked in the outside jaws and a recess bored it it to closely fit an old (pre-1982) bronze tuppence. The tuppence was faced to a total thickness of a little over 5 mm, but I was unable to complete the job on the lathe due to lack of time. The next day, I setup the new target in the CNC mill and milled a groove across the bottom for the wire, then flipped it, fitted the tuppence and tried to get a clean facing cut across it with a 3.175 mm two flute endmill. After some frustration, a Candle crash, and a Windows reboot, I had speeds and feeds that worked for approx. 0.1mm depth of cut, stepping over 0.5mm on each pass, and G-code to do that. I soldered a wire to the Queen's head, and glued the tuppence in its acrylic holder then set it up again. Milling it level had to be done in three stages, shifting the clamps in between, and was complicated by loosing connection to GRBL part way through the job, resulting in the need to pick up the height from the part-milled surface. However it eventually came out OK at fractionally under 5mm thick, and after lapping it to remove machining marks the target measured in at 4.97 mm +/- 0.02mm across its face. Not bad for milling bronze on an unimproved 3018!

After swapping it for the original target and reconfiguring Candle for a 4.97 mm Z probe target height, I tested it and got consistent results touching down on a business card.

It turns out the original target was tilted with about 0.08 mm difference edge to edge - no wonder I had been struggling to get consistent touchdown!

Laser Module

It came with a fan cooled 5.5 W blue diode laser module, that appears identical to this 445 nm one from Sainsmart, the laser drive (aka: Laser Control Module), and a pair of off-green lens 'safety' glasses.

The 'safety' glasses may not be fit for purpose, as they have no markings whatsoever, so no ISO or ANSI approvals. After some research I concluded that for a 5.5 W laser, I need safety glasses with an optical density of at least 4 at the laser wavelength. The published optical density vs wavelength charts for safety glasses of similar lens colour drops off a cliff far too close to the nominal laser wavelength. Apparently for a 5.5W blue diode laser, I need OD 4+ Amber or Red lens safety glasses. I shone a blue LED through one of the dubious 'safety' lenses, and wasn't happy with the attenuation it provided, though I didn't measure the actual optical density.

I installed the laser module at the recommended height, without checking the focus, and because I didn't trust the 'safety' glasses I was wearing, I temporarily fitted an opaque skirt round the laser head, right down to the bed and made sure I was well away from any possible reflected beam path. I pulse test fired it with a sheet of black card as a target. Enough scattered light leaked from the crack between the skirt and the target to confirm it is a blue laser. It pierced the card so it is basically functional, but the setup scares me - un-enclosed machine with no interlocks, and bright metal hold-down clamps which could reflect the beam in nearly any direction, and eye protection that may be partially or totally ineffective. I therefore put it aside till I can get appropriate real safety glasses for everyone who will be in the room, and build a laser-proof enclosure.

I was less than enthused by the recommended laser driver mounting position on the back of the X gantry top beam - it sticks up and may foul the umbilical to the X-carriage, and I think the X + Z motion will stress the cables to the laser head excessively. We added stand-offs between the GRBL controller and the gentry frame to gain enough clearance to mount the laser driver on the carriage, on the back of the Z axis assembly, so nearly all the flexing is in the easily replaceable GRBL controller to laser driver cable, which we routed through the umbilical to protect it. The Z assembly had to be modified slightly with a Dremel to gain clearance for the left side flat strip nut holding the driver so it didn't foul the motor shaft coupler. The driver board remains permanently connected to the GRBL controller so swapping between Laser and spindle motor only needs the two motor connectors or laser cables plugged/unplugged (+ one screw to clamp it and toggling the GRBL $32 laser mode setting).

After getting better safety glasses, I installed LaserGRBL, set the laser module focus at the recommended distance, and did some test burns on heavy card. Cutting performance is not great but it etches nicely. Doing cutting tests on top of a plywood spoil board was a mistake - I had to patch a charred spot. Remove the spoil board or use aluminium foil under the work to protect it from the beam! Further testing and calibration has been put off till we can sort out a fume extractor system for the enclosure.

There is some confusion about the recommended height for the adjustable focus laser module. Some of the documentation says 60 mm and others 50 mm, measured from the bottom face of the module to the surface of the work. As the focus is adjustable, its not too critical as long as you are consistent so we just picked 60mm and stuck to it.

Limit Switches

Although it was equipped with full limit switches, we initially had to run it with them disabled (except for homing) and soft limits enabled as spindle motor noise false triggers the Normally Open Z limit intermittently causing an alarm state. Ideally all the limit switches would be normally closed, but that would need EITHER modding all their mounting PCBs in addition to rewiring them, or a more complex optoisolator board, allowing inversion on a per axis basis. Also, the GRBL controller input filtering will cause a slight lag with NC switches.

We fitted interference suppression capacitors to the motor (Sainsmart recommend 3x 100nF, delta to terminals and motor housing), but 10nf was enough to stop the immediate false triggering and a lower capacitor value avoids excessive inrush current for the PWM MOSFET. We then rewired the Z limit switches with screened cable, screen grounded at the controller end to further increase its EMI resisance.

If we run into further EMI issues, the GRBL wiki recommends opto-isolating the limit switches, which can be done with a small board stacked on the controller limit and Z probe header.

Spoil Board

The spoil board protects the bed from mishaps by providing a sacrificial surface thicker than the difference between the Z limit and the physical end of travel. As long as the bit tip is set at or above its surface at -Z limit, it cant cut into the bed. Slotted 3mm MDF preferred to allow nearly unrestricted use of the T-slots. I designed one in OpenCAD, and laser cut from available ~3mm plywood at RML. Its held to the bed with thin double sided tape which unfortunately leaves it with a little spring as it wasn't as flat as I would have liked, but when the clamps are fitted they pull it down flat.

Issues

  • The GRBL board's power switch was broken - one of the tabs holding it together had lost its ears. Its a soft power switch (i.e. does not carry the motor current), and worked if held together, so a little heatshrink round the switch body to hold the tab in place + a drop of superglue fixed it.

Upgrades and Accessories

There was a spare GRBL controller board and some limit switch and wiring assemblies with it. We suspect the spare borad was obtained due to the power switch issue, and the previous owner just didn't get round to fitting it.

Currently under consideration

  • As the motor mount is plastic, it would be worth grounding the motor body to further reduce EMI, which with a brush on the top spindle end will also mean we don't have to clip a wire to the spindle when Z-probing, provided the target is connected to the A5 probe input
  • Dust/fume extraction
  • Collet set: e.g. Sainsmart's Genmitsu ER11 15 piece set 1 to 7 mm in 0.5 mm steps, + 1/8" and 1/4". They can hold any tool from approx. 0.5mm dia up to the max ER11 capacity of 7mm, and the spare 1/8" collet + an additional ER11 collet nut will speed tool changes, and the 6 mm and 1/4" collets gives more choice of bits, including smaller ordinary router bits.
  • Drill bits: Probably 1/8" shank 0.5 - 3 mm?
  • T-nuts for bed, + choice of M6 bolt/stud lengths for top clamps to minimise the clamp clearance issues
  • Low profile vice, built from three pieces of 12 mm square aluminium, drilled and countersunk for socket headed cap screws to hold them down, and one cross drilled and threaded for long socket headed cap screws to locate in blind cross holes in the third, pushing it to clamp the work. It will use the bed T-slots as its slides.
  • Laser safe viewport or webcam inside enclosure.
  • Modding the GRBL board to break out all the unused GRBL pins to support coolant control and hold/resume/abort buttons.
  • Enclosure door interlock switch + connection to GRBL.
  • Air assist for Laser: Needs an air pump (aquarium type), a nozzle to fit the laser head and some silicone hose. Desirable: SSR to control it (+ coolant control output from GRBL)

Speeds & Feeds

Still under development - I get it wrong more often than I get it right. Two clues to problems are melted or burned material building upon the bit, indicating its running hot because its rubbing too much rather than cutting (or you are simply cutting too deep or chips aren't getting cleared), or if it sounds like Adam Savage's Duck Bomb, which indicates a chatter problem which may be due to choking it with excessive feed, or if I've been particularly dumb, because I've goofed and the direction of cut is climb milling.

Software

Not wanting to spend £££ on commercial CAD software and path to G-Code plugins, I've been learning G-code and investigating FOSS and freeware options to drive it. Using hand-written G-code for various (test) milling operations is a PITA due to GRBL's lack of any macro programming or repeat cycle capability.

Candle G-code sender

Sainsmart's recommended G-code sender is Candle (formerly named grblControl). While it is an entirely adequate G-code sender and visualiser, it sucks for machine control on smaller screens as the preprogramed and macro buttons, the spindle speed, speeds and feeds overrides and jog buttons are all in one vertical pane with a very thin scroll bar, sharing vertical space with the State (current coordinates) and Console panes, and worse, the feeds and speeds sliders and the jog distance and rate dropdown boxes grab the scroll wheel as you pass over them! However it is lightweight and quick to open compared to many alternatives, so I am still persevering with it. Its actually forcing me to learn G-code as its often quicker to jog numerically from the console rather than scroll to access the jog buttons!

Candle hasn't been updated in quite a while. Although a fork of it Candle2 exists, (with improved screen layout), it requires OpenGL 2.0, which rules out use on older laptops, including mine.

Universal G-code Sender (UGS Platform)

A full-featured G-code sender, with visualisation and editing, UGS Platform edition is written in Java using the Netbeans Platform framework, which unfortunately means its very slow to open and initially connect. However once running its very capable and easily customisable. It supports joystick control for jogging (though that's not easy to set up due to the SDL2 game controller library used, which requires you to set up a mapping string for any game controller* and restart UGS before UGS can see it to set up its own mapping) and you can customise the toolbox pane with buttons for your own G-code macros, ether supplementing or replacing the default ones. It supports conversational programming.

* See https://www.generalarcade.com/gamepadtool/ to get the mapping GUID and https://wiki.libsdl.org/SDL2/SDL_GameControllerAddMapping for the mapping string syntax.

LaserGRBL

LaserGRBL is probably the best freeware option for driving a 3018 or similar GRBL CNC with a laser head fitted. It can be customised with button macros for machine control e.g. to set the head to the correct height.

ToDo: Expand this when I've had more hours running the laser!

G-code from Inkscape

I've tested engraving paths generated in Inkscape using its built-in Hershey Text and Gcodetools extensions. Hershey Text (found under Extensions:Text) allows you to convert text to a couple of single stroke fonts so you can engrave the center line of each stroke of the character rather than its inner and outer outlines. Gcodetools generates G-code from selected paths. Its UI sucks as parameters have to be entered in a succession of text boxes it dumps on your page when you use its Orientation Points... and Tools Library... functions, and when you select Path to Gcode... to generate G-code, it dumps a lot of cruft on the page, which it doesn't even group, that supposedly helps visualise the generated G-code, so save before doing this - you *WILL* need to revert. It is *possible* to create a new layer and switch to it before generating G-code to make the cruft easier to remove, but that's scarcely convenient. Otherwise, it does what it says on the tin, it works, generates G-code and the results would be very acceptable for desk or door name plates done in hardwood or plastic bicolor engraving laminate.

Caution: It expects GRBL to be in absolute mode but does not issue a G90 command at the start of the job. It is possible to supply a custom header including G90 to avoid issues if you jog numerically with G91G0 while setting up the work origin.

G-code from OpenSCAD

OpenSCAD is not G-code friendly as it can only output 3D meshes and 2D outlines and can't even output to a text file (other than the console log). You cant interrogate existing geometry e.g. to generate a tool path to follow its surface. However as I prefer coding my geometry to using a conventional parametric CAD program, I am working on a parametric G-code operation generator for OpenSCAD to overcome GRBL's limitation of no macros and variables. This will hopefully offer similar capability to various Conversational G-code generators, except by invoking modules for each desired operation, and adjusting their parameters, rather than by interacting with a wizard on the CNC controller screen. It will render the material to be removed as objects so the work can be visualised. It will not render the individual G-code lines nor will it generate toolpaths from existing geometry. So far, I've made good progress with peck drilling. However the code is not fit to publish yet.

ToDo: Facing, pocketing, path milling

Useful links

CNC @ RML

CNC milling

https://discuss.inventables.com/t/a-guide-to-understanding-basic-feeds-and-speeds/15583 - How to calculate them, and how to diagnose problems if you don't have enough power or rigidity for the theoretical numbers to work.

3018 Specific

CNC Software

  • Programming - A summary of available software from the (defunct) Shapoko wiki.

G-code