Laser X-Y-Axis control

Im wanting to build a X-Y axis control for a laser that uses maybe 2 servos with mirrors on them that rapidly move to draw pictures. This means i want the servos to be repeating a picture at about 25Hz, more if possible. A picture could have a many as 200 points meaning a servo would have to be able to move to up to 5000 points/second. Any ideas on making this happen at this rate? and is it possible to control the laser to turn on and off at different points on the picture so it is not one continous line? Maybe a slightly better controlled version of this "Micro LASER Show with a CD Lens Mechanism Micro LASER Show With a CD Lens Mechanism : 9 Steps (with Pictures) - Instructables"

I would think that a servo would give you less control and slower writing speeds than the technique described in the instructable. The only benefit of a servo would be greater torque but for your application that does not seem necessary. Have you tried to use the CD mechanism as described in that link? It looks like a cool project.

Let’s do some maths.

Suppose your servo is geared so that it takes 5 revolutions of the motor to cover the full range. With 5000 points per second you need a motor capable of turning at a speed of 25,000 revolutions per second. Or expressed conventionally 1,500,000 RPM.

I don’t think it’s on do you?

I think he actually wanted to draw pictures not just patterns.
:wink:

Im having a jam at doing the CD lens idea now. not sure how accurate it wil be though. i didnt think servos would be fast enough. iv also seen a very sucessful but complicated way of doing this which involved making your own servos and a hardout microcontroller system. What if i used a galvanometer instead of a servo. they have very precise movement and do not need to make complete turns, i just found this site which looks exactly like what i want although im not experienced at programming microcontrollers

Im having a jam at doing the CD lens idea now. not sure how accurate it wil be though

I think the pitch between tracks of a cd is much smaller than a thousandth of a millimeter. If you really need more accuracy than that, use the mechanism from a dvd player instead.

Would a dvd dual layer be more accurate?

What if i used a galvanometer

Traditionally galvanometers were always used for this sort of thing. One problem with them is there mechanical inertia making them swing past the position you want them to be at. These were mainly used for drawing Lissajous figures with lasers where continuous waveforms could be sent through them.

What if you were to modify this design of a laser pattern generator could we use varible speeds to some effect?
PCB by itself http://jaycar.com.au/productView.asp?ID=KG9098&CATID=&keywords=laser&SPECIAL=&form=KEYWORD&ProdCodeOnly=&Keyword1=&Keyword2=&pageNumber=&priceMin=&priceMax=&SUBCATID=
Whole unit http://jaycar.com.au/productView.asp?ID=Sl2924&CATID=&keywords=laser&SPECIAL=&form=KEYWORD&ProdCodeOnly=&Keyword1=&Keyword2=&pageNumber=&priceMin=&priceMax=&SUBCATID=

Does anyone know of a digital signal generator program that has audio output and left and right individual controls. i have the cd lens adjuster working and moving but have no software to control it properly. im having to use an amplifier to get any decent sort of movment as my laptop output is not sufficiently powered.
This is the site i was trying to find earlier, this guy built his own galvanometers and a very complicated circuit but got amazing results!
http://elm-chan.org/works/vlp/report_e.html

Did you try it with the software from the instructable in your earlier post?

why not give it a try and see how well it works using analogWrite.

Sorry if I’m digging up an old thread here…

This is absolutely possible with an arduino and analogWrite…

I’ve only made an X scanner, an X/Y scanner should be possible by using two PWM pins and this method.

First, the glory of a working picture:

This was taken during the day, ISO-800, smoke from a cigarette, 100mW red laser

Hook-up details:

Get it working quick:

Use any single-supply op-amp (I used the LM324 from rat shack as I had it lying around… overkill as I’m not using 3 of the op-amps) and hook it up in voltage following mode:
INV1OUT (pin 1): Galvo control wire
INV1- (pin 2): wire directly to INV1OUT
INV+ (pin3): connect to arduino pin 9
Vcc (pin4): +5V
GND (pin11): GND

