Pages: [1]   Go Down
Author Topic: Controlling a CD Lens Mechanism for a laser project  (Read 819 times)
0 Members and 1 Guest are viewing this topic.
Stockholm, Sweden
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Game producer + electronics late-bloomer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset 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.


* lens_mechanism.jpg (101.83 KB, 800x557 - viewed 26 times.)
Logged

Croatia
Offline Offline
Sr. Member
****
Karma: 12
Posts: 498
View Profile
 Bigger Bigger  Smaller Smaller  Reset 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 Offline
Newbie
*
Karma: 0
Posts: 7
Game producer + electronics late-bloomer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset 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
Jump to: