Arduino based Laser Control

A forum for the Arduino based Mach4/Darwin Laser Control Panel
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Arduino based Laser Control

Post by ArtF »

Hi Guys:

  Just tested some new power routines, heres that lighthouse on a granite tile, 300mm x 200mm , with a power gradient of 5% to 70% , it probably should have been a bit lower power.. but its all coming together. :)

Art
Attachments
Lighthouseingranite.jpg
BobL
Global Moderator
Global Moderator
Posts: 466
Joined: Sun Sep 05, 2010 7:18 am

Re: Arduino based Laser Control

Post by BobL »

Well done pal....  Only 1 million tests to go..lol


Cheers
Bob :)
Gearotic Motion
Bob
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: Arduino based Laser Control

Post by DanL »

for a test that's pretty cool
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Arduino based Laser Control

Post by ArtF »

Not as white as Id like.. I think perhaps its the type of stone..thats just a 6.00 polished granite tile from home depot.. Im thining different stones likely give varying
grey scales..

art
User avatar
tweakie
Old Timer
Posts: 170
Joined: Wed Dec 01, 2010 12:58 am

Re: Arduino based Laser Control

Post by tweakie »

Hi Art,

Very nice work indeed with the lighthouse on granite - I really must try something like that.

Now I am being extremely cheeky (and extremely lazy) here but back in post #8 you mentioned;

?you may not want a diagnostics mode at all, and if so, just a simple arduino with
no box, buttons or LCD display would work fine, the program would simply require a bit of recoding and you could hot glue the arduino into your cnc control box to permanently control your laser power
with no interaction?.

Is there any chance of a ?bare bones? arduino sketch (using just the Leonardo board and pot) so we can try out the ngrave mode of operation with Darwin ?.

Tweakie.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Arduino based Laser Control

Post by ArtF »

Tweakie:

  Well, the pot would be hard to read as to where you have it set..but then you could just label it and figure out the power as a
position thing..

  So to do that, all youd really have to do it lock it to NGrave mode.. since the unit now has to be switched to NGrave from Diags mode
when its powered up. So all youd need to do is use the sketch as it is.. and add below this line.,..

if( OpMode < 0 ) OpMode = 2;

the line

OpMode = 2;

&nbsp; This way the Leonardo would come up in NGrave mode ready to go. If you decide to do this let me know because Ill need to publish
the latest sketch I use as it makes the power run from 0 - PotPower in 100 steps of PWM instead of 0-100% determined by Darwin.
The difference is that previously if Darwin limited power to 20% it coudl only send 1-20 in 1% increments..so 20 steps.. but now Darwin always sends
0-100% in NGrave and the leonardo makes it 100 steps no matter the max power selected..&nbsp; I still dont know the minimum change the synrad will accept
but the responce does seem better.

&nbsp; I havent released the sketch information as yet because I just didnt want to confuse anyone currently building.. and the released Darwin isnt the
new 0-100% no matter the spindle speed seting, but the old one that sent power based on S word in photo mode.

Art
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Arduino based Laser Control

Post by ArtF »

Tweakie:

&nbsp; I should point out that none of the other code needs changing because no errors will happen if the lcd isnt connected or the buttons etc... the code assumes no push buttons need pushing and the lcd is only sent data, so if it isnt there, it doesnt matter, the system will still work..

Art
User avatar
tweakie
Old Timer
Posts: 170
Joined: Wed Dec 01, 2010 12:58 am

Re: Arduino based Laser Control

Post by tweakie »

Thanks Art, I will give that a try.

Tweakie.
User avatar
tweakie
Old Timer
Posts: 170
Joined: Wed Dec 01, 2010 12:58 am

Re: Arduino based Laser Control

Post by tweakie »

It was worth a try?

The modified sketch compiles OK and uploads OK but without the diagnostics / display it is hard to tell what is going wrong. The Step, Clock and Data signals are all present but the laser output (Pin9) remains Low.

It could be anything, even my Leonardo, so perhaps it may be best if I wait a while and see how others fare.

Tweakie.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Arduino based Laser Control

Post by ArtF »

Tweakie:

&nbsp; Id doubt it the leonardo, but as you say without a display its hard to say whats wrong. Probably is better to wait until at least one other has lasing just to make sure
it isnt something simple that Ive missed. It will be easier to troubleshoot such a thing if the other user has a display we can run diagnostics on. Make sure though that
the spindle is turned on in M4, without the spindle on, the leonardo will not engage the laser. ( as a safety). And remember, the laser will only fire once every step pulse
from the step flag..so it can be very hard to see unless your scanning along in a photo.

Art
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: Arduino based Laser Control

Post by DanL »

you could change lcd.print to Serial.print so you can use the serial monitor
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Arduino based Laser Control

Post by ArtF »

Might print a lot that way though... but it will work.. You could also erase all the code in the SetDisplay routine
and replace them with just a few Serial.print commands to print any important variables like the power with

Serial.print( PWMPower ); , at least youd know the power is coming in properly..



DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: Arduino based Laser Control

Post by DanL »

yea that's what I meant to say, my bits will be turning up tomorrow so I will start putting it to together I am going with the screen, pot, buttons and led
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: Arduino based Laser Control

Post by DanL »

Hi all I have received some of the bits need for this project forgot to order a screen.
I have been using the serial monitor the first thing I have found is I have to run the baud rate at 2400 so it works any higher it does not work very well at all.
there are a couple of other things that don't seem to be working right I will play some more and see what happens
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Arduino based Laser Control

Post by ArtF »

Hi Dan:

&nbsp; I havent played much with the serial monitor, in the YUN I use the console which works a bit different..

The LCD panels can be found on Ebay pretty cheaply.. but they take awhile to get form China. No rush, dont feel
pressured to catch up or anything... this is one of those long term do as you can type projects for me as well. :)



Art
Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests