# A Nonlinear Observability Analysis of Ambient Wind Estimation with
Uncalibrated Sensors, Inspired by Insect Neural Encoding

Floris van Breugel This work was partially supported by NIH (P20GM103650),
AFRL (FA8651-20-1-0002), and the Sloan Foundation (FG-2020-13422)F. van
Breugel is a faculty member of Mechanical Engineering at the University of
Nevada, Reno, USA (email: fvanbreugel@unr.edu).

###### Abstract

Estimating the direction of ambient fluid flow is key for many flying or
swimming animals and robots, but can only be accomplished through indirect
measurements and active control. Recent work with tethered flying insects
indicates that their sensory representation of orientation, apparent flow,
direction of movement, and control is represented by a 2-dimensional angular
encoding in the central brain. This representation simplifies sensory
integration by projecting the direction (but not scale) of measurements with
different units onto a universal polar coordinate frame. To align these
angular measurements with one another and the motor system does, however,
require a calibration of angular gain and offset for each sensor. This
calibration could change with time due to changes in the environment or
physical structure. The circumstances under which small robots and animals
with angular sensors and changing calibrations could self-calibrate and
estimate the direction of ambient fluid flow while moving remains an open
question. Here, a methodical nonlinear observability analysis is presented to
address this. The analysis shows that it is mathematically feasible to
continuously estimate flow direction and perform regular self-calibrations by
adopting frequent changes in course (or active prevention thereof) and
orientation, and requires fusion and temporal differentiation of three sensory
measurements: apparent flow, orientation (or its derivative), and direction of
motion (or its derivative). These conclusions are consistent with the
zigzagging trajectories exhibited by many plume tracking organisms, suggesting
that perhaps flow estimation is a secondary driver of their trajectory
structure.

_Keywords:_ observability, sensor calibration, anemotaxis

##  I Introduction

Determining the direction of ambient fluid flow is a crucial step for flying
or swimming animals and robots during tasks such as tracking chemical plumes
[1]. Without access to stationary flow sensors, however, ambient flow
direction cannot be directly measured [2]. Instead, agents moving in fluids
can measure apparent flow, corresponding to the vector sum of the ambient flow
and motion induced flow (Fig. 1A). Decoupling apparent flow into its component
parts is a straightforward vector subtraction if given absolute trajectory
information in the same units as apparent flow. Many animals and the smallest
robots, however, do not have access to absolute measurements from GPS, and
cannot rely on Simultaneous Localization and Mapping (SLAM) due to the
associated computational costs, which approach 10 Watts for monocular SLAM
[3].

Instead of relying on GPS and SLAM, some engineers [4, 5, 6] have taken
inspiration from insects, which rely on visual estimates of self-motion
through optic flow [7], providing only relative information due to depth- [8],
texture-[9], and state- [10] dependent response properties. Furthermore,
variability due to manufacturing or development means some calibration is
required [11, 12]. One calibration may be insufficient, however, since damage
[13] or temperature fluctuations [14, 15] can alter responses of sensors and
actuators. Thus, a mechanism for eliminating reliance on absolute measurement
scales and continuous self-calibration would be helpful.

Flying insects have emerged as excellent model systems for studying how
organisms track chemical plumes in moving fluids [16, 17], serving as
inspiration for small robotic systems [18]. One strategy proposed to explain
insects’ ability to orient with respect to ambient wind, called visual
anemotaxis [19], allows them to orient upwind by turning until the angle of
perceived apparent wind is aligned with the angle of motion. Free and tethered
flight behavior experiments with fruit flies, however, suggest that their
turns are often open-loop and ballistic in nature, and not actively controlled
throughout the turn itself [20, 21, 22]. Thus, perhaps flies have more
flexible algorithms for estimating ambient wind direction throughout their
trajectory. Engineers have demonstrated solutions to this estimation challenge
using externally calibrated sensor systems in Cartesian coordinates [23, 24].
Insects, however, encode information in polar coordinates and must contend
with shifting calibrations.

Recent discoveries using calcium imaging in tethered flying fruit flies,
Drosophila melanogaster, have found that a central part of their brain, the
fan-shaped body and doughnut-shaped ellipsoid body, encodes 2-dimensional
angular compass information such as head orientation from polarization [25],
apparent wind angle from their antennae [26], angular direction of motion from
vision [27, 28, 29], and angular motor control commands [30]. Neuroanatomical
studies suggest that similar sensory encodings exist in many invertebrates
[31]. The physical overlap in the brain of the aforementioned sensory
modalities presents an attractive hypothesis that perhaps they play a central
role in insects’ ability to estimate ambient wind direction.

This manuscript presents a methodical nonlinear observability analysis of
different sensor suites relevant to flying insects to understand the
feasibility of estimating ambient wind direction and self-calibrating a
sensorimotor system. Inspired by the 2-dimensional polar encoding found in the
brains of insects, this analysis focuses on the 2-dimensional plane parallel
to the ground, where the largest changes in wind direction are usually
observed. Extensions to 3-dimensions are briefly discussed. To provide a
concrete basis for the analysis and discussion, the term fly is used
throughout this paper. However, all of the concepts described here are equally
applicable to any flying or swimming agent–biological or engineered–that has
an interest in determining the direction of ambient fluid flow while moving.

##  II System Model

We begin with the equations of motion in the body frame of the fly (Fig. 1B),
and model the fly’s ability to control its flight as forces applied parallel
$(||)$ and perpendicular $(\bot)$ to its body through its center of mass, as
well as a torque to introduce angular accelerations (Fig. 1C). In addition to
these controlled forces, there will also be linear and rotational aerodynamic
drag forces.

Figure 1: 2-dimensional geometric relationships of the states describing a
flying fly in the presence of ambient wind.

For this 2-dimensional description of the fly’s dynamics, the full state
describing the fly is
$\boldsymbol{x}=[v_{||},v_{\bot},\phi,\dot{\phi},w,\zeta]^{T}$, where $v_{||}$
and $v_{\bot}$ describe the magnitude of the parallel and perpendicular
velocity in the body coordinate frame, $\phi$ and $\dot{\phi}$ describe the
angle of the fly relative to some global coordinate frame and its derivative
(i.e. the fly’s angular velocity), and $w$ and $\zeta$ describe the magnitude
and direction of the wind in the global coordinate frame. Each of these states
is a function of time,

$\boldsymbol{\dot{x}}=\\\ \begin{bmatrix}\dot{v}_{||}\\\ \dot{v}_{\bot}\\\
\dot{\phi}\\\ \ddot{\phi}\\\ \dot{w}\\\
\dot{\zeta}\end{bmatrix}=\begin{bmatrix}(F_{||}-D_{||})/m+v_{\bot}\dot{\phi}\\\
(F_{\bot}-D_{\bot})/m-v_{||}\dot{\phi}\\\ \dot{\phi}\\\
\tau_{\phi}-D_{\phi}/I\\\ \dot{w}\\\ \dot{\zeta}\end{bmatrix},$ (1)

where $F_{\bullet}$, $D_{\bullet}$, and $\tau_{\bullet}$ are the thrust
forces, drag, and torque in the indicated directions, respectively. Here the
subscript $\bullet$ indicates the collection of all relevant subscripts. The
mass and moment of inertia are given by $m$ and $I$. Since $v_{||}$ and
$v_{\bot}$ are defined in a moving reference frame, their derivatives must
account for the derivative of the body coordinate frame, hence the
$v_{\bullet}\dot{\phi}$ terms. For computational simplicity drag is treated as
a linear function of airspeed111This simplification does not effect the local
observability, since $C_{\bullet}$ may be a function of $\boldsymbol{x}$
following the justification given for $k_{s\bullet}$ in Sec. II-A.,

