Pages: [1]   Go Down
 Author Topic: Controlling a CD Lens Mechanism for a laser project  (Read 349 times) 0 Members and 1 Guest are viewing this topic.
Stockholm, Sweden
Offline
Newbie
Karma: 0
Posts: 7
Game producer + electronics late-bloomer
 « on: February 28, 2013, 03:36:12 am » Bigger Smaller Reset

I've been following this great tutorial: http://www.instructables.com/id/Micro-LASER-Show-with-a-CD-Lens-Mechanism

BUT: I'm having problems identifying which cables control which axis - any tips on how to find this out? I'm debugging, trying to isolate horizontal and vertical movement [with setPos(x, 0) and setPos(0, y)] and can manage to get a good clean vertical movement but the horizontal movement always has a small vertical movement as well.

Also, I wonder about the code line digitalWrite(8, HIGH); - doesn't one of the corresponding coils need to be ground/zero/LOW for this to work?

Code can be found here: http://www.instructables.com/id/Micro-LASER-Show-with-a-CD-Lens-Mechanism/step7/Connect-the-signal-source/
but also see the comments below where it's better formatted.
 Logged

Croatia
Online
Full Member
Karma: 9
Posts: 243
 « Reply #1 on: February 28, 2013, 04:12:15 am » Bigger Smaller Reset

If you are projecting on a wall and the dot is above or below the source you will always get some vertical movement unless you specifically compensate for it. For compensation you'll need to understand a few things:
When you draw an imaginary line from the light source perpendicular to the wall, you get the point closest to the laser source. Let's call it normal point. If you try to project a horizontal line above that point you will actually get a U shaped line. If you project the same line below your normal point you will get an arching line (upside down U).
If you project a vertical line left of normal point, you will again get a curve curving "away" from the normal point. Opposite happens on the right side.
The closer you position your light source to the wall, more pronounce this effect is.

To compensate, easiest thing would be to measure how much it deviates from ideal and come up with a mathematical function which you would include while projecting.

So, to draw a dot on (x, y), you need to actually draw it on (x-x*k, y-y*l), or something similar, where k and l are coefficients for distortion. I don't think the distortion is linear, so this particular formula most likely won't work exactly (I don't have time to figure out the exact formula, sorry), but this should give you an idea of what to look at. If you do use the above formula, k and l should be 0 < k < 1, and most likely k = l.

Forgot to mention that your normal point is (0, 0)
 « Last Edit: February 28, 2013, 04:14:26 am by Shpaget » Logged

Stockholm, Sweden
Offline
Newbie
Karma: 0
Posts: 7
Game producer + electronics late-bloomer
 « Reply #2 on: March 06, 2013, 01:58:01 pm » Bigger Smaller Reset

Thanks, there might be optical issues as well, but I'd like to rule out any mechanical and electrical issues first. I can see the CD lens' movement, so I can "debug" with my eyes to some extent.

Any input on my "which cable controls what" question?
 Logged

 Pages: [1]   Go Up