So, in the TEC thread, I mentioned that I'd been playing around with an idea to make lasers more linear in modulation response by using a photosensor in the spill light near the output and varying the modulation input using a microcontroller.
I don't see why not- being able to time-delay the DI's mod input so that it lines up with the response of your DPSSes seems quite valuable. It's probably possible to do this with some software, but the come-on time of my cheap Chinese DPSS lasers seems to vary substantially with temperature. I also get quite bad not-quite-blanking on my green (mutter, mutter cheaper than the blue mutter) when it's hot; I suspect the threshold moves. All of this can be corrected with a little feedback.
That only matters if I am concerned about absolute intensity or stability on a minute-by-minute basis rather than on a second-by-second basis. The fast changes are more visually intrusive than the gradual ones (high spatial frequencies are more visible than low ones, see any book on the discrete cosine transform) so it's those I want to get rid of first.If you do, you must consider that the wavelength changes with temperature.
I'm actually using light-to-voltage convertor sensors (a snip at a buck a pop, and including temperature compensation, dark current compensation, bias current generator and preamp in one package!) which ameliorates some of these concerns, but again, it's not a major issue.Also that longer wavelengths have a higher photon flux at a given radiant power, but at the same time Rayleigh scattering will be more efficient at shorter wavelengths. Looking at the relevant equations I get that the wavelength dependence of the photodiode current is (λ[1]/λ[2])^3.
The path length between the opening of the laser housing and the sensor is less than a centimetre, and I am working not off the scattered light, but off the off-axis light produced by imperfections in the cheap optics inside the device. The sensor is very highly directional but the degree of crosstalk remains to be seen- it may or may not be a problem. Finally, we recalibrate the scale every time the laser is commanded to go to the maximum or minimum voltage. The control scheme I have implemented turns out to be rather clever if I do say so myself.
Again, you're assuming I care about quantitative results, when a relative result is good enough for this application.That is of course assuming there are no particles in the air. If there is, Mie scattering will dominate and the equation becomes nearly impossible to solve.
Not really. I don't have to worry about protecting the diodes, driving heavy currents, or doing any of the heavy lifting of actually driving a pump diode array.For a DPSS laser it is of course completely different, but what you are talking about here is close to building a whole driver circuit.
It goes like this:
Control voltage from the controller card into one of the ADCs on the Atmel.
Output of photodiode device into a second ADC on the Atmel.
SPI on Atmel to a 12-bit DAC, and the output of the DAC to the modulation input of the laser.
One digital pin of the Atmel to the shutter interlock circuit
When power is applied to the Atmel, it pulls the shutter interlock low to prevent the shutter from being opened. It drives the laser to zero and takes a reading from the photosensor. This is zero. It then ramps up the laser modulation voltage until it gets a non-zero (with a little bit of noise allowed for) reading from the photosensor. This is control point one. Then it continues to ramp up until the reading from the photosensor no longer climbs. This is control point two. The laser is turned off, the shutter is released (tri-stated, so the normal safety system can take over) and things start happening. :-)
The reason this isn't just plain PID is that PID is really sensitive to error, and we have error creeping in in two places- in our measurements, and in the response of our controlled device.
A lookup table is constructed mapping 256 evenly spaced points on the continuum of photosensor voltages to the appropriate modulation voltages. Since the Atmel has 10-bit ADCs and the DAC is a 12-bit part, there is plenty of accuracy to lose in this way without succumbing to confusion.
The controller then enters a loop, reading the command voltage, estimating the appropriate modulation voltage using the table, reading the sensor output and keeping a count of the error percentage. When the error percentage exceeds a certain cumulative limit, it's time to recalibrate. Recalibration is triggered by the command voltage either exceeding the previous record high (read low) (a running "max_command_intensity" variable is kept) or the error percentage cumulative total exceeding limits.
Running recalibration is done not by shuttering the laser and recalibrating the way the base calibration is done, but by waiting for the command input to include a suitable range of inputs. Since many patterns include 100% brightness and 100% blanking, this happens quickly.
I am not completely sure that this running recalibration is the best way to do things, either, but it seems to work.
The output routine feeds a circular buffer which is emptied under interrupt to implement the variable delay. The three processors- one for each colour- measure their delay constantly (since it is naturally measured by the feedback sensor after every change in intensity) and communicate this to each other via I2C. (Currently they just communicate it to me, personally, via USB, but still.)
The fun of this is that I'm not sure you're not right- I guess we're going to find out! This is a fun project with lots of things to learn.Even so, I don't think you should use 'spill' light; the error will simply be too big unless that photodiode is inside of the laser module, which must be hermetically sealed and dust free. I am of the opinion that the sensor must be in the beam.