You really ought to add a signal-levelling cap between GND and INV+ pins, as close to the chip as you can get it (soldered piggyback would be my preference)… but I got decent results with and without. With, your beams should look slightly sharper as the mirror won’t wiggle with the PWM output. I’d use a small value as you don’t want to filter out the high-end too much. For no good reason at all, I chose a small ceramic cap marked 22 for mine.

I used galvos pulled from old supermarket scanners. There must be a million of those things lying around, you can always find them on ebay. They were made by Symbol Tech and are usually labelled as servos or some such… you can usually find them on eBay for around $30 as pulls from old equipment…

The galvo has a four-wire connector, Blue, Red, Yellow/white, Black.

I wrote Symbol a couple years ago to get info about the connector (there’s zilch online in terms of official specs)… as I recall, it’s max rating is 12V (I’ve read others quote 14V). You apply a bias current to the black/red wire pair, and a variable voltage to the other pair. The direction and magnitude of that voltage determines the mirror swing.

I connected Blue and Black to ground, Red to +5V, and Yellow/white to the INV1OUT pin.

then analogWrite(9, value) should position the galvo!

Two big issues with the above:
a) the galvo is way underpowered for it’s rating
b) the PWM on the arduino is timed ~ 490Hz by default

a) is solved by using a 9V adapter / battery to power your arduino, and feeding the motor off of it. To adjust the signal, connect Vcc of the op-amp to 9V instead of 5V, and add a Gain=1.8 to the op-amp. Basically, that means you need two resistors with a value ratio of 1 : 0.8. Connect the higher one from INV1- to GND, and replace the connection between INV1OUT and INV1- with the smaller resistor. Not sure how much value matters, but lower is probably better. The LM324 is current-limited to 40mA sink internally so you can’t really fry your arduino with it, feel free to play around with the resistor values some. If you pick too high of a ratio, you’ll get clipping at the extreme +/- end of the range.

b) requires a little timer hacking. The PWM timer on the arduino is adjustable… I used the following code to set mine fast enough:

#define TIMER_CLK_STOP            0x00      ///< Timer Stopped
#define TIMER_CLK_DIV1            0x01      ///< Timer clocked at F_CPU
#define TIMER_CLK_DIV8            0x02      ///< Timer clocked at F_CPU/8
#define TIMER_CLK_DIV64            0x03      ///< Timer clocked at F_CPU/64
#define TIMER_CLK_DIV256      0x04      ///< Timer clocked at F_CPU/256
#define TIMER_CLK_DIV1024      0x05      ///< Timer clocked at F_CPU/1024
#define TIMER_PRESCALE_MASK     0x07    //Total guess at this value...
void setup() {
  TCCR1B = (TCCR1B & ~TIMER_PRESCALE_MASK) | TIMER_CLK_DIV1;
}

These galvos are really non-ideal for graphics, but the work good for beam effects. They have a wicked non-linear response; my testing seems to indicate there’s a lock-in zone around dead-center (with a LOT of wiggle on it!) and two dead zones on each side half-way to full deflection - your mileage may vary. Circuit tuning your op-amp with some basic filters will certainly help, too.

Problems with my current implementation:
I’m only feeding the galvo 0 - +9v signal, I should be feeding it -10v - +10v, or at least -9v - +9v. Theoretically, you could fix this with a differential PWM driver, a second op-amp, and connect the - side to the blue wire on the galvo… but that would probably require hacking some of the hardcore PWM code in the arduino to generate the proper wave-form…

Just a quick note about the lock in and dead zones…

I was reading the excellent “ELM - Home Built Laser Projector” post (google if you’re curious) and his home-built galvos suffer from the same problem… they’re driven in a similar manner (minus the position detecting segment of his amplifier stage)

He helpfully includes this diagram:

http://elm-chan.org/works/vlp/pdout.png

We’re just using the torque section here… no PD on our galvos, remember…

But the cyan and gray bars still apply - there’s a center zone where the torque is high enough to lock to a central position (this is in my 0-45 zone), and a mid-range zone where the torque is low enough to cause galvo lock at incorrect positions.

