Monday, February 22, 2010

2.22.10

After several realignments and swapping out the mirror, I finally have the larger DM in place. I've been able to generate some pretty hot poke matrices from it; now that I know its working fo sho I've spent the last week or so updating my code and testing it out. Overall it behaves much like the smaller DM, albeit with a greater effect on the beam. I'm not sure exactly why this is, but I suppose it might be due to the larger number of actuators. Because of this I've limited it to voltages in the range [0,180] with a bias at 90V instead of the full 255.

The reconstructed actuator influence functions looked pretty solid, so I constructed a set of modes using those instead of the idealized influence functions we used for the smaller DM. The resulting modal poke matrix looks pretty good for the first 15 or so modes, but basically random after that. I'm not sure if this is due to the commands themselves being strange, or because the mirror can't reproduce high frequency shapes.

Looking at modes again has also dragged up the idea of reducing the beam size to fit in the measurement area. The current number of lenslets, around 1500, is basically an order of magnitude greater than what's found in most AO systems I've heard of, including the high fidelity HEL simulation we use to generate disturbances. The idea is that this is just causing unnecessary computational overhead since the DM's only have 31 or 61 actuators; by reducing the beam size we can utilize the WFS's partial frame mode and achieve higher frame rates (since its a CMOS sensor). This sounds dandy in theory, but in practice I've had a tough time getting a good looking, curricular beam less than around 10mm in diameter, but for the beam to fit in a 5x5 lenslet array would require the diameter to be around 2mm. The trouble is that at that size the beam isn't really circular any more, and the large intensity variations across the cross section make computing centroids from a single WFS image problematic. I don't really know what's causing this, it could be that the relay's I'm using to resize the beam may be crap for that application.

The idea of running the experiment faster is pointless anyway for a couple reasons. First, even with a 5x5 lenslet array, the WFS frame rate would still be much less than the kHz required for real real time experiments, so control would still have to be run on an event driven basis. Second, despite what's been claimed, the DM's need a finite pause between commands for them to reach steady-state. Experience generating poke matrices has shown that a pause of less than 0.08s or so between random commands results in garbage, so this is essentially the upper limit of the experiment unless there are some hardware changes...and I've had enough of those.

I'll continue looking into this a little more, but actually modeling the actuator dynamics is probably beyond what I want to do, since it would require obtaining a frequency response for each DM mode.

With the disturbance DM working, its time to move on and consider what my next move is. This week I'd like to finish modifying my simulink files to apply disturbance commands to DM61. Also, I'd like to review some of my basic adaptive filter/predictor stuff, and maybe have a nice simulink example I can "easily" port over to the experiment to play around with.

For tomorrow:
- Compare mirror step responses for DM61 and DM31 using random and single actuator commands
- Try to figure out what the extra B' is for in the eigenvalue problem for generating modes.
- Review linear predictor stuff. Start building a simple Matlab/Simulink example

Thursday, February 11, 2010

2.11.10

I was able to construct some modes for DM31 (the 31 actuator DM) using influence functions reconstructed from the poke matrix instead of the theoretical, simulated versions. When applied, both sets actually look pretty similar until the 10th mode or so, after which the experimental modes start to look like crap. I think part of the problem is that the WFS only samples the interior 80% or so of the beam, so several actuators peak on the edge or just outside of the frame. Since the experimental influence functions are actually pretty similar to the simulated versions (amazingly, even the amplitudes are within an order of magnitude!), I suspect that resizing the beam such that all the actuators are fully measured would help this out a little. Something to play with next week.

In the mean time, it'd still be interesting to construct modes for DM61 using its poke matrix. I found out yesterday that most of the actuators respond linearly to the square of the voltage command just like with D31, but there are 3 that don't seem to be moving at all, or or moving strangely. Tomorrow the plan is to swap out the mirror that's installed now with the spare to see if that solves the problem, and then take a look at the modes using that mirror's poke matrix.

I'm pretty clear on how to construct the modes now given a set of influence functions. Basically it just involves some clunky linear algebra. Maybe I'll write up a little short story about them one day.

Thursday, February 04, 2010

Back in Business

Apparently the D/A buffers in the driver box get corrupted every time I restart, but they can be cleared by a special command. Of course, why didn't I think of that?

Premature

This all was only wishful thinkin,
this all was only wishful thinkin



Unbelievably, the DM that was working a few hours ago is broken again after restarting my computer. Maybe something happened to the hardware overnight. Maybe our lab was subverted by Chinese hackers. Maybe it was all a dream and I was just hallucinating about it working from the pain meds I took for my knee.

Maybe my experiment's become self-aware and is trying to prevent me from making a discovery that will eventually lead to the extinction of the human race. It is, after all, almost as if the piece of crap was consciously trying to screw me up at every turn. Here's a rough timeline of the last few weeks:

- DM arrives. The cables for connecting the driver to PC are 1 ft long. Order longer cables.

- Longer cables arrive. Install DAC card drivers and search fruitlessly for further instructions. Email for help.

- Help arrives in the form of a software update from DM manufacturer. Software update proceeds to not work and crash. Email again for code that will work in Matlab.

- Example Matlab code arrives. Cryptic and mysterious, it uses syntax and a programming interface I'm unfamiliar with. Running it invokes errors and crashes Matlab. Email for help with suspected code.

- Correct faulty Matlab code and run it to discover...more errors. By now I can fix the "example" code myself.

- Matlab code runs without error. It works successfully with old DM, but new DM refuses to move. Email for help.

- Update DAC card drivers to latest version. Unplug and replug cables.

- SUCCESS! Compose witty and congratulatory blog post. Drink heavily in celebration of completed experimental setup.

- Restart computer. DM again refuses to move despite no software or hardware changes. Email for help.

- Cry. Put on Taking Back Sunday and compose defeated and bitter blog post.

And that is where we stand to this day, only a mere half quarter after we started. Fuck it, I'm taking a vacation.

Monday, February 01, 2010

Now witness the power of this fully armed and operational battle station!

My experiment is complete. Today I finally, finally gotten my second DM working from Matlab after more than a few emails, wasted afternoons and computer restarts; thus all the major components are there and functioning. Here's a picture of an experiment in progress:



There are still a few idiosyncrasies to work out, but the basics of sending commands to both mirrors simultaneously seem to be working. Here's a comparison of the effect of random command vectors applied to either mirror or both simultaneousy



Clearly this new mirror doesn't quite have the range of the 31 actuator model for whatever reason, however for generating disturbances it should get the job done.

This week the focus will be on characterizing the new mirror and rewriting my code to interface with it. The first step is to generate a poke matrix; early attempts at calculating one from random commands today weren't that successful for some reason, although poking each actuator individually seemed ok. I think a good plan for tomorrow would be to

1. Try loading the straight 61 actuator configuration file. Does poking each channel give the appropriate response?

2. Realignment. Are all the actuators covered by the beam? Should the beam be resized or altered in some way? Try to eliminate tilt as much possible before proceeding.

3. Assuming all the channels are behaving as planned, try again to generate a poke matrix using random commands.

Once I can generate this mapping reliably, I can go ahead and look at things like linearity and actuator decay. Then, I can use the experimental actuator influence functions to generate DM modes.

Thursday, January 21, 2010

I'm Doing Science!

Turns out expecting to produce a poke matrix by last Friday was a tad optimistic. After all, why should I expect my $15000 mirror to work out of the box or come with directions? What am I, some naive undergrad researcher?!

Most of of the problems stemmed from the example code I was sent, which contained several errors based on the "version" of the software I was using. Some of those I fixed myself, which I guess is good in retrospect since it forced me to get to know a few of the intimate joys of .NET. I'm sure this will be useful when some piece of code decides to shit the bed later.

In any case, I finally have some code written that I can use to command the USB, 31 actuator mirror using this new interface. Putting me functionally in the same place I was months ago. For some reason I still can't see the new DM from either the bundled software of Matlab, so that will take some further tinkering and emailing. It would be optimistic to plan on having this fixed by next week.

Nonetheless, tomorrow the plan is to get use to this new code and verify its producing the same results as before. Since we have 2 of the new 61 actuator DMs, I should be able to swap the hardware around to pinpoint the problem. I suspect its just some stupid software parameter somewhere that has to be checked, but its probably going to take an email to the manufacturer to figure out.


Friday, January 15, 2010

Sugar Momma

Like every good grad student I'm always looking for ways to get more money. One way of approaching that is to look at the current buzzwords that are flying out of research journals, and finding ways to use your own research in those areas.

Networked control systems seem to be a popular research topic in the control engineering world these days, and one of the major headaches there seems to be the uncertain time delay that results from unreliable data networks. I haven't read enough to know how this is dealt with in practice, but I would guess some kind of ZOH handwaving is used to duct tape the problem.

The AO problem deals with time delays explicitly by predicting future outputs. This is possible since wavefronts exhibit some correlation so we can usually do better than pure guessing on average. Adaptive controllers work even better because the nature of the correlation is uncertain or changes over time.

NCS problems also have time delays, but the problem is exacerbated because the delay itself is unknown. On the other hand, would it be outrageous to assume that the delays might be correlated? If that's true, could you design an adaptive controller/observer that provided an estimate that performed better than ZOH?

In other words, could you consider random delays as simply changes to the PSD of the measured signal? If so, then an adaptive controller might have some promise.

Hmm, this could all be nonsense on second thought.

Tuesday, January 05, 2010

Vacay's Over

Its been a relaxing month of unmitigated laziness since I passed my Quals. In that time I've managed to do less than I ever thought possible, other than ski and eat.

The presentation itself, rushed into production like a Soviet washing machine, went over well. Taking a hint from all the seminars I've slept through, I tried to avoid putting in too much text that would be ignored and instead focused on graphics and charts that I could explain. In my experience, this approach is what usually separated a presentation given by a grizzled transparency veteran, new to powerpoint but not to verbose explanation, and a recently minted academic who still possessed the new PhD smell.

Scheduling it during finals week turned out to be a blessing. Since most of my committee had limited time to spare between giving exams and review sessions to the little ones, I only had an hour or so to talk. A mere 40 minutes remained by the time everyone arrived and I finally opened my mouth, but this limit meant that I could avoid any really technical questions.

Anyway, with a supposedly clear path ahead, the next step is to install and test out the new 61 actuator DM we received. I actually came in a few days over the break to do some alignment, despite the department's attempt to prevent this by turning off the lights and stopping garbage collection. This week the focus will be on commanding the mirror itself. This new mirror only has twice the actuators, but apparently sending it commands is ten times as difficult. Rather than a simple USB driver box, signals to this mirror travel through an NI DAQ card before hitting some other voltage amplifier that actually connects to the actuators. To use this system with Matlab I'll have to upgrade to 2009A, and use the .NET interface to access the DM driver's DLL library. Hooray.

A rough, optimistic schedule of events:

Tues: Finish installing cables, test mirror functionality using V. 1.8 software, begin dissecting AOS .NET example code

Wed: Upgrade Matlab if possible, continue code dissection

Thurs: Adapt code into Matlab DM control function

Fri: create 61 actuator poke matrix

Tuesday, December 08, 2009

Demo

In anticipation of my Qualifying Exam in 2 days, I've created a working demo of my experiment

Thursday, December 03, 2009

All work and no play makes jack a dull boy

Spend too much time doing technical writing, and pretty soon you start thinking in proposal-eese.

The girl over there is pretty hot [5]. However, two prominent features preclude her from attaining optimal attractiveness: her diminutive height, and her apparent predilection for undesirable Australian footwear. The former of these is alleviated by her sitting position. The latter, however, is a consequence of cultural differences and cannot be mitigated directly [14].

Monday, November 23, 2009

A Question

Q: So what do you plan on doing after you graduate?

A: Enjoy not answering stupid questions about what I plan to do.

...can't wait for all the family gatherings coming up.


Wednesday, November 18, 2009

An Update

I finally charmed enough professors into being on my Ph.D committee. The motley crew consists of 3 controls people from MAE and one optimization prof from EE. I deliberately avoided having anyone with too much background in optics to avoid any potentially embarrassing questions, and I really want to emphasize that this is more a controls project than an optics one.

Since it looks like I'll actually be able to do my Quals this quarter, experiments have basically been nonexistent while I work on my prospectus. I'm trying go heavy on the detail to make things easier when its time to write the big boy, and right now I anticipate it'll clock in around 40-5o pages. Bigger than the average prospectus maybe, but I have been plugging away at this for some time after all. Its actually nice to review over everything at one time and see how much I've done...and how much I still have to do.

Graduation in 2010? Maybe not so far fetched after all.

Wednesday, November 04, 2009

Dear Diary,

I spent most of today talking with my advisor about the ability of the DM to reproduce the actuator modes. He seems suddenly interested in this even though identifying a modal poke matrix is something I've been doing for months. At least he admits his obsession with modes is "a sickness."

Yesterday there was some concern that, even though there are only 31 actuators and hence 31 degrees of freedom, somehow more than 31 modes were being produced through some nonlinearity. We looked at this problem by applying a few hundred random commands and computing Karhunen-Loeve modes for the resulting phases and/or slope data. It was hard to tell from the eigenvalues of those modes what exactly was going on, but it looked like there were far fewer than 31 principle components that had a significant contribution to the phases. Even though there were nonzero values past the 31st largest eigenvalue, there is definitely some funny business going on with the rounding, pixel error, and other nonlinear noise affects that could be contributing.

On the control front I'm trying to learn as much as I can about Youla parameterization. Of course, my idea of combining this with adaptive filtering algorithms is about 10 years too late. Still, its a relatively unused technique and there's still some potential for exploration there. Even if I don't end up rewriting the adaptive controller code our lab is currently using, I think its important to know what's going on under the hood.

We've been experiencing all four season in one week here. I need cold weather.

Tuesday, October 27, 2009

10.28.09

Here's a crappy video of the total, tilt removed phase as its corrected by the PI controller.


Quite amazing considering the crap I was getting before. Most of the bias error is concentrated in the focus mode, and its important that note only is the phase largely corrected, but the actuators don't saturate at all.

Of course adding tilt screws things up. Even though the DM clearly attempts to correct those errors, some of the actuators quickly saturate. Manually removing it is difficult since the large distances in my setup make it extremely sensitive to even someone touching a mirror. There are three options for dealing with this:

1. Ignore tilt completely. My preference, and not entirely unrealistic since it is often handled by a separate tracking loop anyway.

2. Add a steering mirror. Probably tougher than it sounds, would require another beamsplitter and probably a month of playing around.

3. Use the disturbance DM. The disturbances are largely free of tilt and probably don't saturate the mirror on their own, thus the tilt modes on the disturbance mirror could be used to correct for some of the overall tracking error of the system.

For now #1 is the only option. Word on the grapevine is that another package is on its way, so hopefully it contains my second mirror. In the mean time, here's what I want done tomorrow:

- Finish implementing an RLS adaptive equalizer example in Simulink
- Test out/modify the existing Simulink files to run the PI loop
- Work on my prospectus
- Look into committee possibilities.

Monday, October 26, 2009

Harder, Better, Faster, Stronger

Finally got the faster DM control code working, only 3 months late! It does make quite a difference, as you can see comparing the response to the original function:

Here's the norm of the wavefront error averaged over 100 different random commands applied with both versions. Its startling how slow the old script was; a pause of 0.5 seconds wouldn't be too conservative. Even with a new script though it looks like some pause is necessary since, although commands can be sent around 100 Hz, actuation doesn't happen until at least 0.1 sec.

You can also see this when looking for actuator decay. Here's the max displacement of each actuator. Note the ~0.1 sec rise time is the same regardless of the actuator unlike before:
Compare this with the similar plot from 10/22. Ultimately I might be able to get away with a pause less than 0.1 sec depending on the application, since it does put a limit on the speed of the overall system. I'm still amazed just how accurately the DM is able to reproduce the modes, here's mode 30 for instance, lookin snazzy:
Mmmm, deformable mirror pr0n...I bet no one's ever said that before.

Thursday, October 22, 2009

Ludicrously Good

The refurbished DM came in late Monday, and I finally got all the glass aligned and working today. I've switched to using Galilean telescopes to resize the beam to keep the overall path length small, and the results so far seem to be pretty good. I tested the DM itself for the first time today and the results seem to be almost absurdly good compared to the crap I was getting before.

Here are the actual influence functions for actuators 1-31 (there are 31 total) taken from the columns of the poke matrix:



