Programs for laser cutting and engraving. Basic programs for the operation of a CNC laser machine. Getting started with the Endurance Neje laser machine

Programs for laser cutting and engraving.  Basic programs for the operation of a CNC laser machine.  Getting started with the Endurance Neje laser machine
Programs for laser cutting and engraving. Basic programs for the operation of a CNC laser machine. Getting started with the Endurance Neje laser machine

The circuit is working, the engraver has started. I even tried to burn something on dark cardboard.

As a first improvement, I fixed a 40x40x10 fan on the engraver body using a piece of 20x20x1.5mm corner to blow the laser and remove smoke from the engraving area.

Forum member orensnake offered to try the T2Laser program. I tried.

The program is great. I haven't come across anything more comfortable yet. Several evenings of experiments and I managed to burn the picture on cardboard with halftones in acceptable quality. Controlled the power of the laser.

I'm still working on the program.

I found a 12V 2a power supply in the stash and decided to use it for the engraver. I bought and fixed the connector for the power supply on the engraver, this is the second minor revision.

As a third and purely aesthetic refinement, I drew and printed stubs in a 20x20 profile.

When I was studying the issue of building a laser engraver, I came across the Chinese program MyLarser - this is the program that NeJe engravers are equipped with.

From the first attempt to start the engraver in this program did not work. A little later I read that the program works with the engraver at a speed of 9600 kbps. Firmware 1.1f works on 115200.

Since this engraver does not use limit switches, and I soldered the board for a larger engraver project, I decided to solder one more brain. Not difficult. Fortunately, there was one more arduino and a number of breadboards in stock. As a 12-5V stabilizer, I used the banal 7805 in the TO220 package. A plus on the board provided a connector for a 12V fan.

I found an old firmware 0.8c on the Internet, running at a speed of 9600. I spilled it into the arduino. Set up.

Grbl 0.8c ["$" for help]

$0=106.667 (x, steps/mm)

$1=106.667 (y, steps/mm)

$2=106.667 (z, steps/mm)

$3=10 (step pulse, usec)

$4=250.000 (default feed, mm/min)

$5=500.000 (default seek, mm/min)

$6=192 (step port invert mask, int:11000000)

$7=25 (step idle delay, msec)

$8=10.000 (acceleration, mm/sec^2)

$10=0.100 (arc, mm/segment)

$11=25 (n-arc correction, int)

$13=0 (report inches, bool)

$14=1 (auto start, bool)

$15=0 (invert step enable, bool)

$16=0 (hard limits, bool)

$17=0 (homing cycle, bool)

$18=0 (homing dir invert mask, int:00000000)

$19=25.000 (homing feed, mm/min)

$20=250.000 (homing seek, mm/min)

$21=100 (homing debounce, msec)

In addition to the difference in the firmware settings, there is another difference. In firmware 0.8, the output for laser control is port 12 (and in 0.9j and later, the 11th output with PWM). The laser has only 2 states, on and off. Without PWM regulation!

On the board, I soldered the contacts under the jumper and connected them to ports 11 and 12. Now, by rearranging the jumper, the laser can be connected to the 11th or 12th port of the arduino.

With this firmware, the engraver was determined by the MyLarser program. The program is extremely simple, complete with the program is a set of pictures. The setting comes down to determining the engraving area and the engraving time.

It turned out to engrave the following pictures:

Of course, this homemade product is nothing more than a toy. However, this is a small step towards making a larger engraver in the future and with a normal, more powerful purchased laser.

Starting from version 2.7.5.0, the CNC Master program supports working with DXF files, which can significantly reduce the complexity of writing many programs for controlling a CNC machine.
Writing a program for artistic engraving, both 3D and 2D, is a time-consuming task, the solution of which is extremely difficult without automation tools. For the case of 2D engraving, an image may consist of hundreds of thousands of primitives. Manually writing programs for such images would require considerable time. In the case of preparing a control program (hereinafter referred to as NC) using modern information processing tools, this operation can take only a few minutes, taking into account the time for preparing the image file.
The algorithm for generating NC for 2D engraving using the CNC Master program is quite simple:

