Arduino based Laser Control
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: Arduino based Laser Control
for a test that's pretty cool
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Arduino based Laser Control
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
grey scales..
art
- tweakie
- Site Admin
- Posts: 171
- Joined: Wed Dec 01, 2010 11:58 am
Re: Arduino based Laser Control
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.
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.
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Arduino based Laser Control
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;
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.. I still dont know the minimum change the synrad will accept
but the responce does seem better.
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
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;
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.. I still dont know the minimum change the synrad will accept
but the responce does seem better.
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
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Arduino based Laser Control
Tweakie:
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
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
- tweakie
- Site Admin
- Posts: 171
- Joined: Wed Dec 01, 2010 11:58 am
Re: Arduino based Laser Control
Thanks Art, I will give that a try.
Tweakie.
Tweakie.
- tweakie
- Site Admin
- Posts: 171
- Joined: Wed Dec 01, 2010 11:58 am
Re: Arduino based Laser Control
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.
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.
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Arduino based Laser Control
Tweakie:
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
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
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: Arduino based Laser Control
you could change lcd.print to Serial.print so you can use the serial monitor
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Arduino based Laser Control
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..
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..