A Raspberry Pi controlled mini CNC Laser engraver [last update Jan 18,2014]

About the capability of the engraver
Due to the size limit of DVD drives, the machine can only engrave within an area of 36 mm by 36 mm.. So it can do little pieces of wood, plastic board or part of  iPhone cases, but not any larger.
The laser used here is 200 mW 650 mm red laser diode. It cuts letter paper fine. But It is not powerful enough to actually cut through anything thicker and tougher. In fact, the working surface is preferred to be black color so that it can absorb as much laser power as possible. To engrave on transparent plastic board, as shown above in the coin size university icon picture, I have to use a black marker to paint the surface and clean the ink after engraving. However, I believe for a thin black foam sheet (<3mm thick), and given enough engraving time, the laser should be able to cut it through, as Groover showed in instructable.
 A Raspberry Pi controlled mini CNC Laser engraver [last update Jan 18,2014]

Now here is the instruction.

Things required:

1. A raspberry pi (running Raspbian or what ever supports GPIO)

2. two DVD writable drives.
To be able to engrave, you need 200mW laser diode from DVD writer. A DVD R or CD R will do nothing. A CD writer might be OK in term of power (~100mW), but the laser diode of a CD writer is infrared, which can be super dangerous (you can't see it!).3. a TO-18 5.6mm laser housing
(like this one http://www.ebay.com/itm/251316903193?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649)
Make sure you get a 5.6mm one. There is another type 9mm.

4. Two dual channel H-bridges.A H bridge is a circuit containing four (effective) switches that can apply a voltage across a load (DC motor or one coil of a stepper motor) in either direction.

Stepper motors from DVDs are 4 wire 2 phase bipolar stepper motors. They require truly reversible voltage on each pairs of the wire. You need two H bridges for each stepper motors. So total of four H bridges for two strepper motors. Some famous stepper motor controllers like ULN2003 are for the 5 wire stepper motors, so they cannot be used for controlling the DVD stepper motors.

You can make your own H bridges by using 4 NPN and 4 PNP transistors and probably TTL converters (RPi's GPIO pin are 3.3V so logic TTL chips might be required). Or you can simply buy them. There are a lot of integrated H bridge circuits available in the market, such as L298. The ones I use are L9110s Dual H Bridge purchased on Ebay (like this one: http://www.ebay.com/itm/350877288713?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649). They are low cost (~$2 each), compact (.8″x1″) and are powerful enough (~800mA). However, if you buy from a Chinese seller, shipping can cost 3 weeks.

L9110s is also sometimes known as HG7881.

Regarding the H bridge, you need to make sure that the continuous current limit of the circuit is greater than 500mA. Usually the stepper motor in a DVD drive is rated at 5V and each coil has a resistance of 10ohm. So the current through each coil would be 500mA! A very large current!

5. a LM317 regulator, a power NPN bipolar transistor (like E3055, should be able to handle continuous 200mA at least), some resistors, capacitors and a bundle of jumpers.
The LM317 is for the laser driver. The power NPN is for making a switch for the laser. My lab has tons of these components so I don't have buy them. If you don't want to solder a driver by your own, you can surely buy a laser driver for <$5. The laser driver need to be able to output at least 200mA at 2V and have the function of enable/disable.

If fact, it will be a better idea replacing the NPN bipolar with a MOSFET transistor. There are a lot of them available on the market and are very inexpensive. Just make sure that the continuous current supported by the MOSFET is above 200mA.

6. a solder gun, screw driver and some basic hard wares.

STEP 1: Disassemble DVD drives (writers)

There are a lot of picture/video tutorials online for this step so I will keep it short.
2. Laser diodes (see picture below). Be very careful
 that the laser diodes on the DVD are very fragile.
 Make sure you don't break them.
There are other good things you can salvage from the DVD drive and keep for future projects, such as a 9 V dc motor near the gate, a brushless motor that spins the DVDs, some shock reducers and some miniature lens and optic parts. You can also find four strong magnets near the laser diode. Don't throw them away. They will turn out to be useful later.

STEP 2: Assemble Laser

Now you have two laser diodes. One is infrared which we don't need. The other one is 650nm red diode (usually has a letter ‘R' on it) and is the one we need. The diode normally has three pins forming a fat triangle. One is NC. You need a multimeter to figure out which two pins are cathode and anode. The forward voltage across anode and cathode should be around 1.4V and the forward resistance should be 20-40k ohm. If the forward resistance is too high then the laser diode is over used.

Carefully put the laser diode into the head of the laser housing. You can use the laser housing body to help knock against the diode and push the diode into the housing head. The diode should fit perfectly into the head. Make sure the pins are still fine. Then solder two wires to the electrodes and assemble the housing together.

STEP 3: LM317 Laser drive

A laser diode is like a photodiode but equipped with a resonant cavity. Laser diode is a huge current sink. Once the diode conducts, it generates a lot of heat, and the heat further lowers the diode impedance. So it is a unstable positive feedback system. If you simply put a 1.5 V battery across the diode, you will either get the diode burn or battery drained right away. We need a laser driver that can output a constant current to the diode.

There are numerous way to do this. One of the most popular and least frustrating way is to use a DC current regulator. LM317 is a good choice. By adding a resister R across the adjust pin and output pin, LM317 can output a constant current of ~1.25V/R.

[In fact, LM317 is mostly used as a voltage regulator. It maintains a 1.25V across the output pin (pin 2) and the adj pin (pin 1). Meanwhile, it controls the current output from the adj pin to be very low (usually <100 uA). Therefore by adding a resistor R across pin 2 and 3, we can have 1.25V/R current output from pin 2 to pin 1. We then add the laser diode across pin 1 and GND. Since pin 1 is forbidden to sink current, all the 1.25V/R current outputted by pin 2 will flow through R and laser diode to GND. The official datasheet of LM317 can be download here .

In my case, I replace the two parallel 10 ohm resistors by two .5 Watt 12 ohm resistors. The max current I am going to run through the diode is 200mA.
Make sure you don't mess up the adjust pin and the output pin. A heat sink would be necessary on the LM317.
You also need a switch that can be controlled by RPi. I used a power NPN E3055 transistor. You can choose what every you want, just make sure that the transistor can support continuous CE current >300mA and also put a heat sink on it.
Laser diodes are very delicate device. They are extremely vulnerable to the condition applied on them. Unstable voltage or current, excessive current/voltage (even for very very short time) could damage them permanently. So always discharge yourself before holding the diode, and always use a constant current driver to power it. As pointed out by one of the reader (thank you, J super), you might also damage the diode by connecting the driver to power supply first and then connecting the diode to the driver. The diode should always be connected to the driver before applying any power to it.

A Raspberry Pi controlled mini CNC Laser engraver [last update Jan 18,2014]

STEP 4: Assemble the machine

Now you have two identical linear stages and it is time to put them together! There are a lot of ways to do this. For 2 axes CNC machine, I think the best way is the one given by Groover @ instructable. In Groover's configuration, the engraving sample is attached to x-axis so it only moves in x direction. The laser is attached to y axis so it only moves in y direction. This configuration minimizes the weight on each of the axes.

I cut a 2″x2″ steel board out of the DVD case and glued it to the x-axis stage as the sample support base. Since the DVD case is made from iron, you can use the strong magnets salvaged from the laser optical system to help you stabilize the engraving sample on the base.
The laser diode will generate a lot of heat . And it is important to dissipate this heat.  Otherwise the diode will die fast. I cut a 1inch cube heat sink from an old computer CPU heat sink and drilled a hole though it. The hole is perfectly large to hold the laser. I glue the heat sink on the y axis stages.
The most important issue is the x axis, y axis and body of laser have to be perpendicular to each other.

STEP 5: Connect H-Bridge to the stepper motors

The stepper motor in DVD is a 4-wire 2-phase bipolar motor. There are two independent coils inside. Each coil has a 10 Ohm resistance. Usually the DVD stepper motors are rated at 5V. Therefor the rated current through each coil is 500mA! The RPi GPIO pins can only output less than 20mA so RPi cannot control a stepper directly. H bridges are required.

For more detail: A Raspberry Pi controlled mini CNC Laser engraver [last update Jan 18,2014]


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top