$\small
D_{\bullet}=\begin{cases}Drag_{||}=C_{||}a_{||}=C_{||}\cdot\big{(}v_{||}-w\cos(\phi-\zeta)\big{)},\\\
Drag_{\bot}=C_{\bot}a_{\bot}=C_{\bot}\cdot\big{(}v_{\bot}+w\sin(\phi-\zeta)\big{)},\\\
Drag_{\phi}=C_{\phi}\dot{\phi},\end{cases}$ (2)

where $C_{\bullet}$ represents a combined drag coefficient for the indicated
direction.

###  II-A Sensor measurements

The primary set of sensor measurements considered here are: a visual or
polarization derived orientation with respect to world coordinates $(\phi)$
the angle of the airspeed (the negative of apparent flow) with respect to the
body $(\gamma)$, and the angular course direction with respect to the body
(i.e. drift) $(\psi)$. These angles can be defined relative to the vector
components,

$\begin{split}\boldsymbol{h}(\boldsymbol{x})=\begin{bmatrix}\phi\\\
\tan(\gamma)\\\ \tan(\psi)\\\ \end{bmatrix}&=\begin{bmatrix}\phi\\\
a_{\bot}/a_{||}\\\ v_{\bot}/v_{||}\end{bmatrix},\end{split}$ (3)

where the airspeed components are:

$\begin{split}a_{||}&=v_{||}-w\cos(\phi-\zeta),\\\
a_{\bot}&=v_{\bot}+w\sin(\phi-\zeta).\end{split}$ (4)

Scenarios where instead of $\phi$ or $\psi$, only their derivatives are known,
will also be considered. To model uncalibrated sensors we can introduce
several unknown parameters $k_{s\bullet}$ that are assumed to remain constant
in time for the duration over which the calibrations are performed,

$\begin{split}\boldsymbol{h}(\boldsymbol{x})=\begin{bmatrix}&k_{s1}\cdot(\phi)\\\
&k_{s2}\cdot(a_{\bot}/a_{||})+k_{s3}\\\
&k_{s4}\cdot(v_{\bot}/v_{||})+k_{s5}\end{bmatrix}.\end{split}$ (5)

The parameters $k_{s1}$, $k_{s2}$, and $k_{s4}$ represent unknown sensor
gains, and $k_{s3}$ and $k_{s5}$ represent unknown sensor offsets. Although
this description implies that the sensors are linear with respect to these
calibration constants, this is not necessarily the case. Since the
observability calculations are done around some operating point
$\boldsymbol{x}_{0}$, if the system is observable, a calibration could be
repeated at multiple operating points to determine the parameters as functions
of the state. For a fly, a state-dependent calibration parameter could, for
example, represent an asymmetric sensor, such as one that has a higher gain on
the left side of the body compared to the right. With respect to the
observability analysis, it is safe to ignore the fact that the parameters
might actually be functions of the state (though solving for them will be more
challenging).

To determine the nonlinear observability of the system, it is convenient to
split the dynamics into the passive dynamics $(\boldsymbol{f_{0}})$, and the
active components
$(\boldsymbol{f_{||}},\boldsymbol{f_{\bot}},\boldsymbol{f_{\phi}})$,

$\boldsymbol{\dot{x}}=\boldsymbol{f_{0}}+u_{||}\boldsymbol{f_{||}}+u_{\bot}\boldsymbol{f_{\bot}}+u_{\phi}\boldsymbol{f_{\phi}},$
(6)

where $u_{\bullet}$ are the control inputs. Relating this notation to the full
equations of motion (Eqn. 1) yields:

$\scriptsize\boldsymbol{\dot{x}}\\!=\\!\\!\\!\\!\\\
\stackrel{{\scriptstyle\mbox{$\boldsymbol{f_{0}}$}}}{{\begin{bmatrix}\shortminus
D_{||}/m+v_{\bot}\dot{\phi}\\\ \shortminus D_{\bot}/m-v_{||}\dot{\phi}\\\
\dot{\phi}\\\ \shortminus D_{\phi}/I\\\ \dot{w}\\\ \dot{\zeta}\end{bmatrix}}}\
\\!\\!\\!\\!+u_{||}\\!\\!\\!\\\
\stackrel{{\scriptstyle\mbox{$\boldsymbol{f_{||}}$}}}{{\begin{bmatrix}k_{m1}/m\\\
0\\\ 0\\\ k_{m2}/I\\\ 0\\\ 0\\\ \end{bmatrix}}}\
\\!\\!\\!\\!+u_{\bot}\\!\\!\\!\\\
\stackrel{{\scriptstyle\mbox{$\boldsymbol{f_{\bot}}$}}}{{\begin{bmatrix}0\\\
k_{m3}/m\\\ 0\\\ 0\\\ 0\\\ 0\\\ \end{bmatrix}}}\
\\!\\!\\!\\!+u_{\phi}\\!\\!\\!\\\
\stackrel{{\scriptstyle\mbox{$\boldsymbol{f_{\phi}}$}}}{{\begin{bmatrix}0\\\
0\\\ 0\\\ k_{m4}/I\\\ 0\\\ 0\\\ \end{bmatrix},}}\ $ (7)

where $k_{m\bullet}$ are parameters that describe how the control input
$u_{\bullet}$ is transformed into an output force or torque (e.g. a model of
the fly’s muscle dynamics). Thus, $F_{||}=u_{||}k_{m1}$. The addition of
$k_{m2}/I$ in $\boldsymbol{f_{||}}$ models the possibility that one of the
fly’s wings might be damaged and a forward thrust command may induce an
unexpected torque as well. As with the sensor calibration parameters, the
$k_{m\bullet}$ parameters are assumed to be constant in time over the duration
of the calibration, and although they may be functions of the state, it is
unnecessary to consider this for the observability analysis.

##  III Nonlinear Observability Analysis (a review)

This section provides a brief applied overview of nonlinear observability, for
a rigorous treatment see [32]. A nonlinear system is said to be globally
observable when there is a one-to-one mapping from the time varying
measurements $\boldsymbol{h}(\boldsymbol{x},\boldsymbol{u},t)$ and associated
control inputs $\boldsymbol{u}$ to the state $\boldsymbol{x}$. More formally,
if
$\boldsymbol{h}(\boldsymbol{x}_{1},\boldsymbol{u},t)=\boldsymbol{h}(\boldsymbol{x}_{2},\boldsymbol{u},t)$
for all $\boldsymbol{u}$ and $t$ implies that
$\boldsymbol{x}_{1}=\boldsymbol{x}_{2}$, then the system is observable [33].
For nonlinear systems this is difficult to prove in a global sense. Instead,
it is possible to prove local observability in the neighborhood of a
particular state $\boldsymbol{\tilde{x}}_{0}$ by comparing the number of
unique equations given by the collection of the sensor measurements and their
time derivatives ($\boldsymbol{\mathcal{O}}$) to the number of unknowns
($\boldsymbol{\tilde{x}}$: the state $\boldsymbol{x}$ plus any parameters). An
efficient approach for checking this condition is to determine if the Jacobian
of $\boldsymbol{\mathcal{O}}$ with respect to $\boldsymbol{\tilde{x}}$ is full
rank at $\boldsymbol{\tilde{x}}_{0}$.

To begin, we calculate how the set of the sensor measurements,
$\boldsymbol{h}(\boldsymbol{x})$, changes with time, with and without active
control. The derivative of $\boldsymbol{h}(\boldsymbol{x})$ with respect to
time is given by,

$\frac{\partial}{\partial
t}\boldsymbol{h}(\boldsymbol{x})=\frac{\partial\boldsymbol{h}}{\partial\boldsymbol{x}}\cdot\frac{\partial\boldsymbol{x}}{\partial
t}=\frac{\partial\boldsymbol{h}}{\partial\boldsymbol{x}}\cdot\dot{\boldsymbol{x}}.$
(8)

If $\boldsymbol{h}$ consists of 3 sensor measurements, then for the 6-state
system $\frac{\partial\boldsymbol{h}}{\partial\boldsymbol{x}}$ will be a 3x6
matrix, and
$\frac{\partial\boldsymbol{h}}{\partial\boldsymbol{x}}\cdot\dot{\boldsymbol{x}}$
will be a 3x1 matrix. Substituting Eqn. 6 for $\boldsymbol{\dot{x}}$ in Eqn. 8
yields:

$\frac{\partial}{\partial
t}\boldsymbol{h}(\boldsymbol{x})=\frac{\partial\boldsymbol{h}}{\partial\boldsymbol{x}}\cdot\big{(}\boldsymbol{f_{0}}+u_{||}\boldsymbol{f_{||}}+u_{\bot}\boldsymbol{f_{\bot}}+u_{\phi}\boldsymbol{f_{\phi}}\big{)}.$
(9)

If all of the control inputs are set to zero, then this is simply the
directional derivative of the sensor measurements with respect to the passive
dynamics. This is equivalent to calculating the Lie derivative with respect to
the passive dynamics, which provides compact notation:

$\frac{\partial}{\partial
t}\boldsymbol{h}(\boldsymbol{x})\bigg{\rvert}_{u_{||}=u_{\bot}=u_{\phi}=0}=\frac{\partial\boldsymbol{h}}{\partial\boldsymbol{x}}\cdot\boldsymbol{f_{0}}=L_{\boldsymbol{f_{0}}}\boldsymbol{h},$
(10)

where $L_{\boldsymbol{f_{0}}}\boldsymbol{h}$ is the Lie derivative of
$\boldsymbol{h}$ in the $\boldsymbol{f_{0}}$ direction. If one of the control
inputs is not zero, then it is possible that new information can be gathered
by quantifying how $\boldsymbol{h}$ changes during the controlled maneuver.
For example, if $u_{||}$ is non-zero and other controls are held at zero,

$\begin{split}\frac{\partial}{\partial
t}\boldsymbol{h}(\boldsymbol{x})\bigg{\rvert}_{u_{||}\neq
0;\>u_{\bot}=u_{\phi}=0}&=\frac{\partial\boldsymbol{h}}{\partial\boldsymbol{x}}\cdot\bigg{(}\boldsymbol{f_{0}}+u_{||}\boldsymbol{f_{||}}\bigg{)}\\\
&=\frac{\partial\boldsymbol{h}}{\partial\boldsymbol{x}}\cdot\boldsymbol{f_{0}}+u_{||}\frac{\partial\boldsymbol{h}}{\partial\boldsymbol{x}}\cdot\boldsymbol{f_{||}}\\\
&=L_{\boldsymbol{f_{0}}}\boldsymbol{h}+u_{||}L_{\boldsymbol{f_{||}}}\boldsymbol{h}.\end{split}$
(11)

Since the present goal is only to determine the observability, the
calculations are simplified by setting $u_{||}=1$. If this process is repeated
for all three control directions, then collecting all of the resulting terms
from a first order time derivative of $\boldsymbol{h}(\boldsymbol{x})$ yields
the following collection, which is referred to as the observability Lie
algebra,

$\begin{split}\boldsymbol{\mathcal{O}}^{1}=\\{&\boldsymbol{h},L_{\boldsymbol{f_{0}}}\boldsymbol{h},L_{\boldsymbol{f_{0}}}\boldsymbol{h}+L_{\boldsymbol{f_{||}}}\boldsymbol{h},\\\
&L_{\boldsymbol{f_{0}}}\boldsymbol{h}+L_{\boldsymbol{f_{\bot}}}\boldsymbol{h},L_{\boldsymbol{f_{0}}}\boldsymbol{h}+L_{\boldsymbol{f_{\phi}}}\boldsymbol{h}\\}.\end{split}$
(12)

The superscript $1$ denotes the first order algebra, which includes only first
order derivatives of the original sensor measurements. If $\boldsymbol{h}$
contains 3 original sensor measurements, then the
$\boldsymbol{\mathcal{O}}^{1}$ described above will be a list of 15 terms. To
assess the observability, we calculate the Jacobian of
$\boldsymbol{\mathcal{O}}$ with respect to all of the independent variables.
Note that the set of independent variables is, at a minimum, equivalent to
$\boldsymbol{x}$, however, it may contain unknown parameters, as well as
uncontrolled dynamics of the wind. This expanded set of independent variables
will be referred to as $\boldsymbol{\tilde{x}}$. If the resulting Jacobian
evaluated at some set of values
$\boldsymbol{\tilde{x}}=\boldsymbol{\tilde{x}_{0}}$ is full rank, then the
system is locally observable in the neighborhood of that particular
$\boldsymbol{\tilde{x}_{0}}$. This calculation can be repeated for different
values of $\boldsymbol{\tilde{x}_{0}}$ to determine states for which the
system is not locally observable.

In some cases, the full system may not be observable, whereas the key state(s)
of interest could be. To assess the local observability of an individual state
($x_{i}$) we can compare the rank of the Jacobian of
$\boldsymbol{\mathcal{O}}$ with the rank of the Jacobian of
$\boldsymbol{\mathcal{O}}$ augmented with $x_{i}$. If the rank is unchanged
after the augmentation, that indicates that $x_{i}$ was already contained
within the original algebra $\boldsymbol{\mathcal{O}}$. Mathematically, if
$\text{Rank}\big{(}\text{Jac}(\boldsymbol{\mathcal{O}})\big{\rvert}_{\boldsymbol{\tilde{x}_{0}}}\big{)}=\text{Rank}\big{(}\text{Jac}(\\{\boldsymbol{\mathcal{O}};x_{i}\\})\big{\rvert}_{\boldsymbol{\tilde{x}_{0}}}\big{)}$,
then $x_{i}$ is locally observable at the operating point of
$\boldsymbol{\tilde{x}_{0}}$.

To simplify the observability calculations, $\boldsymbol{\mathcal{O}}^{1}$ can
be written as
$\\{\boldsymbol{h},L_{\boldsymbol{f_{0}}}\boldsymbol{h},L_{\boldsymbol{f_{||}}}\boldsymbol{h},L_{\boldsymbol{f_{\bot}}}\boldsymbol{h},L_{\boldsymbol{f_{\phi}}}\boldsymbol{h}\\}$.
This simplification corresponds to the fly comparing the derivative of its
sensor measurements with and without the active control.

In some cases, even further information can be gained by calculating the
second order observability Lie algebra. In principle,
$\boldsymbol{\mathcal{O}}^{2}$ contains all of the possible combinations of
cross-terms between different control actuations,
$\boldsymbol{\mathcal{O}}^{2}=\\{\boldsymbol{h},\boldsymbol{\mathcal{O}}^{1},L_{\boldsymbol{f_{0}}}\boldsymbol{\mathcal{O}}^{1},L_{\boldsymbol{f_{||}}}\boldsymbol{\mathcal{O}}^{1},L_{\boldsymbol{f_{\bot}}}\boldsymbol{\mathcal{O}}^{1},L_{\boldsymbol{f_{\phi}}}\boldsymbol{\mathcal{O}}^{1}\\}$.
For the scenarios considered here, it can be shown that including cross-terms
other than
$\boldsymbol{\mathcal{O}}^{2}=\\{\boldsymbol{h},\boldsymbol{\mathcal{O}}^{1},L_{\boldsymbol{f_{0}}}\boldsymbol{\mathcal{O}}^{1}\\}$
always introduces redundant complexity.

