How to save .nc file for lasergrbl

If we have not a program under execution we have the ability to load a file from disk. Use file open button near “Filename” box, or from file menu.

How to save .nc file for lasergrbl
Load file and send

LaserGRBL support G-Code with .nc and .gcode extension. If your file has a different extension but they are G-Code, you can rename your file to use this extensions.

LaserGRBL also support opening pictures and raster images in bmp, jpg, png and gif file format.

Multiple passes

Since v2.7.3 LaserGRBL include a numeric switch to perform multiple passes.

How to save .nc file for lasergrbl

If set to values different from one LaserGRBL will repeat loaded program multiple times (the set number of times) decreasing the counter at each pass.

Hi. First time to LaserGRBL, first time on github.
When I open a raster image in LaserGRBL, the laser comes on and cuts/engraves as per the settings in the target image dialog; no problem.

However, when I load an .nc file, I’m not given that dialog to set power/speed of laser, and when I Run program, the motors move the laser around the drawing, but the laser does not activate.

Typing M3 S50 also turns the laser on for focussing.

Can anyone advise what I need to do to set the laser power and speed and to have it come on when running a .nc file?

Thank you.
Lee

Open the .nc file with a text editor, something like Notepad++ which is free and gives you line numbers, unlike notepad in Windows. See if there are any Laser on options in the code, like M3 or M4.
What did you use to generate the gcode file?

I’m not given that dialog to set power/speed of laser,

That's because they should already be included in the .nc file when it was generated.

Hi @StuartB4 thank you, I’ve downloaded Notepad++ and no, there isn’t any M3 or M4 mention in the code.

The G-code I have created in Scan2CAD

  • the file is one that others have created and shared for making medical visor headbands.
  • I downloaded the .svg version of this and tried to open in LaserGRBL, and it gives me a small Target image dialog allowing me to set speed and power; when I hit run it moves, but the laser doesn’t come on.
  • so I downloaded the .dxg version instead, opened it in Scan2CAD, and saved it out as .nc Gcode, which is where I currently find myself.

Is it as simple as adding in ‘M3’ at the start of this .nc file as I read it in Notepad++ and then ‘M5’ at the end, re-saving from Notepad++ and then re-opening that file in LaserGRBL?

What you can do is load an image and prepare it for burning but instead of clicking start click the File menu and save the file. You should get a gcode .nc file for that image. Open that with a text editor.
At the top it should tell you the Power S and Speed F settings and the laser on command you set in Target image settings, that should be M3 or M4.

How to save .nc file for lasergrbl

It may be that simple to just add the M3 and M5. But you may need to add the power setting and the speed setting as well.
If your power S Max is set to 255 in GRBL configuration ($30) then you can just add S255.
If it's set to 1000 set S to 1000.

Can you paste the first 10 lines of the code from the file here.

This is really so helpful @StuartB4, thank you. I appreciate how frustrating it must be having to deal with these elementary questions.

Thank you though, I now have the laser coming on. I can play around with speed and power from here I think.

Three more primary-school questions from me..

  1. When I open an .nc file, I don’t get a target image dialog, is that correct? No matter, the laser is coming on so I think that’s all I’d need it for.

  2. Line $30 of my grbl config is 1000 ($31 is 0). Am I therefore correct in assuming if I have S500 say in the gcode, that is telling to operate at 50% power?

  3. How do I set it the start position of the laser relative to the image in the laserGRBL main window?
    What I’ve been doing is:

  • the blue crosshair is at 0:0.
  • I’m just manually pulling my laser to the far bottom corner of my laser cutter bed.
  • then I sometimes I seem able to hit the globe icon next to the padlock where the custom buttons are, but currently it is greyed out.
    ^ in theory, if I can get that custom button active again, is that how I would be best advised to ensure the laser ‘starts’ it’s programme from the correct reference point?

I will post the first few lines of code if that helps.

Thank you again(!)

This is what I have for the first 20 or so lines of my gcode: @StuartB4

%

N10 G92 X 0 Y 0 Z 0
M3 S500
F1000

N20 G90

N30 G00 Z 0
N40 G00 X 453.06939 Y 107.77087
N50 G01 Z -0
N60 G01 X 437.01418 Y 112.07285 Z -0

N70 G00 Z 0
N80 G00 X 437.01418 Y 112.07285
N90 G01 Z -0
N100 G01 X 437.01418 Y 112.07285Z -0
N110 G03 X 436.23772 Y 112.17508 I -0.77645714 J -2.8977775

N120 G00 Z 0

And, hopefully my last question, the laser seems to be travelling too far. The framework of the laser is (X) 540mm x (Y) 470mm, and the design is 497 in total wide.

