Scan Issues - Marlin - Diode laser

I tried to lurk info before posting. 2 days trying but got no result; I have the evaluation license, I like the software but I don’t understand why I can’t have decent result with scanning.

I tried this simple test: a scanned rectangle inside a lined one; the dimension difference between them is 0.4 mm; spacing between scan lines 0.5; speed 30mm/sec @100% with a 6w diode neje laser (PWM).

I did it because I noticed that while scanning, I get lines starting before/after they should and ending before/after they should.

I think I did 30 or 40 tests tweaking scanning offset adjustment I got NOTHING. Always crap results. I use this cnc for carving and cutting with a router and it works very well but with laser…
this is the result with no scanning offset adjustment

Can someone explain what I’m missing?


Welcome to the forum! I’m still green with LB, but search overscan, or this link and see if that solves it for you. 48

Thanks for the answer, I tried positive and negative adjustments, but I always have an initial or final offset…

Scanning offset adjustment only helps when the offsets are consistent between scans, which yours don’t appear to be. If your original result looked like this, scanning offsets would help:


Since your appear to be all over, I would look to see if you have something mis-configured.

How wide is the scan you showed above?

Same thing I was thinking… If I make a line, any kind of perimeter, it comes out very precise. While if I want to scan, the only way is flood fill. If I raster scan, I always get crap. This box is 20 x 10 mm. I also tried with inkscape + raster plugin and it is quite the same. It seems like the beam is shooting badly. Tomorrow I’ll try with a different and shorter cable; I’ve already tweak the com settings but nothing done. I repeat, as a cnc it works great.

To be more specific:

left is scan, right is line

Seems like a big delay in pulsing. I tried a different shorter cable (30cm, this is the result).

Don’t know how to solve it

this is at 10mm/s 50% power

Boy I was way off! I look forward to hearing what the solution is.

Is there any kind of ramp-up delay or anything on the PWM output? You’re using one of the fan PWM outputs for this - does it have a soft-start or anything configured? (I’m absolutely guessing here, as Marlin is the firmware I know the least)


taken from v1engeneers forum:

I will summarize the problem. The more recent versions of Marlin the code that updates the settings for the fan was changed. The change caused it to delay the fan updates. Since many of us use the fan to control our lasers that change causes the laser to turn on and off to early or too late. As you can see in your photo and in the photos in the other Thread BT pointed you to.

Here is the offending code. It is located in the Marlin.cpp file.

// Limit check_axes_activity frequency to 10Hz
static millis_t next_check_axes_ms = 0;
if (ELAPSED(ms, next_check_axes_ms)) {
next_check_axes_ms = ms + 100UL;

To fix the problem it needs to be changed to this.

// Limit check_axes_activity frequency to 10Hz
//static millis_t next_check_axes_ms = 0;
//if (ELAPSED(ms, next_check_axes_ms)) {
planner.check_axes_activity(); //< THIS IS THE ONLY LINE OF CODE YOU LEAVE UNCOMMENTED
// next_check_axes_ms = ms + 100UL;

If others have similar issues in marlin you know why. Thanks

Thanks for posting that back here - good info.

just a first attempt, no tuning, but it’s doing what it should now.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.