Dan:
No, if its reporting .95 at S100, then the spindle range is set fine. Does the REM:50 sho up if you do a S50M3 when the dial on the pot is at 100%?
If so, then its probably all good. If you jog the motors , the PWM will follow whatever the REM:% says. Of course, you may not easily see it, your only getting 1 fire pulse per motor step. Make sue you have 1 dialup up for pulse count as well, if pulse count ios set to zero, then it will also not fire..
Art
Arduino based Laser Control
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: Arduino based Laser Control
rem 50 may show up when pot at 100% it flickers from 50 to 100 or 500, its to fast for me to read it comes up with 1 fire pulse, there is a in cress in pwm but the gape between pulses is very long 1/2 second what may be ok the pwm is not steady
I tested doing the same thing with engrave it worked well S50M3 with setting pulse at 1, pwm change with pot value.
ran a g code it worked very nicely with pwm changing value with pot.
if you wont me to try something else let me know
but its the bees knees in engrave mode.
I will strip out the yun parts in the code and see if there is a change
I tested doing the same thing with engrave it worked well S50M3 with setting pulse at 1, pwm change with pot value.
ran a g code it worked very nicely with pwm changing value with pot.
if you wont me to try something else let me know
but its the bees knees in engrave mode.
I will strip out the yun parts in the code and see if there is a change
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Arduino based Laser Control
Hi Dan:
Its weird that only the PWM mode is affected.. sounds like Engrave mode is fine. The engrave mode doesnt use th ePWM at all, it uses serial power, so it must be something to do with the actual PWM signal, which sounds right. SO long as its set at 50hz, it should work OK.
The system can be sensitive to kernal speed, mine is limited to about 35K-40Khz, any higher than that and
the arduino has trouble reading the serial input fast enough.. PWM though should be the easiest one to read
so there must be something dicked up there. Let me know how it runs with the YUN stuff out, mayeb it will help.
If not, we can always make up a test of some kind. Im thinking the interrupt for the pot may be different if your not
using a yun, the PWM relies on interrupt #6 on pin7. In a YUN you attach this interrupt by attaching it to
interrupt #4 which is done by one of two lines in the code...
attachInterrupt( 4, DUMMY, CHANGE ); //reattach the spindle interrupt
This attachment to interrupt #4 actually makes interrupt vector #6 work on a YUN, it IS possibel that if its not a yun, you need to use interrupt 6, so it may be you need to change those two lines to the following two lines as replacment for each call to attachinterrupt. Generally a leonardo cannot use attachinterrupt to gain access to int 6, so the following two lines replace the one call to attachinterrut( 4...
EICRB |= (1<<ISC60)|(1<<ISC61); // sets the interrupt type
EIMSK |= (1<<INT6); // activates the interrupt
Art
Its weird that only the PWM mode is affected.. sounds like Engrave mode is fine. The engrave mode doesnt use th ePWM at all, it uses serial power, so it must be something to do with the actual PWM signal, which sounds right. SO long as its set at 50hz, it should work OK.
The system can be sensitive to kernal speed, mine is limited to about 35K-40Khz, any higher than that and
the arduino has trouble reading the serial input fast enough.. PWM though should be the easiest one to read
so there must be something dicked up there. Let me know how it runs with the YUN stuff out, mayeb it will help.
If not, we can always make up a test of some kind. Im thinking the interrupt for the pot may be different if your not
using a yun, the PWM relies on interrupt #6 on pin7. In a YUN you attach this interrupt by attaching it to
interrupt #4 which is done by one of two lines in the code...
attachInterrupt( 4, DUMMY, CHANGE ); //reattach the spindle interrupt
This attachment to interrupt #4 actually makes interrupt vector #6 work on a YUN, it IS possibel that if its not a yun, you need to use interrupt 6, so it may be you need to change those two lines to the following two lines as replacment for each call to attachinterrupt. Generally a leonardo cannot use attachinterrupt to gain access to int 6, so the following two lines replace the one call to attachinterrut( 4...
EICRB |= (1<<ISC60)|(1<<ISC61); // sets the interrupt type
EIMSK |= (1<<INT6); // activates the interrupt
Art
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: Arduino based Laser Control
I am not quite sure what need me to do
do I replace
//attachInterrupt( 0, DUMMY, RISING ); //pulse external monitor
//attachInterrupt( 4, DUMMY, CHANGE ); //sets the routine to call..
with
EICRB |= (1<<ISC60)|(1<<ISC61); // sets the interrupt type
EIMSK |= (1<<INT6); // activates the interrupt
then what do I do with this bit
//detach the spindle interrupts.
//detachInterrupt(4);
//attachInterrupt( 1, DUMMY, RISING ); //reattach the spindle interrupt
and this as well
attachInterrupt( 4, DUMMY, CHANGE ); //reattach the spindle interrupt
detachInterrupt(1);
do I replace
//attachInterrupt( 0, DUMMY, RISING ); //pulse external monitor
//attachInterrupt( 4, DUMMY, CHANGE ); //sets the routine to call..
with
EICRB |= (1<<ISC60)|(1<<ISC61); // sets the interrupt type
EIMSK |= (1<<INT6); // activates the interrupt
then what do I do with this bit
//detach the spindle interrupts.
//detachInterrupt(4);
//attachInterrupt( 1, DUMMY, RISING ); //reattach the spindle interrupt
and this as well
attachInterrupt( 4, DUMMY, CHANGE ); //reattach the spindle interrupt
detachInterrupt(1);
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Arduino based Laser Control
Dan:
I need to read a bit to see if that will work and what needs to change. Leave it for now.. Liek you say, NGrave mode does everything one needs anyway..
Art
I need to read a bit to see if that will work and what needs to change. Leave it for now.. Liek you say, NGrave mode does everything one needs anyway..
Art
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: Arduino based Laser Control
ok just let me know when you have something to try
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: Arduino based Laser Control
art I did a trucken nob thing I forgot to connect up the common wire to the bob.
it does work in PWM mode and for some reason the MB-06 is running the at 12Hz.
its pulsing so fast you can`t see the change on the screen but I can see it on the scope.
I will change over to using the G540 for the pwm and see if that makes it run at 50Hz.
sorry for being a nob
it does work in PWM mode and for some reason the MB-06 is running the at 12Hz.
its pulsing so fast you can`t see the change on the screen but I can see it on the scope.
I will change over to using the G540 for the pwm and see if that makes it run at 50Hz.
sorry for being a nob
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Arduino based Laser Control
Dan:
Funny thing is I did the same early on, forgot to hook up the 0vdc, so the signals were very noisy.
I had figured last night something must be up since you switch from diags to PWM when you turn on the spindle,
this means the PWM interupt must work.If the PWM is truly too low a freq, just tell it to go a bit faster in the
Darwin Diags menu under PWM frequency. ( Dont enter the frequency in Darin itself, just in Mach4, Darwin uses a differign formula and will report 25hz on a 50hz PWM system.
If the PWM is only at 12hz.. thats slow, not fast. It should make a PWM waveform at 50hz, which is 200us per PWM pulse cycle. Anyway, with the ground wire hooked up you should be seeing that REM:50 in the top of the screen in CNC mode if you select S50M3.
If so, I think your good to go.
Art
Funny thing is I did the same early on, forgot to hook up the 0vdc, so the signals were very noisy.
I had figured last night something must be up since you switch from diags to PWM when you turn on the spindle,
this means the PWM interupt must work.If the PWM is truly too low a freq, just tell it to go a bit faster in the
Darwin Diags menu under PWM frequency. ( Dont enter the frequency in Darin itself, just in Mach4, Darwin uses a differign formula and will report 25hz on a 50hz PWM system.
If the PWM is only at 12hz.. thats slow, not fast. It should make a PWM waveform at 50hz, which is 200us per PWM pulse cycle. Anyway, with the ground wire hooked up you should be seeing that REM:50 in the top of the screen in CNC mode if you select S50M3.
If so, I think your good to go.
Art
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: Arduino based Laser Control
yer seeing rem 50 at s50m3, rem 100 at s100m3,
so its Defiantly all go.
so make me fell like a nob forgetting to connect 0v up to bob from arduino
so its Defiantly all go.
so make me fell like a nob forgetting to connect 0v up to bob from arduino
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Arduino based Laser Control
lol.. dont feel too bad, I forgot to do it as well when I hooked up, and I spent
25 years as an electronics guy...
Art
25 years as an electronics guy...
Art