Grayscale issues

Hi all, new forum member here.
I have literally spent months trying to get grayscale to work properly on my machine. I have tried both Marlin and GRBL firmware, as well as various plugins and software to no avail. I was hoping I would have luck with Lightburn but this too seems to be unsatisfactory.

I initially used Marlin firmware on an Arduino Mega 2560 (clone) with Lightburn but have now switched to GRBL on an Arduino Uno (clone).

No matter what I do there is very little difference across grayscale % power - see images.

My current hardware and firmware is:

Hardware
Laser diode 15w - https://www.aliexpress.com/item/33022812797.html?spm=a2g0s.9042311.0.0.27424c4ddjNaEf
Arduino Uno (clone)
CNC shield V3.51

Firmware
GRBL v1.1j

Within Lightburn I have set the maximum power at S600 (being 60% of the 1000 that GRBL allows) to ensure I do not shorten the life of the laser.

As can be seen, between 100% and 50% at 600, 700, and 800 mm/min there is no/very little variation in darkness. At 40% there is a drop-off in darkness, and nothing at 30%, 20% or 10%. A similar thing is seen at 1100mm/min but the drop-off is at 50%.

Grayscale%20test

I am suspecting that given I have used a variety of hardware, firmware, and software it must be an issue with the laser itself (or the laser driver), although it says it supports TTL/PWM.

Any help in getting it to give better results is appreciated.
On a side-note, I am also in the process of building a CO2 laser engraver which I will use Lightburn with as Lightburn is the best front-end software I have come across.

Thanks in advance.
Denyse

Given that there is no such thing as a 15w blue diode laser, I suspect it’s the driver itself that’s causing you grief. These systems usually pulse internally at a 50% duty cycle, overdriven when on to give the “15w”, but available only half the time. You might need to specify a longer PWM period in GRBL to make it work with the driver.

I am also not familiar with GRBL 1.1j (1.1f is standard, 1.1g is available from some vendors who’ve customized 1.1f). Where did you download it? I don’t see anything like a wiring diagram, so it’s possible it needs to be wired differently than you have it. Has the seller provided any info?

You can save the GCode from LightBurn and inspect it yourself - there’s no magic happening there - It’s pretty basic G1 X Y S F commands.

Hi Oz,

Thank you for your quick reply.

Sorry, you are correct it is only GRBL 1.1f I am running - probably getting mixed up with all the firmware versions I’ve tried! I downloaded from the GRBL site on GitHub. I note as of yesterday there is now version 1.1h available from the site.

According to the GRBL site version 1.1h includes the following: Support for Protoneer CNC Shield v3.51. Step/dir on pins A3/A4, and coolant enable is moved to D13 (old spindle direction pin). Variable spindle/laser mode option IS supported for this shield.

I wonder if the fact the variable spindle/laser mode is supported for the shield in the latest edition would also make a difference. Before I delve into this though and upload that I’ll take a look at your suggestions and see if a longer PWM period helps with v1.1f.

Regarding the wiring, the seller did not provide any info. You will note it has both 3 pin and 2 pin TTL/PWM connectors (as in this image from the internet which appears to be the same driver) . I was unable to get it working with the 3 pin connector (+ - and signal) and am using the 2 pin connected to the signal and ground of the spindle enable of the CNC shield.

2%20and%203%20pin%20pwm-ttl

Thanks again for your feedback. I’ll let you know how I get on (either good or bad) in the hopes it may be of use to someone else encountering the same issue.

Kind regards
Denyse

Hi Oz,

I’ve now been into the GRBL cpu_map.h file and tried each of the following prescalers in turn, but I’m getting the same results. I may try the latest version of GRBL tomorrow and see if that helps - although I must say I don’t hold out any hope.

// Prescaled, 8-bit Fast PWM mode.
** #define SPINDLE_TCCRA_INIT_MASK ((1<<WGM20) | (1<<WGM21)) // Configures fast PWM
mode.**
** // #define SPINDLE_TCCRB_INIT_MASK (1<<CS20) // Disable prescaler -> 62.5kHz**
** // #define SPINDLE_TCCRB_INIT_MASK (1<<CS21) // 1/8 prescaler -> 7.8kHz (Used in v0.9)**
** // #define SPINDLE_TCCRB_INIT_MASK ((1<<CS21) | (1<<CS20)) // 1/32 prescaler -> 1.96kHz**
** #define SPINDLE_TCCRB_INIT_MASK (1<<CS22) // 1/64 prescaler -> 0.98kHz (J-tech
laser)**

