thanks art I will strip it today a run some ruff tests not connected to Darwin I am getting a bob tomorrow so I will test it over the next few days
It will take a couple of days.
I have some advertising work to do engraving a label on 40 pot holders boring as sin to do, 1 minute per cut 1 minute to change pot holders.
Arduino based Laser Control
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: Arduino based Laser Control
Hi art an all I have removed all of the yun stuff, als I have got the board connected up to some switches an leds, with serial monitor for feed back it took a bits of mucking around to get the switch to work properly they do know.
everything seems to be working I will connect up to a bob and Darwin in the next few days.
I will repost the code when I have got everything working.
everything seems to be working I will connect up to a bob and Darwin in the next few days.
I will repost the code when I have got everything working.
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Arduino based Laser Control
DanL:
Excellent. Yell if and when you need help. My darwin is different from yours by a bit, the m4 guys need to fix licensing
before I can release it, as well as a new version since 2068 breaks all plugins again.. though Darwin is ready for 2068.
Art
Excellent. Yell if and when you need help. My darwin is different from yours by a bit, the m4 guys need to fix licensing
before I can release it, as well as a new version since 2068 breaks all plugins again.. though Darwin is ready for 2068.
Art
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: Arduino based Laser Control
cool one thing I have found the serial monitor does not play well with 32u4 boards.
I have set the serial writes in the same place in the program so it will be easy to comment them out so when the switches are working you will just be left with pwm, what is ok if only one thing is running on the serial monitor
I have set the serial writes in the same place in the program so it will be easy to comment them out so when the switches are working you will just be left with pwm, what is ok if only one thing is running on the serial monitor
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Arduino based Laser Control
DanL:
Yes, the timing as the panel is now is pretty critical, I limit myself to 30Khz for that reason.. I may have to update mine some day to a
arduino due at 80mhz to get the speed so I can go faster .. Serial monitor is a interrupt driven protocol in the end so it takes time
away from the system. Its OK for testing and debugging, but youll want to stop all messages when your using it for the laser.. Its
one reaosn the lcd is not using a two wire interface.. the 6 wire one is faster cpu wise..
Art
Yes, the timing as the panel is now is pretty critical, I limit myself to 30Khz for that reason.. I may have to update mine some day to a
arduino due at 80mhz to get the speed so I can go faster .. Serial monitor is a interrupt driven protocol in the end so it takes time
away from the system. Its OK for testing and debugging, but youll want to stop all messages when your using it for the laser.. Its
one reaosn the lcd is not using a two wire interface.. the 6 wire one is faster cpu wise..
Art
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: Arduino based Laser Control
using the serial monitor for testing with only Serial.print( PWMPower ); it has a slight effect on speed, any more than that has a big effect I could see it on my arduino oscilloscope when just sending out a tickle it has a longer delay for lasing.
I have added in a pwm out put for a 1 x 20 or 1 x 16 screen it can be used with a 2 x as well other wise when testing and doing a job it will be a guess as to what to set it to with the serial monitor not used it will be enough of a differences that it not worth the effort to use the serial monitor.
so it needs to done with a screen unless some gets this working on a faster board.
I will play some more tomorrow and see what I can come up with.
I have added in a pwm out put for a 1 x 20 or 1 x 16 screen it can be used with a 2 x as well other wise when testing and doing a job it will be a guess as to what to set it to with the serial monitor not used it will be enough of a differences that it not worth the effort to use the serial monitor.
so it needs to done with a screen unless some gets this working on a faster board.
I will play some more tomorrow and see what I can come up with.
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Arduino based Laser Control
DanL:
Way to go, experiment all you like and let us know what works and what doesnt. Once I release the
CAM module Ill be taking a coupel weeks break for debugging troubles and playing with laser routines while
I consider how to best do the 4th axis work..
Art
Way to go, experiment all you like and let us know what works and what doesnt. Once I release the
CAM module Ill be taking a coupel weeks break for debugging troubles and playing with laser routines while
I consider how to best do the 4th axis work..
Art
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: Arduino based Laser Control
will do
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: Arduino based Laser Control
I found a mistake may be it is here
int8_t PulsePin = 9; //Pin 9 will control the laser.
then you have
pwmWrite( PulsePin, 8); //set for 1us for laser tickle, should this be pin 9 not pin 8 what is a button pin
if( timeron ) //if the timercall worked..
but you have
//int8_t Buttons = 8; //analogue and digital are same numbers..be carefull if you use other pins..
correct me if wrong have not be able to do machine running test still waiting for parts from 500 km away, stuff from china bet it here ordered last week
also if some one wont to run a small screen a 1 x 20 or a 2 x 20 only they will have to work out how to change the screen button settings to do the different laser setting as if you disconnect the 3 buttons pin 10, the 4 buttons pin 8 will do what the 3 buttons do and and the same happens the other way around don't know why this happens but does.
its not a problem for be as I am using a 4 x 20 screen
I have set up a 2 x 20 screen so I can do some testing to the 4 X 20 turns up
it seems to be working ok with all buttons, pot and 2 x 20 screen connected with serial commented out.
some one could use serial with one comment only as that has about a 10 ms differences to it not commented out. the scope I am using is not that grate so it could be more or less. I need to get a decent one one day
that's about all for today's testing
int8_t PulsePin = 9; //Pin 9 will control the laser.
then you have
pwmWrite( PulsePin, 8); //set for 1us for laser tickle, should this be pin 9 not pin 8 what is a button pin
if( timeron ) //if the timercall worked..
but you have
//int8_t Buttons = 8; //analogue and digital are same numbers..be carefull if you use other pins..
correct me if wrong have not be able to do machine running test still waiting for parts from 500 km away, stuff from china bet it here ordered last week
also if some one wont to run a small screen a 1 x 20 or a 2 x 20 only they will have to work out how to change the screen button settings to do the different laser setting as if you disconnect the 3 buttons pin 10, the 4 buttons pin 8 will do what the 3 buttons do and and the same happens the other way around don't know why this happens but does.
its not a problem for be as I am using a 4 x 20 screen
I have set up a 2 x 20 screen so I can do some testing to the 4 X 20 turns up
it seems to be working ok with all buttons, pot and 2 x 20 screen connected with serial commented out.
some one could use serial with one comment only as that has about a 10 ms differences to it not commented out. the scope I am using is not that grate so it could be more or less. I need to get a decent one one day
that's about all for today's testing
Last edited by DanL on Thu Oct 30, 2014 10:19 am, edited 1 time in total.
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Arduino based Laser Control
Hi DanL:
>>I found a mistake may be it is here
>>int8_t PulsePin = 9; //Pin 9 will control the laser.
>>then you have
>>pwmWrite( PulsePin, Cool; //set for 1us for laser tickle, should this be pin 9 not pin 8 what is a button pin
Looks like Pin9 to me.? The 8 above is just the bit size.. Pin8 is buttons..Pin9 is pulse.. Pin 9 is the PWM pin..
>>t8_t Buttons = 8; //analogue and digital are same numbers.. be carefull if you use other pins..
That comment was a warniong to me that Arduino numbers pins a few ways. Pin 4 is digital for example but it also pin 6 if used for analog.
>>also if some one wont to run a small screen a 1 x 20 or a 2 x 20 only they will have to work out how to change the screen button settings to do the different laser setting as if you disconnec t the 3 buttons pin 10, the 4 buttons pin 8 will do what the 3 buttons do and and the same happens the other way around don't know why this happens but does.
I didnt know this, you mean disconnecting one butotn input screws the other? Must be my code.. I image the pins jump to fuill voltage and hoses the logic..
>>it seems to be working ok with all buttons, pot and 2 x 20 screen connected with serial commented out.
Excellent.
Good luck
Art
>>I found a mistake may be it is here
>>int8_t PulsePin = 9; //Pin 9 will control the laser.
>>then you have
>>pwmWrite( PulsePin, Cool; //set for 1us for laser tickle, should this be pin 9 not pin 8 what is a button pin
Looks like Pin9 to me.? The 8 above is just the bit size.. Pin8 is buttons..Pin9 is pulse.. Pin 9 is the PWM pin..
>>t8_t Buttons = 8; //analogue and digital are same numbers.. be carefull if you use other pins..
That comment was a warniong to me that Arduino numbers pins a few ways. Pin 4 is digital for example but it also pin 6 if used for analog.
>>also if some one wont to run a small screen a 1 x 20 or a 2 x 20 only they will have to work out how to change the screen button settings to do the different laser setting as if you disconnec t the 3 buttons pin 10, the 4 buttons pin 8 will do what the 3 buttons do and and the same happens the other way around don't know why this happens but does.
I didnt know this, you mean disconnecting one butotn input screws the other? Must be my code.. I image the pins jump to fuill voltage and hoses the logic..
>>it seems to be working ok with all buttons, pot and 2 x 20 screen connected with serial commented out.
Excellent.
Good luck
Art