Laser pointer discussion. Read/write reviews of laser pointers and laser pointer companies. Learn about all types of laser pointers and lasers

 Welcome to Laser Pointer Forums! If you are looking for a laser pointer or want to compare different laser pointer companies, you may want to check out the LPF Laser Pointer Company Database. The link will open in a new window for your convenience.

One laser store meets all your needs

 Laser Pointer Forums - Discuss Laser Pointers ARDUINO & DAC for XY projector

LPF List of Laser Pointer Companies (link opens new window)

06-16-2013, 08:11 AM #97
 Class 2 Laser Join Date: Feb 2012 Location: UK Posts: 330 Rep Power: 80
Multimode
Class 2 Laser

Join Date: Feb 2012
Location: UK
Posts: 330
Rep Power: 80
Re: ARDUINO & DAC for XY projector

As BB said, would be interestig to see the max points it can output, or the ILDA test frame, or Yuki girl etc.

Good work

LPF List of Laser Pointer Companies (link opens new window)

06-16-2013, 08:02 PM #98
 Class 1 Laser Join Date: Nov 2012 Location: Ventura, Ca Posts: 77 Rep Power: 282
OldNo7
Class 1 Laser

Join Date: Nov 2012
Location: Ventura, Ca
Posts: 77
Rep Power: 282
Re: ARDUINO & DAC for XY projector

That looks pretty good. +1

I want to try using two parralel DACs and write directly to the ports on the micro.

Last edited by OldNo7; 06-16-2013 at 08:09 PM.

06-17-2013, 05:38 AM #99
 Junior Member Join Date: Mar 2013 Posts: 6 Rep Power: 0
laserlightguy
Junior Member

Join Date: Mar 2013
Posts: 6
Rep Power: 0
Re: ARDUINO & DAC for XY projector

This looks pretty good!

However I am confused by the math.

You simply multiply the X/Y values by a scaling + add an offset to get the voltage as the formula for bouncing off mirrors is not linear in the X/Y axis.

Isn't the galvo only linear in the rotation? When I tried this it gives me a pin cushion effect when I draw a square (bigger angle is more severe).

Any thoughts for pincushion correction?

06-17-2013, 11:03 AM #100
 Class 1M Laser Join Date: Sep 2011 Location: Holland, Rotterdam Posts: 102 Rep Power: 14
camvo
Class 1M Laser

Join Date: Sep 2011
Location: Holland, Rotterdam
Posts: 102
Rep Power: 14
Re: ARDUINO & DAC for XY projector

@ Laserlightguy

I am not exactly sure what you mean by pincushion.

The original figures are drawn around the origin of 0,0.
If you draw it out on a sheet of grid paper, you will see it.
The image data also contains negative coordinates.
Call this your "painting canvas" where you draw up the figure.

Code:
```// image data
int imgdata [250] =
{
0,   200,   200,
1,   200,   200,
1,   400,   200,
1,   400,   400,
1,   200,   400,
1,   200,   200,
0,  -400,   200,
2,  -400,   200,
2,  -200,   200,
2,  -200,   400,
2,  -400,   400,
2,	 -400,   200,
etc ........```

"zoom" is just to increase the size of the image. Yes, scaling as you said.

A DAC cannot handle negative figures so I transpose the center to midx and midy to be sure that all figures are in plus.

Code:
```analogWrite(DAC1, valx * zoom + midx);
analogWrite(DAC0, valy * zoom + midy);```

Basically you have a grid of 4096x4096 points (12 bits) to work with.
To keep things simple, I only use a 4000x4000 points.
Then my limited brain can also little bit grasp what is going on.
The real center would be 2048,2048.

Negative numbers are handled as 0 so you get a line at the bottom and left.
Numbers higher than 4095 are handled as 4095 and will display a line at top and/or right.

As far as I know (and have seen) a Galvo is directly linear to the DAC value/output.

Bouncing off mirrors? Did you build "my" PCB for the DUE?
__________________
50mW 532nm (ripped from a cheap stage projector)
500mW 532nm (in the laser harp)

