Author Topic: GRBL Laser PP+PPT  (Read 521 times)

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1376
    • View Profile
Re: GRBL Laser PP+PPT
« Reply #15 on: January 03, 2021, 02:19:18 am »
HI Bubba and Fly

An other thing you suggested "don't put in a target depth', are you sure about this. The polyline generated is 'straight as the laser beam.

100% Bubba, you see I had to do the math to make the PPT.

In the pic I posted, there is a shot of my Height map settings.
The values in Red you will never have to change and are to do with scaling your Laser pwm.
The other values can change between Images of different sizes.

This is what happens when you enter a value in the Mop Target Depth.

First you load up and Image and with the constant scaling values set in the height map generator  0 to -.0255
these values match the values in the PP (or they should) If you leave the Target depth alone then you get a
Raster shaped polyline that varies in Z height along it's length and importantly between 0 and -0.255. perfect for your 8 bit pwm laser.
what this means is that a Z depth increment in the polyline is exactly 1 pwm value. you can do no better that this as there is no quantisation
error.

So what happens when you enter a value into the target depth (logically you might put the bitmap Z depth of -0.255)
what happens now is that the value from your already varying Z height polyline ( varying from 0 to -0.255) is offset another -0.255
this means that the laser power instead of being between 0 and 255 will be varying instead between 256 and 512, this is a bad thing as the effect at the laser is to produce a solid lased black image.

In Reply #11 you have described how to set up the Heightmap Generator plugin, suggested to remove the vertical line that always is there.
 In my case, every time I'm trying to do this CB becomes unresponsive.
Others suggested to increase resolution, I'm already using larger resolution than those setting you suggested X-Y Step are 0.12 mm
converted to an inch = 0.004724409".

Yes I had this issue too, but realised that the lines came from the boarders of some images that I had done in Inkscape.
you must use either Gimp or Inkscape on the images to make them lase properly even if it's only to remove the background properly.

The solution is to prepare your image in the paint program first and you will never run into this issue. (waiting for an eon for CB to respond)
You see in CB when you explode the Heightmap polyline, it is converted into a huge number of small lines and this is what slows CB down, so to avoid
the problem in the first place make sure all of your background is removed cleanly this is the lines.
My extra lines were caused by this and once I learned to prepare the image properly, I don't run into this issue.
continued


How the settings work in the Height map generator.

Say we want an Image of the laser at 100 mm x 100 mm, how big does the input Image have to be.
The 0.12 value is the laser width and for the lasers we have this is the expected well focused dot size. This is why it's a constant and should never change.
You then take the Y height and divide it by the laser width (0.12) giving you a required input image size of 833.3

If you wanted to know how big an existing Image will turn out  then for example a 256 x 256 image will be 30.72 x 30.72 mm. (256 x 0.12)
Bubba you were correct in your conversion 0.004724409.
Make sure your PP post build command arguments are identical to these in the pic.

Dave

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1376
    • View Profile
Re: GRBL Laser PP+PPT
« Reply #16 on: January 03, 2021, 02:21:03 am »
continued...
I've made two new PPT's  a GRBL one and a Mach3 one.
Mainly because I wanted them both simulate identically even though the Gcode
is different to suit each controller.

I've got to run a few more images through them, but at this stage they out perform albeit
not by much (all the low hanging fruit was already gone) by the older ones and they simulate close enough to be considered identical.
Here are a few screen shots of  the new Tardis optimised PPT. which does what it says on the box, and can travel forward and backward
in the file to make decisions now on what happens later in the file.They do this in one pass which is the challenge.

Dave
« Last Edit: January 03, 2021, 02:26:03 am by dave benson »

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3052
    • View Profile
Re: GRBL Laser PP+PPT
« Reply #17 on: January 03, 2021, 12:45:09 pm »
Hi Dave,

Thank you for reply and detailed explanation, I definitely use your advice going forward. Out of frustration, I left the machine on overnight with unresponsive CB running, so I have no idea how long it took to finally complete the task of exploding the polyline. But it did, and as you mentioned and in this case there are 162749 segments and its(poly) ID is 325129 ;D. It is the only polyline here ;D ;D. I'm going to try do the tile as shown in the video you shared, and will post about progress in the thread I started while back called The Laser Project.

Be Safe, Be Well. Happy New Year!
My 2¢

Win 10 64 bit, CB [1.0} rc 1 64 bit, Mach3, ESS, G540

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1376
    • View Profile
Re: GRBL Laser PP+PPT
« Reply #18 on: January 05, 2021, 05:13:31 am »
HI Bubba

I'm going to have a go at the tiles too, my brother dropped over the other day and I showed him the video
he mentioned that 'just maybe' there were some powder\baby blue tiles left over from an aquarium themed
bathroom renovation at my parents house , and he will look for them and if they are there he'll drop them over here.
In the mean time I wanted to do something rather than nothing, so I found a piece of chipboard that has been laminated
and the laminate has a crocodile skin texture, and the painted it with three colours, black,dark sea green and silver.
waited a day and then had a few practice goes at 100% 30% and then 20 %.

And to show fly what the differences were between using Inverted and non Inverted bitmaps with the Heightmap generator, I
made a small tut.
The Idea was too use the Ami pic to demonstrate the differences between the toolpaths with regard to run time from identical pics.

The first part of the process involves making a test tile and determining your maximum laser power, this is what those default values
I posted above are for, then once having determined the laser power required you then enter a value into the spindle scaling
part of the PP post built command arguments textbox you'll see numbers like this  -0.255 0 0 255
the last number is the spindle power scaling value if you have just made a test tile then it will be 255 = full power.
say you have determined that you need 30 % laser power then simply multiply  255 x 0.3 this gives 76.5
enter 76.5 where the 255 is and very importantly you must right click save all on the PP folder and then right click and reload
or the changes wont stick.
now just generate the Gcode and you are good to go, as all the pwm values will be scaled to 30 %.

So I loaded up the Ami Image and set the values in the heightmap generator, Image = size pixels.
and then generated the first heightmap then exploded it and removed the extra line.
generated the code and everything went fine, then I generated the second Heightmap and
exploded and rejoined the polyline but it would not generate any code. then I remembered this
important point. if you generate a Heightmap inverted then all is well,but if you generate a Heightmap
normal or not inverted then this polyline will be generated above the workplane so you have to select the
polyline and Align it with the Z plane with all values being negative and aligned at Z=0.

Here are a couple of pics from the process.
I'm lasing that bit of wood I mentioned earlier and have found the results promising.
I've noticed that the silver coloured paint must not have been left long enough to dry
as when it is lased in larger joined areas that the silver layer gets a bubble in it and lifts
away from the surface just a small amount (trapped solvent I guess).
Happy coming year to you and your family Bubba.

Dave

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1376
    • View Profile
Re: GRBL Laser PP+PPT
« Reply #19 on: January 05, 2021, 05:15:32 am »
more pics

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3052
    • View Profile
Re: GRBL Laser PP+PPT
« Reply #20 on: January 05, 2021, 14:08:50 pm »
Hi Dave,
Nice explanation, thanks. Here, I'm dealing with Mach3 shortcomings because I don't own GRBL. From what I read GRBL controllers are far superior as far as spindle PWM control.

Be SAFE. 
My 2¢

Win 10 64 bit, CB [1.0} rc 1 64 bit, Mach3, ESS, G540

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1376
    • View Profile
Re: GRBL Laser PP+PPT
« Reply #21 on: January 08, 2021, 02:18:55 am »
Hi Bubba/Fly

Quote
From what I read GRBL controllers are far superior as far as spindle PWM control.

Yes and no, You see I've been programming Atmel chips before Arduino was a thing and I use the
factory Atmel software Atmel studio7 and a fancy programmer.
To use that software you have to write code that's very close to the hardware, so I'm a fan of 8 bit micro controllers
But, what the original GRBL was written for a 16 MHz 8 bit controller, and what the GRBL people have
achieved in such a modest controller is remarkable.
You can now get GRBL ports to 32 bit controllers (Due) is one of many.