1. Run the program CNC Master (version 0.2.7.5 and older)

2. Select the "Engraving" tab



4. Click the "Load DXF" button, after which the file selection window will open

5. Select a pre-prepared file and click the "Open" button


6. Set the engraving parameters (depth and speed) and click on the "Generate" button

7. After generation, the "Control program" tab will open with the result of generation


8. Select the "File" item in the top menu, then "Save", save

9. The program is ready. We load it into the machine control program and process it

Most of the articles on the site describe how to work in ArtCAM v8/v9. If you are using later versions of the program (v11/v12 or later), for the convenience of working with the program and articles, after launching ArtCAM, you need to configure the layout, as shown in the figure:

The preparation of the file is designed for a blue laser with a power of 1..10 W with a beam diameter of 0.25 mm.

A dot black and white drawing prepared in a graphic program convenient for you in .bmp format is opened in the ArtCam program

File - Open


If necessary, scale (resize) the model.


In the ArtCam program, you need to change the resolution of the model - increase it approximately twice. Model ->Change resolution.


Use the slider in the left area to set the new resolution (1). The new resolution should be about twice as large as the current resolution. Next, click the Apply button (2).


Call the Form Editor. Model -> Shape Editor or just double-click on the black square at the bottom of the image (1). In the window that appears, select the FLAT button (2). Next, enter a value of 1 mm (3) for the Initial Height. Next- Subtract (4), Apply (5), Close (6).


The relief will appear in the 3d view area.


We create a LASER tool based on an end mill. For this

Go to the UE tab (1),

Select TOOL DATABASE (2),

Add a new tool (3),

We enter the name of the tool, select the type of tool - END, units of measurement mm / s (4),

We set the diameter to 0.001, the minimum processing depth (5),

Pitch - 0.001, speed, spindle - any (6),

Save the changes (7), save the creation of a new tool (8).


Staying in the UE tab (1), select RELIEF PROCESSING (2).


Set up the trajectory of movement - SNAKE ON X, angle - 0, allowance - 0, accuracy - 0.001 (1).

Safety height in Z - 1, cusp in X and Y - 0, in Z - 1 (2).

Tool Select (3) Laser 0.001 (4), Select (5).


Specify a step of 0.25 mm (laser focus) (1), depth per pass 1 mm (2)


Determine the material (1), workpiece height 1.0 (2), pay attention to the offset (3), OK (4), name the workpiece (5), calculate now (6), close (7).




We move the UE to the saved section (1),

Select G-Code (mm) (2),

Save (3),

Select a folder for storage (4) and set the file name (5),

Save the changes (6) and close the window (7).


Next, you need to open the UE in Notepad and replace (Edit - Replace) all the values ​​of Z 1.000 with Z 0.010. If required, change the speed value to the required F1000. This is done so that the Z axis does not waste time, and the head walks at a constant speed without stops and delays for switching on / off the laser.

Photo of a picture obtained by burning on a desktop milling machine with an installed laser.

ATTENTION! Observe safety precautions when working with a laser. DO use goggles!

Burning from a photo on an engraving and milling machine Modelist3040

Video of burning on a table milling machine Modelist3040

Video of cutting paper with a laser on a Modelit3040 machine

Programs for a CNC laser machine are software that allows you to create sketches of future products and turn virtual models into real samples.

Using a laser machine, you can cut products and blanks of various levels of complexity from solid materials. However, in order for the machine to “understand” what exactly it needs to do, two types of software are required: graphic editors for modeling and programs for controlling the machine itself and all cutting processes.

Modeling

Laser equipment works with flat objects, therefore, for computer simulation of future products, such programs as:

  • CorelDraw- a software package that deservedly has a lot of fans. It features an interface that is understandable even for amateurs, a large number of tools and templates, and works with vector and raster images. Saves images in many formats, including the .cdr format, which is necessary for the further creation of G-code understandable by a laser machine.
  • Adobe Illustrator- no less popular professional graphics editor, which is perfect for creating sketches for laser cutting. Works with vector graphics, has a rich library of ready-made sketches, templates, fonts, styles, symbols, etc.
  • LibreCAD- younger and therefore less known software for drawing and 2D design in wide circles. A simple interface with a minimum of settings, .dxf support, a "step back" function, many options and tools - these characteristics are quite enough to create computer models for laser cutting.

Of course, you can create sketches in programs that work with three-dimensional models, so if the user is only familiar with SolidWorks, he does not need to learn CorelDraw to work with a laser machine. All known software packages for 3D design (SolidWorks, AutoCAD, ArtCAM, MasterCAM, 3ds Max, KOMPAS-3D, etc.) are suitable for working with flat shapes, but you need to be prepared for the fact that the model will have to be corrected - often when when exporting a 3D model to a flat format, there are problems in the form of broken or duplicated lines, etc. In these cases, knowledge of CorelDraw is still required to bring the sketch in order.

Laser control software

To control laser equipment, so-called software shells are used, which allow you to control the settings for moving the emitter from a PC and, in fact, creating a product based on a virtual sketch. The most famous among them are:

  • Laser Work- an easy-to-use and understandable graphical environment that allows you to perform such operations as: controlling the processes of moving the laser head, visualizing the processing process, programming cutting parameters, adjusting the laser power and cutting speed.
  • LaserCut- another easy-to-understand program that even operators with a minimal knowledge base in this area can master. Wide functionality allows you to implement a large number of tasks related to laser cutting: determine the entry and return points, adjust the cutting parameters, the power of the emitter and the speed of its movement, determine the time to complete the work, and much more.
  • sheetcam- has a wide range of functions necessary for working with a laser machine: controlling the movement of the emitter, calculating the total cutting time, visualizing the route of the laser head. The program allows you to create tools with custom cutting parameters (torch lowering speed, slot width, burn duration, etc.) and make changes to the NC.
  • RDWork- a laser machine control system that is understandable for familiarization and use, which in terms of functionality is in no way inferior to the above software. Among the tools: setting the cutting order, checking the engraving area, entering the zero coordinates for the machine and part, setting the cutting speed, etc.

Step 1. Creating a vector image from a simple / bitmap image

Please note that vectorization of a raster image does not give an exact copy, but a set of curves with which you need to work further.

