Laser Engraver DVD
On instructables I found an interesting project - a low cost laser engraver. The workspace is a bit small but none the less it works and comes so cheap that most will be able to replicate the result.
You can buy a laser engraver on the basis of 2 DVD chassis for about 70 EUR on ebay. But it is more fun to build one yourself.
I am not the first one to describe such a unit, but I want to document mainly what other people left out.
The laser PWM (Pulse Width Modulation) electronics is home made (1 NPN Transistor, a 1 KOhm resistor, and a 470 uF/16 V capacitor). All other parts used are however easy to find (modules, wires, screws). The small engraver size (38 x 38 mm) and low power (200 mW) is a bit limiting, but the motivation is the fun of controlling such a machine.
A H-bridge driver like the popular L293 chip is not usable for the grbl CNC milling controller. Because of the time critical micro stepping for a better mechanical resolution, a hardware implementation like in the a4988 chip is better suited.
A word of warning is in place . This instructable is using a ~200mW laser. It might nut cut through chunks of wood but it will make you go blind if you are not careful. Never look into the beam, even reflections can be dangerous if focused. Please be careful, and use a safety goggle.
Enlarge the pictures by a mouse click on the picture.
I followed mainly those instructions.
Two DVD burner units are salvaged, to give the basic mechanic and the chassis for 38 mm movement in X/Y direction via bipolar stepper motor and lead screw.
Stepper motor, bipolar: typically 10 Ohm per motor coil (A, B).
Lead screw: typically 3 mm pitch, please see a data sheet
The first DVD housing is screwed on top (edge) of the second DVD housing with the help of two brackets.
The X-chassis is srewed with M6 x 30 mm screws on the vertical DVD chassis.
- Vertical about 9 mm (screw hole center) below the upper end.
- Horizontally centered.
Laser red or blue about 200 - 300 mW in a housing 12 mm diameter (e.g banggood.com Product ID: 1071157)
The laser should be mounted with a heat sink (e.g. banggood.com Product ID: 955963).
For a first test I used sticky double sided tape to mount it, front edge about 6 cm above the table.
The Y-chassis is screwed with M6 x 15-20 mm about 1 mm apart from the vertical DVD housing.
- Horizontally placed, that the center of the mounting bridge meets the center of the laser movement.
- In my case that means 25 mm (screw hole center) from the left.
The home switch could be already mounted by the manufaturer of the DVD-drive. If not, usually there is at the sleigh mechanism a switch, which can be used for that purpose. In my case at the Y-chassis, mounted with hot glue in place, see the picture on the right.
The table is a metal plate (for use of the magnets) 7 x 7 cm, sawed out of the housing of another CD/DVD-ROM drive.
- It is mounted with sticky double sided tape (1 mm thick) and a 3 mm thick 3 x 3 cm plastic plate.
- the 3 mm plate was necessary, in order to allow the table to move above the stepper motor housing.
- It is mounted with sticky double sided tape (1 mm thick) and a 3 mm thick 3 x 3 cm plastic plate.
In the optical head of the DVD drive there are two strong neodym magnets (10 x 7 x 2 mm), which can be used to hold the material to engrave in place on the table (in total 4 pieces).
The Arduino UNO (or clone) with motor driver shield (4 x a4988 modules, ebay.de Nr. 381839921150, about 16 EUR) can be mounted on the back side of the vertical DVD-housing, see the picture on the right. The low edge of the boards should be about in 10 cm height, to allow the placing of an used PC power supply underneath. On the right side there is a little breadboard with the laser driver.
A fan (usually 12 V supply) is useful to blow away the smoke while engraving (burning). A small fan can be placed above the laser, or a bigger one (e.g. 8 x 8 cm) at the side of the table.
Power supply for the Arduino UNO is the USB port. The stepper motor shield is fed with 5 V. The LASER is also fed with 5 V.
The electric connection of the Arduino UNO depends very much to the stepper motor shield use. In the reccomended case (Arduino UNO clone, CNC shield, 4 x a4988 modules with heat sink, ebay.de Nr. 381839921150) and the software grbl the following connections can be made:
Stepper motor X-axis to the CNC shield X-module.
It is important to know what micro stepping means.
Because the resolution of the DVD stepper motor is so low, 20 steps per revolution, normal is 200, with micro stepping with a factor of 8, the resolution can be expanded to 160 steps per revolution.
With a pitch of 3 mm per turn, one normal step means 3 mm/20 = 0.33 mm movement. With micro stepping factor 8 this can be improved to 3 mm/160 = 0.019 mm per step (at reduced torque).
According to this paper the torque reduces with factor 8 micro stepping to about 20% torque.
The maximum pulse rate at maximum torque is about 500 steps per minute (from datasheet).
A practical speed will be about 300 mm/min (F300) for movement without engraving, and about 30 - 50 mm/min (F30) for movement with engraving, depending on the material.
The picture on the right shows the Raspberry Pi icon, engraved in MDF material (backside of a laminate panel), see g-code data file raspberry.nc. The black trace is about 0.3 mm wide.
Home switch X to X- or X+ and GND (0 V).
Stepper motor Y-axis to the CNC shield Y-module.
Home switch Y to Y- or Y+ and GND (0 V).
The connection diagram for the a4988 modules can be found here.
The datasheet of the a4988 stepper motor driver with micro steps is here.
The schematic of the CNC-shield is here.
The assembly guide for the CNC-shield shows the details.
The jumpers for the Microstep resolution should be set to Eight steps (MS0 = MS1 = high = jumper set)
The Laser signal with PWM-control (Pulse Width Modulation, 5 V = active) is connected on the CNC-shield on pin Z- or Z+, which connects on the Arduino UNO on pin D11 (grbl name - Variable Spindle PWM).
The usual case is to use the dismantled red laser diode from the DVD drive. According to this site the following assumptions can be made:
- According to Sony’s product brochure for one of their high-power red laser diodes, SLD1236VL, the diode’s output power (CW or continuous power) will be somewhere along this list:
- x4 speed recoding – 100mW
- x8 speed recording – 140mW
- x12 speed recording – 200mW
- x16 speed recording – 250mW
- x16 Dual Layer speed recording – 300mW
- x24 Dual Layer speed recording – 400mW
You can also venture a really rough guess based on the date of manufacture if by some very strange reason no info about your drive is available on the Internet:
- 2002-2003 – x4 speed recoding – 100mW
- 2003-2004 – x8 speed recording – 140mW
- 2004-2005 – x12 – speed recording – 200mW
- 2004-2005 – x16 – speed recording – 250mW
- 2005-2008 – x16 speed recording Dual Layer – 300mW
- 2008-current x24 speed recording Dual Layer – 400mW
Another assumption is to calculate laser power from the current flow trough the diode, e.g. 100 mA is about 100 mW optical power.
Because the power loss of about 2.5 to 4 times the optical power is converted to heat, you need to use a housing (Aixiz module) and heat sink for the laser diode (5.6 mm diameter TO-18 standard housing), like the:
- 12 mm diameter x 30 mm lenght banggood.com Product ID: 1087544, 2 pc. 4.30 EUR.
Because that is not enough to lower the temperature in the diode to an aceptable level an additional heat sink with mounting capabilities is needed:
e.g. banggood.com Product ID: 955963, about 4,50 EUR), see the picture above on the right.
Another aspect of the laser diode housing is a collimating lens with adjustable distance to the laser diode, in order to focus the beam to a small spot. Please see the picture on the right for a good focused spot (distance laser front to material = 6 cm).
I am using a blue/violet (405 nm) laser module (banggood.com Product ID: 1092171, housing 12 mm diameter x 45.5 mm length, about 22 EUR) with a specified optical power of 1 W.
The supply voltage must be 5 V only.
Power, electric (measured): 5 V @ 350 mA = 1.75 W
When I look at the datasheet of a comparable laser diode, I see an electric power of about 5 W for 1 W optical power.
In reality this module will output about 1,75 W / 5 = 350 mW optical power
That is about 1/3 of the promised optical power.
From the CAD design to the engraving process you need some software. Because I am working with MacOS, I will describe mainly the software versions for this operating system. What I have selected for practical use:
grbl (host: Arduino UNO), a g-code-parser and CNC milling controller
bCNC (host: MacOS), a grbl CNC command sender, autoleveler and g-code editor
inkscape (host: MacOS), a vector graphics editor
Inkscape Laser Tool Plug-in, a converter for g-code output
It is now possible to compile and programm in the ATmega chip with the Arduino IDE (Integrated Development Environment). Before, you had to use several tools, which is more time consuming and error prone.
Actual software version is 1.1f (2017-01-31)
The documentation can be found in the grbl wiki.
Serial baudrate: 115200 baud 8N1 (USB port), the Arduino UNO clone has an USB chip Winchiphead CH340
- Because the USB driver does not come with the Arduino IDE, you have to install extra.
CH340 driver for MacOS Sierra 10.12.3, CH34x_Install_V1.3.pkg (2016-08-16)
If the Arduino UNO is active you can see in Apple Logo->About this Mac->System report->USB
->USB2.0-Serial, Product ID: 0x7523, Manufacturer-ID: 0x1a86
# Check for Arduino UNO present: $ ls -ls /dev/cu.w* 0 crw-rw-rw- 1 root wheel 19, 17 15 Okt 19:53 /dev/cu.wchusbserial14210
The software installation works as follows:
Download the archiv grbl-master.zip
- Unpack the archiv
Copy folder grbl to the path Arduino/libraries/
Exchange in libraries/grbl/ the file config.h with grbl-config.h (remove file prefix "grbl-")
Exchange in libraries/grbl/ the file defaults.h with grbl-defaults.h (remove file prefix "grbl-")
All changes in config.h and defaults.h are marked with CHANGE9
Create folder Arduino/grblUpload
Copy file Arduino/libraries/grbl/examples/grblUpload/grblUpload.ino to Arduino/grblUpload/
Now you can start the Arduino IDE and load program grblUpload.ino
Compile the program and upload into the Arduino UNO ATMega flash ROM
With the Arduino Serial Monitor (115200 baud) you can already enter some g-codes and machine codes:
# set grbl paramter $32 to Laser mode: $32=1 # set home direction inverse (X, Y): $23=3 # check paramters $$ ... $32=1 ... # Laser Focus adjust with GRBL 1.1f and PWM (Pulse Width Modulation, 1 KHz) $HX # Home X $HY # Home Y S1000 # Intensity 100% M3 # Laser always ON G1 X0.1 F50 # Laser ON (move +0.1 mm with speed 50 mm/min) S10 # Intensity 1% S100 # Intensity 10% M5 # Laser OFF
If the command HOME will show in the Status field an Alarm, just clear the Alarm with the command $X and try again.
If you want to use a ball pen for writing, the easiest way from the software point of view is to use the Z-axis with stepper motor. Usually you have an Arduino motor shield with 4 modules A4988 driver, so it is easy to use a third channel for the Z-axis. Just the software has to be changed.
# set grbl paramter $32 to pen mode: $32=0 # set home direction inverse (X, Y, Z): $23=7 # check paramters $$ ... $32=0 ...
The Python program bCNC is the Swiss army knife for CNC handling with g-code.
The documentation can be found in the bCNC wiki.
The program is started with a double click on the command file start_bCNC.command.
It is an advanced fully featured g-code sender for GRBL. bCNC is a cross platform program (Windows, Linux, Mac) written in python.
The sender is robust and fast able to work nicely with old or slow hardware like Rasperry PI (As it was validated by the GRBL maintainer on heavy testing).
For manual control, you can jog the laser in steps, and send g-codes in a virtual terminal, which logs the text of both data directions.
Connect to Arduino UNO serial port:
Click in the header line to ' File and the Connect mask will be shown, see the picture on the right.
Click on the arrow on the right side of the Port field, and a list opens with all available serial ports. Select the one of the Arduino UNO. In my case it is /dev/cu.wchusbserial14950
Click on the cable plug icon to open the connection. After a few seconds you should see in the Status field the message Connected.
Select a g-code file
Click on the folder icon to select your g-code file, for example raspberry.nc, and click on open. The file will be loaded and the content will be shown in a graphical form, as you can see in the picture on the right.
In order to see your draft details, click on your object in the work frame, then click on icon Toggle display of camera (above the window), next click on icon scale to screen size (above the window).
The red circle is the coordinate 0 point.
Regarding the X/Y coordinates, there is a convention that on machines which adds material you use the first quadrant in the XY coordinate system (+X, +Y). On machines which remove material, like mills, you use the third quadrant in the XY coordinate system (-X, -Y).
A useful feature is the Control->scan function, which moves the laser along the red frame, which surround the drawing.
The feature Editor->Statistic will show the statistics of the data file, e.g. maximum dimensions, path length, etc.
When you are sending the g-code file to the Arduino UNO (program grbl) bCNC will show the estimated time for engraving, and what is the actual completion status in time and percent.
Inkscape is a professional vector graphics editor for Windows, Mac OS X and Linux. It's free and open source.
The documentation can be found here.
For installation of inkscape under MacOS Sierra you should look here. I did not manage to install inkscape version 0.92 with macports. Therefore I installed version 0.91.
The start of X-Quarz and Inkscape is really slow, so have patience.
In order to export a g-code file you need the Laser Tool Plug-in, see next chapter. In order to use it in inkscape, make a line drawing and export it with menu Extensions->Generate Laser Gcode.
Known quirks: Because Inkscape runs on X11's architecture, keyboard shortcuts use Ctrl (^) instead of Cmd (⌘) as modifier key. This will change in future versions.
Standard unities in mm: click on File->document settings->common->Standard unities: mm
Unfortunately you have to renew that after each new start of inkscape.
Convert object to path: in order to get a g-code file, you need to convert each object to a path.
e.g. if you want to create a rectangle: click on icon rectangle and draw a rectangle.
right click on the filled rectangle and select filling, click on the cross "X" to remove the filling.
with the activated rectangle select menu path->convert object to path
select menu extensions->Generate Laser Gcode and click on Apply to generate the g-code file.
for the installation of the extension see #plugin_Laser_Tool.
plugin Laser Tool
The Inkscape Laser Tool Plug-in (version 1.7, Python) was developed by Aaron Spike in 2005, and extended in 2015 by Jay Johnson of J Tech Photonics.
The documentation can be found on this page.
You can download the archiv JTP_Laser_Tool_V1_7.zip and expand it in path ~/.config/inkscape/extensions/. There is an dxf import converter and the Laser Tool Plug-in.
For laser engraver use there is a little problem with the G04 Pxxx time delay command. On http://reprap.org G04 Pxxx the "xxx" is defined in milli seconds, while on http://linuxcnc.org it is defined in seconds, like gbrl does so. The default value in the Laser Tool Plug-in is unfortunately 100, so in grbl a 100 ms time delay will show up with a 100 s delay time. The fix is easy:
# file laser.inx edit line 13 from (ms or s) in (ms) # file laser.py edit line 3165 from "self.options.power_delay" in "str(int(self.options.power_delay)/1000.0)"
As an example I provide for download the example file raspberry.nc. The engrave speed ist set to F30 (30 mm/min).
If you use thin paper (about 0.08 mm thick) it is possible to cut the paper with a speed of F200 (200 mm/min). Then a cut run needs just about 4 minutes instead of 16 minutes with speed F30, see the picture below.
Another example is the aircraft Spitfire, cut out from a 'foam rubber plate, 2 mm thick, see the picture in chapter #inkscape. This plate can be obtained from a local hobby shop, in several colors and thickness. I selected dark brown as color, because you need less laser power to cut, the darker the material is and the color away from the laser color (about 650 nm to 405 nm).
List of pages in this category:
-- RudolfReuter 2017-02-05 16:14:11