However, with the laser starting at the bottom left of the X/Y axis when I hit Run, it follows that blue line up, which should only be about 440mm along the X axis, and yet it overshoots this and grinds against the end of the X axis framework.

Am I reading the measurements on this screen incorrectly or is this scaling error coming from the gcode somehow?

How to save .nc file for lasergrbl

And, hopefully my last question, the laser seems to be travelling too far. The framework of the laser is (X) 540mm x (Y) 470mm, and the design is 497 in total wide.

However, with the laser starting at the bottom left of the X/Y axis when I hit Run, it follows that blue line up, which should only be about 440mm along the X axis, and yet it overshoots this and grinds against the end of the X axis framework.

Download this file and run on your engraver: TEST GCODE.zip

How to save .nc file for lasergrbl

This should draw a 50x50 mm square.
If your result have different size, go to menu "Grbl - grbl configuration" and set $100 and $101 using this formula.

$100 = $100 x 50 / width
$101 = $101 x 50 / height

Q1. Yes, because all the settings for the file are included when the gcode is generated from any program, there is no need to set anything else. That's fine, but some programs generate different commands in some of the code that not all programs understand. Like for cnc machines you might have a tool change command, when you try to use that file in a laser engraver it does'nt understand the extra commands.

Q2. Yes half the S Max number whether it's 255, 1000, 10,000 should correspond to half the power, and a quater a quater power etc, etc.

Q3. My home position is bottom left so I've never used the Globe button or re-positiond the laser anywhere else. I know the button is only active when you've move the blue cross/laser away from the home position.

@arkypita that was precisely it - thank you! It cut that initially at 100mm x 100mm and so I have been able to correct that now thank you.

@StuartB4 Thank you for all your help. All up and running now. If we weren’t in lockdown I would buy you a beer or 6.

Finally, at the end of 3 frustrating days, you’ve sorted it in the best part of an hour!

Follow up question. Have completed about 20mins of laser cutting on full power. Was about halfway through the design. Now laser appears to have lost power, and is now just a feint blue dot. Now worried I should not have been operating it at 100% power.
Have I just killed the laser do you think?

It is probable. If you have bought a laser overpowered, underdissipated, and sold for more powerful than it really is, by ebay or aliexpress. It's an incorrect and very very unpleasant practice which unfortunately is widespread. Read this; #780

I'm sorry and I can imagine the disappointment, complain to who sold you the laser and pretend a refund.

Hi @arkypita thank you. I suspect you are right.

The laser was only bought for this purpose for a little community group in our village to try and produce some PPE for our local doctors trust. Unfortunately we didn’t have much of a budget.

A classic case of you get what you pay for I guess. I can’t even imagine how I post this back to them - it took about 3hrs to put together this week..

I suppose better laser modules are available that I could fit to it? Though that would involve more outlay I guess.

You are correct in your assumption; a unbranded Chinese model bought via amazon.

I'm sorry, unfortunately there are many unfair people.
Where are you from?

Just outside Nottingham, England. Everyone on here has been very helpful. Thank you for that. I’ll try and return the laser. Amazon have a good returns policy I guess. I just won’t dismantle it fully.

I'm sorry, I don't know vendors in your area.

I bought my laser from the united states, from dtr-laser only diode and heat sink were about $ 100 per 2W of power.

I know of a good seller from russia. A little expensive for my taste, but the product is exactly what it says. https://endurancelasers.com

I suggest you make the return with amazon, give a replacement, and then use the LaserGRBL settings to switch between work cycles and cooling cycles (you will find an entry in the configuration).

Thank you that is very helpful

What files can I use on LaserGRBL?

LaserGRBL also support opening pictures and raster images in bmp, jpg, png and gif file format.

How do I save a gCode file?

Save as G-code.
Open a DWG/DXF file and edit it if required..
On the Output tab in the Conversion group select the CAD to G-code command..
3.By default all drawing contours are converted. ... .
4.By default ABViewer generates a control program for a milling machine. ... .
Click the Convert button. ... .
Click the Save G-code button..

Can LaserGRBL open DXF files?

LaserGRBL does not give line cuts to a DXF or PNG file, so I decided to use DXF2Gcode to create the gCode to use for the laser cut.

How do you make a laser engraving file?

Laser Engraving a Logo.
Step 1: Start Your Design. Open your program and create new file (OPEN-NEW FILE), use the TEXT tool and write the word you want to engrave. ... .
Step 2: Transform Letters Into Objects. Image 2. ... .
Step 3: You're Almost Done! ... .
Step 4: Transform Your Objects Into 1 Object. ... .
Step 5: Your File Is Ready to Go!.