Author Topic: The Laser Project  (Read 12395 times)

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 2985
    • View Profile
The Laser Project
« on: December 29, 2019, 15:54:08 pm »
Here, where we share our finding and experiences related to use of the diode laser (more common and less expensive), CamBam, and other software. This is a continuation of the conversation started here

http://www.cambam.co.uk/forum/index.php?topic=8371.0,

but i will continue here and is dedicated to lasers.

To start the whole thing which got me interested in pursuing an idea of using CamBam for generating necessary gcode to laser cut pictures,

 https://www.youtube.com/watch?v=GHv_ZoR2kH0

If anybody have an idea, where to move it, change it, anything.. I'm absolutely fine with it.


Now, what I have found so far. Flattening the polylines as David suggested in other post does not work. As it create gcode with even Z value thru out the program, so in fact you get even shade spot. In the other hand, from my experience by leaving z values unmodified I got fairly detailed burn, but it slows down the XY movement and the Z axis looks like sowing machine needle bar on steroids. That's why I think Dave Benson idea of converting Z value to laser power PWM control is good one.

I attach the pdf file to show how my laser is connected and configured.  
My 2¢

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

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2371
    • View Profile
Re: The Laser Project
« Reply #1 on: December 29, 2019, 17:26:23 pm »
There are two types of images which can theoretically be reproduced with a laser:
1. A raster image which is actually BW (bi-level) image consisting of dots or lines with variable size/width. That's how laser printers print images. Color printers do the same but with four sets of raster imposed over each other. Same for the commercial offset printing.
2. Gray scale images where the intensity varies from 0% (white) to 100% (black). Like true BW photography. This method would be challenging because different materials will produce different shade under the same power from the laser. It would be non-linear and would require complicated calibration.

Therefore IMHO the first method is the preferred one. You either have the laser off or on. As for the dot size or line width - 64 discrete values covering the range from 0 to 100% are enough for producing an easily perceptible image. I'd expect the discussion to concentrate on this method. If, of course, I am not completely wrong. :)


Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4466
    • View Profile
Re: The Laser Project
« Reply #2 on: December 29, 2019, 20:30:44 pm »
Bubba,

Good thread, I look forward to the discussion.
Made in England

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6135
    • View Profile
    • Cambam V1.0 French Doc
Re: The Laser Project
« Reply #3 on: December 30, 2019, 00:31:08 am »
Hello

Is there any chance that it works with a laser post pro that write no Z ?

++
David

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 2985
    • View Profile
Re: The Laser Project
« Reply #4 on: December 30, 2019, 01:35:00 am »
Is there any chance that it works with a laser post pro that write no Z ?
*****************
David,
Honestly I haven't tried that, I know I used when profile cut the plywood at 0.042" depth increment. This need to be done in order to keep the laser focus in its focal length. I also know the laser power on/off is done by M11P#/M10P#, so on any active axis the power is on, is Z axis have any affect on this, I don't know..
  
What trigger the PWM, when variance in power is necessary when engraving?

Here attached picture engraved with Endurance laser with Lightburn software unfortunately it wont support Mach3 pwm. Most machine using this software are grbl arduino type. That leave me out..
« Last Edit: December 30, 2019, 01:42:19 am by Bubba »
My 2¢

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

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6135
    • View Profile
    • Cambam V1.0 French Doc
Re: The Laser Project
« Reply #5 on: December 30, 2019, 02:19:07 am »
I don't understand exactly how works you engraving method with the heightmap ; what I can say is that whith the pp in attachment on the previous message, the M10Px and M11Px are written in the GCode when Z go above or below the clearance plane; no change compared to the PP you're using, but the Z are totally removed from the Gcode (the M10/M11 are not affected)

++
David


Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1345
    • View Profile
Re: The Laser Project
« Reply #6 on: December 30, 2019, 07:08:26 am »
Eddy I haven't tried the lines option and will do so later today.

Bubba I looked at the video you pointed to and I noticed that he replaced all Z height values with
Z = 0 so this tells me that Mach3 only needs to see a Z value (could be any number) to trigger the M codes to stop and start the laser. Is this important, don't know yet, but I have noted it down.
I  also read down in the comments that he says he's using an undocumented feature of Mach3
using  a E1P1 E1P0 pair.

I'll try and keep to the Mach3+Laser PP here as much as possible.

My understanding is that you emit a M11P1 and then use the Z axis going above and below the stock surface to trigger the laser on and off.
And then when the Lasing code is finished emit a M11P0 to turn the feature off.

I have made a new file for you to check, I have scaled the spindle speed  from 20 to 100 rpm
When I looked at the file in more detail I found that some of the hole depths ranged to into the 5 to 10 percent PWM range (which I think would be to low) so the minimum value in this file is 20 percent.

You'll be able to change this number to suit your machine and work piece.
The file is in inches.

I chose a small file size of 5 x 5 1\2 inches which has some gradient shading.
 And shouldn’t take all that long to run.
I just need to know if it runs successfully turning on and off the Laser once the basics are
right, then we can move on to the decoding schemes weather it's Rastering or something else.

Edit to add:
After a little bit of digging around, I've found out that any movement on any Axis will trigger the cut.
This File has a delay or dwell in milliseconds you must make sure this is set in your Mach3 config screen.
Dave
« Last Edit: December 30, 2019, 11:49:11 am by dave benson »

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 2985
    • View Profile
Re: The Laser Project
« Reply #7 on: December 30, 2019, 15:52:14 pm »
Eddy I haven't tried the lines option and will do so later today.
******************
Personally, I like the lines better than the circles to..

Dave,
 I'm looking forward to try this gcode. As we are using spindle motor output to control laser power I think M3, M5 are nesesary.

I  also read down in the comments that he says he's using an undocumented feature of Mach3
using  a E1P1 E1P0 pair.
*************************************************
I have missed that, no idea  what those do..

Here what I have seen so far running part of the gcode you created, yes, the M3 before Sxxx is nesesary because the with out there is no PWM control, the power is wide open, after editing the gcode by adding M3 those S values were varied accordingly.


The P values were way to long, after editing some of them from P24.1 to P10 and then to P 5 the diference can easily be seen.
As seen on image, the unedited code burned the 1/4" thick plywood most all the way thru, so I quit because there was no valuable info to get from this. ;)

"I chose a small file size of 5 x 5 1\2 inches which has some gradient shading.
 And shouldn’t take all that long to run.
I just need to know if it runs successfully turning on and off the Laser once the basics are
right, then we can move on to the decoding schemes weather it's Rastering or something else."

Yes, it did.All that laser on/off was correct.   

Here is copy of part of conversation explaining why particular version of Mach3 should be used with laser and it was written by guy on Mach3 and other forums named Tweakie.

 "This now means that the undocumented M Code command M11P1 will turn on Output #1 and M10P1 will turn off Output #1 (the P defining the Output #) coincident with axis movement and without any noticeable delay.
There may be some other refinements made before the latest version of Mach3 R3.043.056 is released and posted on the Artsoft website"

Attached is picture of image that was lasered from gcode created by CB highmap plugin. Feed 60 ipm, spindle/power 30.
« Last Edit: December 30, 2019, 20:26:08 pm by Bubba »
My 2¢

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

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1345
    • View Profile
Re: The Laser Project
« Reply #8 on: December 31, 2019, 02:28:50 am »
HI Bubba
Here is a PP and post treatment to put in your CamBam post folder.
Open up the cb file.
Check under the machining tab to see if the PP is there.
Select the system tab and select the post processors folder.
Select the PP  ---->  LaserPPG81ToLaser.
Scroll down to the same spot as in the picture.
An explanation of what the variables are is in the cb file.

That file has four 1\8 holes on a 4 inch square each with a different depth.
It produces the CB file that I've supplied.
You can limit the m\s dwell time with the last variable I've set it to 10 for example.

I'll have to explain this CB thing so the values that you change actually stick.

At first, say you change the m\s value to 20 from 10  altering the text, then right click and
select save and then right click and select reload, it may be prudent to right click on the PP folder
and select refresh too.


Then generate the code and have a look at the generated files one will be the standard file
and the other, the altered file this is the one you run.

You should experiment with this one first and when you are happy with the delay values
you can move on to the semitone plugin output (the holes one for now).
And see how you go.

