Wednesday, March 18, 2009

Close

After a lot of trial and error, I discovered another problem with the way I was applying random perturbations. To avoid saturating the actuators, I was first generating random DAC commands in the range [0,255], and then calculating the corresponding perturbation from that. The problem with this is that the resulting perturbations aren't zero mean, so if the current command is, say, 200, then its unlikely a positive perturbation will be generated. Thus, the gradient was effectively being estimated with information in only one direction.

I fixed this by randomly generating the perturbations themselves, rather than absolute commands and back calculating the perturbation values. I'll have to play around with the parameters to make sure they're actually zero mean. Saturation might just be something I'll have to live with, especially when generating random modal commands. The ideal method for generating these things actually might require some thinking. If the current command is close to 255, for example, then having too many perturbations that are saturated is a waste.

With this change I tried running the SPGD controller with a single mode (the focus mode), commanding all actuators with the same value. Luckily it converges in steady state to approximately the same control command as the PI controller, around 199. However the command seems to jump around to a much lower command every other iteration, so I think I'll need to play around with the gain to tamp that down.

I witnessed similar behavior when feeding back the intensity instead of the WFS data. I'm hopeful that I can get it working by just picking the right gain.

I'm close...I can smell it.

No comments: