GBRL PWM Setting - It almost doesn't change the power

Machine: K40

Board: Cohesion 3D

Firmware: GRBL-LPC

Problem/ Question: Hi,
I have a K40 with Digital Panel but I have installed an Ampmeter to check the proper mA the laser it shooting at.
I ran some tests with GBRL-LPC firmware and lightburn to see how it managed power but results are far from satisfying: I’ve create 10 rectangle, each one running at a different power (10% increments), but the results shows (also checking the Ampmeter) that actually from 100% to 60% the laser is always firing at 100% (15mA, that I have manually set as max power) and then it decreases reaching 6mA for the 10% rectangle (I was expecting a value closer to 1.5mA).
I have tried to change the PWM both in the confing.txt file (from 200 to 400) and in GBRL changing $33 from 5000 to 10000. In the first case nothing happens, in the second case the laser doesn’t even fire.

What could I do? Am I missing something?

Also, in the confing file I tried to change the laser maximum power from 0.8 to 1 to see if anything would happen but leaving the digital panel at 43% (which is the value I was setting it for shooting at 15mA) it still shoot at 15mA. Is it normal?
With GRBL should I always also change the confing.txt file or it doesn’t matter any longer?

Thank you very much for your support,

My best,

Alessandro

I would recommend running Smoothie, not GRBL-LPC - since we fixed the raster speed issue in Smoothie some time ago there is almost no reason remaining to run GRBL.

You can reflash the SD Card with clean files for Smoothie as explained on the bottom here: Cohesion3D Board Indicator Status LEDs

Then you can try the exact instructions here: PWM tuning for Smoothie Firmware

Hello,

I have tried what you have suggested (everything went smoothly and the LEDs on the board are perfect after re-installing Smoothieware) and I ran some tests.

The test are 20 squares with +5% increments (starting at 5% all the way up to 100%).
Each test was ran at 260mm/s at 100% Power both in Ordered and Greyscale mode and then at 100mm/s at 100% Power again in Ordered and Greyscale mode.
I ran GRBL, Smoothieware with PWM set at 200 and Smoothieware with PWM set at 400.
At fast speed (260) GRBL has been the most successful. At slow speed Smoothie was better at greyscale but not ordered when set at 200 PWM.
Smoothieware at 400 PWM was giving a slightly better scale (with the maximun value at 15mA it was engraving the 5% square at 5mA instead of 6mA), but still far from good. At the same time setting 400 PWM in Smoothieware gave big problems in alignment: all the squares are skewed as you can see in the picture.

GRBL: https://imgur.com/w1DrPEK
Smoothie 200 PWM: https://imgur.com/OHzqt3W
Smoothie 400 PWM: https://imgur.com/tLHSuIR

Please pardon the barrel distortion given by the phone camera I’ve used to take the pictures…

What shall I do? I am really lost…

Thank you very much,

Alessandro

the results looked dithered - did you create those squares in a graphics editor and then push the raster image to the laser or did you create them as objects in ligthburn and scale the power accordingly using the Shape Properties dialog?

Hello,

yes, there are two examples for each setting:
One is in “Ordered” mode, the other one is pure greyscale (254 DPI) as if it was vector engraved.
Therefore the power is not scaled down directly in the Shape Property: I have done it this way because you can clearly see that the details when in ordered mode are way better if using GRBL.
In terms of power, before doing this, I have tried making squares and lowering the power down in the Shape Property windows and the results were exactly the same: the power doesn’t go down properly…

OK. that explains what i"m seeing perfectly then.

Laser power vs output doesn’t scale linearly. It’s tube- and power supply-dependent and every machine is different. I would definitely suggest avoiding the dithering when testing relative power levels as that can give you strange results. Squares with power levels scaled using the shape properties method are going to be more consistent and accurate.

There’s also the material to consider: material doesn’t respond to power linearly either, depending on what it is. Acrylic is very consistent, both in terms of response on the piece and batch-to-batch, but wood not so much. I have some 3mm wood that gets a very dark black at 20%/200mm/sec, and another wood that is a light brown from 15%-50%/200mm/sec, then darkens gradually.

The point i’m trying to make is, there are a lot of variables that can affect apparent power, and you’ll have to play around with it a lot to get results you want.

Hello,

I am sorry but I don’t really see your point.
I have made two tests, ordered and greyscale, because the point is not only the comparison among GRBL and Smoothieware from a “power” point of view but also in terms of precision, and that can be better seen engraving a fine pattern like in the case of the ordered image.

Now, as I haven’t changed material but I have engraved on the exact same piece of wood, it is a good representation of the limits of the two firmware. GRBL, as you can see, is far more precise than Smoothieware.

Also, power wise, I have checked manually (by changing the power on the digital panel of the PSU) and the laser would still fire (and engrave) at 2mA.
Apart from not beeing linear, as I have already stated, it doesn’t reach 2mA when set via software with Lightburn and that then, I guess, it is surely a software/board problem.

So I have made some further tests and investigations…

Firstly I created two new tests:

  1. 20 Squares, +5% increments (via Shape Properties panel), vector engraving greyscale.
  2. 20 Squares, +5% increments (raster image), mode: ordered

I used GRBL with these settings:
Imgur
As you can see PWM are set to 200 (5000 in the code).
I tried to set them to 400 (10000 in the code) but the laser won’t fire (even if I change the config.txt file on the SD card to 400)
Results show no contrast but extremely precision at whatever speed (I set 500mm/sec even if clearly it wasn’t going at that speed).
GRBL RESULTS: https://imgur.com/EhQWHk5

Then I tried Smoothieware and, before running the tests, I followed the PWM setting description obtaining the following data (with Max Power set to 10mA on the analog AmpMeter):
S | @ 200 PWM | @400 PWM
0.1 | 5mA | 3.5mA
0.2 | 5.9mA | 4.3mA
0.3 | 6mA | 5.1mA
0.4 | 7mA | 6mA
0.5 | 8mA | 6.2mA
0.6 | 9mA | 7.2mA
0.7 | 10mA | 8.2mA
0.8 | 10mA | 9.8mA
0.9 | 10mA | 10mA
1 | 10mA | 10mA

I therefore set the PWM to 400 for the test and I obtained a better greyscale compared to GRBL (probably because of the PWM?!).
Unfortunately Smoothieware is very imprecise and the borders of the squares are completely a mess and, in some cases, completely distorted (especially true when it comes to raster engraving in ordered mode).
SMOOTHIEWARE RESULTS:
Imgur
Is there a way to make Smoothieware more precise? This way it is unusable…
It is not a matter of speed because with GRBL the machine demostrated to be capable of precisely engraving at those speed. There must be some setting I am missing somewhere in Smoothieware…
Are there any PWM setting that I could try (I guess other numbers…?) to make the scale even more precise?

On the other hand, is there a way to set the proper PWM on GBRL so to obtain a proper greyscale?

Thank you very much for your support,

My best,

Alessandro

After some even further investigation I discovered the following (without solving any issues):
GBRL wise:
Setting in the config.txt file on the SD with PWM 400 and setting $33=400 would fire a very precise power scale when firing just a simple line but when trying to scan some text, images, vector engraving it would go completely crazy scanning some completely random lines.
Also, sending Gcode to the machine would produce different power output compared to what lighburn does when setting the power in the Cut dialog box.
For example setting the power in the dialog box at 10% would produce correctly a 10% output but when prompting in the dialog box G1 X100 S0.1 F600 the AmpMeter would read a different value (higher).

Seems to be interesting to investigate as I properly managed to output a line at 1Amp (read with the analog AmpMeter) which I have never been able to do before…

Anybody has some hint?

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