In February 2009 Ted, one of the members of the Hacklab.to (of which I am a member) in Toronto found a laser cutter for sale on craigslist for about $500. Seeing a deal too good to pass up, (they're close to $20,000 new) he bought it and transported it to the lab. Part of the electronics were missing and were apparently at a repair shop. We found out the following week that the ancient electronics were broken and could not be repaired... likely why the owner of the machine (a trophy shop) got rid of it. However, in a club filled with bright minds, we weren't too bothered by this problem, seeing it as an excellent challenge and opportunity to learn.
The machine itself is a Universal Laser Systems ULS-25P laser cutter, which contains a 25W CO2 laser which produces 10.6um IR light. The beam is focused onto the work with a lens assembly which moves on a 24" x 18" gantry style X/Y table. The table itself moves up and down on a motorized screw assembly, although this seems useful only for setting up the focus distance to the object to be engraved or cut, rather than to move during a job. Apart from the electronics, the rest of the machine looked to be in good condition. This type of system can be used to cut and/or engrave many types of materials including wood, glass, plastic and so on. Most metals won't work, and plastics which give off nasty chemicals (PVC) should not be used either. But for a club filled with geeks this type of machine offers lots of both technical and artistic possibilities.
After getting it up the stairs (thanks to a helpful construction worker from across the street) we started to poke around and see what we could learn about the machine. There are three stepper motors, one for each axis. The Y and Z use motors rated at 2.2V @ 2.2A. The X also has a 2.2V motor but only at 0.6A. Resistance measurements confirmed that the motors were in somewhat working order and within spec. Each axis has an optical slot sensor used for homing the axis. The laser itself is mounted on the back of the machine with its power supply below. A 25W laser requires about 400-500W of DC power to operate. Optics and mirrors guide the beam to the moving lens assembly which can travel anywhere over the cutting surface. A control cable inside the machine runs to the laser unit and provides signals to adjust the laser power and turn it on and off.
A Plan For Rebuilding the Machine
During the week following the delivery of the machine we discussed various options for getting it going, and I talked to one of my friends on IRC who is a laser expert to find out some safety information about IR lasers. There were several options discussed for bringing the machine back to life. The electronics were apparently not repairable so we looked into either buying an upgraded control unit, (expensive) buying an off-the-shelf stepper motor controller and building a laser controller, (less expensive) or just trying to build everything from scratch. (most interesting) We decided to try making new electronics from scratch as this would allow us to understand and control all aspects of the system, and repair it easily.
Some other problems with the machine are the physical size, and the fact that it needs ventilation to get rid of nasty smoke and fumes caused by etching or cutting various materials. Since Hacklab Toronto is quite small, it was decided that the most appropriate place for the machine would be in the bathroom. This will hopefully keep the noise and smell contained and not waste any precious space in the main room. It means that Hacklab no longer has a useable bathtub/shower, but that's not really the end of the world. I'm not sure anyone has taken a shower at the lab so far anyway.
Testing the Laser
A week or so after getting the machine Dan and I came into the lab on a Friday evening and decided to give the laser a try. We found some docs on a very similar model to our laser which indicated that a pulse-width modulated control signal of about 5kHz should be used to adjust the power to the laser. A 1us tickle pulse is required to keep the gas in the laser ionized but not actually produce any laser output. I made a quick Arduino program to generate a signal which I could control from a computer. It only took a second to burn through some paper. The laser worked!
Bringing it to Life
There were various aspects to getting the laser cutter working again so we divided the project into various parts. I would tackle some new electronics, Dan would look into software and control, Byron would take care of the physical infrastructure in the bathroom, and Steve would design and install the ventilation system. The following shows some photos from our rebuild project which took us a weekend. The final details were worked out over the following week or two.
Ventilation and Bathroom Infrastructure
Proper airflow is critical to getting good results from the machine, having less smell in the workspace, and saving the optics from damage from smoke. Some information we found suggested that more than 800 CFM of airflow was needed for even a small desktop engraving machine. Steve found a used furnace blower for a low cost and then picked up a whole bunch of 4" metal ducting at the hardware store. The blower was mounted on the bathroom ceiling above the toilet and vented directly outside through the window. It does a very excellent job of creating proper airflow across the cutting table inside the machine.
The machine is large and requires a dedicated space, so we decided to install the machine over the bathtub. To keep the bathtub from being damaged Byron built a strong platform to spread the weight out across the bottom of the tub.
We originally considered making control software to drive the motors and laser. But it quickly became clear that this task was more difficult that it first seemed. Dan did some research and found the emc2 software for Linux which is used by many CNC hobbyists. They have an active IRC channel and the software comes with support for many kinds of CNC machine types. emc2 handles timing for motors in software using a realtime Linux kernel. The distribution comes as a complete Ubuntu install CD containing the correct realtime kernel configuration. It was easy to get it installed on the Intel Atom machine that we built for the purpose.
More difficult was learning all the configuration of the system. emc2 contains a very flexible HAL (hardware abstraction layer) which can be used to map control signals in and out of the software. We use the parallel port to interface the computer to our control board. This provides enough lines to control three motors, the laser, reading the home sensors, and a few other things. The hardest part of setting up emc2 was programming the HAL and setting up the motor speeds properly. But once it is running it's actually quite easy to load files and run jobs.
Since the original electronics were deemed unrepairable, we figured that we should build something from scratch so that we could have control over all aspects of the system, and the ability to repair anything in case of problems. On the Saturday morning at the start of the project I went over to the local electronics store near the lab to see what they had in the way of power MOSFETs and PIC microcontrollers. I drew up some quick schematics for both a control board and a motor driver board. The goal of this design was to build the entire system from common parts that I could buy locally. This meant I could complete the boards over the weekend, and it would be easy for others to build similar systems easily in the future.
Motor Driver Board
The motor driver board is a set of six H-bridge drivers, two for each motor. The motors are 2.2v so we used +5V from a PC power supply to drive the steppers. This allowed for a few volts to be dropped across the FETs. Because I used somewhat low-cost FETs, the on resistance of each FET is high enough that it drops some voltage, which turns out to be almost exactly right for the Y and Z motors. For the X motor, we use some small power resistors to waste an additional volt or so. The 24 FETs each have small heatsinks as they can dissipate a few watts worst-case. Diodes are places across each FET to snub back-EMF from the motor coils. Because the supply voltage of the motor drivers is +5V, it's quite simple to drive them directly from TTL voltage levels from the control board. If higher voltages are used, level translators might be necessary. They board is simply driver circuits and doesn't do any current monitoring or regulation.
The control board consists of a PIC16F877A microcontroller acting as an I/O interface between the PC parallel port and all the machine controls. This includes generating the stepper motor sequencing for each of the three motors and the laser PWM signal. The emergency stop loop and system control lines (amp enable, charge pump) are implemented by the PIC also. This means that in case of emergency, the E-stop input will turn off the laser, all motors, and send the stop signal to the computer. The charge pump input accepts pulses from the computer which acts as a watchdog input. The computer has to send pulses continuously or the system shuts down automatically. This avoids the BIOS and device probing from turning on the system, and ensures that if the computer crashes, the system shuts down soon after.
The home sensors are wired through this board also, and a 74LS04 is used to buffer the very weak signals that their photo transistors output. And finally, the control panel parts which include indicator LEDs and laser power control/override switches are also handled by this board. The control panel was made from a thin piece of steel and made to fit in place of the original control panel. Since home-made control panels often look a bit retro anyway, we went all out and used some huge LEDs for the amp enable signal and laser on indicators. Toggle switches set the output power, and allow the laser to be forced off without adjusting the power setting.
Here are a few of the many tests that we ran during the first few days with the machine in operation. We used a lot of paper and cardboard as cheap test material. The laser cuts perfectly and doesn't even singe the edges of the material very much. We're still tweaking the system, but it's incredible how well it works. One of the most surprising things I found was the tiny size of the beam when focused properly on the surface. The depth of field appears to be large enough to cut cleanly through double-sided corrugated cardboard. It would be very easy to make models and parts that would normally need to be die-cut.
The following video is the very first test we ran with both motors and laser. We had no idea what was going to happen or whether it would work:
The following video is one of our first tests with the system fully installed. This is before the final ventilation and motor tweaks were made, but shows fairly good operation:
So far the major challenge has been occasional slipping/misalignment of the lens position during a job. This was mainly due to pulses from emc2 getting missed by the controller because they were too short. But even after this was corrected, there were still strange resonances in the X/Y gantry. We were advised that we should be half-stepping all the motors instead of full-stepping. This made an amazing improvement, and after adjusting the speed settings, we now get 0.002" steps and about the same speeds. And all the resonances and weird vibrations are gone.
Overall though I'm amazed at what we have been able to accomplish in such a short time. We're already discussing what else we can do with lasers. I've got my safety glasses ready for a less contained beam path!
© Copyright 2011 - Andrew Kilpatrick