4096 Step Laser Analog Driver

Spindles & Lasers.
Forum rules
Be Kind to other's.
No Cussing or Swearing.
Don't post anything Illegal or Obscene.
Image attachment size limit is 500 KiB.
Leparti83
Posts: 4
Joined: Sat Jan 02, 2016 1:25 pm

Re: 4096 Step Laser Analog Driver

Postby Leparti83 » Tue Jan 12, 2016 6:38 am

Well so far it works, but of course my problem now is with my laser driver, which wont produce good results with grayscale (driver is TTL with 0-20khz and 0-100% duty cycle). I quess i need to get myself Flexmod P3 to achieve better results. (my laser is NDB7775 with 3 element lens. Laser is similar to NDB7875) and i have current set to 1.8A so it should be around 2W.

Anyway here is the code that I am using in arduino Duemilanove:

#define laser_PWM OCR1A
#define STEP 2 // step pin
#define DIR 3 // direction pin

int Counter = 0; // for counting Z pulses
const int PWM_max = 1024; // maximum value 1024 set for 10bit DAC. To get 12bit just change to 4095

void setup() {
// put your setup code here, to run once:
OCR1A = 25;
pinMode(9,OUTPUT); // Set output mode for PWM pin
attachInterrupt(STEP -2, IRQ1, RISING);
pinMode(DIR,INPUT_PULLUP);
TCCR1A = (1 << COM1A1) | (1 << WGM11); // Enable Fast PWM on OC1A (Pin 9)
TCCR1B = (1 << WGM13) | (1 << WGM12) | (1 << CS10); // Mode 14 Fast PWM/ (TOP = ICR1), pre-scale = 1
ICR1 = PWM_max;// Set the TOP value for PWM
laser_PWM = 0; //Set the PWM output to full off.
}

void loop() {
// put your main code here, to run repeatedly:
if (Counter < 0) { Counter = 0; }
if (Counter > PWM_max) { Counter = PWM_max; }
laser_PWM = Counter;
}

void IRQ1()
{
if (!digitalRead(DIR)) { Counter--; }
if (digitalRead(DIR)) { Counter++; }
}

User avatar
Picengravertoo
Full Access Moderator
Posts: 1092
Joined: Thu Dec 18, 2014 4:02 pm
Contact:

Re: 4096 Step Laser Analog Driver

Postby Picengravertoo » Tue Jan 12, 2016 8:46 am

Hi Tero,

Post your results, PicLaser settings, grbl settings and any details of your setup you can give us. There are various things you may need to fine tune to achieve good results. It may not be your driver, because by the specs it should handle the PWM.

Jeff

Leparti83
Posts: 4
Joined: Sat Jan 02, 2016 1:25 pm

Re: 4096 Step Laser Analog Driver

Postby Leparti83 » Tue Jan 12, 2016 12:45 pm

Here i made testprint after some adjustments and now i think it looks better than what i got earlier. Actually the laser works really nicely directly with J-Tech GRBL PWM output, but i just wanted to try this DAC option as i have CNC6040 machine which i could mount this laser to ;) currently it's installed temporarily in 3D printer (Prusa i3).

My settings in GRBL for DAC were:
Acceleration Z = 1000mm/min^2
Acceleration X = 1000mm/min^2
Acceleration Y = 20000mm/min^2
Steps for Z = 2048 steps / mm (This was for 10bit setup so that with 0.5mm i will reach max output 1024)

Here us picture i got with that DAC setup:

DSC_1209.JPG
DSC_1209.JPG (164.25 KiB) Viewed 10311 times


I know it's dark as the "wood" or whatever material it is is quite brown itself :lol:

User avatar
Picengravertoo
Full Access Moderator
Posts: 1092
Joined: Thu Dec 18, 2014 4:02 pm
Contact:

Re: 4096 Step Laser Analog Driver

Postby Picengravertoo » Tue Jan 12, 2016 3:26 pm

Looks like your getting good results and will only get better on a different type of wood.

Jeff

Leparti83
Posts: 4
Joined: Sat Jan 02, 2016 1:25 pm

Re: 4096 Step Laser Analog Driver

Postby Leparti83 » Tue Jan 12, 2016 5:44 pm

My next print, map from lord of the rings lasered in white synthetic leather (made this for my friends as he requested) :)

print2.jpg
print2.jpg (122.95 KiB) Viewed 10298 times

User avatar
Picengravertoo
Full Access Moderator
Posts: 1092
Joined: Thu Dec 18, 2014 4:02 pm
Contact:

Re: 4096 Step Laser Analog Driver

Postby Picengravertoo » Tue Jan 12, 2016 6:50 pm

Nice job Tero!

Thanks for sharing. :cool)

Jeff

User avatar
Picengraver
Full Access Moderator
Posts: 381
Joined: Tue Dec 23, 2014 5:40 pm
Contact:

Re: 4096 Step Laser Analog Driver

Postby Picengraver » Tue Jan 12, 2016 8:29 pm

Thanks Tero,
:Bravo!
John

User avatar
Picengravertoo
Full Access Moderator
Posts: 1092
Joined: Thu Dec 18, 2014 4:02 pm
Contact:

Re: 4096 Step Laser Analog Driver

Postby Picengravertoo » Wed Jan 13, 2016 11:36 am

John,

We got your hint and added another smiley. ;-D

Jeff

User avatar
Picengraver
Full Access Moderator
Posts: 381
Joined: Tue Dec 23, 2014 5:40 pm
Contact:

Re: 4096 Step Laser Analog Driver

Postby Picengraver » Wed Jan 13, 2016 7:05 pm

I like! Thanks. [8>)


Return to “Hardware Discussions”

Who is online

Users browsing this forum: No registered users and 1 guest

cron