To efficiently explore different combinations of sensor measurements and
control actuations, the aforementioned calculations were implemented using
symbolic algebra in SymPy [34], and the Jacobians evaluated at values of
$\boldsymbol{\tilde{x}_{0}}$ where each variable was assigned a unique (non-
zero) prime number, unless otherwise noted.

##  IV Analysis

###  IV-A Estimating wind direction using vision & airspeed

In the following three subsections we will walk through increasingly
challenging scenarios to build intuition about which sensor measurements and
active controls are necessary in which circumstances. At the end of each
subsection a summary table is provided. Starting with the case of constant
wind and no drag, a detailed example of the observability analysis is given.
For the subsequent scenarios the details are omitted; but are provided in an
open source supplement here: https://github.com/florisvb/windobs.

####  IV-A1 Calibrated sensorimotor systems in 2D

#### Constant wind, no drag

In this first scenario, consider a completely calibrated sensorimotor system
in constant wind, in the absence of air drag. Thus, the only forces and
torques on the fly are those that it controls with its muscles. For this
scenario, the only values that must be determined are the state itself, thus
$\tilde{\boldsymbol{x}}=[v_{||},v_{\bot},\phi,\dot{\phi},w,\zeta]^{T}$.

To simplify the mathematical expressions for readability, we can substitute
the value of “$1$” for each parameter, except $k_{m2}=0$ for simplicity, into
Eqn. 7. With only the sensory measurement functions given by Eqn. 3 it is
clear that the system is not fully observable, as there are only 3 unique
terms in $\boldsymbol{h}$, whereas $\boldsymbol{\tilde{x}}$ contains 6.
Including the first order time derivative of $\boldsymbol{h}$ such that
$\boldsymbol{\mathcal{O}}^{1}=\\{\boldsymbol{h},L_{\boldsymbol{f_{0}}}\boldsymbol{h}\\}$
adds three additional terms to the observability Lie algebra resulting in:

$\begin{split}&\boldsymbol{\mathcal{O}}^{1}=\bigg{\\{}\phi,\;\;\frac{v_{\bot}+w\sin{\left(\phi-\zeta\right)}}{v_{||}-w\cos{\left(\phi-\zeta\right)}},\;\;\frac{v_{\bot}}{v_{||}},\;\;\dot{\phi},\;\;-\dot{\phi}-\frac{v_{\bot}^{2}\dot{\phi}}{v_{||}^{2}},\\\
&\frac{-\dot{\phi}\left(v_{||}^{2}-2v_{||}w\cos{\left(\phi-\zeta\right)}+v_{\bot}^{2}+2v_{\bot}w\sin{\left(\phi-\zeta\right)}+w^{2}\right)}{\left(v_{||}-w\cos{\left(\phi-\zeta\right)}\right)^{2}}\bigg{\\}}.\end{split}$
(13)

Since the observability of the system is determined at one particular value of
$\boldsymbol{\tilde{x}}$ at a time, one of the new terms, $\dot{\phi}$, does
provide new information. In other words, the inclusion of the
$L_{\boldsymbol{f_{0}}}\boldsymbol{h}$ term accounts for the fact that if
$\phi$ is known at multiple time points, then $\dot{\phi}$ can also be
determined. The last two terms, however, are simply combinations of the first
4. Only by including some element of active control in the form of thrust
parallel or perpendicular to the body is enough new information gained such
that $\zeta$ becomes observable. For example, if the fly applies thrust
parallel to its body $\big{(}u_{||}\neq 0\big{)}$ then the complete set of
observations,
$\boldsymbol{\mathcal{O}}^{1}=\\{\boldsymbol{h},L_{\boldsymbol{f_{0}}}\boldsymbol{h},L_{\boldsymbol{f_{||}}}\boldsymbol{h}\\}$,
adds the following terms to Eqn. 13:

$\bigg{\\{}0,\;\;-\frac{v_{\bot}+w\sin{\left(\phi-\zeta\right)}}{\left(v_{||}-w\cos{\left(\phi-\zeta\right)}\right)^{2}},\;\;-\frac{v_{\bot}}{v_{||}^{2}}\bigg{\\}}.$
(14)

With the addition of these terms, the rank of the Jacobian of
$\boldsymbol{\mathcal{O}}^{1}$ is now 6 (for most values of
$\boldsymbol{\tilde{x}}$), making the system fully observable (most of the
time). The unique terms for {Eqn. 13; Eqn. 14} are $\\{1,2,3,4,8,9\\}$. The
system is also observable if $L_{\boldsymbol{f_{\bot}}}\boldsymbol{h}$ is
included instead of $L_{\boldsymbol{f_{||}}}\boldsymbol{h}$, although the last
three terms in $\boldsymbol{\mathcal{O}}^{1}$ will change.

There are still certain conditions (states) for which $\zeta$ remains
unobservable. For example, if the magnitude of the airspeed is zero (the fly
is advected by the wind and therefore the airspeed angle is undefined) or the
magnitude of the ground speed is zero (the fly is hovering and therefore the
drift angle is undefined), then $\zeta$ remains unobservable. The latter case
is resolved by incorporating inertial measurements (Sec. IV-B).

Furthermore, the flies course direction (i.e. $\phi+\psi$, where
$\psi=\tan^{-1}\big{(}v_{\bot}/v_{||}\big{)}$) must either change, or be
controlled so as to actively counteract changes that would otherwise occur
(due to changes in wind speed or direction, for example). In other words, to
maintain observability, the fly cannot simply accelerate in a straight line,
which would correspond to $u_{||}\neq 0$, $v_{\bot}=0$, and $\dot{\phi}=0$.
This requirement can be satisfied in a number of ways. (1) If $\dot{\phi}\neq
0$, there will be a change in course due to the body rotation and the non-zero
ground speed. (2) If $\dot{\phi}=0$, but $u_{||}\neq 0$ and $v_{\bot}\neq 0$,
then $v_{\bot}/v_{||}$ will change. (3) Similarly, if $\dot{\phi}=0$, but
$u_{\bot}\neq 0$ and $v_{||}\neq 0$, the system is observable if
$v_{||}/v_{\bot}$ is included as a measurement instead of $v_{\bot}/v_{||}$.

TABLE IV-A.1: Estimating wind direction $\zeta$ given 3 calibrated angular sensor measurements, and a calibrated motor system, requires applying thrust in either the forward or lateral direction, accompanied by a change in course (or orientation) and non-zero airspeed and ground speed. In dynamic wind, a $2^{nd}$ derivative must be computed. To estimate wind direction in the body-frame only ($\phi-\zeta$), the measurement $\phi$ may be replaced with $\dot{\phi}$. | Description | Math Expr.
---|---|---
Dynamics | 2D, no drag | Eqn. 7, $D_{\bullet}=0$
| Calibrated
---
parameters
| body,
---
motor,
& sensor
|  $m$, $I$
---
$k_{m\bullet}$,
$k_{s\bullet}$
| Uncalibrated
---
parameters
None | None
Sensors $\boldsymbol{h}(\boldsymbol{x})$ |  | orientation,
---
visual angle,
airspeed angle
|  $\phi$,
---
$v_{\bot}/v_{||}$,
$a_{\bot}/a_{||}$
| Required
---
actuations
| forward thrust
---
\- - OR - -
lateral thrust
| $u_{||}\neq 0$
---
\- - OR - -
$u_{\bot}\neq 0$
| Required
---
state
| non-zero ground speed,
---
& non-zero airspeed,
& change in course/orientation
|  $v^{2}_{||}+v^{2}_{\bot}\neq 0$,
---
& $a^{2}_{||}+a^{2}_{\bot}\neq 0$,
& ($\dot{\psi}\neq 0$ or $\dot{\phi}\neq 0$)

#### Dynamic wind, no drag

