Arduino based Laser Control

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Arduino based Laser Control

Re: Arduino based Laser Control

by DanL » Mon Dec 22, 2014 8:29 pm

thanks art merry xmas

Re: Arduino based Laser Control

by ArtF » Mon Dec 22, 2014 1:46 pm

Hi All:

  Just a note. Im playing with my laser today to see the differences between modes of the panel
to ensure its working as I wanted. Ive modfiied it a bit in Darwin. Heres a definition of how each mode
works.


Diags Mode:

  Used ony for testing, nice to see how many shots and at what power it takes to piece
  a particular material.
 
CNC ModE:

  In this mode, if the PWM spindle is on, during any motion the laser shoots. The power is
  set by the S word, ( S(SpindleMax) is equal to max power. BUT, the power is distance/time corrected.
  Let me explain that last term. Lets say you have a feedrate of 4000mm/min. Thats 66.6mm/sec.
  My laser shoots 5000hz, so 5000 times a second it can shoot. SO if Im moving at 66mm/sec, thats
  5000 shots over 66mm at top speed or about 75 shots per mm. My system has 250 steps/mm so thats
  75 shots over 250 motor steps..  so I only get about 30% of each fullpower shot over any 1 step
  of the motor.
    But what if Im still accelerating ? I may be moving much slower than 66mm/sec as I speed up, so the
  CNC mode takes account of how many steps Im currrently taking this second, compares it to the fastest
  I will go as determined by the F word, and scales all outpu8t to that max. This way, you dont get more
  energy per mm at acceleration or deceleration. This is very handy at smoothing out acceleration articfacts
  and stopping burning in corners.
    Its important to understand this as you must try to set a feedrate that isnt higher than you can go.
  For example setting a feedrate of F25000 when the fastest your drawing can get to is 250 will mean you
  will always have no more than 1% of your expected power.
 
Engrave Mode

  My favorite mode. In this mode the laser will NOT shoot unless a) its moving and b) its a G1 move.
  This means once you turn on the spindle, you can jog and it wont cut, run a Gcode program that uses a spindle,
  and the G1's will cut, while the G0's wont. this means you dont need a bunch of M3 and M5 to slow
  you down or have to edit to get that. A normal Gcode program for mill will cut on a laser fine with
  no editing. Also, in this mode you can link a photo for photo engraving, the laser will then vary power in
  realtime as a ratio fo Photo density.
    I have found though, that I wanted the distance/time fix as mode CNC above. So today I added that to the
  Engrave mode. Im testing it and all seems very good in all three modes. (Im cutting a XMas card for my wife
  as a test. ( Christ Im cheap.. or perhaps I just hate shopping that much... :-)
 
    So I used VCarve to vector a Card graphic, posted for mill, and its cutting it fine from Bristol board.
  Gotta love lasers. So this latest update makes the Laser cut fine from Milling GCode. Love it..
 
 
  Anyay, just a Laser update.. Enjoy the holidays.
 
  Art

Re: Arduino based Laser Control

by ArtF » Sun Dec 14, 2014 12:23 am

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

Re: Arduino based Laser Control

by DanL » Sat Dec 13, 2014 9:07 pm

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

Re: Arduino based Laser Control

by ArtF » Sat Dec 13, 2014 1:23 pm

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

Re: Arduino based Laser Control

by DanL » Sat Dec 13, 2014 7:38 am

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

Re: Arduino based Laser Control

by DanL » Sat Dec 13, 2014 6:15 am

ok just let me know when you have something to try

Re: Arduino based Laser Control

by ArtF » Sat Dec 13, 2014 5:20 am

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

Re: Arduino based Laser Control

by DanL » Fri Dec 12, 2014 10:33 pm

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);

Re: Arduino based Laser Control

by ArtF » Thu Dec 11, 2014 12:59 pm

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





Top