Just remember to enter the new -Z value into the pp section where I showed you  when you
select a new image so the scaling is correct.


Dave

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1345
    • View Profile
Re: The Laser Project
« Reply #9 on: December 31, 2019, 02:30:08 am »
Ran out of room, Here's the PP files
Edit: to add file
« Last Edit: December 31, 2019, 02:35:40 am by dave benson »

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 2985
    • View Profile
Re: The Laser Project
« Reply #10 on: December 31, 2019, 14:22:37 pm »
I don't understand exactly how works you engraving method with the heightmap ; what I can say is that whith the pp in attachment on the previous message, the M10Px and M11Px are written in the GCode when Z go above or below the clearance plane; no change compared to the PP you're using, but the Z are totally removed from the Gcode (the M10/M11 are not affected)

++
David



David, sorry I missed your reply. I will try it and report back..
My 2¢

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

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 2985
    • View Profile
Re: The Laser Project
« Reply #11 on: December 31, 2019, 15:59:33 pm »
David, I just tried your PP without Z, and it does not work. It cut at 100% laser power, just what I thought, it does need Z, or some form for PWM to vary the laser power.

Gcode generated with your no Z PP called 'Pumpkin_No_Z' attached and the CB file as well.

Dave, tried the newest gcode you created, it was unmodified and here are the results..

Hole#      Burn dia in inch
 1                   0.010
 2                   0.112
 3                   0.161
 4                   0.140
For some strange reason I'm getting an error message when generating gcode using your PP PPG81tolaser. All, the PP and the post treatment exe file are placed in system, posts folder. Please see attachment. Looking at the gcode I dont not see M11P1/M10P1 statement even thou it exists in the PP itself.. I presume the .exe post treatment file is not working as it should.
« Last Edit: December 31, 2019, 17:59:59 pm by Bubba »
My 2¢

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

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1345
    • View Profile
Re: The Laser Project
« Reply #12 on: December 31, 2019, 21:20:23 pm »
Hi Bubba

When you download these PP's from one of my posted CB files you'll need to change
the directory name the PP is pointing too,to suit your machine.
CB just can't find the Post treatment File as it's looking for it on my machine.

Here is a pic of my test system's diagnostic screen everything works, lot's of blinking
lights as the program's runs.

I know your using the SS and I had a quick look yesterday for the .pdf setup to see what outputs they use
as this will tell me what Mcodes are needed. but I couldn't find it so could you post a link to it please.

In the pic of the two Ladies, was that code produced with some other software and does it work properly
if it works on your system could you post it as one look at it and I'll be finished.

I've done the code to do the raster line approach varying the power with line depth of the engraving line
and this works well on the test profile in Mach3 I set up to test this stuff.


Dave

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6135
    • View Profile
    • Cambam V1.0 French Doc
Re: The Laser Project
« Reply #13 on: December 31, 2019, 23:30:50 pm »
Hello

Quote
David, I just tried your PP without Z, and it does not work. It cut at 100% laser power, just what I thought, it does need Z, or some form for PWM to vary the laser power.

Ah OK, I did not know that the laser power must change during the "print", I thought it was set only at the beginning of the GCode then the laser was used with the same power to make something like a points matrix.

What I don't understand is how do you "link" the Z position to a power value for the laser ??? (without a Post treatment File)

++
David

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 2985
    • View Profile
Re: The Laser Project
« Reply #14 on: January 01, 2020, 01:30:37 am »
Here is a PP and post treatment to put in your CamBam post folder.
*********************
Dave,
just to make sure I won't screw it up I did follow it to a T.. ;) :D ;D
Thanks for straighten this for me. Corrected this issue and now another thing pop out. During gcode generation and message appears on the bottom"Unhandled Exeption ..." Please see attachment.

Are you referring to my laser setup pdf? I don't quite understand..

The picture of those ladies (my wife and her cousin) were my first attempt to cut picture, it was done with CB using the heightmap plugin  ;D ;D. I used the video about it posted in my first post.


David,
I really don't understand it completely to be honest. I only go by what I seen in the videos or read about it. I have made attempt to use other programs without much success, all of them asking for some kind Z command..      
« Last Edit: January 01, 2020, 01:41:35 am by Bubba »
My 2¢

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