Thursday, June 04, 2009

6.4.09

I've spent most of this week porting my control algorithms to Simulink and the "suggestion" of my adviser. Conceptually this shouldn't be that hard since I already have a simulation using the experimental poke matrices. Reading the WFS image is trivial with the image acquisition toolbox. However implementing my custom code for calculating slopes and sending commands to the mirror requires me to use these Embedded Matlab blocks that translate m-files into C code for execution in Simulink, and that process involves a whole shit storm of issues. I found a pretty simple, slightly cheating, way of doing it that basically just involves calling my existing code as "extrinsic" functions that don't compile into C, but instead run in the Matlab workspace. This seems to work pretty well and right now I have my PI controller running beautifully (albeit slowly) in Simulink.

I've gotten the code necessary to control the SLM from Matlab as well, and its pretty clunky and generally crap, although I guess its functional enough to use. Getting it to work in Simulink as above though is, not surprisingly, a pain in the ass.

Tomorrow we meet with some Ophthalmologists to see if we can use any AO techniques on their retinal imaging machines. This has been done before by some people at Berkeley, so what they ask for might not be particularly novel, probably difficult (getting the optics setup), and from a control perspective not very interesting (the phase distortion of the eye is basically constant). Still, it doesn't hurt to talk.

No comments: