Ian M's Adventures in CNC: Difference between revisions

From richmondmakerlabs.uk
Jump to navigation Jump to search
(14 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]]''


A friend recently acquired an older Mostics 3018 Pro CNC machine, with the optional 5.5W blue diode laser module, and the standalone controller. [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!  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.
==Haysam's 3018 CNC==


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.  
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.  [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.
 
===Hardware===
====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.
* 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.
 
Our specific board came with the Reset button 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 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.
 
====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.
 
===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 [[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!
 
====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.
 
====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''


==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 Platemaker, 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


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


CNC Software
===CNC Software===
* [https://web.archive.org/web/20211127014103/https://wiki.shapeoko.com/index.php/Programming Programming] - A summary of available software from the (defunct) Shapoko wiki.
* [https://web.archive.org/web/20211127014103/https://wiki.shapeoko.com/index.php/Programming Programming] - A summary of available software from the (defunct) Shapoko wiki.
===G-code===
* https://lachiver.fr/Accueil/res/GrblPocketReference.pdf - GRBL V1.1 Pocket Reference, which lists all the GRBL supported commands, error codes and settings. 
* https://howtomechatronics.com/tutorials/g-code-explained-list-of-most-important-g-code-commands/

Revision as of 17:33, 15 June 2024

Back to Ian M's profile

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. 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 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 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 to brace the open corner. 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.

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.

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 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!

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.

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.

ToDo: Facing, pocketing, path milling

Useful links

CNC @ RML

3018 Specific

CNC Software

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

G-code