The program InkScape is used (https://inkscape.org/ru/download/).

With InkScape, you can turn a bitmap image into a vector image, that is, turn it into a path.

To convert a bitmap to vector paths, load or import bitmap.

Highlight in the program field, your bitmap image, which you will convert to contours, and in the main menu, select the command Paths - Vectorize raster…”, or use the key combination Shift+Alt+B.

2. Preview as a result of applying the Brightness Reduction filter.

Second filter - "Edge Detection". This filter creates an image that looks less like the original than the result of the first filter, but provides information about the curves that other filters would ignore. The threshold value here (from 0.0 to 1.0) adjusts the brightness threshold between adjacent pixels, depending on which adjacent pixels will or will not become part of the contrast edge and, accordingly, fall into the outline. In fact, this parameter determines the severity (thickness) of the edge.

1. First:

1.1. Select the object to be engraved. Selection and transformation tool, in the tool window (the first tool on top is a black arrow) or press the S or F1 key. The selected inkscape object will have a black or dotted border around it. 1.2. Position object at the desired coordinate point (X;Y) according to the method of attaching our material to the 3D printer table. Just move the image mouse or arrow keys, or use precise coordinates(in the top command line) using the "X" and "Y" fields:

2. Use the first InkScape plugin: .

2.1. For this possibility, we must have the files of this plugin ("laser.inx", "laser.py") in a folder inside the program location, namely "C: Program FilesInkscapeshareextensions". For your convenience, we have attached these download files to the instructions.

2.3. Specify the necessary parameters for code generation in the dialog box.

2.3.1. The laser on and off commands used for our printer (for example, for the Wanhao 3D printer, these are the M106 and M107 commands, respectively, and for the DIY engraver, the commands are M03 and M05, respectively). 2.3.2. Movement speed (when the laser is off).

2.3.3. Burn speed (when the laser is on).

2.3.4. Delay before moving (burning) in milliseconds after the moment the laser is turned on at the start point of each contour.

2.3.5. The number of passes through our drawing.

2.3.6. Depth in millimeters per pass. This parameter is taken into account in the code when the number of passes is more than one. After each pass, a command is added that lowers the laser down by a given amount (to maintain focus).

2.3.7. We specify the directory for saving the file with our code, it will be remembered by the program and the next time it will not need to be entered again.

2.3.8. Click "Apply" to start the plugin.

2.3.9. In some cases, a software error is possible as a result of the plugin's operation, and we see a notification about this, then the code will not be generated. In such cases, you can edit the vector slightly and re-run the plugin. Or use the following plugin.

2.3.10.1. Insert the line "G28 X Y" (Go to origin only on the X and Y axis) at the beginning of the code. This is important if you have mechanically moved the printer head for any reason. The "G28" (Go to origin on all axes) command will reset all axes to zero.

3. In case of unsatisfactory performance of the first plugin, use the plugin: gcodetools.

In special cases, before calling the “Path to Gcode” function, it is required to run the functions “Orientation points…”, “Tools library…”, “Area…” (eng: “Area…”) in sequence, see the lessons on the plugin developers page http:/ /www.cnc-club.ru/gcodetools 3.1. If this is our first launch, then go to the third tab: parameters ... 3.1.1. We specify the directory for saving the file with our code, it will be remembered by the program and the next time it will not need to be entered again.

3.2. We return to the first tab. We start "Apply".

3.3. The resulting code is opened in the Notepad++ program (https://notepad-plus-plus.org/) and then we make several replacements throughout the code:

3.3.1. Remove the header before the words “(Start cutting path id:…”

3.3.2. Insert the line "G28 X Y" (Go to origin only on the X and Y axis) at the beginning of the code. This is important if you have mechanically moved the printer head for any reason. The "G28" (Go to origin on all axes) command will reset all axes to zero.

3.3.3. Place the cursor at the beginning of the file. Press the key combination Ctrl + H. We check that in the “Replace” dialog box in the “Search Mode” settings it is set to “Advanced (

3.3.4. Replace everywhere "(" with ";("

3.3.5. Replace "G00 Z5.000000" everywhere with "G4 P1

3.3.6. Replace "G01 Z-0.125000" everywhere with "G4 P1

3.3.7. Replace "Z-0.125000" everywhere with "" (i.e. delete "Z-0.125000" everywhere).

3.3.8. Replace “F400” with “F1111” everywhere (i.e. choose the right speed for our engraving, for example, 1111 is a fairly fast speed) 3.3.9. Note that in this Gcode we do not specify the Z coordinate (laser height), because set it just before launching the laser.

3.4. The edited code looks like this:

4. Our code is almost ready to be used in a 3D printer or engraver with the L-Cheapo laser installed.

In the work of any programs there may be failures or errors. Here are some suggestions for overcoming problems:

3.1. plugin J Tech Photonics Laser Tool sometimes does not put a space in any line of a Gcode file before an occurrence of "F", for example: "G0 X167.747 Y97.2462F500.000000". To fix: Replace "F500" with "F500" everywhere (in the last expression, a space is inserted at the beginning).

3.2. plugin gcodetools sometimes produces an empty file as output. Then you need to execute: menu "Circuit", Further "Outline object" and repeat the Gcode generation.

4.1. Use Gcode visualization program: Basic CNC Viewer.

Step 4: Print and burn.

After turning on the printer, perform auto-detection of the origin of coordinates for all axes (see Step 2 p.1.2.2).

Before starting the engraving, it is necessary to set the Z laser height manually on the printer, if this is not provided by our code.

The optimal height Z corresponds to such a position that the laser beam is in focus on the surface of the sample.

On the top frame of the Wanhao 3D printer, there is a separate special red button for turning the laser on and off.

Wear protective goggles before by enabling this button!

Protective goggles can be removed only after turn off this button!

BE SURE TO FOLLOW THE SAFETY RULES WHEN WORKING WITH THE LASER. Use ONLY PROTECTIVE GLASSES when the laser is on.

Useful:

1. M18 (Disable all stepper motors) command releases the table from blocking by motors, useful, for example, at the end of the entire code execution.