To put a close to our playlist concerning plotters and lasers, in the fourth video of this series, we’ll work with the replacement of the pen of our example by a laser diode. Also, we’ll load it and operate a drawing. Considering the danger of the laser, I’ll also show a pair of goggles that I recently bought, but that still need to be tested. To avoid accidents, I also drew the cabinet, which I recommend doing in MDF. The template is available for download at the end of the article.
In the first video: Plotter and Laser with Raspberry Pi CNC HAT, we set up an XYZ table, which is the basis of this "printer,” which serves both to record and cut certain materials, and involves the whole process of mounting the mechanical part. In the second video: How to configure CNC with Raspberry Pi, we prepared this microcontroller with the image RPI CNC V4 using HAT (version 2.58) and configured the GRBL. The third video was about the Drawing with GCODE. This fourth video will end this series.
I really like this setup, specifically for its innovation of using Raspberry instead of Arduino. In addition, we also have the novelty of being able to use a HAT in this project, which is like Shield for Raspberry, by Protoneer (Electronic Prototyping Specialists).
Step 1: Features Used for Table Construction:
Laser 12W 450nm
12V / 5A source for the laser
M3 screws for laser fixation
Plastic fixing part of the laser
Step 2: Laser Plotter Cabinet
Here are pictures of the Laser Plotter office. I advise that the covers are made of MDF wood instead of transparent acrylic. I also recommend you put a power switch on the side of the box to ensure the laser only works when the case is closed.
If you want, you can install a webcam inside the case and then follow all the work developed inside it, without taking any risks. Inside the box, you will still have a space for the Raspberry circuit, laser source, etc. The design is very simple and was performed in Fusion 360.
Step 3: Installing the Laser
Installing the Laser - (Fixing)
1. As we will take advantage of the previous assembly of the plotter for the laser, we will need to disassemble the Z-axis, leaving only the part I mounted.
2. Let's now fasten the new laser fixture to part I. Adjustments to the part may be necessary because of variations during printing.
3. To fix it, we used four superb screws of 2mm in diameter.
4. To fix the laser, we use four M3x8 screws. When attaching the laser, pay close attention so it’s as perpendicular to the XY plane as possible.
Step 4: Installing the Laser - (Electrical Connections)
The Laser has its own independent power supply, which connects to the laser controller circuit (POWER).
There are two connections, one for the laser and another for the FAN that cools it.
The TTL output, responsible for activating the laser, must be connected to the Rpi CNC Hat.
The TTL output of the laser controller will be connected to the spindle control (SPN.EN PWM) on the Rpi CNC Hat.
Pay close attention to the polarity of the connection.
Step 5: Configuring GRBL for Laser Mode
After the mechanical installation of the laser, we have to change the settings of the GRBL to the Laser mode. For this, using some of the methods already discussed (via serial command or using the bCNC configuration wizard), we will change the parameter $ 32 to 1 (laser mode enabled).
In laser mode, the GRBL will treat the spindle / laser changes via the M3, M4, and M5 commands without stopping, and avoiding, when possible, irregularities in recording or cutting.
Now that the mechanics of the XY plane have been tested and shown to have worked well, we take advantage of the situation and increase their speed and acceleration limits.
If these new configurations were found to be satisfactory, with some more experience it would also be possible to fine-tune the configurations.
Step 6: Generating a File for Recording
Generating a file - Inkscape
Let's use InkScape again to generate our G-Code file.
We will not delve into all the available options, but instead show a quick guide to import an image and generate a file.
InkScape can be found to download at: https://inkscape.org/en/
1. There are several plugins for InkScape. For this example, we will use the J Tech Photonics plugin. So, first of all, it is necessary to check if it is installed. To do this, in InkScape, try to access the menu:
2. To download the plugin, use the link: https://jtechphotonics.com/?page_id=1980. After downloading, unzip the content to: "inkscape \ share \ extensions" at the InkScape installation location.
3. With the plugin installed, we can get started. Open a new document in Inkscape. For ease of location, measure the page to a size equivalent to the work area of the machine, or the part where you want to record. Give attention to the correct choice of units! In this example, we size the approximate measurements of the material we will use: 150mm wide by 200mm high.
4. Through the menu: "File >> Import,” we’ll select the picture that we want to record. You can also make your own drawing using InkScape.
5. When you import a file, an import options window appears. Select the one that is best for you. Here is an example of the settings we used:
6. To use our image to create a path, we have to "rasterize" by right clicking on the image, and selecting "Rasterize bitmap."
7. To create a path, there are some techniques. This time we'll use "Unique Search: Create Paths,” selecting the option: "Edge Detection." We adjusted the "Threshold" value until the preview had a satisfactory appearance. To preview the result, select the "Preview" option.
8. Upon completion of "rasterization," a new object will be created. This object has the path information that will be used to generate the G-Code. Let's select it and delete the original object.
9. We now go to the menu: "Extensions >> Generate Laser Gcode >> J Tech Photonnics Laser Tool...” and set the parameters for recording.
The parameters will depend on the power of the laser used, the type of work performed, and the material to be worked with.
We use these parameters to record a white MDF board.
We find these values after some experimentation.
Step 7: Generating a File - M3 X M4 Code
An important detail is to note the commands M3 and M4 that are responsible for the activation of the laser. These must be options in "Laser ON Command"
M3 - Constant Laser Power Mode
The laser does not vary in intensity during the course.
M4 - Dynamic Laser Power Mode
The laser has varied intensity according to the speed of movement, and by the adjustment of the value of the PWW.
Step 8: Using BCNC to Write the File
1. Using bCNC to print the file Open the bCNC, and in the "File" menu, open the connection with the Hat.
2. In the "Control" menu, use the controls to position the laser tip in the lower corner of the part. After positioning, use the X = 0, Y = 0, and Z = 0 buttons to determine the origin.
3. In the "File" menu, click "Open" and select the file for recording.
4. It should be possible to view the paths that will be recorded.