1W RGB (500mW-660nm, 200mW-532nm, 500mW-450nm) Touch the white beam and it is: "AUCH!!"

The white laser burned the paint off from the door!
I am thinking of starting a "door-etching-business"

Last edited by camvo; 06-17-2013 at 11:04 AM.

06-17-2013, 11:10 AM #101
 Class 1M Laser Join Date: Sep 2011 Location: Holland, Rotterdam Posts: 102 Rep Power: 14
camvo
Class 1M Laser

Join Date: Sep 2011
Location: Holland, Rotterdam
Posts: 102
Rep Power: 14
Re: ARDUINO & DAC for XY projector

@ OldNo7

Which DAC will you use?

If you cannot update them simultaniously, it will not work.
Then you are back at post 1 of this thread.

I also tried the MCP4922 DAC and applied the LDAC function. (See post#45)

It worked but way, waaaaayyyy too slow.
__________________
50mW 532nm (ripped from a cheap stage projector)
500mW 532nm (in the laser harp)

1W RGB (500mW-660nm, 200mW-532nm, 500mW-450nm) Touch the white beam and it is: "AUCH!!"

The white laser burned the paint off from the door!
I am thinking of starting a "door-etching-business"

Last edited by camvo; 06-17-2013 at 02:49 PM.

06-17-2013, 12:10 PM #102
 Class 2 Laser Join Date: Feb 2012 Location: UK Posts: 330 Rep Power: 80
Multimode
Class 2 Laser

Join Date: Feb 2012
Location: UK
Posts: 330
Rep Power: 80
Re: ARDUINO & DAC for XY projector

Quote:
 Originally Posted by camvo @ Laserlightguy I am not exactly sure what you mean by pincushion.
Pincushion distortion, difficult to describe, but the outer corners of a projected square will distort due to the angel / distance..... errr this might be better
http://en.wikipedia.org/wiki/Distortion_(optics)

For small deflection angles the effect is not very visible.
For marking / size critical applications, the system will compensate for the error.

06-17-2013, 09:10 PM #103
 Class 1M Laser Join Date: Sep 2011 Location: Holland, Rotterdam Posts: 102 Rep Power: 14
camvo
Class 1M Laser

Join Date: Sep 2011
Location: Holland, Rotterdam
Posts: 102
Rep Power: 14
Re: ARDUINO & DAC for XY projector

Thanks Multimode,

I have a magnetic disc pin cushion so I had no imagination.
__________________
50mW 532nm (ripped from a cheap stage projector)
500mW 532nm (in the laser harp)

1W RGB (500mW-660nm, 200mW-532nm, 500mW-450nm) Touch the white beam and it is: "AUCH!!"

The white laser burned the paint off from the door!
I am thinking of starting a "door-etching-business"

06-17-2013, 09:12 PM #104
 Class 1M Laser Join Date: Sep 2011 Location: Holland, Rotterdam Posts: 102 Rep Power: 14
camvo
Class 1M Laser

Join Date: Sep 2011
Location: Holland, Rotterdam
Posts: 102
Rep Power: 14
Re: ARDUINO & DAC for XY projector

Could I feed the DAC signals directly to an ILDA projector?
__________________
50mW 532nm (ripped from a cheap stage projector)
500mW 532nm (in the laser harp)

1W RGB (500mW-660nm, 200mW-532nm, 500mW-450nm) Touch the white beam and it is: "AUCH!!"

The white laser burned the paint off from the door!
I am thinking of starting a "door-etching-business"

06-17-2013, 09:50 PM #105
 Class 2M Laser Join Date: Dec 2012 Location: Santa Rosa, CA Posts: 909 Rep Power: 65
pschlosser
Class 2M Laser

Join Date: Dec 2012
Location: Santa Rosa, CA
Posts: 909
Rep Power: 65
Re: ARDUINO & DAC for XY projector

So in the end, what kind of performance are you getting from your DACs? How many writes per second?

I've been following this thread for some time, and I was disappointed with the initial poor performance of the I2C bus. I want to be able to overdrive my scanners, which means (at least to me) I want to see 40K writes per second to each DAC. Perhaps, more than that, if I am writing to X, Y and one or more blanking DACs.

I just reread through the entire thread, and I guess I'm not seeing what the final performance figures were with the improved performance of the Duemilanove. Is an Arduino Due necessary for decent performance?

06-17-2013, 09:57 PM #106
 Class 1M Laser Join Date: Sep 2011 Location: Holland, Rotterdam Posts: 102 Rep Power: 14
camvo
Class 1M Laser

Join Date: Sep 2011
Location: Holland, Rotterdam
Posts: 102
Rep Power: 14
Re: ARDUINO & DAC for XY projector

How could I test its max output?

I have a scope....
__________________
50mW 532nm (ripped from a cheap stage projector)
500mW 532nm (in the laser harp)

1W RGB (500mW-660nm, 200mW-532nm, 500mW-450nm) Touch the white beam and it is: "AUCH!!"

The white laser burned the paint off from the door!
I am thinking of starting a "door-etching-business"

06-17-2013, 10:48 PM #107
 Class 4 Laser Join Date: Oct 2007 Location: Oregon, USA Posts: 5,478 Rep Power: 3157
Class 4 Laser

Join Date: Oct 2007
Location: Oregon, USA
Posts: 5,478
Rep Power: 3157
Re: ARDUINO & DAC for XY projector

It's kind of like how a fisheye lens distorts the image because the lens affects the mapping of the image.

The value provided to the DAC, that then goes to the galvos is supposed to map to a linear distance. For example, a value of 10 should be twice as long as a value of 5. However, the galvo is actually tilting a mirror, so that value actually corresponds to an angle. For small angles you can make the approximation tan(theta) ~ theta; however, for larger angles that does not hold. Usually that "pincushion" effect doesn't make much difference because galvos are used at very shallow scan angles to improve speed.

laserlightguy: I would try adjusting your galvos to use smaller scan angles. You can try doing this in code by dividing down the output values that go to the galvos.

Quote:
 Originally Posted by pschlosser I just reread through the entire thread, and I guess I'm not seeing what the final performance figures were with the improved performance of the Duemilanove. Is an Arduino Due necessary for decent performance?
An ATmega-based Arduino would be pretty bad, and the "DAC"s on those are just 10k PWM that need to be filtered. You should stick with the Due.
__________________
You must spread some Reputation around before giving it to <person> again.

Last edited by Bionic-Badger; 06-17-2013 at 11:04 PM.

06-17-2013, 11:09 PM #108
 Class 1M Laser Join Date: Sep 2011 Location: Holland, Rotterdam Posts: 102 Rep Power: 14
camvo
Class 1M Laser

Join Date: Sep 2011
Location: Holland, Rotterdam
Posts: 102
Rep Power: 14
Re: ARDUINO & DAC for XY projector

I just thought about a fair test.

1. I will put 10 values in the image data array.
(Or more or less. See if the scope can pick up the return to the beginning of the data array.)

2. I will let the DAC-s put out a square wave from 0 to 4.88V
(DAC numerical value 4000.)

3. I will set the color to white so 3 lasers have to be switched on.
(Using a simple digitalWrite command, no direct port manipulation.)

4. I will put the white color as last CASE in the SWITCH loop.
(So all cases need to be examined.)

5. I will delete all delay commands.
(To get the maximum speed)

That would be the worst case scenario I think.

Then hook it up to the scope at the galvo connectors on the PCB.
See what frequency I can get.

Anyone more items?
__________________
50mW 532nm (ripped from a cheap stage projector)
500mW 532nm (in the laser harp)

1W RGB (500mW-660nm, 200mW-532nm, 500mW-450nm) Touch the white beam and it is: "AUCH!!"

The white laser burned the paint off from the door!
I am thinking of starting a "door-etching-business"

06-17-2013, 11:45 PM #109
 Class 2M Laser Join Date: Dec 2012 Location: Santa Rosa, CA Posts: 909 Rep Power: 65
pschlosser
Class 2M Laser

Join Date: Dec 2012
Location: Santa Rosa, CA
Posts: 909
Rep Power: 65
Re: ARDUINO & DAC for XY projector

I am interested in the best possible scenario.

With no delays due to trig calculations (as in using hard-coded values) and with no write delays, how many writes per second is the setup capable of?

I would expect as the code gets more complex, the maximum writes per second may decrease.

My vote for your test scenario is looping through four pairs of values to make a square. Then, pump the values out to the galvos and see how fast you can make those babies move. If the speed exceeds the galvos, we may expect to see some distortion in the image, such as rounded corners.

I'm also curious if the DACs need some "settle time" after the value is written before the correct value is seen by the galvos.

An internal software counter may be all you need, if you have an accurate time-of-day clock in which to benchmark your writes.

This all sounds like great fun.

06-18-2013, 04:13 AM #110
 Class 4 Laser Join Date: Oct 2007 Location: Oregon, USA Posts: 5,478 Rep Power: 3157
Class 4 Laser

Join Date: Oct 2007
Location: Oregon, USA
Posts: 5,478
Rep Power: 3157
Re: ARDUINO & DAC for XY projector

From the datasheet it takes 25 clock periods to convert, which should be far less than the maximum point-rate the galvos would use, given the DAC conversion clock period is at a maximum of 1 microseconds.
__________________
You must spread some Reputation around before giving it to <person> again.

06-18-2013, 12:12 PM #111
 Class 2 Laser Join Date: Feb 2012 Location: UK Posts: 330 Rep Power: 80
Multimode
Class 2 Laser

Join Date: Feb 2012
Location: UK
Posts: 330
Rep Power: 80
Re: ARDUINO & DAC for XY projector

Quote:
 Originally Posted by camvo I just thought about a fair test. 1. I will put 10 values in the image data array. (Or more or less. See if the scope can pick up the return to the beginning of the data array.) 2. I will let the DAC-s put out a square wave from 0 to 4.88V (DAC numerical value 4000.) 3. I will set the color to white so 3 lasers have to be switched on. (Using a simple digitalWrite command, no direct port manipulation.) 4. I will put the white color as last CASE in the SWITCH loop. (So all cases need to be examined.) 5. I will delete all delay commands. (To get the maximum speed) That would be the worst case scenario I think. Then hook it up to the scope at the galvo connectors on the PCB. See what frequency I can get. Anyone more items?
OR,

A logo /frame needs to be output at ~20 to 25hz minimum to be flicker free.
My test would be using a scope to see the maximum number of points can be output before the scan frequency drops below ~25hz.
From what I have seen () , ILDA frames / logos have between 700 and 1300 points.

This would shown the limit of the electronic hardware and as long as this comfortably exceeds the scanner capability (1300 points ish) ...happy days.

ATB
MM

06-18-2013, 01:18 PM #112
 Class 4 Laser Join Date: Oct 2007 Location: Oregon, USA Posts: 5,478 Rep Power: 3157
Class 4 Laser

Join Date: Oct 2007
Location: Oregon, USA
Posts: 5,478
Rep Power: 3157
Re: ARDUINO & DAC for XY projector

Ideally, if he could load up the points in the ILDA frame he could see how that displays for a "true" PPS count.
__________________
You must spread some Reputation around before giving it to <person> again.

 Tags arduino, dac, lasershow

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 LinkBacks (?) LinkBack to this Thread: http://laserpointerforums.com/f47/arduino-dac-xy-projector-82479.html Posted By For Type Date Volcan Veins This thread Refback 07-17-2016 08:34 PM ?ASTRAL PLANE? This thread Refback 05-01-2016 09:04 PM ???????? This thread Refback 04-27-2016 09:39 AM myswap.sinaapp.com Site Overview This thread Refback 04-24-2016 07:36 AM I want peace This thread Refback 04-20-2016 12:47 AM :???*:???:?? This thread Refback 04-19-2016 12:44 PM

All times are GMT. The time now is 12:03 AM.

 -- DarkShadows V5 -- Responsive LPF -2562016 -- Default Style Contact Us - Laser Pointer Forums - Archive - Top