Episode 4 - Where we talk about alternative to Arduino and DAC

A project log for Wendy

Wendy is a UV laser projector for alt photographic process printing

pierre-loup-mPierre-Loup M. 03/12/2019 at 09:190 Comments

Lasers galvo are variable-tension driven. If you want to set the galvo to its middle position, you give it 0V. If you want, say, -10°, you give it -5V. If you want 5°, you give it 2.5V. (arbitrary values here). There is a hardware peripheral on every computer that goes the same way : sound ! Is was tempting to give it a try, and simply connect the control line of galvo drivers to the 3.5mm output jack of a computer ! And every computer can (should, in fact...) use at least CD quality, i.e. 16bits, 44100Hz ! That would be nice...

The main program was then modified, and all that was linked to serial communication were cancelled. PWM for driving laser intensity were cancelled as well, because it should have been synchronized with audio stream, which would have been a difficult task. Instead pixel value was map to a speed (going slow let the time for the laser to expose the image, going fast doesn't expose at all), and pixel positions were transform into a value oscillating from -1 to 1 on both X and Y axis. -1 and 1 correspond to extreme angles on the galvo. The values are then written to an audio file, using pixel value / speed to generate a ramp from one pixel to the next.

And it worked out of the box ! Very reliably, and repeatably ! Each pixel was precisely positionned, enough to send the image several time without seeing any gap ! Then we tested it on a netbook it should run on (this project was started with a friend interested enough in it to put some money on the table), and... Total fail. It appeared my Thinkpad has a "real" DAC, but my friend's netbook has what looks like a PWM soundcard... Totaly unreliable. Big gaps between pixels, and sending the same data lead to different output position.. Surprisingly enough, testing it on my iMac, which has more than decent audio quality, lead to strange behavior: X axis (fast scanning) was precise enough, but Y axis was always centered. This is due to the low scanning speed on that axis, and the sound card zeroing out what appears to be silence...

The audio solution was usable, but it had to behave the same every time, regardless of the computer used as user interface...

At this point, I had been working on the project for months, and I couldn't write one more line of code... So the laser was put on a shelf, and it lied here alsmot two years !