![]() |
MAOS
Multithreaded Adaptive Optics Simulator
|
The DM hysteresis model is based on "Modeling the hysteresis of a scanning probe microscope", J. Vac. Sci. Technol. B 18 (2), Mar/Apr 2000.
Formula (2) of the paper is used with \(x\) replaced by the actual DM position \(y\) and \(V\) replaced by the command \(x\):
\[ \frac{dy}{dx}=\alpha\, \mathrm{sign}(dx) (\beta x-y)+(\beta-u) \]
For a closed hysteresis loop within the stroke limit \(S\), the linear ordinary differential equation can be solved analytically:
\begin{eqnarray*} y_{t/r}(x)=\beta x \mp \frac{u}{\alpha}\left(1-\frac{2\exp(\mp\alpha x)}{\exp(-\alpha S)+\exp(\alpha S)}\right) \end{eqnarray*}
where \(t\) and \(r\) represent the trace (increasing \(x\), upper sign) and retrace (decreasing \(x\), lower sign) directions. It is desirable to have \(y\) within the same range as \(x\) to simulate a calibrated command: \(y_{t/r}(S)=S\). Let the hysteresis ratio be \(h\), defined as the maximum difference between the trace and retrace curves, which occurs at \(x=0\), divided by \(2S\). We have
\begin{eqnarray*} \frac{y_r(0)}{S}&=&\frac{u}{\alpha S}\left(1-\frac{2}{\exp(-\alpha S)+\exp(\alpha S)}\right)=h \\ \frac{y_{t/r}(S)}{S}&=&\beta-\frac{u}{\alpha S}\left(1-\frac{2\exp(-\alpha S)}{\exp(-\alpha S)+\exp(\alpha S)}\right) = 1 \end{eqnarray*}
The equations can be solved uniquely for \(u\) and \(\beta\) when \(\alpha S\) is fixed. The hysteresis curve is a weak function of \(\alpha S\), and \(\alpha S=2\) produces a good looking curve. A smaller \(\alpha S\) has slower convergence of the hysteresis curve.
The hysteresis model is simulated using simple integration. For each step with a new command \(x\), the position \(y\) is updated as
\begin{eqnarray*} dx &=& x-x_{last} \\ dy &=& \alpha |dx| (\beta x_{last}-y_{last})+dx(\beta-u) \\ y_{last}&\mathrel{+}=&dy \\ x_{last}&=&x \\ y&=&y_{last} \end{eqnarray*}
The model is implemented in lib/hyst.c:
In maos, the model is enabled for a DM when dm.hyst is nonzero, using the parameters
dm.hyst: the hysteresis ratio \(h\), between 0 and 1 (default 0, i.e., disabled),dm.hyst_alpha: \(\alpha S\) (default 2),dm.hyst_stroke: the stroke \(S\) in meters at which the hysteresis is measured (default 10e-6),with defaults in config/maos/sim.conf. The models are created in maos/sim_utils.c, and filter_dm() (maos/filter.c) applies them to convert the DM commands simu->dmcmd to the actual DM shape simu->dmreal.