Introduction (this article is under construction)
Having been impressed by the bond film, Goldfinger, many years ago I have decided to try to make a laser cutter. (Actually, I had access to a laser cutter some time ago and found it a very useful piece of kit. For example, I used it to cut the customised instrument panels for my TR7-V8 project.) Also, many years ago, I had been fascinated by home-made laser projects described in the The Amateur Scientist pages of the Scientific American (at the time, pre 2001, when it was a really good mag). Sadly, making a CO2 laser is probably beyond me now (it require glass blowing, vacuum technology etc.) but I should be able to have a decent stab at a cutter if the numerous YouTube videos describing how it can be done are anything to go by.
Below are some things I did when I had access to a laser cutter. It could cut 3mm Perspex and MDF easily but would not touch metal. Top left: The basic arrangement of a laser cutter with a stepper motor for each axis (X & Y). Top right: I designed the parts for the TR7 switch panel on CorelDraw. A printer driver for the laser cutter was loaded on my laptop and transferring the design to the cutter was as simple as any print job. Below, bottom left: The logos for the switches which were glued into the black panel with corresponding cut outs. Below, bottom right: The panel installed in the car. The logos were illuminated by LEDS glued to the back of the panel (I describe this in more detail on my old site, www.mr-r.co.uk).
It strikes me that a laser cutter is in some ways easy to build, compared to, say, A CNC milling machine which has to have enough strength to press a rotating cutting tool against a piece of work and also move a heavy motor around in three dimensions. The laser cutter just needs to move some mirrors and a lens around in two dimensions. Hence the motion can be controlled by a toothed belt rather than a lead screw and nut. There is, of course the difficulty of lining up and focussing an invisible beam of light with the potential to blind or start a fire!
As far as I can see, all laser cutters are XY, Cartesian coordinate type machines. Not being averse to a left field solution, what other configurations are there that will be able to cover every point on a rectangular area? For example, something like the human arm pivoting at the shoulder and elbow would be possible. The business end is only supported by the levers and the two pivots which would have to be very rigid and free from play. Also I’m not sure how the laser mirrors would be arranged. Another configuration could be the delta arrangement used on some 3D printers. I’m not sure how the mirrors could work with this either. So Cartesian X-Y it is!
It would seem that by far the most popular way of making a laser cutter or similar is to make use of aluminium extrusions developed by OpenBuilds which feature V-edged grooves which can guide sliding carriages running on specially profiled wheels. These extrusions come in various different multiples of a basic 20x20mm base configuration. I have chosen 20x40mm versions as the carriages will run on the 40mm side providing a more accurate location than a 20x20mm extrusion. They will also be more rigid.
There seem to be two ways to cause a stepper motor to drive a carriage across an extrusion (see above). One way is to mount the stepper motor at the end of the extrusion and have a loop of drive belt the lenth of the extrusion with an idler wheel at the opposite end to the motor. The carriage is fixed to the belt at one point and is pulled back and forth as the bet moves. The other method places the motor on the carriage with a fixed belt which acts as a sort of rack to the drive wheel on the motor’s pinion. The belt passes under the wheels of the carriage and up (or possibly down) round the drive wheel on the motor making sure that sufficient teeth are in contact to ensure a secure drive. Which is better? (Answers on a postcard…)
The principle behind a stepper motor is quite simple; some electromagnets are turned on and off so as to drag magnets round and round. (I made a YouTube video – see below- which demonstrates this simple principle. However, the details of driving the coils of the electromagnets at speed is a different matter and the theory of driving quite high current pulses into inductances might have been accessible to me when I was at college many years ago but now… not so much!
More complexity involves fractional steps, when the magnets are not just dragged round to be exactly opposite one pole but are somewhere in between two. There may be up to 32 fractional steps. A half step is easy, adjacent poles are turned on so the magnet hovers halfway in between but 1/32 from one pole and 31/32 from the next must be tricky for the electronics driving the coils! Fortunately, clever ICs have been developed and Pololu (who seem to have a big share of the market) have incorporated them onto small breakout boards which can easily be incorporated into other circuitry.
Choosing the right Stepper Motor
I’m not sure how to choose the right stepper motors. The loads are light, so nothing very large should be necessary. NEMA 17 seems to be appropriate. The 17 in NEMA 17 – (National Electrical Manufacturers Association), just seems to refer to the diagonal distance between the fixing holes, in this case 1.7 inches. I am using Motech Motor type MT-1704HSM168A supplied by Ooznest. These are 0.9 degree per step motors (400 steps / revolution). Most seem to be 1.8 degrees (200 steps). The more steps, the better the resolution but, perhaps, the slower the speed? Time will tell whether I have made the right choice!
Electronics and Software etc.
2D and 3D CAD programs (my laser cutter will only need 2D design) will output vector graphics designs as files in svg or dxf format. These will have to be converted to a G-code file which contains instructions for the movement of stepper motors etc. tailored to the CNC machine being used. The CNC machine needs its own computer with software which can read the G-code instructions and send the required pulses to the stepper motor driver circuits.
Arduino Uno provides the Brains
At this stage, this is how I see the electronics and software for this project developing. I am going down the open source route. I intend to use an Arduino Uno flashed with GRBL motion control software. An Arduino CNC Shield will sit on the Uno and provide sockets for the Pololu stepper drivers and various jumpers which can be used to customise the operation of the whole kit and caboodle (see picture above – the Uno is under the CNC shield).
Not so Banggood
As an aside, I really feel for the guy who originated the CNC Shield. This is a quote from his site: “Due to Chinese Clones being sold for less than $5 and pricing me completely out of the market (and them not contributing to the project) I have decided to not publish future versions (of) design files.” And its true, on sites like Banggood you can find shields with clones of the Pololu drivers for peanuts. Apart from a lack of manufacturer’s logo, they look absolutely identical.
Of course, this is everywhere. Arduinos and similar have been cloned for years. I once bought a cloned Ethernet Shield, it was about £10 cheaper than a genuine item and I have felt (a bit) guilty ever since. This is, perhaps, the one area, the stealing of intellectual property, where I have a bit of sympathy for Trump. Did I just write that? UGH!
Add in a Raspberry Pi
I hope use a Raspberry Pi to send G-code to the Uno via a USB/serial connection. The Pi will run bCNC “Swiss army knife for all your CNC/g-code needs”. (Universal Gcode Sender is, I believe, an alternative.) Also, keeping things Pi-based, I could use Inkscape running on the Pi to do the required CAD work or I could send files to the Pi from my PC over SSH etc.
Testing GRBL , the CNC Shield & Drivers
While waiting for some parts to arrive, I started to load some software. Flashing GRBL to the Arduino proved to be straightforward following these instructions and I was able to issue some G-code instructions (for example: G0 X100 or G1 Y-50 F100)) using the Arduino IDE Serial Monitor and see a stepper motor run. The “running” did not seem totally right – sometimes it would seem to stop before it’s allotted number of steps had been run. Then I guessed that the DRV8825 might be overheating and shutting down while it cooled off. (As a person who had to use a pair of pliers to conduct the heat away for the leads of germanium transistors while soldering to prevent them being permanently cooked, I still can’t quite believe semiconductors can get so hot and still work!)
The problem was, I believe, A failure on my part to set the current limit. The easiest way to do this is to measure the voltage at a through hole connection on the Pololu PCB. I put a piece of 30 gauge wire through the hole to make contact and measure between this and ground. Twiddle the preset potentiometer on the board until the numerical value of the voltage is half the numerical value of the desired current limit (see picture below).
Next, I installed bCNC on the Raspberry Pi 4. This is a Python package utilising Tkinter. Installing a Python package is not completely straightforward for those who just dabble in Python like me! There are details here. According to someone on a blog (I can’t remember the reference!) you need the following installed first before installing bCNC: pip, numpy, scipy, tk, wheel, serial, setuptools PIL, and opencv. The last two allow X-Y alignment using a USB web-cam on the gantry. I’m not sure if this will be useful for laser cutting. Anyway, with some difficulty, I installed opencv using the instructions on this page. This also showed me how to install all these bits and pieces within a virtual environment which seems to be a good thing.
The otherwise perfect description of the opencv installation process seems to leave out a couple of points. Under “Step #4”, add the following lines to your ~/.profile:
export WORKON_HOME=$HOME/.virtualenvs export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv source /usr/local/bin/virtualenvwrapper.sh export VIRTUALENVWRAPPER_ENV_BIN_DIR=bin
Without the last line, I got the error /home/pi/.virtualenvs/cv does not contain an activate script. Also, to ensure that the virtual environmet works when you close the original shell and open another, you have to add these lines to ~/.bashrc:
export WORKON_HOME=~/.virtualenvs VIRTUALENVWRAPPER_PYTHON='/usr/bin/python3' source /usr/local/bin/virtualenvwrapper.sh
Then you have to source ~/.bashrc to activale the changes.
Initial testing of bCNC
So having finally got bCNC installed on a Rpi, I connected the Arduino/CNC Shield with a USB lead and started bCNC (open a terminal window and enter workon cv – cv being the name of my virtual environment – then enter bCNC return).. I selected the correct port by trial and error (it was /dev/tty/ACM0) and was able to run both the X and Y axis motors by clicking on the “Move Gantry” button, moving the cursor on the drawing board (is that what it’s called?) and clicking.
Some parts arrived from Ooznest, so I was able to start construction. For now, I am concentrating on building a two-axis, CNC-controlled (in effect) plotter. If I can get that working, I will then invest in a 40 Watt CO2 laser.
V-slot makes it easy
The use of Openbuilds type parts seems to be universal for self-build projects and that is the route I am taking. I have bought enough 20/40mm V-slot extrusion to make a rectangular frame and a gantry to move up and down it. As I mentioned above, 20/40 seems to be the right dimension of extrusion for a machine in the region of 900 x 500 mm. I relied on Ooznest to cut the extrusions to length. It’s really important they are cut really accurately and exactly square and they have the right saw to do it. I have seen videos of mitre saws being used and it is true that almost any type of blade can cut aluminium (without, in my experience, getting rapidly blunted – as a child, I used woodworking brace and bit augers to cut holes in aluminium to mount valve or vacuum tube bases and they are still fine after fifty odd years with only the occasional sharpening). However, most setups will not be as accurate as is required in my view.
Bits & bobs
I bought a job lot of angle brackets, a bag of 5mm T-slot nuts and 8mm button-head stainless steel socket-head screws from Ebay and Amazon and assembled a frame. I had never used T-slot extrusions before but I was impressed with how quickly it all goes together. Put the screw through the bracket, start the nut on the screw, push it through the slot, turn the screw with a ball-headed Allen key and the nut spins round and jams at ninety degrees before it finally tightens up. Voila! Job done!
Having, therefore, got a frame and a bar which would act as the Y gantry, I purchased three V-slot gantry plates (with Delrin wheels which slide along the V-slot), some 2GT Gates Open Timing Belt (6mm wide) three 2GT Pulleys – 30 Tooth (for 6mm belt – 5mm bore to fit the steppers) and a couple of 2GT 20 – toothed Idlers – again from Ooznest.
Then I needed to make up a lot of brackets and similar bits and bobs to hold the stepper motors, tension the drive belts and attach limit switches etc. I made these mostly out of 3mm (or 3.2mm) aluminium plate or angle.
Accurate drilling (hopefully!)
In order to accurately place holes and in the absence of a CNC drill/mill (perhaps this is what I should be making?) I used my 3D printer to make patterns with the holes in the right places. The patterns had 2mm holes for pilot drills which were then enlarged. The problem with this method is that the patterns only last one time as the holes in the PLA are quickly enlarged.
Fortunately, the accuracy of operation of the finished machine depends on the accuracy of the stepper motors and the Grbl software driving them (and the belts and pulleys, perhaps). For the most part, a lack of accuracy in the construction of a few tenths of a millimetre on my part will not be a problem.
When enlarging the pilot holes, it pays to clamp the work down to the drill table as just holding it “loose” with a machine vice inevitably leads the hole to wander out of true. This problem increases as the diameter of the hole increases – for example, the hole for the location of the stepper motor (22mm diameter) for which I used a stepped drill (from Aldi!). I scribe a 22mm diameter circle with dividers first so that I am reasonably confident the hole is in the right place as the hole increases in size.