article: Animal flight requires fine motor control. However, it is unknown how flying animals rapidly transform noisy sensory information into adequate motor commands. Here we developed a sensorimotor control model that explains vertebrate flight guidance with high fidelity. This simple model accurately reconstructed complex trajectories of bats flying in the dark. The model implies that in order to apply appropriate motor commands, bats have to estimate not only the angle-to-target, as was previously assumed, but also the angular velocity (“proportional-derivative” controller). Next, we conducted experiments in which bats flew in light conditions. When using vision, bats altered their movements, reducing the flight curvature. This change was explained by the model via reduction in sensory noise under vision versus pure echolocation. These results imply a surprising link between sensory noise and movement dynamics. We propose that this sensory-motor link is fundamental to motion control in rapidly moving animals under different sensory conditions, on land, sea, or air.
  An important open question in neuroscience is how animals transform incoming sensory information into motor commands to control movement [1–6]. This problem is particularly difficult in flying animals, in which sensory input is rapid and motor control must be accurate. Bats are the only mammals capable of true flight [7,8]. Many tasks performed by bats require fine maneuvering toward targets (e. g. , catching mobile prey or landing on small stationary objects). To converge to its target, the bat must reduce to zero the azimuth-to-target angle, θ (Fig. 1A). Reducing θ requires careful, well-coordinated control of the forces the bat applies to maneuver. Thus, a major challenge the bat faces is to translate the noisy estimates of θ into motor commands. A few previous studies tested how bats control their approach [9,10]. These studies focused either on the flight pattern [10–13] or on the echolocation dynamics [9,10,14], but they did not examine the sensorimotor loop [15]—that is, how bats rely on sensory input to control flight motor commands. Here, we aimed to examine: (1) If it is enough for the bat to measure the azimuth-to-target (θ), or does it need additional information in order to apply the correct motor commands to converge onto the target? Specifically, it is well known from control theory that noisy measurements can pose a great challenge in fine guidance tasks, necessitating additional measurements, such as derivatives of θ. (2) Does the bat change its control strategy under different sensory conditions which differ in their noise level, such as in dark versus light, and moreover, do environments with reduced sensory noise affect the motor commands and accordingly the flight? To answer these questions, we developed a control-theory based sensorimotor model that receives noisy sensory input and computes the needed forces based on basic physical principles. This model allowed us to test different control strategies to evaluate the bat’s sensorimotor strategy and to examine its control strategy under different sensory conditions (light versus dark). To test our model, we used behavioral data from Egyptian fruit bats (Rousettus aegyptiacus) —flying mammals that possess an advanced biosonar (echolocation) system [16–21], as well as an excellent visual system [22]. We found that a simple model, which considers only the angle-to-target and its derivative (a “proportional-derivative controller”), was able to reconstruct complex, several-meter-long flight trajectories very accurately—with an average error of only 14. 6 cm. We show that, to successfully land in the dark, the bat has to integrate (to average) sensory data from its biosonar system over several hundred milliseconds, in order to overcome sensory noise. We also demonstrate that when flying in light and using vision, bats reduced their flight curvature. This change in movement pattern was fully explained by the model as resulting from the reduced sensory noise when using vision. Taken together, these results imply an important link between sensory noise and movement dynamics in a rapidly moving mammal.
  We simulated several control strategies with increasing complexity; in all models, turning forces F⊥ were applied perpendicularly to the movement trajectory in order to turn (maneuver) the bat based on the sensory input. We first tested the simplest possible control strategy, the so-called “proportional control” [24–26], in which the turning forces F⊥ at every moment are proportional to the measured angle θ: F ⊥ =− k p ⋅ θ where kp is a constant, referred to as the “proportional gain” (Materials and Methods). Such a simple proportional controller performed poorly: First, it converged onto the target in only 61% of the complete-darkness trials (136/222). Second, it converged successfully only in trials with “easy” initial conditions, i. e. , small initial angle θ0; 88% of the successful trials (120/136) had θ0 < 45° (see, for example, red curve in Fig. 1B). The convergence in these trials is not surprising because the bat started flying already heading towards the target, and thus small corrections were sufficient to reach the target. Third, in the difficult cases with θ0 > 45°, the model failed in 73% of the trials (θ0 > 45° occurred in 59/222 trials, and in 43/59 or 73% of these difficult trials, the model failed to converge; Fig. 1E, compare empty versus full bars to the right of the dashed line [θ0 > 45°]; c. f. Fig. 1C). Failures to converge occurred mostly because the forces applied during flight were too large, leading to large angular velocity and oscillations of θ that did not converge to zero (see S1 Fig. , middle row). Thus, a simple proportional controller is not adequate to explain bat guidance of flight. The failure of the proportional controller implies a need for a stabilizing effect, to counteract these strong forces. A simple stabilizer commonly used in control theory is to add a derivative term, which dampens the overshooting effect of the proportional controller; such a control strategy is called a “proportional-derivative (PD) controller” [24–27]: F ⊥ =− k p ⋅θ− k d ⋅dθ/dt The PD controller proved to be dramatically superior as compared to the simpler proportional controller: the PD controller led to convergence in 100% of the trials (222/222, see examples in Fig. 1B-D, blue lines); it converged successfully even in those trials in which the bat maneuvered strongly (Fig. 1C, D: compare the red lines [proportional controller] that diverged versus the blue lines [PD controller] that converged accurately; see more examples in S2–S7 Figs.). Notably, the PD controller was able to explain even extreme-maneuvering trials in which the bat exhibited a full 360° rotation (Fig. 1D). For each trial we found the model parameters (kp and kd) that minimized the error between the simulated trajectory and real bat trajectory (see Materials and Methods for error-index definition). We computed the error index for the proportional controller and for the PD controller, for those 136 trials in which the proportional controller converged. The analysis revealed that in 92% of the cases (125/136), the PD controller led to trajectories with a smaller error (Fig. 1F, blue bars). The average reconstruction error of the PD controller over the testing data was extremely small—only 14. 6 ± 1. 1 cm (mean ± S. E. M. ; see Materials and Methods for details on the training and testing procedure; see also S1 Table for data on each individual bat). In contrast, the proportional controller did not converge at all in 39% of the trials (86/222; Fig. 1F, gray bar), and in those trials where it did converge, its trajectory error was, on average, 3. 6 times worse than in the PD controller. In some cases (12. 5%, 17/136), the PD controller outperformed the proportional controller by more than 10-fold. Importantly, when we plotted the distribution of the parameters (kp, kd) that best fitted each experiment, we found that bats used one consistent control strategy (Fig. 1G, note the uni-modal distribution of best parameters for each individual bat, peaking at around kd ≈ 2–6 and kp ≈ 1–5). When examining different individual bats, each bat had slightly different optimal parameters (Fig. 1G and S2 Table), but they were all centered within the same limited range in the parameter space. This consistency between and within bats, all of which exhibit high (non-zero) values of optimal kd, argues against the proportional model—and emphasizes the need for differentiating the angle, as implemented in the PD model. Finally, we tested two alternative two-parameter models, the proportional-integrative (PI) model and the derivative-integrative (DI) model. Both of these models performed worse than the PD model, and one of them performed worse than the Proportional model as well (S8 Fig). We therefore conclude that the superior performance of the PD controller was specifically due to the combination of the proportional and derivative terms (P+D). This combination is particularly effective during rapid maneuvering because the proportional term corrects the error and the derivative term stabilizes the controller. All the models we discussed so far were deterministic and assumed that the bat can perfectly measure the angle-to-target. In reality, however, all organisms have sensory errors. To assess the effect of this sensory noise, we tested two models of angle-dependent additive Gaussian noise, which mimic the sensory errors found in the auditory system of several vertebrates (S9 Fig. and Materials and Methods) [28–30]. As expected, sensory noise had strong implications for the convergence of the model: in many trials, adding the noise resulted in increased maneuvering errors (Fig. 2A, top, red dashed curves), and oftentimes led to complete failure to converge (Fig. 2B-C, top). The noise impaired convergence in 85% of the 222 trials (189/222). The percent of diverging simulations increased in trials with highly curved turns, as expressed by their small straightness index and large maximal angle θmax (Fig. 2D, see Materials and Methods for definitions of these indices). Even in the trials that did converge despite the noise, the error index increased substantially, on average by more than 2-fold. The model failed to converge in the presence of noise because the derivative term of the PD controller differentiates noisy measurements, which further amplifies the noise (see Materials and Methods). We therefore hypothesized that the bat must use a noise-suppression strategy and integrate (average) over several sensory measurements to overcome the noise. To elucidate the number of measurements of θ that should be averaged before executing the motor commands, we tested several different integration functions and evaluated their effect on the percent of successful convergences and on the error index. An exponentially decaying integrator (Materials and Methods), which only takes into account the three to four most recent measurements, was found to outperform uniform and linearly decaying integrators (S10 Fig.). This simple exponential integrator exhibited successful noise suppression and reproduced the bat’s flight trajectories with high fidelity (Fig. 2E, arrow; see also Fig. 2A-C, bottom—compare to the failed convergences in the top panels when not using noise suppression). Interestingly, there is a biologically-plausible update algorithm to implement such an exponential integrator, by only requiring the bat to remember the last average θ (see Materials and Methods). Previous work has shown that in stationary micro-bats (Eptesicus fuscus) that perform a detection task, integrating information over five to ten sonar calls substantially improves performance [31]. Our current findings strengthen the need for integration. The shorter integration window that we found in flying bats (three to four sonar pulses; note the optimum in Fig. 2E: arrow) versus stationary bats (five to ten calls [31]) might reflect the need for faster decision-making during flight maneuvers. It might also result from the difference between the bat species used in the two studies, which rely on echolocation to a different extent (Rousettus less than Eptesicus). An important prediction of our model is that sensory noise determines motor performance. In particular, the model predicts that using an alternative sensory system with less noise would allow the bat to apply stronger turning forces. In the highly visual Egyptian fruit bat [22], visual estimation of θ is less noisy than echolocation-based estimates. This is due to two factors: First, visual angular acuity in these bats is 0. 3° [22], 10-fold better than their echolocation-based acuity of 2°–3° [17]; and second, vision has a much higher effective update rate (at least 25 Hz flicker-fusion limit in mammalian vision [32] versus 7–10 Hz echolocation rate). We therefore hypothesized that, because the effective sensory noise is substantially reduced under vision, bats performing a visually guided flight will be able to use stronger maneuvering forces F⊥, which will be expressed by higher gain parameters (kp, kd) in our model. To test this hypothesis, we conducted new experiments in which the same individual bats (five of the six bats) flew under a light level that is considered optimal for bat vision (1 lux) [33], while performing the same landing task. We examined here all of these 43 light-based trials, and found that the PD controller used for modeling the dark conditions (Figs. 1 and 2) was inadequate in explaining the light trials (the mean error was 2-fold higher, see Materials and Methods). Therefore, we implemented a new version of the PD controller, where we increased the sensory update-rate from 10 Hz (sonar) to 25 Hz (vision [32]) and also decreased the noise level [22] (see Materials and Methods). This PD model was able to reproduce the trajectories flown in the light with a high fidelity (Fig. 3A, top row, green curves). We found that, as we hypothesized, the simulated bat exhibited significantly larger gain parameters (kp, kd) in light versus dark (Fig. 3B; 8/10 parameters increased in the five bats; Wilcoxon signed rank test, p < 0. 01). Further, the simulated bat exerted significantly stronger forces when flying in the light (Fig. 3C; t-test, comparing flights with θ0 > 45°: p < 10−11 see also Fig. 3D). Moreover, flight trajectories in light conditions were more direct than in darkness, as quantified by their higher straightness index (Fig. 3E, t-test: p < 0. 03). Additionally, we found that using an appropriate integration window is even more crucial in light than in dark (the optimum is more pronounced, see Fig. 3F, arrow). We next tested if the light-based gain parameters could explain trajectories flown in the dark, and vice versa. When we applied on flights performed in light the kp, kd parameters derived from dark trials, the simulations produced trajectories that converged onto the target, but were much less direct (Fig. 3A, top row, blue curves). Conversely, when we applied on dark trials the kp, kd parameters from the light condition, the simulations produced straighter trajectories (Fig. 3A, bottom row, green curves; and Materials and Methods), consistent with the stronger forces applied by the bats in the light. Interestingly, this implies that, in terms of its motor abilities, the bat could have easily flown more directly to the target in the dark—but instead, it flew in a curved manner because of sensory limitations (namely, the higher sensory noise and lower sensory update-rate in the dark).
  Taken together, our results demonstrate a simple, biologically-plausible, sensorimotor model that explains flight guidance in bats—that is, how they maneuver towards a desired target in the presence of sensory noise. In our model we concentrate on translating noisy sensory input into motor commands. We ignore noise in the motor and proprioception systems [34], both of which affect the bat’s flight performance in reality. Such noise should be similar in light and in dark and thus will not affect any of our results (aside from making the flight trajectories less smooth). Our model relies on two key components. The first is (i) integrating (averaging) sensory information over time, in order to acquire a better (less noisy) estimation of the angle-to-target (θ). Importantly, we have found that the bat could apply a very simple biologically-plausible implementation of such an estimator (or integrator), which uses minimal memory and only requires memorizing one previous sensory estimation of θ (see Materials and Methods). And the model relies on (ii) the derivative of θ in addition to θ itself, in order to stabilize the controller. These two components suggest strong limitations on the processing that must be implemented in the bat’s brain, or in the brain of other rapidly moving animals. We found that two main factors explain why bats fly in curved trajectories towards the target: (i) The initial angle θ0: when the bat starts flying at a non-zero initial angle θ0 (e. g. , Fig. 1C), it flies in a curved manner, while if the bat takes off from the wall with a near-zero θ0, it flies rather straight to the target (Fig. 1B). This is especially true in the dark (when sensory noise is higher) and the bat does not apply strong forces to decrease its angle-to-target. (ii) The gain parameters kp, kd of the PD controller: low gain parameters are used when the sensory noise is higher (e. g. , in the dark), leading to curved flights; while high gain parameters lead to straighter flights. Finally, the experiments in the light suggest that, when using vision, bats can exert stronger motor command (stronger forces) and thus fly to the target more directly than when using biosonar. In contrast, in the dark, when there is higher sensory noise and lower sensory update-rate, the bats exert weaker forces—and therefore the angle-to-target converges more slowly. Taken together, these results imply the surprising conclusion that the highly curved flight trajectories often exhibited by bats in the dark are due to sensory limitations—not motor limitations.
  All experimental procedures were approved by the Institutional Animal Care and Use Committees of the Weizmann Institute of Science and the University of Maryland, where these experiments were performed. The full behavioral methods for the dark experiments were described elsewhere [17]. In brief: Six adult Egyptian fruit bats (Rousettus aegyptiacus) were trained to detect, localize and approach a polystyrene sphere (10 cm diameter) that was mounted on a vertical pole positioned inside a large anechoic flight-room (6. 4 × 6. 4 × 2. 7 m). The target’s size resembles the size of some fruits that are commonly eaten by these bats in nature, such as mango. To exclude the possibility of using vision, the target was painted black and the room was in complete darkness (illuminance < 10−4 lux). To prevent use of olfaction, the bats were food-rewarded (with a piece of fruit) only after landing on the target. After every trial, the target was randomly repositioned inside the room, both in the horizontal and in the vertical planes. A total of 253 trials were collected with at least 30 trials per bat. Because our model only addresses azimuth measurements, θ, we excluded all flights in which there was a change of more than 15% in the bat’s elevation (height) over the entire flight. This resulted in 222 trials of darkness flights, at least 20 trials per bat, which were analyzed here. To test the effect of a sensory system with lower noise (vision), additional 43 new trials were conducted in light conditions, using 5 of the 6 individual bats that were tested in the dark. We used a relatively dim light (illuminance = 1 lux), which is considered ideal for bat vision [33], and which is equivalent to light levels under bright full moonlight. The model consists of two controllers (one angular controller for turning the bat and one thrust controller for forward movement), and a set of differential equations describing the bat’s motion. We used a fixed sensory update rate of 10Hz for echolocation (i. e. , 100 ms steps) or 25Hz for vision (i. e. 40 ms steps). At each sensory update step, the model uses the angle-to-target θ, either deterministically or with additive noise (see main text). The noise was added to the value of θ, which was based on a single estimation or on an average of several estimations depending on the exact model (main text). The model then uses this θ as input for the first controller—the angular controller, which calculates the turning force according to one of the control methods described in the main text and below (proportional controller or proportional-derivative [PD] controller). This turning force is then used by the second controller which calculates the forward thrust. The two forces (turning and thrust) are then integrated in the motion equations to calculate the angle-to-target, θ, at the next time step. In between two updates, the simulated bat continues to move with the same forces as used in the most recent calculation. We calculate the line-of-sight (LOS) distance to target r, the velocity vector ν, the angle θ between w and the LOS, and the angular velocity ω (see S11 Fig.), by solving the following set of differential equations (the motion equations) r ˙ (t) =v (t) cosθ (t) (1) v ˙ (t) =− drag− angular damping force+ thrust (2) θ ˙ (t) = ω (t) (3) ω ˙ (t) = U θ (t) (4) where the operator Ẋ represents the derivative with respect to time, d (X) /dt. The forces drag, angular damping, thrust, and the turning force Uθ, which is calculated by the angular controller, are explained below. Additionally, we defined θmax as the maximum angle θ along the flight t > 0. The acceleration ν̇ (t) can be described by the following ordinary differential equation (ODE): v ˙ (t) = −drag− angular damping force+thrust =− D f v (t) − D t ∥ U θ (t) ∥+ U v (t) (5) where drag is proportional to the velocity ν (t), and Df is the drag coefficient [11]; and the angular damping force is proportional to the turning force Uθ (t) (i. e. , when the bat turns, it slows down), with a coefficient Dt. The forward thrust of the bat Uν (t) is proportional to the wing beat and is described by U v (t) = Fsin (2πβt) (6) where β is the flapping frequency of the wings, which we set to 10 Hz according to the behavior of the real bats [11], and F is the forward thrust of each wing flap, according to the data from [11]. In addition to the azimuth θ (t), we assume that the bat estimates the distance to the target (for instance, by using bio-sonar). The distance in our model is only used to slow down the approaching velocity when the bat reaches a critical minimum distance to the target. We estimated from our observations this distance to be approximately 0. 5 m. Slowing down is modelled by replacing Equation 6 with the damping term Uν (t) = −1. 1ν (t). In order to compare the simulated bat’s motion to our experimental results, we transformed the bat’s egocentric polar coordinates (r, θ) into the Earth Cartesian coordinates x, y using the linear transformation θx = θ + α, where θx is the angle between the vector of flight and the x-axis (see S11 Fig.). This allows computing the velocity components along x and y through the following equations: v x (t) =v (t) cos (θ x (t) ), v y (t) =v (t) sin (θ x (t) ) (7) α (t) =atan2 (y (t), x (t) ), − π≤α (t) ≤π (8) where the coordinates x (t) and x (t) are calculated by integration of νx and νy at every instance (every 1 ms), given the initial conditions x (0), y (0), ν (0) and θ (0), and the function atan2 (y, x) is the Matlab (Mathworks) function for arctan (y/x), defined in [−π, π]. In the main text we denoted θ (0) by the shortened notation θ0. Using the linear transformation above, we can then calculate the angular velocity and the angular acceleration as θ ˙ (t) = ω x (t) − α ˙ (t) (9) ω ˙ (t) = ω ˙ x (t) − α ¨ (t) (10) where α̇ (t) and α ¨ (t) are the first and second time derivatives of α (t) (dα (t) /dt) and d2α (t) /dt2, respectively). Combining Eq. 3 and 9 leads to the set of differential equations θ ˙ x (t) = ω x (t) (11) ω ˙ x (t) = U θ (t) + α ¨ (t) (12) In order to compute α̇ (t) and α ¨ (t), we first define the relative velocity components in Earth coordinates to be V TBx = V Tx − V Bx V TBy = V Ty − V By where VT is the velocity of the target; in our case VT = 0, since we tested only stationary target. VB = ν (t) is the velocity of the bat, and VTB is the relative velocity (target-bat). The components of the velocity vectors can be calculated using VBx = νx (t) and VBy = νy (t) found in Eq. 7. Then the expression for change in the line of sight, α̇ (t), is obtained by [27]: α ˙ (t) = x (t) V B y −y (t) V B x x (t) 2 +y (t) 2 (13) and α ¨ (t) is obtained by differentiation of Eq. 13 using the chain rule. Control theory offers many solutions for how to calculate the amount of forces needed in order to achieve a desired response with respect to performance and stability. In the case of the bat, the objective is to reduce the angle θ between the line of flight and the LOS, by applying turning forces Uθ (t) (in the main text denoted F⊥), thus controlling the angular acceleration of θ. In our case of a stationary target, the control objective is to reduce θ to zero. The simplest control strategy that can achieve this is the so-called proportional control, applying forces that are proportional to the error e (t); in our case of reducing θ (t) to zero, the error e (t) is θ itself. The forces are computed by U θ, p (t) =− k p θ (14) where p denotes the proportional controller, and kp is the proportional factor (gain). This angular force Uθ, p (t) is then used in Eq. 4 to calculate ω ˙ (t) —the change in angular velocity. A typical problem of this proportional controller is that it does not consider the rate of convergence, and therefore tends to overshoot and often oscillates around the desired angle. In certain cases, the proportional controller may even lead to divergence away from the target (instability). To compensate for this and to stabilize the system, it is common to introduce a derivative element, which takes into account the rate in which the angle θ changes. In the proportional-derivative (PD) controller, the forces are computed as: U θ, pd =− k p θ− k d θ ˙ (15) where d denotes the derivative term, kd is the derivative gain, and kp is the proportional gain as before. We assume that the bat estimates the angular velocity, for instance by using a simple first order numerical differentiation, such as first order Euler [26], obtaining θ ˙ (t) = θ (t) −θ (t− 1) dt (16) where θ (t – 1) is the previous measurement of θ. Other simple, well-known, two-gain control strategies that we tested were the proportional-integrative (PI) and the derivative-integrative (DI). The PI controller can be written as U θ, PI =− k p θ− k i ∫ t 0 t θdτ (17) where the ki is the integral gain. The less commonly used, two-gain parameter DI controller can be written as To estimate the proportional and derivative gains of the controller (kp and kd, respectively) that best fit the bats’ behavior in the dark, we first simulated 31 values in the parameter space of each gain, ranging from 0 to 16. We validated the model by randomly dividing the dark trials of each bat into 80% training trials and 20% testing trials (80% of the 222 trials were randomly selected with equal probability). We first computed the best mean gain parameters for each bat in the dark using the training set and then tested these parameters on trials from the test set (the remaining 20%). This procedure was repeated 100 times. The average error for the training set was 4. 6 cm, while for the test set it was 14. 6 cm, suggesting that our model could indeed predict accurately the bats’ behavior. All the errors reported in this article are errors on the testing set. The test values for each bat are provided in S1 Table. To test whether our model, developed for dark conditions, is accurate for light conditions as well, we simulated the trials conducted in light for each bat using the same model, i. e. , 10 Hz update rate of echolocation and the same gain parameters that were used in the dark; we then compared the error index. Few of the trials diverged, and of the trials that did converge, the mean error was 2-folds larger than the error we obtained for the dark trials, especially for large angles (maximum error over 60 cm). We therefore went on to test a different model for the light with a higher update rate (25 Hz) and a different noise model with less noise (see below). Interestingly, when we used the training procedure in order to optimize the control parameters in the light trials (see the kp and kd values in S2 Table), and then tested these on the dark trials, most of the simulations diverged. Of those simulations that did converge, the error increased from 2. 6 cm in the light to 21. 50 ±0. 6 cm in the dark, supporting our hypothesis that the bat uses a different control model in the light than in dark conditions. We tested the parameter space kd and kp by simulating the 222 dark trials and 43 light trials, all without noise, over a grid of combinations of kd and kp from 0 to 16. We measured the error index between each simulation and its corresponding real trajectory (see below). The parameter values that minimized the error index are provided in S2 Table. A trial simulation was stopped when one of the following convergence criteria was satisfied: (1) When the simulated bat hit the target (i. e. , reached a 5 cm distance from the center of the 10 cm diameter target). (2) When the simulation lasted more than 7 s. This criterion was set because the average time-to-landing in the real experiments was 1. 5 s, and the longest flight duration observed in the 222 trials was less than 4 s. In order to compare the trajectories of the simulated and the real bat, we first created a joint closed shape that is defined by the two curves (i. e. , as illustrated in S12 Fig. , the curves that surround the areas A1, A2, and A3). The area inside the closed continuous curve can be calculated by Since our vectors are in discrete form, the above continuous equation can be approximated to discrete-time form by the following A j = 1 2 [ ∑ i=1 m−1 (x i + x i+1) (y i+1 − y i) − ∑ i=1 m−1 (y i + y i+1) (x i+1 − x i) ] (20) where m is the number of discrete points in each curve. If the curves intersect, the intersection points are found using linear interpolation between each of the elements composing the curves (S12 Fig.). In those cases, we sum all the closed areas using ∥A∥= ∑ j=1 k−1 A j (21) where k is the number of intersection points (e. g. in S12 Fig. , k = 4). The error index is defined by normalizing the total area ∥ A ∥ by the length of the experimental trajectory of the corresponding trial. Simulations in which the bat circled the target prior to landing (see convergence criterion above) were penalized by multiplying the error by a factor of 10, since such a behavior was never observed in the real experiments. In the dark, we assumed that the bat measures the angle, based on echolocation with a frequency of 10 Hz, i. e. , every 0. 1 s. We assumed that the noise is θ-dependent [20–22], and we tested two different models. The first noise model has no bias (the measured θ linearly depends on the real θ), and it has a nonlinear noise term that is low at small angles and increases above π / 2 (S9 Fig. —left): θ ˜ =θ+n κ 1 sin 2 θ+n κ 2 (22) where θ ˜ is the noisy estimation of θ, κ1 = 0. 65, κ2 = 0. 15 and n is Gaussian noise (N (0,1) ). The second noise model (S9 Fig. - right) has both a bias in the estimation of θ (t) and additive Gaussian noise that is θ-dependent [20–22]: θ ˜ =asin (θb) +0. 4nθ+0. 15n (23) with the parameters a = 2. 22 and b = 0. 458, and n is the Gaussian noise. In the light conditions, the simulated bat estimated the angle-to-target θ by using both vision and echolocation (the real bats did not completely stop echolocating at this light level). We assumed that the additional independent visual measurements were acquired at a rate of 25 Hz (see more details in the main text). Additionally, the noise model assumed a measurement of θ, which is approximately 7-fold more accurate at each time step, following previous behavioral and anatomical studies (see main text): θ ˜ =asin (θb) +0. 07nθ+0. 02n (24) We implemented the exponentially decaying integration function as follows: θ ¯ = ∑ i=1 N W i ⋅ θ ˜ i ∑ i=1 N W i (25) where θ ¯ (t) is the estimated angle θ at the current time after integration (averaging) over several sensory measurements, and θ ˜ i is the measured angle θ at sample time i, with noise and without integration. Each of the previous N sensory inputs was integrated with a weight Wi calculated according to Wi = wi–1 / V and V = (1–wN) / (1–w), and w is the decay parameter, which was estimated in our case to be w = 0. 5. The window that was found to best explain the behavior was N = 3–4 (Fig. 2E). We also tested a linearly decaying averaging model, and a uniform averaging model, and found the exponentially decaying average to be superior in terms of successful convergence and accuracy (error index); this testing was done by comparing between the experiments trajectories and 120 simulated trajectories with noisy measurements for each trial (S10 Fig.). The above integration function requires the memory of at least three past measurements, and to perform a relatively complicated mathematical expression at each time step. A much more practical and biologically plausible method to implement the above integration function is to use the discrete form of a low pass filter [26], which updates the current angle estimation using the previous one according to the weight constant γ θ ¯ k = θ ¯ k−1 (1−γ) +γ⋅ θ ˜ k (26) where k is the time step and θ ˜ k is the current noisy measurement of the angle (Eq. 22–24). Using the above equation, the organism needs only to remember the most recent measurement and the value θ ¯ k−1 estimated at the previous measurement. The above practical implementation is another presentation of Eq. 25. To see that, we apply Eq. 26 recursively: θ ¯ k =γ θ ˜ k + (1−γ) γ θ ˜ k−1 + (1−γ) 2 γ θ ˜ k−2 + ⋯ + (1 − γ) k θ ¯ 0 = ∑ i=0 k−1 (1−γ) i γ θ ˜ k−i + (1−γ) k θ ¯ 0 and for the choice of γ = 0. 5 and assuming that the first estimation θ ¯ 0 =0, we have θ ¯ k =0. 5 θ ˜ k +0. 25 θ ˜ k−1 +0. 125 θ ˜ k−2 +0. 0625 θ ˜ k−3 +⋯ (27) which is corresponding to Eq. 25 with a decay parameter w = 0. 5. Indeed, the simulation results of the above equation and an exponentially weighted function (Eq. 25) with three past measurements are very similar. We have shown (S8 Fig.) that the PD controller was superior in performance to the other two-parameter controllers, i. e. the DI and the PI. It was also superior to the single parameter P controller. We will prove here that the derivative term is essential for stabilization of the guidance controller. Applying the proportional controller (Eq. 14) to the model dynamics (Eq. 12), we get ω ˙ x = θ ¨ x =− K p (θ x − θ d) + α ¨ (t) (28) =− K p (θ x −α) + α ¨ (t) (29) since θd = 0. Rearranging the above equation, we get (θ ¨ x − α ¨) + K p (θ x −α) =0 (30) The solution for this differential equation is marginally stable [24,25] and the solution oscillates; i. e. , it never converges to an isolated steady state, except when the true solution is a straight line (initial angle to target is identically zero). Applying a proportional-derivative controller, (Eq. 15) we get ω ˙ x = θ ¨ x =− K p (θ x −α) + K d (θ ˙ x − α ˙) + α ¨ (31) and then we get the second order differential equation (θ ¨ x − α ¨) + K d (θ ˙ x − α ˙) + K p (θ x −α) = (32) e ¨ (t) + K d e ˙ (t) + K p e (t) =0 (33) which is an exponentially stable system for any positive parameters Kp ≥ 0 and Kd > 0 [24,25], and thus the error e (t) = θx – α = θ is reduced to zero exponentially with time. This proves that the derivative term is essential for ensuring convergence of the controller—that is, the PD controller is the simplest stable controller for guidance purposes.
summary: Bats are extremely skillful aviators: they are able to capture prey and land on targets under challenging flight conditions, as well as maneuver accurately using either echolocation or vision. It remains a mystery, however, how bats—or other flying animals—rapidly translate the noisy incoming sensory information into correct motor commands in order to converge onto a target. To address this question, we developed a sensorimotor control model that explains animal flight guidance and tested it in bats with experiments conducted under dark and light conditions. The model reproduced the bats’ flight trajectory with very high accuracy, suggesting that bats have to estimate not only the angle to target but also changes in the angle over time (angular velocity). Additionally, we demonstrate that the bat must suppress its sensory noise by integrating sensory information over several sonar pulses in order to successfully guide its flight. Comparisons of flight trajectories in light and dark suggest that the surprisingly curved flights exhibited by bats in the dark are due to sensory noise, not motor limitations. We hypothesize that rapidly moving animals must adaptively change their motor control strategy to optimally match the sensory conditions.
title: A Sensory-Motor Control Model of Animal Flight Explains Why Bats Fly Differently in Light Versus Dark