Each one is almost suspiciously clean. There was a significant pause between applying the command and capturing the wavefront, so it doesn't look like I'm having the problem with actuator decay like I was before. The columns of the modal poke matrix are even more impressive:



Even the high frequency modes are recognizable and look almost simulated. I haven't had the balls to look at the reconstruction error yet, maybe tomorrow. Even better, there doesn't seem to be any actuator decay, shown by looking at the plots of the peak displacement




Compared to the results from Sept. 9 with the old DM this is golden. Note how higher numbered actuators take longer to respond). Right now the WFS is using a lot of subapertures to capture the wavefront in relatively high resolution. After the DM is vetted I'll swap out the optics to go back to a reduced frame and higher frame rates. Hopefully the higher resolution DM for generating disturbances will show up soon as well.

Tomorrow more testing. I'd also like to get the new (faster) DM control code working, which was the original motivation for everything that's gone on the last 3 months.

Thursday, October 15, 2009

10.15.09

I finally got the new laser late Monday, just as I was about to call and see what the dillio was. Tues. was mostly dedicated to getting the spatial filter aligned, usually quite the bitch apparently, but some online resources were really helpful and I can do it in a few minutes now. Since then I've been going slowly with the realignment, especially since a package (with mysterious contents) was dispatched from AOS today. If the new DM's arrive then I can finally assemble the (hopefully) complete system. How many times have I said that? So far this laser is much easier to work with. I think the asymmetric divergence of the diode laser was really screwing things up.

Other than that I spent most of last week learning LaTeX while working on my prospectus. Just like shaving and wearing matching socks, its something every graduate engineer has to learn to do at some point.

Wednesday, October 07, 2009

Beware the time vampire

If your boss bought some equipment from ebay with no obvious utility to "play around with," what's the worst thing you could imagine? How about an impenetrable metal box the size and weight of a small fridge?

Oh wait, it's not impenetrable, there's a 1 inch slot on the top.

Friday, October 02, 2009

10.1.09

Shit I can't believe its October already. I feel like I've basically been a waste of precious government resources the last year, but I guess that's just the pace research moves. This blog has helped though...helped me realize how much time I've wasted on certain ::cough::spgd::cough:: algorithms.

I finally ordered a new HeNe laser like I always wanted. Its going to require some substantial changes to the glass in my experiment so I've decided not to waste any time messing around with my current setup until I get it. The diode laser spot was just too messed up by the time it reached the WFS to provide useful data. The problem, I think, is that the spot divergence is inversely related to the spot magnification, and diode laser spots diverge asymmetrically. The result was far from circular after passing through so many optical elements, and as a result the accuracy of a measured wavefront was seriously suspect.

I hoping it arrives next week. I'm using the down time to get outside of the lab and reacquaint myself with some long rusty controls material. I'm really interested in eventually trying some adaptive Q parameterization, but that means I have to know such riveting concepts as coprime factorization and Bezout identities.

Plus, the ratio sucks in the engineering buildings. Outside classes are in session, the sun is shining, people are out and about...its no time to be stuck indoors with a bunch of lasers and postdocs.

Wednesday, September 23, 2009

Times they are a changin'

Here's a dandy chart showing the decrease in frame rate as the WFS image size is increased. Each sub-aperture is around 22 px across, and each pixel is around 6 um, so that gives you an idea of the beam size necessary. I also varied the shutter speed, but this should obviously be set to the minimum value necessary to see the centroids.



Aligning the beam is turning out to be problematic because the divergence is significant as the beam size shrinks. The good news is that a windfall in our equipment budget means I'm finally getting a HeNe laser like I always wanted. expanding it is slightly more involved than with the diode laser I'm using now, but I should be able to clean it up using a spatial filter and get a pretty nice spot.

As a matter of fact, we also ordered a new DM to use in place of the retarded SLM I've struggled with. The new DM contains around 60 actuators compared to the 31 in the current model. It might seem odd to use the higher density DM as a disturbance generator, but in RL atmospheric turbulence is always going to generate higher (spatial) frequency distortion than can be corrected with a finite actuator DM.

This basically means that all the active components of my experiment are going to be repaired/replaced in the next few weeks. I really really hope that's it because frankly i'm tired of dealing with all this optics shit.