Hi there! I'm trying to move away from the stock K40 board/laserdrw towards grbl/lw

Hi there!

I’m trying to move away from the stock K40 board/laserdrw towards grbl/lw but I can’t figure out the last part of the puzzle.

With grbl/lw I get a scorched result while the stock board/coreldrw gives a “deeper” engrave without the “black fill” (and cleaner lines as well)

I wanna achieve with grbl/lw the same results I have with k40 stock board/laserdrw.

I’m using the laser fill path and I have tried countless settings but I can’t get rid of the black scorched fill.

For the records, its a arduino+cnc shield+grbl 1.1f / inkscape /lw since .728 (yes, I’m lw rookie :slight_smile: and I’m loving it)

Any ideas?



Do you have a POT in your machine? What speed and power are u using?

POT disabled. Using PWM connected to IN. Tried power from 5% to 20%, speed from 10mm/s to 30mm/s, line distance from .05 to .2

Are you sure PWM is working? Also 30mms is very very slow. Try doing 200mms at 20 to 25%

My guess is that you have PWM settings incorrect. As a result, you are firing at 100% power (or more) and you are going very slow. I’m guessing that your meter is spiking over 16ma and not the 2ma to 5ma you should be seeing.

On some K40, the speed was labeled mm/sec, but was actually cm/sec. So 30 on the old software is equal to 300 on LW. As suggested, try 200 just to see what you get.

I think PWM is working. I can see the needle moving and I take extra care to not go past 15. The below is from 0% - 60%.


In regards to speed… The fast I can go is 133mm/s (8000mm/m).

Just did a few tests… (power/feed)
10/30 - 20/50 - 20/100 - 40/100 - 35/133


at 5-20% is should get no where near 15ma. It shouldn’t even get near 10ma.

Yes, below 5% it wont even fire. At 10% it bounces around 3-5ma

Well, you were the one that said you tested 5-20% and got those original results :wink: I would say that 10% bouncing up to 5ma is a problem. IMO, 100% is around 20ma on a K40. Of course, I only have experience with mine.

I think you are not getting the variance in Power you should. Likely caused by PWM Settings in GRBL. Look at PWM Frequency.

Also, I don’t understand the 133mm/sec limit? Where is that coming from?

I just tried again changing max speed/accel and I can’t get past 150mm/s. I’m using DRV8825 so I gave the steppers more current but still can’t pass 150mm/s.

Right now I have max speed: 8000 / accel: 2000
that gives me 133mm/s max speed.

I did change the TCCRB_REGISTER to disable the prescaler. What are you using?


BTW, I’m using the IN not the L signal so theoretically the PMW frequency is not at play cos IN is analog - it will only take the voltage into account (from the POT for instance). Well, that’s my understanding.

I haven’t tried Grbl on laser yet. I had smoothie running pretty well and then started to look at switching to Grbl due to raster issues I couldn’t solve. Then I had a forced break from laser project due to workload. I can’t really help with the settings. It’s very possible that Arduino is not able to process the steps at those speeds. The 8825 drivers can definitely do faster speeds. I run those on my CNCs and I think that’s what’s on the MKS boards.

@cprezzi ​ does grbl have a setting for pwm period? I had this result when set to 20 instead of around 200 in smoothie but I am unfamiliar with grbl firmware

Claudio told me the setting exists for the frequency which is 1/period. Of course I haven’t done it myself so no idea but I thought it was there…


// Disable prescaler -> 62.5kHz
// 1/8 prescaler -> 7.8kHz (Used in v0.9)
// 1/32 prescaler -> 1.96kHz
// 1/64 prescaler -> 0.98kHz

I’ve played with, compiled a few times with different options but no real change. I’m guessing that’s because I’m applying PWM to the IN instead of L on the LPS.

I couldn’t find an option to open drain or invert PWM pin on the arduino or the cnc-shield. Looks like now this is the question.

Anyone that have already connected an arduino/cnc-shield to L without an additional/external mosfet to create an open drain?

Appreciate you all jumping in.

There is a great deal of info about Laser Power Control on Don’s page. http://donsthings.blogspot.com/2016/11/k40-laser-power-supply-control-take-2.html If you go towards the bottom, you will see a discussion about the Level Shifter.

I ended up buying a cohesion3d. Moving the arduino/cnc-shield back right where it belongs, the cnc machine.

Thank you all for the input.

I see two problems here. First, don’t feed a PWM signal into the analog IN pin. Let the pot connected at the IN pin (for adjusting max power) and feed the PWM to the L pin. Therefore you need to invert the signal either by a transistor or a mosfet.

You could not expect the same results like with the moshi board, if you feed the signals differently.

Next step would be to test different PWM frequencies. Higher frequency and feed produces deeper grooves with less burning, lower frequency and feed gets darker and better grayscale.

I got the C3D yesterday and I’m now playing with your modified $33 grbl-lpc. I’m having great results. Still tuning/learning the relations between feeds x speeds x freqs. I’ll post my results.