Ian M's Adventures in CNC: Difference between revisions

From richmondmakerlabs.uk
Jump to navigation Jump to search
IanM (talk | contribs)
IanM (talk | contribs)
No edit summary
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
''Back to [[User:IanM|Ian M's profile]]''
''Back to [[User:IanM|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==
==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


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 upHere'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. 
 
[https://www.mostics.com 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 an 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' is notably unhelpfulFortunately its a direct knockoff of the Sainsmart [https://www.sainsmart.com/products/sainsmart-genmitsu-cnc-router-3018-pro-diy-kit Genmitsu 3018 Pro CNC], and Sainsmart are much more customer/user friendly.


Unfortunately the original owner had lost the assembly notes, but it did appear to be mostly assembled correctly.  [https://www.mostics.com Mostics] aren't particularly helpful for support as they purge old product pages from 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 [https://www.sainsmart.com/products/sainsmart-genmitsu-cnc-router-3018-pro-diy-kit 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 [https://www.sainsmart.com/products/genmitsu-1-8-shank-40-pcs-cnc-cutter-milling-carving-bit-set-mc40a 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.
They've gained us as an actual customer - if you need 1/4" (3.175 mm) bits for an ER11 or similar spindle, their [https://www.sainsmart.com/products/genmitsu-1-8-shank-40-pcs-cnc-cutter-milling-carving-bit-set-mc40a 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===
===Hardware===
====GRBL Controller====
====GRBL Controller====
The controller is Sainsmart's clone of the 'Woodpecker' CAMXTOOL-V3.5 CNC GRBL board, running [https://github.com/gnea/grbl GRBL v1.1] on an ATmega328P, with on-board stepper drivers. Review here: https://benmaker.fr/2021/03/10/camxtool-v3-5-carte-controleur-cnc/ and schematic here: https://elektrotanya.com/sites/default/files/forum/2021/06/camxtool_v35_schrev0.pdf and the schematic can be found here: https://github.com/remias/CAMXTOOL-V3.5-cnc-board-sch
The controller is Sainsmart's clone of the 'Woodpecker' CAMXTOOL-V3.5 CNC GRBL board, running [https://github.com/gnea/grbl GRBL v1.1] on an ATmega328P, with on-board stepper drivers.
* Manual: http://s3.amazonaws.com/s3.image.smart/download/101-60-284/Controller_Board_User_Manual-English-V1.0-20200612.pdf
* Review: https://benmaker.fr/2021/03/10/camxtool-v3-5-carte-controleur-cnc/
* Schematic: https://elektrotanya.com/sites/default/files/forum/2021/06/camxtool_v35_schrev0.pdf or https://github.com/remias/CAMXTOOL-V3.5-cnc-board-sch
 
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.
 
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. 


Its identifiable by the clear acrylic 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.  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 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 enclosure and mod-wire it direct to the  ATmega328P, so when we commission the laser module, we can add GRBL controlled air assist.''
Our specific board (and the spare) came with the Reset button (usually next to the power switch) replaced with a two pin header for an external latching E-stop button.  
 
''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====
====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 to brace the open corner.  We clad it with a cut up [[https://www.protection.co.uk/products/proplex-5mm-recycled-plastic-sheeting 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.
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 [[https://www.protection.co.uk/products/proplex-5mm-recycled-plastic-sheeting 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====
====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 E-stop switch is connected to the GRBL board's ATmega328P /RESET input which tristates all I/O pins, effectively stopping all motion (unless the spindle MOSFET fails shorted).  Unfortunately this means hitting E-stop looses all volatile 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.   
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.
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.
N.B. There is a risk of the laser head pulsing at power-up, which can burn a small spot on the work.  If this is a problem, shield the work before turning the inhibit switch back on.
====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====
The macine came with a fan cooled 5.5 W blue diode laser module, that appears identical to [https://www.sainsmart.com/products/sainsmart-blue-laser-module-kit this 445 nm one] from Sainsmart, the laser drive (aka: Laser Control Module), and a pair of off-green lens 'safety' glasses.
The supplied '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 [https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches 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 [https://www.sainsmart.com/products/genmitsu-15pcs-er11-precision-spring-collet-set 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 [https://www.youtube.com/watch?v=mCCJ4esK50M 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.
It is possible to mill softer non-ferrous metals, but a high spindle speed with a very small depth of cut and slow feed must be maintained to prevent excessive spindle deflection.  With RPM at max, feed at 50 mm/m and 0.1mm depth of cut, using a Dremel multi-flute spiral carbide milling bit, 3.05mm dia, it was possible to side mill 12.7mm thick aluminium to a satisfactory finish.  The chips were fine flakes.


===Software===
===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.
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====
====Candle G-code sender====
Sainsmart's recommended G-code sender is [[https://github.com/Denvi/Candle 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 preprogrammed 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 scrool 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!
Sainsmart's recommended G-code sender is [https://github.com/Denvi/Candle 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 [https://github.com/Schildkroet/Candle2 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, [https://winder.github.io/ugs_website/ 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<sup>*</sup> 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====
 
[https://lasergrbl.com/ 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====
====G-code from Inkscape====
I've tested engraving paths generated in [[https://inkscape.org/ 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.
I've tested engraving paths generated in [https://inkscape.org/ 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====
====G-code from OpenSCAD====
[[Ian M's OpenSCAD stuff|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.  ToDo:  Facing, pocketing, path milling.
[[Ian M's OpenSCAD stuff|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==
==Useful links==
===CNC @ RML===
===CNC @ RML===
* https://wiki.richmondmakerlabs.uk/index.php/CncMill - OpenBuilds Platemaker, in the cloakroom
* https://wiki.richmondmakerlabs.uk/index.php/CncMill - OpenBuilds C-Beam Plate-maker, in the cloakroom
* https://wiki.richmondmakerlabs.uk/index.php/Rewiring_the_CNC - (3 years ago, work by Ian B and Andy)
* https://wiki.richmondmakerlabs.uk/index.php/Rewiring_the_CNC - (3 years ago, work by Ian B and Andy)
* https://wiki.richmondmakerlabs.uk/index.php/Andy%27s_Adventures_in_CNC
* https://wiki.richmondmakerlabs.uk/index.php/Andy%27s_Adventures_in_CNC
* https://wiki.richmondmakerlabs.uk/index.php/Denford_Micromill_%26_Microturn_blog - Our Denford Micromill and Microturn machines aka: the white boxes taking up floor space in the corner and under the 3D printing bench!
===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===
===3018 Specific===
* https://docs.sainsmart.com/article/3jgtgas880-genmitsu-3018-pro-resources
* https://docs.sainsmart.com/article/3jgtgas880-genmitsu-3018-pro-resources
* https://youtu.be/GpsdNzSu0EM - 3018 PRO Tips and tricks - care and feeding of 3018 machines
* https://youtu.be/GpsdNzSu0EM - 3018 PRO Tips and tricks - care and feeding of 3018 machines
* https://www.sainsmart.com/blogs/news/introducing-genmitsu-milling-bits
* https://www.sainsmart.com/blogs/news/introducing-genmitsu-milling-bits-part-2


===CNC Software===
===CNC Software===

Latest revision as of 15:05, 19 August 2024

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 an 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' is notably unhelpful. 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.

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.

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

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 which tristates all I/O pins, effectively stopping all motion (unless the spindle MOSFET fails shorted). Unfortunately this means hitting E-stop looses all volatile 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.

N.B. There is a risk of the laser head pulsing at power-up, which can burn a small spot on the work. If this is a problem, shield the work before turning the inhibit switch back on.

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

The macine 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 supplied '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.

It is possible to mill softer non-ferrous metals, but a high spindle speed with a very small depth of cut and slow feed must be maintained to prevent excessive spindle deflection. With RPM at max, feed at 50 mm/m and 0.1mm depth of cut, using a Dremel multi-flute spiral carbide milling bit, 3.05mm dia, it was possible to side mill 12.7mm thick aluminium to a satisfactory finish. The chips were fine flakes.

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