1 \documentclass[12pt]{article}
4 \usepackage[latin1]{inputenc}
5 %\usepackage{pstricks,pst-node,pst-text,pst-3d}
14 \usepackage{subfigure}
19 %%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
20 \newcommand{\noun}[1]{\textsc{#1}}
22 \newcommand{\tab}{\ \ \ }
24 %%%%%%%%%%%%%%%%%%%%%%%%%%%% my bib path.
27 \title{Using FPGAs for high speed and real time cantilever deflection estimation}
29 \author{ Raphaël COUTURIER\\
30 Laboratoire d'Informatique
31 de l'Universit\'e de Franche-Comt\'e, \\
33 90016~Belfort CEDEX, France\\
35 Laboratoire d'Informatique
36 de l'Universit\'e de Franche-Comt\'e, \\
38 90016~Belfort CEDEX, France\\
39 \and Gwenhaël Goavec\\
56 {\it keywords}: FPGA, cantilever, interferometry.
59 \section{Introduction}
62 %% quelques ref commentées sur les calculs basés sur l'interférométrie
64 \section{Measurement architecture}
65 \label{sec:measure-archi}
67 %% description de l'architecture générale de l'acquisition d'images
68 %% avec au milieu une unité de traitement dont on ne précise pas ce
71 %% image tirée des expériences.
73 \section{Design goals}
76 %% objectifs en terme de rapidité et de précision, avec en vue l'ajout
77 %% du contrôle => l'unité de traitement qui s'impose est un FPGA =>
78 %% algo adapté au FPGA.
80 %% peut etre que cette section peut être déplacée en intro ... à voir.
82 \section{Proposed solution}
85 \subsection{Cantilever deflection estimation}
87 %% => faire de l'interpolation de signal sinusoidal
88 %% descriptif rapide des deux méthodes : splines et moindres carrés
89 As shown on image \ref{img:img-xp}, each cantilever is covered by
90 interferometric fringes. The fringes will distort when cantilevers are
91 deflected. Estimating the deflection is done by computing this
92 distortion. For that, (ref A. Meister + M Favre) proposed a method
93 based on computing the phase of the fringes, at the base of each
94 cantilever, near the tip, and on the base of the array. They assume
95 that a linear relation binds these phases, which can be use to
96 "unwrap" the phase at the tip and to determine the deflection.\\
98 More precisely, segment of pixels are extracted from images taken by a
99 high-speed camera. These segments are large enough to cover several
100 interferometric fringes and are placed at the base and near the tip of
101 the cantilevers. They are called base profile and tip profile in the
102 following. Furthermore, a reference profile is taken on the base of
103 the cantilever array.
105 The pixels intensity $I$ (in gray level) of each profile is modelized by :
109 I(x) = ax+b+A.cos(2\pi f.x + \theta)
112 where $x$ is the position of a pixel in its associated segment.
114 The global method consists in two main sequences. The first one aims
115 to determin the frequency $f$ of each profile with an algorithm based
116 on spline interpolation (see below). It also computes the coefficient
117 used for unwrapping the phase. The second one is the acquisition loop,
118 while which images are taken at regular time steps. For each image,
119 the phase $\theta$ of all profiles is computed to obtain, after
120 unwrapping, the deflection of cantilevers.
122 This phase computation is obviously the bottle-neck of the whole
123 process. For example, if we consider the camera actually in use, an
124 exposition time of 2.5ms for $1024\times 1204$ pixels seems the
125 minimum that can be reached. For a $10\times 10$ cantilever array, if
126 we neglect the time to extract pixels, it implies that computing the
127 deflection of a single cantilever should take less than 25$µ$s, which is
130 \subsection{Considered algorithms}
132 Two solutions have been studied to achieve phase computation. The
133 original one, proposed by A. Meister and M. Favre, is based on
134 interpolation by splines. It allows to compute frequency and
135 phase. The second one, detailed in this article, is based on a
136 classical least square method but suppose that frequency is already
139 \subsubsection{Spline algorithm}
141 Let consider a profile $P$, that is a segment of $M$ pixels with an
142 intensity in gray levels. Let call $I(x)$ the intensity of profile in $x
145 At first, only $M$ values of $I$ are known, for $x = 0, 1,
146 \ldots,M-1$. A normalisation allows to scale known intensities into
147 $[-1,1]$. We compute splines that fit at best these normalised
148 intensities. Splines are used to interpolate $N = k\times M$ points
149 (typically $k=3$ is sufficient), within $[0,M[$. Let call $x^s$ the
150 coordinates of these $N$ points and $I^s$ their intensities.
152 In order to have the frequency, the mean line $a.x+b$ (see equation \ref{equ:profile}) of $I^s$ is
153 computed. Finding intersections of $I^s$ and this line allow to obtain
154 the period thus the frequency.
156 The phase is computed via the equation :
158 \theta = atan \left[ \frac{\sum_{i=0}^{N-1} sin(2\pi f x^s_i) \times I^s(x^s_i)}{\sum_{i=0}^{N-1} cos(2\pi f x^s_i) \times I^s(x^s_i)} \right]
161 Two things can be noticed. Firstly, the frequency could also be
162 obtained using the derivates of spline equations, which only implies
163 to solve quadratic equations. Secondly, frequency of each profile is
164 computed a single time, before the acquisition loop. Thus, $sin(2\pi f
165 x^s_i)$ and $cos(2\pi f x^s_i)$ could also be computed before the loop, which leads to a
166 much faster computation of $\theta$.
168 \subsubsection{Least square algorithm}
170 Assuming that we compute the phase during the acquisition loop,
171 equation \ref{equ:profile} has only 4 parameters :$a, b, A$, and
172 $\theta$, $f$ and $x$ being already known. Since $I$ is non-linear, a
173 least square method based an Gauss-newton algorithm must be used to
174 determine these four parameters. Since it is an iterative process
175 ending with a convergence criterion, it is obvious that it is not
176 particularly adapted to our design goals.
178 Fortunatly, it is quite simple to reduce the number of parameters to
179 only $\theta$. Let $x^p$ be the coordinates of pixels in a segment of
180 size $M$. Thus, $x^p = 0, 1, \ldots, M-1$. Let $I(x^p)$ be their
181 intensity. Firstly, we "remove" the slope by computing :
183 \[I^{corr}(x^p) = I(x^p) - a.x^p - b\]
185 Since linear equation coefficients are searched, a classical least
186 square method can be used to determine $a$ and $b$ :
188 \[a = \frac{covar(x^p,I(x^p))}{var(x^p)} \]
190 Assuming an overlined symbol means an average, then :
192 \[b = \overline{I(x^p)} - a.\overline{{x^p}}\]
194 Let $A$ be the amplitude of $I^{corr}$, i.e.
196 \[A = \frac{max(I^{corr}) - min(I^{corr})}{2}\]
198 Then, the least square method to find $\theta$ is reduced to search the minimum of :
200 \[\sum_{i=0}^{M-1} \left[ cos(2\pi f.i + \theta) - \frac{I^{corr}(i)}{A} \right]^2\]
202 It is equivalent to derivate this expression and to solve the following equation :
205 2\left[ cos\theta \sum_{i=0}^{M-1} I^{corr}(i).sin(2\pi f.i) + sin\theta \sum_{i=0}^{M-1} I^{corr}(i).cos(2\pi f.i)\right] \\
206 - A\left[ cos2\theta \sum_{i=0}^{M-1} sin(4\pi f.i) + sin2\theta \sum_{i=0}^{M-1} cos(4\pi f.i)\right] = 0
209 Several points can be noticed :
211 \item As in the spline method, some parts of this equation can be
212 computed before the acquisition loop. It is the case of sums that do
213 not depend on $\theta$ :
215 \[ \sum_{i=0}^{M-1} sin(4\pi f.i), \sum_{i=0}^{M-1} cos(4\pi f.i) \]
217 \item Lookup tables for $sin(2\pi f.i)$ and $cos(2\pi f.i)$ can also be
220 \item The simplest method to find the good $\theta$ is to discretize
221 $[-\pi,\pi]$ in $N$ steps, and to search which step leads to the
222 result closest to zero. By the way, three other lookup tables can
223 also be computed before the loop :
225 \[ sin \theta, cos \theta, \left[ cos 2\theta \sum_{i=0}^{M-1} sin(4\pi f.i) + sin 2\theta \sum_{i=0}^{M-1} cos(4\pi f.i)\right] \]
227 \item This search can be very fast using a dichotomous process in $log_2(N)$
231 \subsubsection{Comparison}
233 \subsection{FPGA constraints}
235 %% contraintes imposées par le FPGA : algo pipeline/parallele, pas d'op math complexe, ...
237 \subsection{Least square algorithm}
239 %% description précise
242 \subsection{VDHL design paradigms}
244 \subsection{VDHL implementation}
246 \section{Experimental results}
252 \section{Conclusion and perspectives}
255 \bibliographystyle{plain}
256 \bibliography{biblio}