Now we will relax the earlier assumption of constant wind to see how the
requirements for observability change when the wind is allowed to vary as a
function of time. It is now necessary to also estimate $\dot{w}$ and
$\dot{\zeta}$, thus
$\tilde{\boldsymbol{x}}=[v_{||},v_{\bot},\phi,\dot{\phi},w,\zeta,\dot{w},\dot{\zeta}]^{T}$.
As a first step, we check whether the conditions for observing $\zeta$ with
constant wind are sufficient, i.e. is the system observable given
$\boldsymbol{\mathcal{O}}^{1}=\\{\boldsymbol{h},L_{\boldsymbol{f_{0}}}\boldsymbol{h},L_{\boldsymbol{f_{||}}}\boldsymbol{h}\\}$.
In this case, $\text{Rank}(\text{Jac}(\boldsymbol{\mathcal{O}}^{1}))=7$,
whereas $\boldsymbol{\tilde{x}}$ contains 8 terms. By augmenting
$\boldsymbol{\mathcal{O}}^{1}$ with individual states and comparing the Rank
of the Jacobian of these augmented algebras with the original it can be shown
that $v_{||},v_{\bot},\zeta$ and $w$ are observable, whereas $\dot{w}$ and
$\dot{\zeta}$ are not. However, by including second order terms, the system
can be shown to be fully (locally) observable.

#### Dynamic wind, with drag

A real fly experiences aerodynamic drag forces on its body that will oppose
its airspeed, introducing passive deceleration. With the addition of drag,
estimating $\zeta$ does not require any thrust, contrary to the previous
scenario. Instead, only a single derivative of the measurements is required,
or a $2^{nd}$ derivative if the wind is dynamic and $\dot{\zeta}$ estimates
are desired. This is because the drag forces will introduce the necessary
changes in $v_{||}$ and $v_{\bot}$ for the system to become observable. In
practice, it is likely more efficient to apply active controls rather than
rely on the drag.

#### Eliminating the global reference

The global angular reference $\phi$ is necessary for $\zeta$ to be observable
in global coordinates. Although many insects have access to some measure of
$\phi$ through polarization sensors, they also have access to angular velocity
measurements ($\dot{\phi}$) through either the halteres [35, 36], antennae
[37], or wings [38] without needing to differentiate their measurement of
$\phi$. By including $\dot{\phi}$ in $\boldsymbol{h}$ instead of $\phi$, the
wind direction in body-coordinates ($\phi-\zeta$) remains observable.

####  IV-A2 Uncalibrated sensorimotor systems in 2D

Thus far we have assumed that the fly somehow has knowledge of the parameters
related to its body ($m,I,C_{\bullet}$) and motor systems ($k_{m\bullet}$). It
is, however, likely that flies must calibrate their body and muscle parameters
at least once, if not continuously. Likewise, we have thus far assumed that
the parameters of the sensory system ($k_{s\bullet}$) are perfectly
calibrated. For example, we have assumed that when the fly’s body is aligned
with its airspeed ($\gamma=0;a_{\bot}/a_{||}=0$), then its measurement of
$\gamma$ is indeed equal to zero. This might not be the case due to damage or
developmental asymmetries. The same arguments can be made for the visually
determined measure of $\psi$. In this section we will build on the previous
analysis to determine (1) which sensory measurements and active maneuvers are
necessary to estimate $\zeta$ given a completely uncalibrated sensorimotor
system, and (2) what is necessary to calibrate all of the unknown parameters.

#### Estimating $\zeta$ with an uncalibrated sensorimotor system

Analyzing the dynamics described by Eqn. 7 and the uncalibrated measurements
given by Eqn. 5, it is unsurprising that the previously successful
approach–$\boldsymbol{\mathcal{O}}^{2}=\\{\boldsymbol{h},L_{\boldsymbol{f_{0}}}\boldsymbol{h},L_{\boldsymbol{f_{||}}}\boldsymbol{h},L_{\boldsymbol{f_{0}}}L_{\boldsymbol{f_{||}}}\boldsymbol{h}\\}$–is
now insufficient ($\text{Rank}(\text{Jac}(\boldsymbol{\mathcal{O}}^{2}))=13$;
$\text{Rank}(\text{Jac}(\boldsymbol{\mathcal{O}}^{2};\zeta))=14$). However, by
applying thrust in both the perpendicular and parallel directions, $\zeta$
does become observable with

$\begin{split}\boldsymbol{\mathcal{O}}^{2}=\\{&\boldsymbol{h},L_{\boldsymbol{f_{0}}}\boldsymbol{h},L_{\boldsymbol{f_{||}}}\boldsymbol{h},L_{\boldsymbol{f_{\bot}}}\boldsymbol{h},\\\
&L_{\boldsymbol{f_{0}}}L_{\boldsymbol{f_{||}}}\boldsymbol{h},L_{\boldsymbol{f_{0}}}L_{\boldsymbol{f_{\bot}}}\boldsymbol{h}\\},\end{split}$
(15)

yielding $\text{Rank}(\text{Jac}(\boldsymbol{\mathcal{O}}^{2}))=17$ and
$\text{Rank}(\text{Jac}(\boldsymbol{\mathcal{O}}^{2};\zeta))=17$. Contrary to
the prior cases, in constant wind a second derivative is still necessary to
determine $\zeta$. There are, however, a total of 19 terms in
$\boldsymbol{\tilde{x}}=[v_{||},v_{\bot},\phi,\dot{\phi},w,\zeta,\dot{w},\dot{\zeta},C_{\bullet},k_{s\bullet},m,k_{m1},k_{m3}]^{T},$
indicating that while $\zeta$ can be observed, several other terms cannot. The
unobservable terms include $\\{w,v_{\bullet},C_{\phi},k_{m1},k_{m3}\\}$. Also
notable is that the body parameters that determine rotational control
($I,k_{m2,4}$) are not found in $\boldsymbol{\mathcal{O}}^{2}$, and are
therefore omitted from $\boldsymbol{\tilde{x}}$ and unobservable. Both points
are addressed in Sec. IV-A.

As in the calibrated case, $\zeta$ is not observable for all values of
$\boldsymbol{\tilde{x}}$: both airspeed and ground speed must be non-zero,
otherwise the angles are undefined. Of particular interest is that
$\dot{\phi}$ must be non-zero, and the alternative methods for changing course
that worked in the calibrated case are insufficient. Finally, for calibration
constants to be observable in either constant or dynamic wind scenarios, the
second order terms of $\boldsymbol{\mathcal{O}}^{2}$ are needed.

#### Calibrating the entire sensorimotor system

To calibrate all of the parameters that appear in Eqn. 7 and Eqn. 5 requires
that they all appear in the observability Lie algebra. The simplest solution
is to include $\dot{\phi}$ in $\boldsymbol{h}$ and apply torque. By adding a
new uncalibrated sensor, $k_{s6}\dot{\phi}+k_{s7}$, to $\boldsymbol{h}$ given
in Eqn. 5, the complete list of terms now includes
$\boldsymbol{\tilde{x}}=[v_{||},v_{\bot},\phi,\dot{\phi},w,\zeta,\dot{w},\dot{\zeta},C_{\bullet},k_{s1-7},k_{m1-4},m,I]^{T}$.
Furthermore, each of these terms appears in the second order algebra given by
$\boldsymbol{\mathcal{O}}^{2}=\\{\boldsymbol{h},L_{\boldsymbol{f_{0}}}\boldsymbol{h},L_{\boldsymbol{f_{||}}}\boldsymbol{h},L_{\boldsymbol{f_{0}}}L_{\boldsymbol{f_{||}}}\boldsymbol{h},L_{\boldsymbol{f_{\bot}}}\boldsymbol{h},\\\
L_{\boldsymbol{f_{0}}}L_{\boldsymbol{f_{\bot}}}\boldsymbol{h},L_{\boldsymbol{f_{\phi}}}\boldsymbol{h},L_{\boldsymbol{f_{0}}}L_{\boldsymbol{f_{\phi}}}\boldsymbol{h}\\}$.
Even after making this change, however, some of the body parameters still
cannot be determined: $\\{k_{m1},k_{m3},m,I\\}$. There are two reasons for
this. First, $m$ and $I$ always appear together with another body or motor
parameter. The solution is simple: $m$ and $I$ must be absorbed into the
definitions of the parameters that they appear with. After doing so, the only
body or motor parameters that cannot be determined are $k_{m1}$ and $k_{m3}$.

Parameters $k_{m1}$ and $k_{m3}$ and states $w$ and $v_{\bullet}$ cannot be
determined with an uncalibrated sensorimotor because they all relate to the
scaling of the observability problem. If $k_{m1}$ were known, then known motor
commands $u_{||}$ would translate into known accelerations with meaningful
units. To determine these body parameters and states, at least one properly
scaled sensory measurement (in meaningful units) is needed.

TABLE IV-A.2: Estimating $\zeta$ given 3 uncalibrated angular sensor measurements and body/motor parameters, requires applying thrust in both the forward and lateral directions, accompanied by a change in orientation and non-zero airspeed and ground speed. To determine wind direction in body-coordinates ($\phi-\zeta$), the measurement $k_{s1}\phi$ can be replaced with $k_{s1}\dot{\phi}+k_{s0}$. Contrary to the calibrated case, constant wind also requires $2^{nd}$ order terms. | Description | Math Expr.
---|---|---
Dynamics | 2D, including drag | Eqn. 7
| Calibrated
---
parameters
None | None
| Uncalibrated
---
parameters
| body,
---
motor,
& sensor
|  $m$, $I$, $C_{\bullet}$,
---
$k_{m\bullet}$,
$k_{s\bullet}$
Sensors $\boldsymbol{h}(\boldsymbol{x})$ |  | orientation,
---
airspeed angle,
visual angle
|  $k_{s1}\phi$,
---
$k_{s2}a_{\bot}/a_{||}+k_{s3}$,
$k_{s4}v_{\bot}/v_{||}+k_{s5}$
| Required
---
actuations
| forward thrust
---
\- - AND - -
lateral thrust
| $u_{||}\neq 0$
---
\- - AND - -
$u_{\bot}\neq 0$
| Required
---
state
| non-zero ground speed,
---
& non-zero airspeed,
& change in orientation
|  $v^{2}_{||}+v^{2}_{\bot}\neq 0$,
---
& $a^{2}_{||}+a^{2}_{\bot}\neq 0$,
& $\dot{\phi}\neq 0$

###  IV-B Estimating wind direction using acceleration & airspeed

Although most organisms use vision to help them orient relative to fluid flow,
some animals perform these behaviors in environments with poor visual
contrast, such as when flying at night, over low contrast terrain, or swimming
in murky waters. In this section we will find that an inertial sense of linear
acceleration in polar coordinates (measured using the same sensors as angular
velocities [39]) can serve in lieu of a visually determined angle of motion.
For these calculations we simply substitute
$k_{s4}\frac{\dot{v}_{\bot}}{\dot{v}_{||}}+k_{s5}$ for
$k_{s4}\frac{v_{\bot}}{v_{||}}+k_{s5}$ from Eqn. 5 and recalculate
$\boldsymbol{\mathcal{O}}^{2}$. It is, however, necessary to substitute in the
expressions for $\dot{v}_{\bullet}$ such that these new sensor measurements
are described entirely by the state of the system,

$\small\begin{split}\dot{v}_{||}&=v_{\bot}\dot{\phi}-C_{||}/m\big{(}v_{||}-w\cos(\phi-\zeta)\big{)}+u_{||}k_{m1}/m,\\\
\dot{v}_{\bot}&=-v_{||}\dot{\phi}-C_{\bot}/m\big{(}v_{\bot}+w\sin(\phi-\zeta)\big{)}+u_{\bot}k_{m3}/m.\end{split}$
(16)

Two of the control inputs, $u_{||}$ and $u_{\bot}$, appear in these
expressions, and since they are known by default (they can be thought of as
efferent copies), they can (and must) be included as measurements, resulting
in:

$\begin{split}\boldsymbol{h}(\boldsymbol{x})=\big{[}&k_{s1}\phi,\;k_{s2}\cdot\big{(}a_{\bot}/a_{||}\big{)}+k_{s3},\\\
&k_{s4}\cdot\big{(}\dot{v}_{\bot}/\dot{v}_{||}\big{)}+k_{s5},\;u_{||},\;u_{\bot}\big{]}^{T}.\end{split}$
(17)

The previous approach, which worked with an uncalibrated visual angle, does
not work here
$\big{(}\text{Rank}(\text{Jac}(\boldsymbol{\mathcal{O}}^{2}))=19$ and
$\text{Rank}(\text{Jac}(\boldsymbol{\mathcal{O}}^{2};\zeta))=20$, where
$\boldsymbol{\mathcal{O}}^{2}$ is given by Eqn. 15$\big{)}$. The key term that
prevents the system from being observable is $k_{s5}$. If $k_{s5}$ is known,
then $\zeta$ is observable; without $k_{s5}$, wind direction in the body-frame
($\phi-\zeta$) is still observable if $k_{s1}\phi$ is replaced by
$k_{s1}\dot{\phi}+k_{s0}$ (or
$L_{\boldsymbol{f_{||}}}L_{\boldsymbol{f_{0}}}\boldsymbol{h}$ and
$L_{\boldsymbol{f_{\bot}}}L_{\boldsymbol{f_{0}}}\boldsymbol{h}$ are included
in $\boldsymbol{\mathcal{O}}^{2}$). If the calibration terms are temporally
stable over significant periods of time it would also be possible to use the
visual system to calibrate $k_{s5}$ when both modalities are available.

Once again, there are certain states for which $\zeta$ cannot be determined.
The airspeed must still be non-zero and the fly must still rotate its body,
however, the ground speed may now be zero, although either $\dot{v}_{||}$ or
$\dot{v}_{\bot}$ must be non-zero. This approach would allow a hovering fly to
estimate $\zeta$ by rotating and continuously adjusting $\dot{v}_{||,\bot}$ to
remain in place.

