Sunday, May 30, 2010

5.30.10

I've been sidetracked the last couple weeks working on this idea of quantifying frozen flow layers. The problem is to identify how many layers are moving in a phase profile, and estimate their velocities. A common idea among some "predictive" AO controllers is to then use this information to generate control commands some number of steps in the future.

Of course, this only works when the velocities are constant and pretty well known, but it seems to be a common approach among certain fields. Based on some comments I've heard, they like it because it incorporates some knowledge about the physics behind the problem. I think deep down some of them just don't trust the completely black box methods that's common in hard core controls applications.

We typically use one of these feared methods to identify a state space model for the turbulence. One question that's bothered us though, is how can we extract the velocity and layer information? Since the controller developed from the state space is optimal, the velocity info has to be embedded in there, but since the states are a product of the ID it isn't clear how.

One approach people in the AO community have tried is to generate a bunch of image correlations from the data, and look for peaks. If the phase is composed of a finite number of layers moving with distinct velocities, the correlations between images separated by enough delay should develop peaks corresponding to each layer. In our case, we have a state space model. And while we could just generate a sequence of data and use these methods, I'd be cooler if we could identify the velocity straight from the system matrices directly.

Coincidentally, I've been reading this book on subspace identification, and it has a good review about calculating the state and output covariance matrices for a state space system. Its very easy to compute the covariance matrices for any number of time steps, so I started to wonder if you could compute the covariance function directly from these matrices. After much, much head banging, it turns out you can.

I don't want to reveal the exact details, but I'll just say even though its not theoretically complicated, its pretty cumbersome in the 2D case, and required many many cups of coffee and a nontrivial amount of cursing to figure out. I still haven't tried it out on real data, but in all the simple 2 layer, integer velocity cases I've developed it works swimmingly, and seems relatively robust to random similarity transformations to the state space.

Monday, May 17, 2010

5.17.10

Now that I can identify simple disturbance models from open-loop data, I'd like to try designing an optimal controller using the identified system. I think it should work out in simulation, but ideally I'll be able to implement it in the experiment and see some results. This is actually much more simple than using actual wavefronts and doing a multichannel problem; since the plant is particularly simple (with a slow enough sampling time), the optimal controller should do a pretty good job.

1. Make sure models can be id'ed using the disturbance model, probably using the 61 actuator modes constructed using the poke matrix.

2. Ignore the PI controller for now? Try to apply disturbances while the integrator is running and see what the results look like.

3. Come up with a script that calculates the optimal controller structure using the controller SS model. First by solving a WH problem, then also by solving a finite time LQR problem. Results should be the same with each.

4. Apply the controller in simulation and in the experiment if all goes well.

5. ....?

6. Profit.

The one wrinkle in all this it that controller and disturbance DM are using different sets of modes, so I have to think about the best way to unify them. Ultimately, I suspect I'll end up using the DM61 modes for generating disturbances, but since that process is basically opaque from the controller's perspective, all the ID and control will be done on the basis of the DM31 modes.

Wednesday, May 12, 2010

5.12.10

I feel like my brain's overheating from all the wasted processing cycles I'm asking it to do this week, mainly due to my shallow grasp of concepts I should know by now. The problem with doing several complicated dance moves simultaneously is that they all overlap into something that resembles a seizure more than a coherent motion.

1. Making headway in my subspace ID book. I found the presentation of prediction theory from a Hilbert Space perspective to be particularly illuminating once I finally got wtf was going on. Now embarking on several chapters on stochastic realization.

2. Now that I can roughly identify a noise model from input/output data, the question is how to construct the optimal controller. This is covered in a past grad's thesis that I'm dissecting; like all dissertations its terse, and lets the references do most of the talking.

3. We've struggled for some time for a way to evaluate layer velocities for a turbulence model given a state space realization if you assume "frozen flow" holds. In the past people have estimated the velocity by looking at the spatial autocorrelation of the WFS measurements and tracking the peak. I brought up the point that perhaps the steady-state autocorrelations could be derived analytically from the state space realization, specifically the state covariance matrix. Its not clear if this is feasible or if I was just high on lens cleaning fumes.

4. I'm also working on a midterm for the class I'm taking, doing some analysis of neuronal pattern generators using quasi-linear multivariable harmonic balance. Yeah.

Shits gettin real.

Wednesday, May 05, 2010

Backpacking: After Action

Some lessons learned:

1. Respect the toilet paper. Waste not the toilet paper. Cherish its many uses.

2. Snowshoes? That's for teh gayz!

3. On second thought, frozen boots are bad, dripping socks are worse.

4. Filtering is a PITA. Socks are not adequate water filtration devices despite their affinity for water.

5. No amount of caffeine withdrawal makes Starbucks a decent choice.

6. Sleeping on a slope sucks.

Monday, May 03, 2010

Inb4SID

I'm trying to gradually ween myself (and my advisor) off tinkering with my experiment and start working on actual controls. Before I can get to controller design I have to do some work on system ID; stuff more complicated than simple ARX models of the DM. Its been so long since I've actually taken any classes in this stuff that this means a lot of reading in the weeks ahead.

The reason for focusing on system ID is that one way to reject disturbances is to characterize the disturbance input as the output of an LTI filter with white noise input. Once you have that you can internalize the model in the controller and use it to reject disturbances "optimally." This is explicitly what an adaptive controller does, but doing the ID in a separate step has its advantages.

The immediate question was did the experiment have enough accuracy in reading and applying wavefronts to do this? To do this I cooked up a little Simulink file that runs white noise through a FIR filter and applies the resulting modal commands. The game is to read the wavefronts from this and reconstruct these filtered commands. With those and knowledge of the inputs, it should be possible to identify the FIR coefficients if the reconstruction is accurate enough.

To my amazement this actually worked out well; the reconstruction of the filtered commands was accurate enough to do a good job of estimating the filter with batch least-squares. The modes also seemed orthogonal enough that I could determine identify separate filters if a different one was applied to different modal channels.

For shits and giggles I stuck the RLS block in the Simulink model and was able to get it to converge to the SS error pretty quickly. You can see this in action by changing the filter coefficient half way through the experiment and watching it re-converge.

This is good news. Eventually I'm going to unleash a subspace ID algorithm on this biotch to identify even more complicated state space, MIMO models, but since I know nothing about that stuff its going to be a while before I catch up on all the reading. In the mean time there's plenty to play around with here. I'd like to see how well I can identify a multichannel FIR filter, particularly if only a limited number of modes are used in the ID. Also, I think I'd be good for the soul to try to code an RLS filter myself.