Laser job won't start

The calibration and laser itself seems to work however jobs throw a Failed to Copy error.
I’ve tried running the stock Wooden Ruler project that comes standard with Luban and could not for the life of me get it to start.

I’ve tried WiFi, USB and local copies however the head will just home in on the work piece then throw a ‘Failed to Copy’ error regardless of where it comes from.
Neither restarts or cache clearing seem to do much.

Error shown is identical to the one in this post Running a G-code file

Luban version is 4.7.3

The error from the SC_log file seems to be

1683217140441,2023.05.05 00:19:00.441,ERROR,SC,java.lang.NumberFormatException: empty String
1683217140442,2023.05.05 00:19:00.442,ERROR,SC, at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1842)
1683217140443,2023.05.05 00:19:00.443,ERROR,SC, at sun.misc.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
1683217140443,2023.05.05 00:19:00.443,ERROR,SC, at java.lang.Float.parseFloat(Float.java:451)
1683217140444,2023.05.05 00:19:00.444,ERROR,SC, at fabscreen.platform.base.lib.parser.GcodeParser.parseG0G1(GcodeParser.java:908)
1683217140444,2023.05.05 00:19:00.444,ERROR,SC, at fabscreen.platform.base.lib.parser.GcodeParser.parseLine(GcodeParser.java:385)
1683217140445,2023.05.05 00:19:00.445,ERROR,SC, at fabscreen.platform.base.lib.parser.GcodeParser.parse(GcodeParser.java:250)
1683217140445,2023.05.05 00:19:00.445,ERROR,SC, at fabscreen.platform.base.lib.parser.GcodeParser.lambda$rfQhR5ZAexoUD-N2qANsmlC4lj8(Unknown Source:0)
1683217140446,2023.05.05 00:19:00.446,ERROR,SC, at fabscreen.platform.base.lib.parser.-$$Lambda$GcodeParser$rfQhR5ZAexoUD-N2qANsmlC4lj8.run(Unknown Source:2)
1683217140446,2023.05.05 00:19:00.446,ERROR,SC, at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
1683217140446,2023.05.05 00:19:00.446,ERROR,SC, at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
1683217140447,2023.05.05 00:19:00.447,ERROR,SC, at java.util.concurrent.FutureTask.run(FutureTask.java:266)
1683217140447,2023.05.05 00:19:00.447,ERROR,SC, at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
1683217140448,2023.05.05 00:19:00.448,ERROR,SC, at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
1683217140448,2023.05.05 00:19:00.448,ERROR,SC, at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
1683217140449,2023.05.05 00:19:00.449,ERROR,SC, at java.lang.Thread.run(Thread.java:919)
1683217140538,2023.05.05 00:19:00.538,DEBUG,SC,Try to parse file %s failed./mnt/media_rw/CCA9-D875/Ruler.nc

I’ve attached the generated file created by Luban
Ruler.nc (90.4 KB)

Edit: By analyzing the generated NC file it seems Luban generates several entries with an incorrect number.
There are 4 entries such as this in the file which i am assuming are causing the issue

G0 ZNaN F150

If anyone can check some of their laser .nc files and let me know what it looks like for them i can try and fix my own manually at the very least and hopefully get it to run.

I suggest to try a other version of luban, its available in the forum.
Interesting line you figured out.

Hi Pinguinus
I have the same problem as you Failed to Copy error and the only thing that I can cut out on the laser is the a4 paper square and that is all. Is there a fix for this or is the newest software the problem. Luban 4.7.3 as I updated the Artisan first before trying the cut something first.

So thankfully i’ve managed to get it working and solved the issue.

Replacing ZNaN with Z-0 in the nc file worked and the file ran without further problems. You will be limited with using the USB stick this way unfortunately but at least it works.
Overall opening the .nc file, checking for anything with NaN in the name and replacing it should work.
To note this doesn’t happen with all laser jobs as i’ve tried an aluminum engraving job and that didn’t have ZNaN in the generated file.

For the development team:
I’ve found some info on this issue in the Octoprint github where ZNaN is generated because python allows NaN values while the GCode parser does not.
Search for NaN in the following hyperlink OctoPrint Git
Just replacing NaN as a default with 0 is not a solution as NaN should not be an allowed value in the first place. It is indicative of a generation error in the GCode from either Marlin or Luban.

Overall it’s a hassle and if i didn’t have programming knowledge the Laser module would be non-functional from my point of view.

Thanks for the solution, but you can actually skip the USB, just load the fixed file in the workspace and send it to the device.
I am doing the same with 3d printing gcodes, as the luban 3d printing is a nightmare.

1 Like

@parachvte, please fix :sunglasses: