Professional Documents
Culture Documents
Arduino Laser Engraver PDF
Arduino Laser Engraver PDF
Table of Contents
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
http://www.instructables.com/id/Arduino-Laser-Engraver/
Author:getburnt Get Burnt
I'm a young engineer from Australia
This machine can engrave wood and cut paper. I haven't tried other materials yet because there is no fume extraction capability - plastics generally create toxic gases
when burnt.
SAFETY WARNING - Please be safe when using lasers. The laser used in this machine can cause permanent eyesight damage, and probably even blindness. When
working with powerful lasers (>5mW), always wear a pair of laser safety glasses designed to block your laser's wavelength.
For a quick overview of the guts of the machine, have a look at the video below
(Note: The machine runs slightly faster now, and also has a different laser heatsink to the one in the video)
Also, for any Aussies unsure about the laser import laws, I've attached the current rules (at Dec 2013) below. Laser diodes and laser modules (such as the one in this
machine) are legal , however laser pointers are prohibited.
This is a pdf version of the following webpage: http://www.customs.gov.au/site/page4372.asp
Image Notes
1. Frickin laser beams!
File Downloads
http://www.instructables.com/id/Arduino-Laser-Engraver/
parts_and_prices.xls (30 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'parts_and_prices.xls']
The y-axis is on the bottom of the machine, and provides a moving base for the engraved piece. The x-axis is on the top , and moves the laser assembly (the laser isn't
shown in the model).
I chose to use ballscrews due to their very high accuracy (minimal backlash), rigidity and efficiency. Since the ballscrew nut consists of ball bearings rolling in a track
against the ballscrew, there is very little friction, which means the motors can run at higher speeds without stalling.
The second photo shows a test fitting for the x-axis. On either side of the ballscrew is a linear bearing on a steel shaft. This configuration is quite common for cnc
machines, and provides a stable foundation for the base plate (Y-axis) and laser assembly (X-axis).
The parts I used are:
16mm hardened chromed shaft , 500mm length (qty: 4)
16mm linear bearing - SC16LUU (qty:4)
16mm shaft support - SK16 (qty:8)
The ballscrew nut's rotational orientation is locked using a piece of aluminium (this is how we spell it in Australia!) angle attached to the moving component of the
axis. This can be seen in the last photo, which shows the y-axis. The base plate is fastened to the two linear bearings, and to the ballscrew nut (through the aluminium
angle). Rotation of the ballscrew shaft results in the linear motion of the base plate.
http://www.instructables.com/id/Arduino-Laser-Engraver/
Image Notes
1. The most important tool
I chose to use these posts because they are easy to cut and drill, and also hold their shape well when supporting heavy loads. In addition, because they are square, they
provide excellent reference surfaces to make sure things are parallel / perpendicular.
The holes were drilled using a cordless drill, and the posts were cut using a mitre saw. (It is also possible to cut the aluminium posts with a hacksaw).
M5 socket head cap screws , and M5 nuts were used to hold most of the parts together. I didn't use a permanent fastening method because I wanted to keep
everything adjustable. Using screws also means that the machine is easy to disassemble and modify for future upgrades.
Some pictures of the frame being built are above. The base of the Y-axis is made up of several A4-sized 4.5mm thick clear acrylic sheets .
http://www.instructables.com/id/Arduino-Laser-Engraver/
Step 4: Stepper Motors + Drivers
After some poor results with NEMA 17 stepper motors in an earlier design, I decided to use some NEMA 23 motors with a decent torque rating for this machine. Strong
stepper motors also require strong drivers to get the most out of them. As a result, I chose to use a dedicated stepper driver for each motor .
For each axis, the motor directly drives the ballscrew through a motor coupler . The motors are mounted to the frame using two aluminium angles and an aluminium
plate. The aluminium angles and plate are 3mm thick, and are strong enough to support the 1kg motor without bending.
Note: It is really important to correctly align the motor shaft and ballscrew. The couplers I used have some flex to compensate for minor errors, but if the alignment error is
too large, they will fail!
http://www.instructables.com/id/Arduino-Laser-Engraver/
Image Notes
1. Failure is always an option...
The laser diode requires a heatsink , when running at high power levels. I used two SK12 12mm aluminium shaft supports, to both mount and cool the laser module.
The intensity of the laser output is dependent on the current that goes through it. The diode by itself cannot regulate current, and if connected directly to a supply, it will
draw more and more current until it destroys itself. So, a regulated current circuit is required to protect the laser diode and control its brightness. A circuit diagram of my
laser driver is above.
This circuit requires at least a 10V DC supply, and has a simple on/off signal input, which is provided by the Arduino. The LM317T chip is a linear voltage regulator, which
has been configured as a current regulator . A potentiometer is included in the circuit to allow the regulated current to be adjusted.
R1 and R2 together control the value of the regulated current. The range of current outputs for this circuit are:
R1+R2 = 1ohm: 1.25A
R1+R2 = 6ohm: 0.21A
The NPN transistor is used as a switch . When there is a 5V output from the Arduino, the circuit will turn on the laser. When there is a 0V output from the Arduino, the
circuit will switch off the laser.
I used veroboard (stripboard) to mount all the laser driver components. Heatsinks were also installed on the LM317T and NPN transistor. Solid core 22 AWG wire was
used for connections between different points on the veroboard.
http://www.instructables.com/id/Arduino-Laser-Engraver/
Image Notes
1. Do not forget to use these!
I bought OD4 190-540nm laser safety glasses to reduce the 445nm laser output to
a safe level
Image Notes
1. These heatsinks are probably overkill, but they look like tiny skyscrapers :)
2. 5ohm potentiometer
3. Ignore this half of the board
The laser driver requires a supply voltage of at least 10V, with current of at least 1.25A. I used an ATX PC PSU as a 12V power supply. The laser driver is connected to
the PSU through a breakout box that I made, which provides standard banana jacks for +5V and +12V terminals. The box also has analog ammeters for monitoring
current. For instructions on how to create an ATX PSU breakout box, there are a number of other instructables on this site.
http://www.instructables.com/id/Arduino-Laser-Engraver/
Image Notes Image Notes
1. Piggyback banana plugs 1. Backlit labels for the ammeters
(left is for 12V, right is for 5V)
Image Notes
1. Lab power supply
2. ATX PC PSU
3. Breakout Box for ATX PSU
An important thing to remember is that the grounds for all components should be connected together .
I used solid core 22AWG wire for signal lines and power cables. For power cables, the power supply ends were terminated with banana plugs .
http://www.instructables.com/id/Arduino-Laser-Engraver/
Step 8: Software (Raster Engraving)
When I originally designed the machine, I only wanted it to engrave regular bitmap picture files. So, I made three separate programs , which when used together, allow
normal bitmap pictures to be engraved onto wood.
This accepts a bitmap file and outputs a text file , containing "instruction characters". The bitmap type it accepts is a 24-bit bitmap , with only black and white pixels
(no greys / colours). The program analyses the bitmap, scanning row by row for the black pixels that need to be engraved. First, it scans the top row left-to-right, then
drops down one row, scans right-to-left, drops down another row, scans left-to-right, and so on, until the last row is scanned. It can skip blank pixels on the edges of the
rows, and can skip blank rows . Also, due to the Arduino serial buffer limitations, the program divides the text file into comma separated "instruction blocks", which are
under 64 characters long. These numerical instructions are interpreted by the Arduino (see Arduino Sketch section for details).
This program works well for smaller images (eg less than 1000 x 700), but gets bogged down with larger images that have lots of burnt pixels (can take over 10 minutes
to generate the instruction file).
The way that this program scans the image carries over directly to the way the machine engraves the image. The Arduino uses the instruction file to make the machine
engrave the image row by row.
Sample Comma Separated Instruction Blocks (to see what the numbers mean, scroll down to the Arduino sketch section):
111111111111111111111111115555555555555555555555555555555555920,
019201920192010101010101010101010101010101010101010101010101010,
010101010101010101010101010101010101010101010101010101010101010,
0101010101010101010101010192019201920,
11594039403940394039403940303030303030303030303030303030303030,
030303030303030303030303030303030303030303030303030303030303030,
0303030303030303030303030303030394039403940394039403940,
A simple Processing sketch was created to stream the contents of the instruction file .
The data is streamed via a virtual serial port connection to the Arduino. The sketch sends the comma separated instruction blocks, one block at a time , with a delay
between blocks . These delays are calculated at run time, based on the contents of each instruction block. The delay is needed to ensure that the Processing sketch
doesn't send new instructions to the Arduino before the previous instructions have executed. If this occurs, the engraved image will be corrupted, so the timing values
used in the Processing sketch and Arduino sketch have to be compatible.
The Processing sketch also provides a progress status, by counting the total number of instruction blocks, and continuously reporting how many instruction blocks have
been sent to the Arduino.
The Arduino sketch interprets each instruction block. There are a number of instruction characters:
1 - Move RIGHT by one pixel FAST (blank pixel)
2 - Move RIGHT by one pixel SLOW (burnt pixel)
3 - Move LEFT by one pixel FAST (blank pixel
4 - Move LEFT by one pixel SLOW (burnt pixel)
5 - Move UP by one pixel FAST (blank pixel)
6 - Move UP by one pixel SLOW (burnt pixel)
7 - Move DOWN by one pixel FAST (blank pixel)
8 - Move DOWN by one pixel SLOW (burnt pixel)
9 - Turn laser ON
0 - Turn laser OFF
r - Return axes to start position
With each character, the arduino runs a corresponding function, to write to the output pins.
The Arduino controls the motor speed through the delays between step pulses . Ideally, the machine would run the motors at the same high speed, whether its
engraving a pixel or passing over a blank pixel. However, due to the laser diode's limited power, the machine has to slow down slightly when burning a pixel . This is
why there are two speeds for each direction in the instruction character list above. Currently, I have configured the machine to pass over a blank pixel in 8ms , and to
pass over a burnt pixel in 18ms .
File Downloads
http://www.instructables.com/id/Arduino-Laser-Engraver/
processing_sketch.zip (763 bytes)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'processing_sketch.zip']
arduino_sketch.zip (1 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'arduino_sketch.zip']
Step 9: Software (Vector Mode)
The machine is compatible with the very cool Grbl Arduino software.
Grbl has been designed to control 3-axis CNC milling machines . It interprets G-code instructions, and outputs control signals for X/Y/Z axis stepper motor drivers and
the spindle.
For the laser engraver, the X and Y axis stepper drivers are connected to the relevant pins on the Arduino. The Z axis outputs are ignored.
The laser driver is connected to the spindle enable pin on the Arduino. To turn on the laser, the M03 code is used. The M05 code disables the laser.
(These are usually the codes to turn on the spindle (clockwise) and turn off the spindle)
The video below shows the machine engraving a vector drawing with Grbl.
Final Thoughts
Overall, I think this project was worth the time and effort. I gained a lot of knowledge that can be transferred to future projects. Probably the most useful thing I learnt is to
make sure all the parts can work together effectively - if there is a weak component, it has the ability to limit the whole machine, due to dependencies between
components. For example, the motors have to be strong enough to move the axes, but then the frame has to be strong enough to hold the motors, and so on...
There are also a few future updates that would make the machine better:
- Install a stronger laser to speed up the machine
- Add limit switches on both axes to protect the machine from crashing into itself (haven't had a crash yet, but it is inevitable without limit switches)
- Refine the C sharp program, so that larger images don't take 15min+ to process into instruction files
Image Notes
1. Guess the car
2. The actual size of this image is 12cm x 7.5cm
http://www.instructables.com/id/Arduino-Laser-Engraver/
Image Notes
1. Look familiar?
Related Instructables
Advertisements
Comments
30 comments Add Comment
First, you will need the Processing IDE installed on your computer (link is on step 8). Currently, I am using version 2.0.1 32-bit, with the Serial library.
(Serial doesn't work with the 64-bit version at the moment)
From Step 8, download and extract "CNC Image Program.zip" to a folder on your computer (eg C:\CNC Image Program). There should be three files in
the folder
Prepare a 24-bit bitmap file. Find a picture, convert it to black and white only (eg use GIMP / Photoshop to dither it to a 1-bit image) then save it as a 24-
bit bitmap.
From Step 8, download and extract "processing_sketch.zip" to somewhere on your computer (eg C:\). Run the file "textfilestreamer2.pde". The
Processing IDE should start, and ask you if it can move the file into a folder. Click yes/ok, and the .pde file will be in a new folder (eg
C:\textfilestreamer2\texfilestreamer2.pde)
In the folder, create a new folder called "data" (eg C:\textfilestreamer2\data) Copy the generated file, cncinstructions.txt, into the data folder
From Step 8, download and extract "arduino_sketch.zip" to somewhere on your computer (eg C:\). Open the .ino file and upload it to your arduino. Also,
the Arduino needs to be configured to use COM3
After all these steps, all you need to do is click run in the processing sketch. It will open a serial connection to the arduino, and begin sending
instructions. The arduino will interpret the commands and move the motors / control the laser.
http://www.instructables.com/id/Arduino-Laser-Engraver/
getburnt says: Dec 1, 2013. 3:07 AM REPLY
My laser's a bit too weak for metals, and even the 100W laser tubes probably can't do it. A CNC plasma cutter would probably be the best solution!
There are some examples on Youtube, such as http://www.youtube.com/watch?v=Hx5alADaTpI
Would you be able to use smaller/faster/cheaper motors at least for the X axis if you were only moving a 45? mirror and had the laser and heatsink affixed to
the side?
When I tried NEMA 17 motors previously (in something else), I didn't have proper stepper drivers - I used a ULN2003 chip to manually switch coils on/off
through an Arduino. This was a relatively low performance way to make the motors move, so I probably didn't get the most out of those motors.
Also, I chose NEMA 23 motors because they are a bit more versatile. Stepper motors lose most of their torque at higher speeds, so stronger motors
usually have a wider range of usable speeds (when a load is applied).
"Laser modules, laser diodes and laser lighting" (and stinkbombs!) can be legally imported. So if you were to order the same laser diode/module as the
one in this instructable, Customs wouldn't be allowed to seize it, because it isn't a laser pointer. If they did consider it to be a weapon, then they would
have to class every single Blu-Ray player in the country as a weapon!
Also, if someone in Australia did import a high power laser module, and used it to create a laser pointer, then that would be illegal. I think to be
considered a laser pointer, it must be portable / handheld and battery powered. My machine isn't exactly handheld (it weighs more than it looks) and
can't run on batteries, so I think I'm safe :)
http://www.instructables.com/id/Arduino-Laser-Engraver/
jiajunwang says: Dec 1, 2013. 6:51 AM REPLY
Great project! But since the process does not involve contact (hence no force), it seems a bit unnecessary to use stepper motors as powerful as yours.
http://www.instructables.com/id/Arduino-Laser-Engraver/