But make no mistake, GRBL is  not Mach3\4 or linuxcnc.
It makes perfect sense for hobby lasers and 3d printers, but would be less suited to
mills, you could do it, but it's better experience to use a fuller featured controller.

It goes like this:
The variable pwm mode (M3 on the GRBL )  on both controllers are for all intents and purposes the same problem solved the same way.
The M4 mode in GRBL  and variable feed rate mode on the Mach3 version are not really the same problem solved the same way.  one varies the power to the laser based on feed rate (constant power at the work piece), but with Mach3, the feed rate is varied with the laser being constantly at full power.

Dave

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1376
    • View Profile
Re: GRBL Laser PP+PPT
« Reply #22 on: January 08, 2021, 02:20:31 am »
continued...

In the overall scheme of things though, If you were to ask the question, what would you recommend to someone
with no cnc experience and saw the tile video and wanted to have a go, then I would recommend:
One of those 200 dollar lasers available everywhere, you see they are designed pretty well for Imaging with a laser.
They can achieve a more faithful representation of the image than for example all of us with large laser power,
Because their lasers are in the two to four watt range, it can represent a greater dynamic range.
One of those little imports  and Gimp\Inscape (essential) Lightburn or one of the alternative free ones.
This will provide a quick set up and result, as the laser based software was built from the ground up as laser
software, whereas using CB to achieve the same result requires a some  work  in the Imaging software
and to know the quirks of the Height map generator before you a decent result.

So this means that if you did a test where you took an identical image and lased it with a four watt laser
where the laser power varies over a range between 0 255 full power, then lase the image with a 10 watt laser
of course you have to turn down the power (test tile) to maybe 30 percent else you will burn the work.
What does this mean really, It means that your Image will have 70 percent less dynamic range as opposed to those
little laser imports. So there image will be noticeably more faithful to the original.

It' not all doom and gloom though (for us folks with higher power lasers) , what can we do to improve our dynamic range
when I was doing this a year ago now, I new about this problem, but as this is a very slow process I didn't intend to do
Imaging anyway, Now though I would like to do a photographic image in a tile, so need to address the problem.
What I'm going to do is order a longer focal length lens, IIRC there’s a lens with twice the focal length Than the one  I have.

What I think will happen is that the dynamic range will increase because the laser will be farther away from
 the work (but still focused)meaning less power to the work (effectively making your laser less powerful) If we are
really lucky then the power delivered would be in the two to four watt range like the $200 imports.
So you would need one lens for Imaging and one lens for cutting.
Dave

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1376
    • View Profile
Re: GRBL Laser PP+PPT
« Reply #23 on: January 08, 2021, 02:23:05 am »
continued...

I've finished up the Mach3 version of this pp+ppt, on the images I've done so far it's behaved itself.
I'll do a few more images to test it out, and then rewrite the GRBL one, as I want to make the experience of using them
be identical so if you ask a question about a problem you have, the answer will equally apply to each PP regardless
of what powers your machine be it Mach3 or GRBL.  when done I'll post them both.
I've been painting a flat piece of Alum stock at the moment and lasing it and then sanding it back on the belt sander
and reusing it.
I have a vagabond assortment of rattle paint cans, purchased from different places and so different brands, I started
painting and lasing,  and have found a wide range of laser power difference between them, same amount of coats
and colour, just different brands, the biggest difference was between two brands of Aluminium  paint.
One dis-appeared almost entirely while the other tenaciously hung on the the surface until a bubble formed
underneath it which lasted through until the end of the file, but almost immediately after finishing the job, the bubble split.
and it was the most difficult of all paint to clean off and start again.
This is one reason making a test tile is so helpful as you can tune the pwm to colour pretty quick and easy.
There's one pic of the last ppt modifications showing both inverted and non inverted tool paths being optimised.
The more red you see the more optimisation, the most optimisation happens where you see missing tool paths as
compared to a view in CB which is a full raster.
The other pic is of the first image done with the wood and silver and black paint, you can see what I mean
about the silver paint forming a bubble and falling off later.

