CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Laser Controller

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
arunkish



Joined: 23 Dec 2008
Posts: 83

View user's profile Send private message

Laser Controller
PostPosted: Wed Jul 13, 2011 3:02 am     Reply with quote

Dear All,

I have Galvo/Scanner with XY Control board purchased from LASERPIC.

http://www.laserpic.com/Ebay/CW20%20galvos.html

he board required DAC signal to be sent and I have developed my own DAC using DAC chip - AN7528JN and PIC Controller (18F4620). I can also get the DAC output results as required and I can see some movements in the mirror based on the analogue values that I give.

But what I really wanted to know is the way to create patterns, for eg square, rectangle etc and output it out to the DAC.

http://elm-chan.org/works/vlp/report_e.html

Mr.Chan has a control board http://elm-chan.org/works/vlp/ldpctl.jpeg and he has also written the code in assembly language. http://elm-chan.org/works/vlp/ldp.zip. He has also supplied with a PC software to trace and find the xy coordinates. In my DAC, if I give 128 for X and 128 for Y, the mirrors are positioned at 0,0. But according to Chan's website the software actually give values in negative and in positive... My question is how can I send negatives to the DAC.

Is there any particular method to write the data to the Galvo Control Board from the co-ordinates I get from the Software?

If anyone has tried this before or if you have any ideas, please give me some advice on this. I admit that I am unable to figure out what's going on with Chan's Assembly code as I am not good in that.


Thanks in advance.
Ttelmah



Joined: 11 Mar 2010
Posts: 19563

View user's profile Send private message

PostPosted: Wed Jul 13, 2011 9:40 am     Reply with quote

This is all down to scaling....

Imagine you have a ten bit DAC, that gives 0 to 5v.
Feed to through an op-amp adder, running off +ve and -ve rails, with -2.5 'added' to the input, and now you have a DAC giving -2.5 to 2.5v.
The numbers you feed the DAC remain the same (0 to 1023, for a 10bit DAC), but now values from 0 to 511, generate -ve outputs, and the value behaves as a 'signed' number. Feed this through an op-amp, with *2 gain, and you now have -5v to +5v, for values from 0 to 1023.
You can then use signed arithmetic internally, generating a value from -511 to 512, and add 512, when you send the value to the DAC.
If you check the data for your laser unit, you will see that it accepts an input from -5 to +5v.
Even if you have a DAC, that produces -ve output voltages, you will need to scale the output to produce the right range.

So you need to scale and shift the output from the DAC, using op-amps (effectively an analog computer), to produce the range of voltages needed. Then for drawing, some parts are simple, and others much harder.

A 'square' parallel with the axes is very simple.
X,Y pair to DAC's. Increment X, wait, repeat till you reach the X limit. Then do the same for Y, Then do the same for X working the other way, and finally work back to the starting point.
'Generic' lines, are probably best handled by Bresenham's algorithm, with each output 'pair' being generated and held for a short interval.

You need to build the work up as a library. A routine to display a 'dot' (move to X,Y pair, hold for an interval, return). Then use this to draw lines, then circles, etc. etc..

Best Wishes
arunkish



Joined: 23 Dec 2008
Posts: 83

View user's profile Send private message

PostPosted: Wed Jul 13, 2011 9:52 pm     Reply with quote

Dear Ttelmah

Thank you for your valuable information. I am using 8 BIT DAC (AN7528JN), this was because when asked with the manufacturer they said 8 BIT DAC could be used.

Right now in my DAC chip

0 give me (-9.5 V ) negative Voltage
128 - give me - 0 V ( As I said it positions the mirrors to the center)
255 gives me (9.8) Positive Voltage.

The circuit behaves in the same way as of the manufacturers board. The difference is that that had used 89C51 and I am trying out with PIC18F4620.

As you said I understand galvo will accept -5 to +5v. Now how should I scale down when passing the values to the chip. I have never done this before and do not have any ideas on this. Please advice.

I checked the datasheet of the Galvo Control Board and it says

Signal Input Voltage:±5V Symmetrical (±10V single).

I dont understand what they exactly mean by this.

Thanks
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group