Figure 2: Example trajectories in constant wind categorized according to the potential for observing wind direction ($\zeta$) for the wind-vision case with or without sensorimotor calibrations (Eqns. 3 & 5, respectively). Calibratable: the uncalibrated system is observable. Color (light to dark) encodes increasing time, $\zeta=\pi/2$, and arrows indicate body orientation. (A) With no change in direction or orientation, $\zeta$ is unobservable, even if $u_{||}\neq 0$ & $u_{\bot}\neq 0$. (B) Changes in direction makes $\zeta$ observable, but without changes in orientation, sensorimotor parameters cannot be calibrated. (C) Incorporating changes in orientation with a turn, in principle, allows for calibration. However, the requirement for $2^{nd}$ order derivatives makes calibration with a single rapid turn challenging. (D-E) Two or more turns, or continuous changes in orientation and direction, are ideal. (F) By changing orientation and controlling $u_{||,\bot}$ for a constant course, calibration is also possible. In dynamic wind, one solution is for trajectory changes to occur at a sufficiently fast rate (see Fig. 3). TABLE IV-B.1: Estimating the wind direction $\zeta$ with the direction of acceleration instead of velocity, and uncalibrated sensors, requires applying thrust in both the forward and lateral directions, accompanied by a change in orientation, non-zero airspeed, and non-zero acceleration. One sensory parameter, $k_{s5}$, cannot be self-calibrated in this case unless $k_{s6}v_{\bot}/v_{||}+k_{s7}$ is also included, or $\zeta$ is only estimated in body-coordinates by replacing $k_{s1}\phi$ with $k_{s1}\dot{\phi}+k_{s0}$ (or including additional terms in $\boldsymbol{\mathcal{O}}^{2}$). | Description | Math Expr.
---|---|---
Dynamics | 2D, including drag | Eqn. 7
| Calibrated
---
parameters
None | $k_{s5}$
| Uncalibrated
---
parameters
| body,
---
motor,
& sensor
|  $m$, $I$, $C_{\bullet}$,
---
$k_{m\bullet}$,
$k_{s1-4}$
Sensors $\boldsymbol{h}(\boldsymbol{x})$ |  | orientation,
---
airspeed angle,
inertial angle
|  $k_{s1}\phi$,
---
$k_{s2}a_{\bot}/a_{||}+k_{s3}$,
$k_{s4}\dot{v}_{\bot}/\dot{v}_{||}+k_{s5}$
| Required
---
actuations
| forward thrust
---
\- - AND - -
lateral thrust
| $u_{||}\neq 0$
---
\- - AND - -
$u_{\bot}\neq 0$
| Required
---
state
| non-zero acceleration,
---
& non-zero airspeed,
& change in orientation
|  $\dot{v}^{2}_{||}+\dot{v}^{2}_{\bot}\neq 0$,
---
& $a^{2}_{||}+a^{2}_{\bot}\neq 0$,
& $\dot{\phi}\neq 0$

##  V Discussion

The analysis presented here demonstrates the mathematical potential for flying
or swimming agents to determine the direction of ambient flow using
uncalibrated angular measurements of apparent flow, orientation, and direction
of motion (or its derivative). All three measurements are required. To
estimate flow direction in the body-frame, angular velocity may be substituted
for orientation. Solutions only exist, however, for trajectories that, broadly
speaking, incorporate some active change in direction and orientation along
with non-zero airspeed and ground speed (Fig. 2). The need for terms like
$L_{\boldsymbol{f_{||}}}\boldsymbol{h}$ in $\boldsymbol{\mathcal{O}}$
indicates the requirement for comparing sensor measurements across time (a
derivative) during these active maneuvers. Actually constructing a reliable
nonlinear observer to estimate $\zeta$ is, however, not trivial. For example,
applying a square-root Unscented Kalman Filter [40] to the measurements and
dynamics given by Eqns. 3, 7 for actively controlled trajectories like Fig. 2D
requires many turns before converging, even without sensor noise (Fig. 3),
even though wind direction should be observable after a single turn. The same
filter completely fails on more challenging scenarios. For example, in the
calibrated wind-inertial case there are frequent divide-by-zero issues when
$\dot{v}_{||}$ changes sign, whereas in the uncalibrated wind-vision case the
UKF has trouble likely because this scenario is not fully observable. A closer
look at insect sensory processing (e.g. [41]) and strategies for control may
offer insight for building a more reliable bespoke observer.

Figure 3: Applying a square-root Unscented Kalman Filter (UKF) to the
calibrated wind-vision case (Eqn. 3) for a trajectory similar to Fig. 2D, but
with either 34 or 100 turns, nearly converges on the correct value of $\zeta$
given sufficiently frequent turns, even when both $\zeta$ and $w$ (wind
magnitude) are changing in time according to unknown dynamics. Inset:
magnified trace showing timing of left/right/straight turns. No added sensor
noise, simulation time-step $=0.01$, UKF covariances: $R=10^{-7}I_{3}$,
$Q=10^{-10}I_{6}$.

Real-world flow estimation is not restricted to 2-dimensions. However, with
the approach presented here, it can be shown that the 3D case is also
observable, provided that two additional sensory inputs are available: the
angle for out-of-plane fluid flow, and an angle describing the ground plane
orientation. Insects likely solve the latter by maintaining a stable head
orientation with respect to the world using visual reflexes for gaze
stabilization [42], and altitude control [43]. The bilateral symmetry in the
neural circuitry flies use for estimating the planar direction of flow [44],
however, does not suggest mechanisms for measuring out-of-plane flow. Near the
ground, vertical wind magnitude is attenuated compared to planar wind, so
perhaps estimating vertical flow is less critical. Insects do, however,
exhibit vertical motion during plume tracking [17, 45], so further
investigation is warranted.

Although ambient wind estimation does not require estimating the absolute
scale factor, some behaviors such as estimating distance to a landing target
[8] or distance flown, would greatly benefit from an estimation of scale.
Perhaps flying insects rely on a visual scale factor determined while walking
[12], or controlled movements of the antennae to calibrate the scale of their
flow sensors [39, 46].

The requirement of frequent changes in direction for observability and
calibratability is consistent with the crosswind zigzagging trajectories
adopted by most chemical plume tracking organisms [1], suggesting a hypothesis
that casting may aid in flow direction estimation in addition to facilitating
plume encounters. Insect sized robots tasked with plume tracking might also
benefit from constrained trajectories similar to those exhibited by insects.
For larger machines carrying calibrated sensors, this analysis lays the
groundwork for developing visual-wind and wind-inertial state estimation,
which if combined with visual-inertial methods (i.e. [3]) would increase
robustness through redundancy.

## Acknowledgements

I am grateful for feedback on the manuscript from N. Brace, A. Rutkowski, R.
Tung, R. Murray, and K. Nagel.

## References

  * [1] K. L. Baker, M. Dickinson, T. M. Findley, D. H. Gire, M. Louis, M. P. Suver, J. V. Verhagen, K. I. Nagel, and M. C. Smear, “Algorithms for olfactory search across species,” The Journal of Neuroscience, vol. 38, pp. 9383–9389, Oct. 2018.
  * [2] H. Schöne, Spatial Orientation: The Spatial Control of Behavior in Animals and Man.  Princeton University Press, 2014.
  * [3] Wofk, Diana and Ma, Fangchang and Yang, Tien-Ju and Karaman, Sertac and Sze, Vivienne, “FastDepth: Fast Monocular Depth Estimation on Embedded Systems,” in IEEE International Conference on Robotics and Automation (ICRA), 2019.
  * [4] A. Beyeler, J.-C. Zufferey, and D. Floreano, “Vision-based control of near-obstacle flight,” Autonomous Robots, vol. 27, pp. 201–219, 2009.
  * [5] N. Franceschini, “Small brains, smart machines: From fly vision to robot vision and back again,” Proceedings of the IEEE, vol. 102, pp. 751–781, May 2014.
  * [6] M. Ohradzansky, H. E. Alvarez, J. Keshavan, B. N. Ranganathan, and J. S. Humbert, “Autonomous bio-inspired small-object detection and avoidance,” in 2018 IEEE International Conference on Robotics and Automation (ICRA), IEEE, May 2018.
  * [7] H. H. Yang and T. R. Clandinin, “Elementary motion detection in drosophila: Algorithms and mechanisms,” Annual Review of Vision Science, vol. 4, pp. 143–163, Sept. 2018.
  * [8] F. van Breugel, K. Morgansen, and M. H. Dickinson, “Monocular distance estimation from optic flow during active landing maneuvers,” Bioinspiration & Biomimetics, vol. 9, p. 025002, May 2014.
  * [9] D. C. O'Carroll, N. J. Bidweii, S. B. Laughlin, and E. J. Warrant, “Insect motion detectors matched to visual ecology,” Nature, vol. 382, pp. 63–66, July 1996.
  * [10] G. Maimon, A. D. Straw, and M. H. Dickinson, “Active flight increases the gain of visual motion processing in drosophila,” Nature Neuroscience, vol. 13, pp. 393–399, Feb. 2010.
  * [11] D. Dhingra, Y. M. Chukewad, and S. B. Fuller, “A device for rapid, automated trimming of insect-sized flying robots,” IEEE Robotics and Automation Letters, vol. 5, pp. 1373–1380, Apr. 2020.
  * [12] T. Krause, L. Spindler, B. Poeck, and R. Strauss, “Drosophila acquires a long-lasting body-size memory from visual feedback,” Current Biology, vol. 29, pp. 1833–1841.e3, June 2019.
  * [13] D. J. Foster and R. V. Cartar, “What causes wing wear in foraging bumble bees?,” Journal of Experimental Biology, vol. 214, pp. 1896–1901, May 2011\.
  * [14] B. Tatler, D. C. O'Carroll, and S. B. Laughlin, “Temperature and the temporal resolving power of fly photoreceptors,” Journal of Comparative Physiology A: Sensory, Neural, and Behavioral Physiology, vol. 186, pp. 399–407, Apr. 2000.
  * [15] A. S. French and J. E. Kuster, “The effects of temperature on mechanotransduction in the cockroach tactile spine,” Journal of Comparative Physiology A, vol. 147, no. 2, pp. 251–258, 1982.
  * [16] R. T. Cardé and M. A. Willis, “Navigational strategies used by insects to find distant, wind-borne sources of odor,” Journal of Chemical Ecology, vol. 34, pp. 854–866, June 2008.
  * [17] F. van Breugel and M. H. Dickinson, “Plume-tracking behavior of flying drosophila emerges from a set of distinct sensory-motor reflexes,” Current Biology, vol. 24, pp. 274–286, Feb. 2014.
  * [18] M. J. Anderson, J. G. Sullivan, T. K. Horiuchi, S. B. Fuller, and T. L. Daniel, “A bio-hybrid odor-guided autonomous palm-sized air vehicle,” Bioinspiration & Biomimetics, vol. 16, p. 026002, Mar. 2020.
  * [19] J. S. Kennedy, “The visual responses of flying mosquitoes.,” Proceedings of the Zoological Society of London, vol. A109, no. 4, pp. 221–242, 1940.
  * [20] F. van Breugel and M. H. Dickinson, “The visual control of landing and obstacle avoidance in the fruit fly drosophila melanogaster,” Journal of Experimental Biology, vol. 215, pp. 1783–1798, May 2012.
  * [21] J. A. Bender, “Visual stimulation of saccades in magnetically tethered drosophila,” Journal of Experimental Biology, vol. 209, pp. 3170–3182, Aug. 2006.
  * [22] J.-M. Mongeau and M. A. Frye, “Drosophila spatiotemporally integrates visual signals to control saccades,” Current Biology, vol. 27, pp. 2901–2914.e2, Oct. 2017.
  * [23] D. Zachariah and M. Jansson, “Self-motion and wind velocity estimation for small-scale UAVs,” in 2011 IEEE International Conference on Robotics and Automation, IEEE, 2011.
  * [24] A. J. Rutkowski, M. M. Miller, R. D. Quinn, and M. A. Willis, “Egomotion estimation with optic flow and air velocity sensors,” Biological Cybernetics, vol. 104, pp. 351–367, June 2011.
  * [25] Y. M. Giraldo et al., “Sun navigation requires compass neurons in drosophila,” Current Biology, vol. 28, pp. 2845–2852.e4, Sept. 2018.
  * [26] T. S. Okubo, P. Patella, I. D’Alessandro, and R. I. Wilson, “A neural network for wind-guided compass navigation,” Neuron, vol. 107, pp. 924–940.e18, Sept. 2020.
  * [27] P. T. Weir, B. Schnell, and M. H. Dickinson, “Central complex neurons exhibit behaviorally gated responses to visual motion in drosophila,” Journal of Neurophysiology, vol. 111, pp. 62–71, Jan. 2014.
  * [28] J. Green, A. Adachi, K. K. Shah, J. D. Hirokawa, P. S. Magani, and G. Maimon, “A neural circuit architecture for angular integration in drosophila,” Nature, vol. 546, pp. 101–106, May 2017.
  * [29] C. Lyu, L. Abbott, and G. Maimon, “A neuronal circuit for vector computation builds an allocentric traveling-direction signal in the drosophila fan-shaped body,” bioRxiv, 2020.
  * [30] J. D. Seelig and V. Jayaraman, “Neural dynamics for landmark orientation and angular path integration,” Nature, vol. 521, pp. 186–191, May 2015.
  * [31] H. H. Thoen, J. Marshall, G. H. Wolff, and N. J. Strausfeld, “Insect-like organization of the stomatopod central complex: Functional and phylogenetic implications,” Frontiers in Behavioral Neuroscience, vol. 11, Feb. 2017\.
  * [32] R. Hermann and A. Krener, “Nonlinear controllability and observability,” IEEE Transactions on Automatic Control, vol. 22, pp. 728–740, Oct. 1977.
  * [33] H. Nijmeijer, Nonlinear Dynamical Control Systems.  New York, NY: Springer, 1990.
  * [34] A. Meurer et al., “Sympy: symbolic computing in python,” PeerJ Computer Science, vol. 3, p. e103, Jan. 2017.
  * [35] J. W. S. Pringle, “The gyroscopic mechanism of the halteres of diptera,” Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, vol. 233, pp. 347–384, Nov. 1948.
  * [36] B. H. Dickerson, A. M. de Souza, A. Huda, and M. H. Dickinson, “Flies regulate wing motion via active control of a dual-function gyroscope,” Current Biology, vol. 29, pp. 3517–3524.e3, Oct. 2019.
  * [37] S. P. Sane, A. Dieudonne, M. A. Willis, and T. L. Daniel, “Antennal mechanosensors mediate flight control in moths,” Science, vol. 315, pp. 863–866, Feb. 2007.
  * [38] T. L. Mohren, T. L. Daniel, A. L. Eberle, P. G. Reinhall, and J. L. Fox, “Coriolis and centrifugal forces drive haltere deformations and influence spike timing,” Journal of The Royal Society Interface, vol. 16, p. 20190035, Apr. 2019.
  * [39] A. P. Lopez, R. Tung, and F. van Breugel, “Upwind detection of ambient wind using biomimetic antenna sensors for aerial vehicles through active sensing,” in AIAA AVIATION 2020 FORUM, American Institute of Aeronautics and Astronautics, June 2020.
  * [40] R. V. der Merwe and E. Wan, “The square-root unscented kalman filter for state and parameter-estimation,” in 2001 IEEE International Conference on Acoustics, Speech, and Signal Processing. Proceedings, IEEE.
  * [41] T. A. Currier, A. M. Matheson, and K. I. Nagel, “Encoding and control of orientation to airflow by a set of drosophila fan-shaped body neurons,” eLife, vol. 9, Dec. 2020.
  * [42] S. J. Huston and H. G. Krapp, “Visuomotor transformation in the fly gaze stabilization system,” PLoS Biology, vol. 6, p. e173, July 2008.
  * [43] A. D. Straw, S. Lee, and M. H. Dickinson, “Visual control of altitude in flying drosophila,” Current Biology, vol. 20, pp. 1550–1556, 2010.
  * [44] M. P. Suver, A. M. Matheson, S. Sarkar, M. Damiata, D. Schoppik, and K. I. Nagel, “Encoding of wind direction by central neurons in drosophila,” Neuron, vol. 102, pp. 828–842.e7, May 2019.
  * [45] M. A. Willis, E. A. Ford, and J. L. Avondet, “Odor tracking flight of male manduca sexta moths along plumes of different cross-sectional area,” Journal of Comparative Physiology A, vol. 199, pp. 1015–1036, Oct. 2013.
  * [46] T. R. Khurana and S. P. Sane, “Airflow and optic flow mediate antennal positioning in flying honeybees,” eLife, vol. 5, Apr. 2016.