Welcome to Laser Pointer Forums - discuss green laser pointers, blue laser pointers, and all types of lasers

LPF Donations

Links below open in new window

ArcticMyst Security by Avery

Converting XY points to DAC values

Joined
Mar 31, 2013
Messages
6
Points
0
I have an XY galvo and want to make a control card.

If I have values (0,0) (0,10) (10,10), (0,0) eg a square, how do I convert these XY values to voltages?

My understanding is that the angle the mirror rotate is supposed to be linear between -5v and +5v eg if I get it 0 volts then the mirror should rotate to 0 degrees, if I give it +5v it should go to say +20degrees so +2.5v=10degrees.

Playing with my galvo I see if I adjust the X galvo from -5v to +5v it will scan a straight line but if I scan the Y galvo the line is not vertical if the X galvo is not at 0v.

Anyone have the equations for the function (volts_A,volts_B)=function(x,y) ?
 





camvo

0
Joined
Sep 25, 2011
Messages
102
Points
0
It depends on what kind of DAC you are using.

I find that the Arduino DUE board is most easy one.

Code:
analogWrite(DAC1, valx );
analogWrite(DAC0, valy);

That's it!
And its biggest advantage is that both DACs are updated at the same time.


Or with MCP4725:

Code:
 Wire.beginTransmission(DACX);  
 Wire.send(64);                // cmd to update the DAC  
 Wire.send(valx >> 4);         // the 8 most significant bits...
 Wire.send((valx & 15) << 4);  // the 4 least significant bits...
 Wire.endTransmission();

 Wire.beginTransmission(DACY);  
 Wire.send(64);                // cmd to update the DAC  
 Wire.send(valy >> 4);         // the 8 most significant bits...
 Wire.send((valy & 15) << 4);  // the 4 least significant bits...
 Wire.endTransmission();

You need 2 separate DACs. You can not update them at the same time.
So no diagonally lines, only stair cases.


MCP4922 which is a dual DAC has latching capability but is is way to slow.

Have a look at this thread at LPF
 
Last edited:
Joined
May 19, 2013
Messages
43
Points
0
Im working with an SPI DAC, its ALOT faster than I2C once like MCP4725. Its easy to interface it if your reading the datasheet =)
 
Joined
Feb 10, 2012
Messages
330
Points
0
Im working with an SPI DAC, its ALOT faster than I2C once like MCP4725. Its easy to interface it if your reading the datasheet =)

I set up a SPI DAC running at 8mhz clock and it tops out at about 700 points.
Any more points and the graphics starts to flicker.

The DAC / processor Camvo is using loads the DAC by writing to the DAC registers directly, so only takes a few clock cycles, therfore the limiting factor is the scanners not the SPI bandwidth.

ATB
MM
 




Top