Dave

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3052
    • View Profile
Re: GRBL Laser PP+PPT
« Reply #24 on: January 08, 2021, 12:47:49 pm »
Hi Dave,
Thank you for the explanation. I'm looking forward to your future experiments with this and will try to follow along. So far, my experimentation with the Laser Convert plugin and the gcode created did not produce satisfactory results for me. So I need to try something else.

Be Well.
My 2¢

Win 10 64 bit, CB [1.0} rc 1 64 bit, Mach3, ESS, G540

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8380
    • View Profile
Re: GRBL Laser PP+PPT
« Reply #25 on: January 08, 2021, 13:21:37 pm »
Dave Benson wrote: "What I think will happen is that the dynamic range will increase because the laser will be farther away from the work (but still focused)meaning less power to the work (effectively making your laser less powerful)"
-----------------------------
That old "power falls as an exponent (usually the square) of the distance" only holds for a divergent beam of light.  If your laser is still focused to a point at the greater distance, you're still going to be applying about the same power to the point of incidence.  You'd have to move it a tremendous distance away to get any reasonable reduction in power.

Other than a beam-splitter (which can slightly affect focus), I don't know of any way you can reasonably reduce the power, except by blocking a portion of the beam - right at the exit of the laser - with an aperture sized to allow a certain 'calculated area' of the beam to pass through.  It would have to be some darned heat-resistant material, even though it's not placed at the focal point.  It would be placed at the exit, before any focusing lenses.

Keep in mind that even an aperture will cause some diffraction of the beam at its edges.

Lloyd
« Last Edit: January 08, 2021, 13:35:58 pm by lloydsp »
"Pyro for Fun and Profit for More Than Fifty Years"

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1376
    • View Profile
Re: GRBL Laser PP+PPT
« Reply #26 on: January 08, 2021, 15:25:24 pm »
Yes you are quite correct LLoyd.

You see about a year ago when I first got my big laser, I recall visiting a ebay shop were they were
selling glass lenses claiming more power because they had a shorter focal length, so after
posting here I went and found the shop and they say that there lens is better because it has a focal length
of 2.3 mm against the standard 4 mm focal length. but the idea of going the other way was just an aberration. ;D

So that left me with the dilemma of what to do, I had worked out from my test tile results and
the input power of my laser (don't know the output power) so I hope everything is linear.
Anyway the abacus popped out 1.8 watts for 0 to 225, so 2 watt's is what i need and
this is not surprising really as that is what a lot of the ebay offerings are.

I looked at a 2 watt laser module and could get one for $70 and I could swap it out with the 15 watt
when needed but this still required me using the mill which is too slow for lasing and I use it for a lot for other
things, so today I bought a $200 dollar 650 mm x 500 mm 2 watt, the laser mount fit's my big laser too
so I can use it as well.
I'll just sit in the corner of the shop and let it run, if doing imaging then it's going to take time.

Dave

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2420
    • View Profile
Re: GRBL Laser PP+PPT
« Reply #27 on: January 08, 2021, 17:04:03 pm »
I've tested my laser module (which is claimed to deliver 5.5W optical power but I don't quite trust Chinese claims) from 40 to 100 mm above the stock surface. As long as the beam is focused I don't see any visible difference in the burned marks.

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8380
    • View Profile
Re: GRBL Laser PP+PPT
« Reply #28 on: January 08, 2021, 17:56:37 pm »
Fly,

As I stated above, you won't see any particular difference based upon distance, so long as the beam is focused properly.

I must be honest -- I've never done any laser engraving.  But during the 90s, I worked for about a year with our local planetarium to create laser projection systems with servo-based deflectors for doing 'drawing' on the dome  (I was the 'electronics guy'). I learned a lot about how they behave, and how various optics and distances affect their performance.

Lasers are lasers.  They behave pretty-much the same whether they're in the visible spectrum or IR, whether they're gas tubes or solid-state.

Heh!  At one point, we had the servo system fail in use, and ended up burning a hole in the fabric dome (even with visible-light tubes!  Yeah... Gas lasers back then!!! <grin>)

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"