There’s no doubt the laser is turning on and off and the gcode for the first 2 passes at 600mm/min along the x axis direction show the S value changing - below with added comments. I even upped the laser max power from 60% to 80% as shown in the gcode and this gave the same results as the 60% max power in my first post

; LightBurn 0.9.04
; GRBL device profile, absolute coords
G00 G17 G40 G21 G54
G90
M4
; Scan @ 600 mm/min, 100% power
M8
G0X20Y13.1
G91
G1X10F600S800 // 100% power where device settings using GRBL are fixed at max power of 80%
G1X5S0
G1X10S720 // 90% power where device settings using GRBL are fixed at max power of 80%
G1X5S0
G1X10S640 // 80% power where device settings using GRBL are fixed at max power of 80%
G1X5S0
G1X10S560 // 70% power where device settings using GRBL are fixed at max power of 80%
G1X5S0
G1X10S480 // 60% power where device settings using GRBL are fixed at max power of 80%
G1X5S0
G1X10S400 // 50% power where device settings using GRBL are fixed at max power of 80%
G1X5S0
G1X10S320 // 40% power where device settings using GRBL are fixed at max power of 80%
G1X5S0
G1X10S240 // 30% power where device settings using GRBL are fixed at max power of 80%
G1X5S0
G1X10S160 // 20% power where device settings using GRBL are fixed at max power of 80%
G1X5S0
G1X10S80 // 10% power where device settings using GRBL are fixed at max power of 80%
G1Y0.12S0
G1X-10S80
G1X-5S0
G1X-10S160
G1X-5S0
G1X-10S240
G1X-5S0
G1X-10S320
G1X-5S0
G1X-10S400
G1X-5S0
G1X-10S480
G1X-5S0
G1X-10S560
G1X-5S0
G1X-10S640
G1X-5S0
G1X-10S720
G1X-5S0
G1X-10S800

Tomorrow is another day, so it’ll have to wait until then.

Kind regards
Denyse

Hi Oz, and other members/visitors,

An update on progress for those having same/similar issues.

I tried out the new version (v1.1h) of GRBL and had no improvement.

I was able to get these results using the following settings - I went back to v1.1f of GRBL just because I had all my settings saved properly.

Test%20scale

S value maximum (device settings) - 600
Speed - 1000mm/min
Min power - 0%
Max power - 100%

As can be seen there is very little variation in the darker shades from about 75% upwards, and in the lighter shades from about 25% downwards.

I then got the following using these settings:

Test%20scale%20reduced%20max

S value maximum (device settings) - 600
Speed - 1000mm/min
Min power - 25%
Max power - 75%

This has given a much improved variation in shades between 5% and 100%. I am sure there can be more tweaking but I was happy with this so far as it’s progress from the many months it’s taken to get to this point.

Unfortunately I didn’t have any further luck with the power scaling feature in Lightburn.

I hope this helps anyone else who may be experiencing similar issues.

Kind regards
Denyse

I was using an Arduino Uno a while back and it worked like a champ. The version of GRBL you have will have Laser mode and I am sure you turned that on. The thing I noticed in your comments was the intensity of 600 for ‘full power’. I have my S set at 255 in and that seems adequate - Edit, Device Settings, just above baud rate.

Hi Jeff,

Thanks for that.

I did try S255 but it was extremely light.

It seemed like S1000 was 100% with GRBL but not wanting to overwork the diode I’ve restricted it to S600 or 60% of maximum.

Much better results were obtained but it is highly dependent on the wood I’m engraving.

Some I have to increase the minimum from 0% to 25/30% with maximum at 75-100%.

I did note in GRBL firmware the laser settings are 255 so not sure why it’s so light when I set to 255 in device settings and then use 100% power in lightburn.

Thanks again.

Kind regards

Denyse