Lightburn GCode Inverts Light and Dark on Photos

I have a photo that I have dithered using imag-r.com using Norton tile method. Everything looks great in Lightburn using Threshold but when gcode runs on SM2, it prints as if inverted has been selected which is hasn’t. It also prints this way on the Lightburn dither options with the exception of grayscale at S-Value 254. @brent113…you have a lot of Lightburn experience. Have you seen this before? I started with LB 9.20 and have bumped down to 9.13. I am on SM2 firmware version 1.9.0. I have looked high and low at the gcode but have no idea what I am looking at (I have some but not enough) to figure out what the issue is. Any suggestions would be greatly appreciated.

I haven’t seen that before. Could you zip and post your lightburn project file?

Here you go…thank you for taking a peek and Happy New Year. I am using LB 9.13 at the moment. OdessaTest.zip (356.9 KB)

I think ultimately you might have a better result not using threshold once you get it printed, but regardless it should not be inverting and I don’t really see why it is inverting in those settings.

When you set up the device did you use the snap maker device profile? If you look at the g-code in a text editor it contains a p parameter on the M03 lines right, like M03 P70 Swhatever

It’s worth mentioning that this machine only changes laser power when motion is stopped to synchronize, and because of that you’ll likely have a better result with dithering where it moves over to a spot and puts a dot down rather than traveling with the laser on which will result in a darkening at the start and end.

I’m wondering if that motion quirk could be responsible for what you’re seeing.

There are a few people having the same issue as I am with one having found a work around using grayscale and setting the S-Value to 254.

I tried looking at the gcode and here are some of differences I saw. Mode I used is in the title:

2 Likes

UPDATE:

I brought out my SM1 and am not having the inverting issue that I have with the SM2. It must be something with the firmware difference and the Marlin that it is using. I’m so glad, I did not sell my SM1.

I read through that thread you linked above.

Did you try dropping the S value to 254?

I do recall seeing something suspicious with 100% power values in the firmware calculation, I wouldn’t be surprised if it’s that issue. I did spend some time thinking about it though and I didn’t actually think it was a problem.

I did and it didn’t make a difference for the dithering. Dropping the S value only seemed to work with grayscale mode.

Could you post one of the .nc files that’s causing a problem? I generated gcode from my profile via the .lbrn and it seemed fine.

Here you go. This .nc file works fine on SM1 but on SM2, it’s as if it is negative. On the preview, it looks as it should. Thank you.
fam.zip (748.5 KB)

Would you be interested in running this edited version and seeing what happens?
2 changes: 1) M03 P0 -> M5, and 2) G1 after an M5 -> G0 since it’s a non laser move

fam-edit.zip (726.1 KB)

I sure can. Thank you…I will let you know what happens.

Just tested and it is printing inverted.

In the Snapmaker JS…there was no M106 P0 S255 but there is in the Luban gcode. Do you think that may have something to do with it?

M106 is fan speed. Not going to be that.

Which version of the firmware did you say you’re running? 1.9? Maybe try the latest version?

I finally brought it up to 1.10.1 yesterday hoping that would work but sadly no. I feel like we are close to figuring it out but that could also be wishful thinking.

Interested in trying a brand new unreleased firmware from their github? Firmware request: Tool Change Mode with enclosure lights left ON

That firmware is based on what’s currently on the Snapmaker dev site with 1 small tweak unrelated to what you’re doing here.

Sure. I will install it and try again.

UPDATE:
Still experiencing the same issue.

Interesting. Well I’m fighting an issue elsewhere in the firmware where sometimes an OK response isn’t send when it should be, which breaks Lightburn - serial connection is dropped, killing the print in progress.

It seems like your issue could be comms related as well, like the thing is parsing everything 1 command delayed??

Don’t really have anything else to add right now, other than SN is buggy as hell and it’s really irritating.

There a bunch of other things that could be tried, but it’s just guessing now. :man_shrugging:

I agree that it is very irritating and I appreciate all of your assistance and suggestions. I have a support ticket open which is my last resort before I buy a cheaper laser engraver that will work with lightburn. Hopefully you’ll resolve your issue and if you want me to test any firmware updates…just let me know.

Thank you.

After I unbrick my controller tonight I’m going to spend some time running your code with a debugger and see if I can find anything. I need a break from my issues for my own sanity lmao.

In the meantime, I have had good luck with the Lightburn greyscale mode which does lines of varying power for images. It requires a special version of firmware I posted elsewhere: Laser Pause While Changing Power