I wanted to do some laser cutting so I thought I will just order a laser and mount it to my 3D printer. I ordered one with most orders on ali: https://www.aliexpress.com/item/32562052620.html . When it came, the fun started.
This was probably the easiest part. I just went to Thingiverse and found this model: https://www.thingiverse.com/thing:2552134 . After printing it, it fitted mostly OK after adding some extra holes.
There are three connectors on the control board with different combinations of following signals:
I chose the middle one with VCC and GND pins for connecting power. The laser requires 12V supply and my printer runs on 24V so I needed to use an external adapter. After making a proper cable
laser started to output full power. There is a button on the board to switch between low power (just a pointer) and full power for cutting. This is of course not suitable for using with automated cutting – so I needed to wire the TTL/PWM signal.
The usual way of controlling laser power on 3D printer is by using G-codes M106 and M107. These commands control the speed of print cooling fan which is not needed when cutting and it’s socket is about to be connected to laser PWM pin.
But let’s look on the output stage of my printer and input stage of the laser controller:
It’s obvious that the direct connection wouldn’t work so I modified it and added an adapter like this:
This solution has two advantages: no need to modify the printer controller board and separate grounds.
This has worked very well and I was able to control the power from G-code.
Once I had a working laser unit, I focused the beam, downloaded a random G-code from the Internet, loaded it to my Octoprint with Klipper controller and run it. But nothing was cut. I found out that Klipper doesn’t support G2, G3 G-codes which are used by most G-code generators for cutting and engraving. After some googling I found out that luckily the support was added a few weeks ago so I just updated to the latest version, added a few lines into config and tried my print again and it worked. Later on, I’ve discovered and fixed one bug and printing was without issues.
One of course doesn’t want to print downloaded designs only so I started to google how to create my own G-code out of some images or vectors. The first result was LaserGRBL which looks nice on first sight but is for Windows only.
Later I found a plugin for Inkscape (https://github.com/mbastl/bastl-laser-tool) which generates a gcode out of any picture. I did some fine tuning to the code and here are my settings:
- Laser mode – you want GRBL, otherwise laser ON/OFF commands won’t be used
- Laser ON/OFF/intensity – these specify G-code commands to control the laser. We have connected our laser to the part cooling fan, so we will use M106, M107 as described earlier
- Additional initialization – I want to start the print from current laser position so I use G92 – described below
- Z-level, X,Y- offset – all zeroes – we position laser as described below
- Travel speed – speed of the laser movement when moving between curves in off state
- Laser speed – speed of the laser movement when cutting – this depends on the laser power and material being cut – you need to experiment with this value
- Laser power – maximum value that the laser power command accepts – in case of Klipper and M106 it is 255
- Power-on delay – in many printer controllers, the fan speed setting M106 is not tightly synchronized to extruder movement. This value ensures that the printer waits specified amount of time after powering the laser on to be sure it has enough time to start and only after that it starts following the cut route. You can experiment with this value – 1000ms is very safe value
- Passes – how many passes of cutting you want to do – useful when cutting thick material by layers
- Pass depth – length of Z axis movement after each pass
To keep the possibility to manually adjust the starting point of the cut I use G92. I simply home the printer (G28), Set Z axis to my focus height (50mm), manually adjust X and Y to place where I want to start and then run the gcode. This allows me to position the laser manually and then it considers the manually set position as the origin (0, 0, 0 position). This way I am able to use the same gcode multiple times or to precisely align the object on the bed.
Here is some example I cut.
In next article I’ll describe the creation of PCB stencils.