This is where the force of the centering spring + dynamic friction stop the stator movement, then it takes a larger torque to get the mirror moving again… this is actually a desireable effect to get nice clean lines out of the scanner, but too much causes position errors.

This tells me a few things about this galvo:

It’s going to be very timing dependent. The direction of motion and magnitude of motion for each point will greatly impact the accuracy and final position of the galvo during a single analogWrite command

It’s going to be hard to correct for this in software with an 8-bit value - with more granularity, it would be easier to dynamically “jerk” the galvo into position based on a derived model of it’s properties

And finally, to create a driver for this galvo that takes advantage of the properties of movement of the galvo, I would set the output range in the +30 - +60 offset range. This should minimize drift error and still give a useable range… if -10v - +10v = -180 - +180, then +30 - +60 should = 3.33v - 6.67v, giving an op-amp circuit of offset 3.33v and gain of 0.67.

To change the basic gain op-amp amplifier design above to include offset, compute RB and RA as before (G = (RA + RB) / RA)… then using RA as one leg, create a voltage divider to set the offset at 3.33v (i.e. compute a value RC to connect to 5V such that 5V / 3.33V = RA / RC)

There are two common approaches to drawing images with lasers (that I've seen, anyway).

One is with a deflecting mirror. The mirror only has to move microscopic amounts, and is usually moved by piezoelectric transducers. The angle of deflection is amplified with lenses.

The other is to emulate a television raster. The laser is aimed at all points of the field, and turned on and off at appropriate parts of the field to generate an image. To move the laser beam, one or two rotary mirrors are used.

I was just asking someone for a source of these mirrors in another thread. http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1238687080

I think you may be able to combine both vertical and horizontal scanning with a single spinning multifacted mirror, by varying the vertical angle of successive mirrors.
This principal is used in mechanically-scanned thermal imagers.
However, to keep the number of facets reasonable, it will be necessary to have multiple light sources, which then produce horizontal (or vertical) swathes.

Yeah, I did some searching... found a guy that glued a bunch of mirrors off a disco ball to a fan. Looked like he used bent paperclips and then manually adjusted each mirror. It's probably only in focus at the distance he adjusted for, I would imagine... but he shows a 16x16 pixel display running off an arduino with a laser pointer (projection size: maybe 3"x2")

He says it's doable, just tedious...

It's the second project down on this page:

http://heim.ifi.uio.no/haakoh/avr/

found a guy that glued a bunch of mirrors off a disco ball to a fan

Surface-silvered mirrors would be the best - I'd guess the mirror-ball mirrors are probably behind glass, which makes for:

  1. Heavier mirrors
  2. mirrors prone to reflections off the face af the glass.

Not cheap though.

Oh I agree totally - but that's not what he did, and I think it's impressive that he got the results he did with those mirrors.

It'd be a different story if his throw distance was longer though... the seconday reflection probably isn't too far off the main line at that distance...

BTW, I hear cheap paint stripper and acetone can take the back off a regular mirror and convert it to a front-surface...

I've also seen people fashion laser mirrors of this sort out of stainless steel. Most hobby stores and some home improvement stores sell this as an adhesive-backed 1" strip. I'm guessing it's probably between a true FS mirror and the typical crappy hobby mirrors most of us can get our hands on, in terms of beam quality. It's practically impossible to cut without the right tools (stainless steel is harder than steel, so you need tungsten carbide or diamond bits and saws) The trick would be to solidly mount it to a flat surface, and use high-grit wet-dry to polish it to a mirror finish.

Galvanometers are the canonical way to do this, and modern ones are really good. Sharp corners and vector animation are within the current state of the art. Try searching for 'laser galvos'.

I think it's impressive that he got the results he did with those mirrors

Oh I agree entirely - I used to work with images from military thermal imagers (TICM II), and when I found how they worked, I was amazed.
Just eight sensors, building a standard definition image at 25 fps.