SUMMARY
The American cockroach, Periplaneta americana, is reported to follow walls at a rate of up to 25 turns s^{–1}. During highspeed wall following, a cockroach holds its antenna relatively still at the base while the flagellum bends in response to upcoming protrusions. We present a simple mechanosensory model for the tasklevel dynamics of wall following. In the model a torsional, massdamper system describes the cockroach's turning dynamics, and a simplified antenna measures distance from the cockroach's centerline to a wall. The model predicts that stabilizing neural feedback requires both proportional feedback (difference between the actual and desired distance to wall) and derivative feedback (velocity of wall convergence) information from the antenna. To test this prediction, we fit a closedloop proportionalderivative control model to trials in which blinded cockroaches encountered an angled wall (30° or 45°) while running. We used the average state of the cockroach in each of its first four strides after first contacting the angled wall to predict the state in each subsequent stride. Nonlinear statistical regression provided bestfit model parameters. We rejected the hypothesis that proportional feedback alone was sufficient. A derivative (velocity) feedback term in the control model was necessary for stability.
Introduction
Mechanosensory stimuli from antennae (Staudacher et al., 2005) mediate a breadth of locomotory behaviors including escape (Camhi et al., 1978; Comer and Dowd, 1993; Comer et al., 1994; Comer et al., 2003; Ye et al., 2003), slowspeed exploration (Okada and Toh, 2000; Okada and Toh, 2004; Okada et al., 2002; Dürr et al., 2001) and highspeed control (Camhi and Johnson, 1999). Specialized mechanoreceptors distributed along a highly segmented, compliant structure, the flagellum, detect contact and strain to provide tactile feedback (Schafer and Sanchez, 1973; Schafer, 1971; Seelinger and Tobin, 1982; Slifer, 1968). Stimuli can also displace the flagellum with respect to two basal segments, the scape and pedicel (Toh, 1981; Okada and Toh, 2000). How arthropods integrate this mechanosensory information depends on input from other sensory modalities, such as vision (Ye et al., 2003), and on the behavioral context, such as locomotion speed prior to or during antennal contact. At the slowest extreme, when a cockroach is initially standing, antennal contact can elicit an escape response (Camhi et al., 1978; Comer and Dowd, 1993; Comer et al., 1994). Basal receptors, as opposed to flagellar receptors, initiate escape turns, while prior flagellar (Comer et al., 2003) or visual (Ye et al., 2003) stimuli either directly or indirectly influence the response. During slow exploratory behaviors, animals actively sweep their antennae to provide rich information about their environment for selforientation (Okada and Toh, 2000; Okada and Toh, 2004; Okada et al., 2002) and for slowspeed walking (Dürr et al., 2001). At the fastest extreme, rapidly running cockroaches use antennal feedback to follow surfaces with remarkable consistency, while holding the base of their antenna at nearly fixed angles relative to their body (Camhi and Johnson, 1999). The dominant information for tasklevel control of this behavior originates from the flagellum, with littletono contribution from the base of the antenna (Camhi and Johnson, 1999), though antenna base angle regulation likely requires basal proprioception. The long, passive, unactuated flagellum bends in response to objects in its environment and transduces contact and strain stimuli to neural impulses for control. Using this sensory input, cockroaches can execute extremely high fidelity maneuvers, reportedly achieving up to 25 turns s^{–1} in response to environmental stimuli (Camhi and Johnson, 1999).
We contend that control of rapid locomotion must be embedded in both neurosensory circuitry and an animal's mechanical system, and that a neuromechanical model of a sensory mediated behavior can lead to specific, testable hypotheses regarding afferent neural processing. We tested tasklevel control hypotheses using the antennal sensory system because of its effectiveness at high speeds, the ease of measuring performance, and the availability of welldeveloped mechanical models upon which we can build.
Neuromechanical models
Legged locomotion results from complex, nonlinear, dynamically coupled interactions between an animal and its environment. Despite this complexity, simple patterns often emerge that are consistent with lowdimensional mechanical models or templates (Full and Koditschek, 1999). Legged locomotion in the sagittal plane is consistent with a spring loaded inverted pendulum (SLIP) (Cavagna et al., 1997; McMahon and Cheng, 1990; Blickhan, 1989; Schwind and Koditschek, 2000), a result that scales across the number of legs and three orders of magnitude of body mass (Blickhan and Full, 1993; Farley et al., 1993). Similarly, horizontal plane locomotion in sprawledposture animals is well characterized by the lateral leg spring template (LLS) (Schmitt and Holmes, 2000a; Schmitt and Holmes, 2000b), because animals also bounce sidetoside. Surprisingly, both templates exhibit passive, dynamic stability when perturbed, thus requiring minimal neural feedback (Full et al., 2002; Schmitt et al., 2002; Altendorfer et al., 2004; Seyfarth et al., 2002). The LLS template reveals that horizontal plane dynamics are asymptotically stable in all states except direction and speed, which are neutrally stable and thus both require active control (Schmitt and Holmes, 2000a; Schmitt and Holmes, 2000b).
To build upon prior mechanical locomotor templates, we incorporate antennal sensing and neural control of running direction directly into one mechanosensory template of antennabased wall following. In contrast to the LLS model, which aims to capture the withinstride dynamics of cockroach locomotion (Schmitt et al., 2002; Seipel et al., 2004), our model focuses on the multistride dynamics.
Wallfollowing dynamic model
Consider a cockroach running on a horizontal flat substrate, following a straight vertical wall. The inertial frame's Xaxis points along the wall, and the Yaxis points into the arena, as shown in Fig. 1. We model the cockroach as a planar rigid body. Let (x,y) denote the position of a point we call the point of rotation (POR). Let v denote the forward speed of the POR, and ϕ the velocity heading of the body POR, so that (vsinϕ,vcosϕ) is the POR velocity vector. Denote the body angle by θ, and let ω=dθ/dt denote the rotational velocity of the body. Cockroaches apply forces with their legs that keep the two angles θ and ϕ aligned during turning (Jindrich and Full, 1999), therefore we model the body angle and the heading as coincident at all times, namely: (1) Under these modeling assumptions, the rigid body kinematics are given by (2) where the dot is used to indicate the time derivative, e.g. ẋ=dx/dt. At each instant, the body moves forward in the heading direction at speed v (assumed constant), while pivoting about the POR at angular velocity ω. The general robotics literature refers to this kinematic model as a `planar unicycle' (see Bloch, 2003).
Our antenna model estimates the distance, d, from the body centerline to the wall. The antenna senses ahead of the POR a fixed distance l, which we call the preview distance (Fig. 1B). Under these assumptions, (3) The linearized antenna measurement kinematics simplify to (4) Eqn 4 describes how the antenna measurement, d, changes as a function of the motion of the cockroach. We distinguish the model's effective preview distance, l, from the physical contact distance, L, which denotes the distance ahead of the animal that the antenna is touching the wall (Fig. 1A). The preview distance, l, is based on the information available to the cockroach from a variety of potential mechanosensory receptors (e.g. campaniform sensilla, hair sensilla and marginal sensilla). The antenna may encode distance, d, to the wall via a variety of surrogate signals such as contact point, strain, antennal forces, contact area, or bend, or some combination, that are all likely to be highly correlated with the distance to the wall during wall following. Finally, neural and muscle activation delays may decrease the effective preview distance, a possibility explored in the Discussion.
To turn, a cockroach must generate a net polar moment, u (Jindrich and Full, 1999). The polar moment of inertia, J, and damping coefficient, B, parameterize the `yaw' dynamics: (5) Damping is used to model stridetostride frictional and impact losses. The animal does not run in a preferred direction, so we do not include a torsional spring force that would orient the animal.
Combining the two linear differential equations, Eqn 4 and 5, yields an openloop dynamical system model of cockroach wall following. One can express a transfer function, G(s), between the moment, u, and the antenna measurement, d, as (6) The dynamical system model (Eqn 4, 5) summarized by the linearized transfer function (Eqn 6), has eight parameters, including the dimensionless angle,θ , and seven dimensional quantities: complex frequency, s; headtowall distance, d; input moment, u; polar moment of inertia, J; damping, B; preview distance, l; and forward velocity, v. These reduce to four dimensionless groups: u=ul/Bv, τ=Jv/Bl, d=d/l, θ; with s=sl/v, where s is the dimensionless complex frequency. Then, from Eqn 6 the dimensionless transfer function relating u and d can be written as: (7) The dimensionless constant (8) plays an important role in our model since its value determines the ease of stabilization via closedloop feedback (Fig. 2). If the cockroach uses negative feedback from the antennabased distance measurement d, thenτ constrains the control structures that can stabilize the system.
The simplest possible feedback strategy, `proportional feedback control' (Pcontrol), assigns an input moment proportional to the `tracking error', namely (9) where d_{∞} is the steadystate distance that the cockroach neural control system attempts to maintain and K_{P} is the feedback gain. For stability, the poles (zeros of the denominator) of the closedloop system, K_{P}G/(1+K_{P}G), must have negative real parts. In nondimensional terms, the closedloop poles are given by the solutions of the characteristic equation: (10) where K_{P} is the dimensionless proportional gain. Routh's stability criterion (see Franklin et al., 1994) reveals that the system is stable (i.e. the roots of Eqn 10 have negative real parts) if and only if 0<τ<1 and K_{P}>0.
We hypothesize (for reasons expanded upon in the Discussion) that Pcontrol will not be sufficient to guarantee stability. To test our hypothesis, we fit a `closedloop' model to a set of behavioral observations. The closedloop model couples the dynamics of Eqn 2–5 with a proportionalderivative (PD) controller, (11) where K_{D} is the gain of the derivative term, which encodes rate of approach to the wall. This additional derivative term helps to stabilize the system, allowing a greater range of allowable values for τ. Note that setting K_{D}=0 reduces the controller to Pcontrol. The nesting of models enables statistical hypothesis testing of the PHypothesis (null) against the PDHypothesis (alternative). During model fitting, we obtain estimates for l, as well as the ratios K_{P}/J, K_{D}/J and B/J. The resulting values enable us to estimate the dimensionless constant, τ.
Materials and methods
Animal husbandry
Adult male American cockroaches Periplaneta americana L. were acquired from Carolina Biological Supply Company (Burlington, NC, USA) and housed in a ventilated plastic container. Cockroaches were exposed to a L:D cycle of 12 h:12 h and given fruits, vegetables, dog chow and water ad libitum.
Wallfollowing arena
Our arena was similar to that used by Camhi and Johnson (Camhi and Johnson, 1999). A rectangular arena, 85 cm×45 cm×15 cm (length × width × height), was enclosed with a galvanized aluminum sheet wall (Fig. 3A). The upper half of the aluminum wall was coated with petroleum jelly to prevent the cockroaches from escaping. A long, highdensity fiber (HDF) block, 50 cm×5 cm×5 cm, was used as a part of the observation wall to view the cockroach's wallfollowing behavior. To induce turning, we placed HDF boards cut at angles of 30° and 45° in the middle of the first wall. Depending on where the cockroach started, it ran along either wall first using its right or left antenna for wall following. We noted this, but did not distinguish between the two scenarios for modeling. Henceforth, we refer to the wall that the cockroach initially tracks, either using their left or right antenna, as the control wall and refer to the wall that induces a turning behavior as the angled wall. The two walls collectively constitute the observation walls.
Two highspeed video cameras (Kodak EktaPro 1000, Eastman Kodak Company, Rochester, NY, USA) positioned approximately 1.5 m above the arena (Fig. 3A) captured the cockroaches' running behavior. A halfsilvered mirror placed in front of each camera at 45° deflected light shone from a 150 W fiberoptic illuminator onto the running surface. There was littletono ambient lighting during the experiment. The two camera views of the observation walls overlapped slightly for camera calibration purposes and to ensure continuity of data from each trial (Fig. 3B). Each camera's field of view covered 35 cm in length of its respective wall, with an average resolution of 0.8 mm per pixel. The cameras synchronously captured images at 500 frames s^{–1}.
We captured video images (Fig. 4) of running cockroaches under low light using a retroreflective sheet from 3M (St Pauls, MN, USA) as the running substrate. Proper alignment of the lighting evenly illuminated the retroreflective running substrate and markers, simplifying detection and tracking of the cockroach, because the nonretroreflective walls, cockroach body and legs appeared as sharp silhouettes.
Animal preparation
We prepared cockroaches inside a 4°C cold room as follows. After initially cooling the animals for 15–20 min, we anesthetized them using CO_{2}. While anesthetized, we attached two small round retroreflective markers to each animal's wings, approximately aligned with the body fore–aft axis, enabling us to estimate the cockroach's position and body angle from video images. The markers did not restrict the wings in any way. To block their visual senses, we covered their compound eyes and ocelli using a white nail polish, taking care to avoid the head/scape joint. This preparation process took less than 40 min per group of five cockroaches. After this preparation, the cockroaches recovered at room temperature for at least 24 h before testing.
Kinematics
Prior to a set of trials with a cockroach, we placed it in the arena for several minutes to acclimate. When the insect walked into position at the initial part of the control wall, we induced an escape response by tapping the running substrate with a long stick near the posterior of the cockroach. Trials were accepted when the animal ran rapidly along the wall and executed a turn at the angled wall. Trials were rejected when (1) the cockroaches stopped or climbed the wall while they were in view of the cameras, (2) the distance of their POR to the wall deviated by more than 2.5 cm while running along the angled wall; this typically occurred when the animal appeared to voluntarily leave the wall and run into the open space of the arena, (3) their body (excluding their legs) collided with the angled wall, or (4) their antenna was not in a `bent backward' posture when the antenna first encountered the angled wall; this eliminated trials in which the tip was pointing forward, thereby wedging the antenna in the corner.
After each successful trial a cockroach rested for 2–3 min while we downloaded the recorded images to our workstation. When the animal stopped exhibiting the escape response from our perturbation or did not achieve any acceptable trials for 30 min, we switched to a different individual. An individual was never used for experiments twice in the same day.
Before each set of experiments, we captured an image from both cameras of a threedimensional, noncoplanar block with retroreflective markers. The geometry of the markers was measured with a set of digital calipers. Using these data, we calibrated the cameras using the direct linear transform.
We extracted four quantities from each trial. First, our custom scripts (Matlab, The MathWorks, Inc., Natick, MA, USA) tracked the cockroach's two body markers to obtain the body's POR (see below) and body angle, (x,y,θ), for all frames (Fig. 4). We visually verified the tracking data by superimposing the predicted marker measurements onto the raw images. Second, custom Matlab scripts automatically determined (and visual inspection confirmed) the frame number for each posterior extreme position (PEP) of the outside hindleg, contralateral to the observation wall. Third, we manually determined the time at which the antenna ipsilateral to the wall first came in contact with the angled wall. This time is the start time of the perturbation, t=0. Fourth, we randomly selected 20 frames from which we manually digitized the antennawall contact points, 10 frames from the control wall and 10 frames from the angled wall. If the antenna was not in contact with the wall in the selected frame, a new frame was randomly selected. From these data, we obtained L (see Fig. 1A). The distance L provides an upper bound on the preview distance, l (see Fig. 1B).
Finding the point of rotation
Since we modeled the cockroach as a unicycle, the 2D position of the running cockroach was represented by its point of rotation (POR). To estimate the POR, we used the positions of the two retroreflective markers that were attached on the fore–aft axis of the cockroach's wings. Assuming an ideal, noslip unicycle, the following equation holds: (12) where α is the distance between the POR and the rear marker, ω is the instantaneous rotational velocity, and v^{⊥} is the instantaneous velocity of the rear marker in the direction that is perpendicular to the heading (see Fig. 5). After approximating ω_{i} and using two consecutive image frames, i and i+1, we performed a leastsquares fit to find the best α, i.e. (13) where n is the total number of frames in a given trial, and thus found the POR.
Data filtering and normalization
For each trial, we collected a time series of cockroach positions and angles spaced at 2 ms intervals. We zerophase forward and reversefiltered the data with a five pole, lowpass Butterworth filter with a cutoff frequency of 62.5 Hz, nearly three times the maximum observed frequency of angular motion (Camhi and Johnson, 1999) during wall following. The origin of the reference coordinate system coincided with the corner where the control wall met the angled wall, with Xaxis parallel to the angled wall, pointing in the direction of running, and Yaxis perpendicular to the angled wall, pointing into the open arena.
Because our model (Fig. 1) does not try to capture the detailed mechanics within each stride, we averaged the cockroach motion during each stride to estimate its state. We used the outer (contralateral to the wall) hindleg PEP frame to segment the data into individual strides and averaged the data over each stride to obtain the values (), where k=1, 2,... indicates the stride number and j=1,..., N indicates the trial number. The position during the k^{th} stride, (), was computed as the mean POR location over all frames of a given stride. Likewise, we computed the mean angle of the body axis, θ ^{j}_{k}, during the k^{th} stride. We calculated the speed, v ^{j}_{k}, as the change in position of the POR between successive contralateral hindleg PEPs divided by the stride duration, t ^{j}_{k+1}–t ^{j}_{k}. Similarly we calculated the angular velocity,ω ^{j}_{k}, as the change in angle divided by the stride period. The first stride (k=1) for each trial was selected as the stride that began after the antenna first contacted the angled wall. The steadystate distance, d_{∞}, was approximated for each trial by averaging the last three strides in view. We observed that most cockroaches had regained quasisteady running by this point, which was typically at least 20 cm and at least 5 strides after the perturbation.
To test the model for speed dependent parameters, we segmented it into two groups, `slow' and `fast'. The average speed was computed for each trial as the mean of the individual stride speeds, v ^{j}_{k}, for that trial. The fast group was comprised of trials whose average speed was greater than or equal to the median speed. The slow group were trials less than the median average speed. For each trial, the stride frequency was computed using the average time between successive outer hindleg PEPs.
For visualization purposes, we processed the data as follows. Each trial was normalized to distance traveled along the angled wall, with x=0 corresponding to the point where the control wall meets the angled wall. This corresponds to the start time of the perturbation, t=0, at x=0. In all trials, x increased monotonically through the trial. The data were linearly interpolated and renormalized resulting in a sequence of normalized observations (), at positions along the wall x=0, 0.1,..., 30.0 cm. Lastly, we grouped and averaged trials of similar speed, so that simulated trajectories could be compared with averaged actual trajectories.
Dynamic model fitting and testing
To fit the parameters of our model we compared model simulations of each stride with the actual data from each stride, as follows. First, we combined the equations for the dynamics (Eqn 5), antenna distance measurement (Eqn 3), and PDcontrol input (Eqn 11) into a single third order, nonlinear differential equation: (14) where (15) There are four independent parameters p=(l,B/J,K_{P}/J,K_{D}/J). Note that the position along the wall, x, can be omitted from the formulation. We assume the parameters p and the speed v are constant during a trial. Given a set of parameters, p, and the cockroach state, (), at stride k of trial j, the flow, Φ, predicts the state of the cockroach during the subsequent stride: (16) where the `hatted' quantities, (y^{j}_{k+1},θ^{j}_{k+1},ω^{j}_{k+1}), are model estimates for the subsequent stride of the same trial, andΔ t ^{j}_{k}=t^{j}_{k+1}–t ^{j}_{k} is the stride duration. We evaluated the flow (Eqn 16) by simulating the dynamics (Eqn 14) for the full duration of a stride (using Matlab's ode45 command) to obtain the prediction of the state at the next stride of the same trial. We assumed the residual error, (y^{j}_{k+1},θ^{j}_{k+1})–(y^{j}_{k+1},θ^{j}_{k+1}), between the model and the measured cockroach position and angle was an independent and identically distributed Gaussian noise process with zero mean and unknown covariance. This assumption implies that each stride is an independent sample for nonlinear regression.
We fit the full nonlinear dynamics, rather than the linearized dynamics, since our perturbations included relatively large angles (up to 45°). After the antenna had first contacted the angled wall, only the first four stridetostride transitions (k=1,2,3,4) were considered for each trial, because after that point, most animals had almost fully recovered from the perturbation, and including more strides amounted to fitting small fluctuations that occurred during straight wall following. To fit the parameters of the controlled mechanosensory system, we followed the nonlinear statistical modeling framework described by Gallant (Gallant, 1987)^{1}. We used Gauss–Newton optimization to minimize the leastsquares error between the observed stride states, and the stridetostride predictions thereof, namely: (17) where N was the number of trials used for fitting (with four strides per trial), and M is the estimated noise covariance matrix (Gallant, 1987). For computing confidence intervals (significance P=0.05), we assumed 4N–4 degrees of freedom (d.f.; 4N independent state transitions and 4 fitted parameters). Because our goal was to test the overall model structure and the importance of derivative feedback for control, we did not fit the parameters to each individual animal. Moreover, doing so may be experimentally infeasible due to the large number of successful trials that are required for fitting. Thus, we fit all of the data simultaneously, and then divided the data into two groups by speed to determine if control system parameters were speed dependent. We also checked for very large variations between individuals by rerunning the statistics with data from each individual omitted.
Because Pcontrol (Eqn 9) results from simply setting K_{D}=0 in Eqn 11, the Pcontrol and PDcontrol hypotheses can be written: (18) We tested the hypothesis H_{P} against the alternative H_{PD} using a nonlinear version of the Student's ttest with 4N4 d.f. and P=0.05 significance.
Results
We accepted a total of 59 trials from 11 individual cockroaches (mass=0.770±0.113 g, body length=3.70± 0.17 cm, antenna length=4.36±0.41 cm, shortest antenna= 3.81 cm, longest antenna=4.91 cm, means ± s.d.). The speeds ranged from 24.7 to 63.6 cm s^{–1} (7–17 strides s^{–1}), all of which were above that of metachronal walking (Watson and Ritzmann, 1998), and below the speeds for which four and twolegged running emerges in P. americana (Full and Tu, 1991). Therefore the stepping pattern was consistent for all speeds in the study: the animals always exhibited an alternating tripod gait (Delcomyn, 1971).
Model validation
The planar unicycle assumption requires Eqn 1 to hold, namelyϕ =θ. To validate this assumption, we performed a leastsquares fit of the strideaveraged ϕ and θ to the linear model,ϕ =β_{1}θ+β_{0}. The result wasβ _{1}=1.00±0.01 andβ _{0}=2.18±0.30° (P=0.05), with an R^{2} of 0.96 (see Fig. 6). The nonzero value of β_{0} may have resulted from the inconsistencies in the placement of the two visual markers along the fore–aft axis of the cockroach's body. Alternatively, occasionally, the cockroaches exhibited a wedging behavior during which they ran at a slight angle toward the observation wall.
PControl is insufficient
Table 1 shows the results of model fitting. For both slow running (35.2±3.8 cm s^{–1}, 7–13 strides s^{–1}, 29 trials) and fast running (48.3±6.0 cm s^{–1}, 10–17 strides s^{–1}, 30 trials), the null hypothesis H_{P} was strongly rejected in favor of H_{PD} (ttest; slow: P=0.01; fast: P<0.001). Fig. 7 shows the average trajectory of a cockroach when encountering a 45° angled wall, in addition to the model prediction. Note that these plots are different than what was used for fitting. For parameter fitting, we used the model to predict only from stride to stride, whereas in the summary data plots, the model generates the entire trajectory. To verify the importance of the derivative gain, K_{D}, we tested the model with K_{D}=0. In this scenario, the model predicts large excursions of the cockroach that would cause successive collisions with the wall interleaved with large departures into the open space, which is quite atypical. Clearly, the derivative gain in the model is behaviorally critical. When data from each individual were in turn omitted, there was no statistically significant difference in the parameters, so we concluded that any outlier effects were negligible. It was not possible to fit the model parameters to a single individual due to the large number of trials required to perform an accurate fit of the parameters.
There was no statistically significant dependence of the model parameters on speed, so we also fit all 59 trials (41.9±8.3 cm s^{–1}; mean ± s.d.) simultaneously to the model, which decreased the 95% confidence intervals of the parameters. The R^{2} value was 0.75. Again, H_{P} was strongly rejected in favor of H_{PD} (ttest, P<0.001).
The model's effective preview distance, l, is based on the information available to the animal from mechanosensory receptors along the antenna. Therefore, the contact distance, L, measured along the body axes from the POR to the farthest antennawall contact point, provides an approximate upper limit for the antenna preview distance. The preview distance will likely be shorter than the contact distance due, for example, to delays. We randomly selected and manually digitized this contact point for 20 frames from each accepted trial. The contact distance averaged over all slow trials, L_{slow}=4.72±0.65 cm, and fast trials, L_{fast}=4.40±0.53 cm (mean ± s.d.), were significantly different (P=0.04, oneway analysis of variance). As the cockroach ran faster, the antenna contact distance decreased because the animal ran closer to the wall (Camhi and Johnson, 1999), and/or experienced increased drag of the antenna against the wall at higher speeds.
As another test of the Pcontrol hypothesis, we directly fit the model with only three free parameters p=(l,B/J,K_{P}/J), using the same approach as before. This pure Pcontrol model proved inadequate because the best preview distance (l=9.29±2.95 cm) was significantly longer than the values for L we observed for fast and slow running, and also significantly longer than the longest antenna length for any of the individuals we tested. Therefore we reject the simplistic Pcontrol model in favor of the PDcontrol model, which better captures the data, and does so with physically realistic parameters.
Discussion
Basis of planar unicycle template
Our template for running is most similar to a unicycle viewed in the horizontal plane (Fig. 1). The planar unicycle takes advantage of the unique performance of the lateral legspring template (LLS) (Schmitt and Holmes, 2000a; Schmitt and Holmes, 2000b), allowing for simple control of body angle. The LLS template has been remarkably effective in modeling the dynamics of cockroach running (Schmitt et al., 2002; Schmitt and Holmes, 2003; Lee et al., in press). It consists of a rigid body that bounces from sidetoside as it moves forward with a pair of virtual legsprings representing the summed behavior of an animal's legs. The legsprings are attached at a fixed (or moving) point called the center of pressure. Six states describe the LLS: the centerofmass position (x,y), body angle θ, angular velocityω , forward speed v, and the COM velocity heading relative to the body axis, δ. Schmitt and Holmes's analysis (Schmitt and Holmes, 2000a; Schmitt and Holmes, 2000b) shows that for a wide range of centerofpressure locations (for example, fixed behind the COM), the discrete stridetostride dynamics partially asymptotically selfstabilize to an isolated equilibrium point in both angular velocity and relative heading. In other words, if an external force slightly perturbs steadystate running, those two variables return to steady state as a result of mechanical feedback (Full et al., 2002). Stability results from losses/gains of angular momentum incurred in legtoleg transitions with minimal sensory feedback. In addition, the forward speed and body angle are neutrally stable, so that small perturbations might slightly increase or decrease the speed or send the template off in a somewhat different direction, but they will asymptotically acquire the new steadystate after the perturbation.
Our unicycle template captured the overall trajectories of cockroaches by utilizing the withinstride dynamics responsible for much of the passive selfstability of the LLS template (Schmitt and Holmes, 2000a; Schmitt and Holmes, 2000b). Specifically, in our planar unicycle, the strideaveraged body axis angle remained coincident with the POR's velocity vector. We reduced the passively stable relative heading of the LLS model to an algebraic constraint,δ =0, a simplification supported by our data when averaged over each stride (Fig. 6). We added rotational damping to cause the angular velocity to decay to zero after perturbations, enabling the body angle to reach a new steady direction, much like the LLS template predicts. Because our objective was to capture the angular dynamics of antennabased control, we made one further simplifying assumption – the animal holds its forward speed constant. To enable tasklevel control of the otherwise neutrally stable body angle, θ, we incorporated into our model an input moment, u, about the POR, and an antenna that measures distance, d. Finally, we assumed that a PDcontroller linked the measurement, d, to the input moment, u (Fig. 2). We then fit this control model to data experimentally to determine the parameters of the model. This enabled us to test whether velocity feedback information was necessary for control.
Integration of mechanics, sensing, and tasklevel control
The proposed controller for the planar unicycle demonstrates the necessary integration of mechanics and sensing during rapid running (Fig. 2). Stable control requires a consideration of mechanics, sensing and delay. Our simple PDcontrolled unicycle model provides a mechanism to investigate these three components, which all contribute to the neuromechanical performance limitations inherent in wall following.
Our hypothesis that Pcontrol would be insufficient was motivated by rootlocus analysis of the system G(s) in Eqn 7 under Pcontrol (Eqn 9), as shown in Fig. 8. Under Pcontrol, for τ near 1, two complex conjugate roots will dominate the response, leading to large oscillations every time the cockroach encounters an angled wall. For a given gain K_{P}, the system becomes increasingly damped as τ decreases. At the critical value τ_{crit}=1/9, the system can be critically damped with K_{P}=3, with a triple root at s=–3. For anyτ<τ_{crit} and an appropriate choice of K_{P} the closedloop system would have one distinct real pole and one double real pole. This analysis leads to three distinct cases:

τ≥1. The system cannot be stabilized with Pcontrol.

τ_{crit}<τ<1, whereτ _{crit}=1/9. For all choices of the gain K_{P}, the system will be underdamped and therefore oscillatory.

τ≤τ_{crit}. The system can be stabilized with Pcontrol, and for an appropriate choice of K_{P}, the system can be either under damped, over damped, or critically damped.
Eqn 8 indicates that τ increases with speed. If τ remains bounded below τ_{crit} for behaviorally relevant speeds, then we would hypothesize that Pcontrol will be sufficient. If τ exceeds unity (or evenτ _{crit}), then we would hypothesize the need for a more complex compensation mechanism that includes adding velocity dependent feedback via a proportionalderivative (PD) controller (Eqn 11).
Unfortunately, we cannot independently measure all of the parameters that determine τ in Eqn 8, and it would therefore seem impossible to make a prediction as to whether or not Pcontrol is sufficient. However, one additional insight leads to the hypothesis that Pcontrol is insufficient: delay can destabilize a control system. Two separate calculations below predict that ethologically observed neural delays of 30 ms or more preclude Pcontrol for stability. As seen, our experimental results bear out this prediction.
A delay of T seconds, arising from neural processing and generation of muscular forces, adds a multiplicative term e^{–}^{sT} to the openloop transfer function G(s) in Eqn 6: The term e^{–}^{sT} adds pure phase lag. This can be seen by evaluating e^{–}^{sT} along the imaginary axis, along which it has unity gain and negative phase. Recall that lower values forτ make Pcontrol possible, so assume for simplicity that τ=0. In this case, the delayed version of the dimensionless transfer function (Eqn 7) simplifies to: (20) where T=Tv/l is the dimensionless delay. We use Camhi and Johnson's measured latency of approximately 30 ms for a cockroach to respond to an outward wall projection during wall following in P. americana (Camhi and Johnson, 1999). That result nearly matches the latency of the antennal escape response for this species (Ye et al., 2003). Since longer preview distances simplify control, we assume that the preview distance is l=4.5 cm (which corresponds to the contact distances, L, that we measured). With these optimistic assumptions, as the running speed approaches the maximum observed running speed of P. americana of 1.5 m s^{–1} (Full and Tu, 1991), the dimensionless delay approaches a critical value of T=1, at which point the cockroach cannot be stabilized with Pcontrol for any choice of proportional feedback gain, K_{P}. This can be seen by using the Nyquist stability criterion (Fig. 9). A Nyquist plot is constructed by evaluating the transfer function (Eqn 20) along the imaginary axis, namely G(jω), from 0 to ∞. Residue theory from complex analysis can be used to show that if this plot encircles the –1 point, the closed loop transfer function is unstable. In our case, for T≥1, the Nyquist plot always encircles the –1 point at least twice regardless of the feedback gain; thus under Pcontrol the closed loop transfer function must have at least two unstable poles when T≥1. For values of T slightly lower than 1, Pcontrol will be highly oscillatory. Adding a velocity feedback component can mitigate this problem by adding phase lead, which can counteract to some extent the phase lag introduced by the delay.
We also suggest a different perspective on the role of delay by assuming that the delayed signal simply decreases the preview distance. As we show here, this alternative explanation leads us to the same conclusion: that Pcontrol is insufficient. One might reasonably expect the preview distance to vary according to (21) where L is the maximum contact distance. In other words, the faster the cockroach runs, the less the effective preview distance due to the delay. Recalling that τ=Jv/Bl, we expect that (22) Again we assume T=30 ms. As P. americana approach their maximum speed 1.5 m s^{–1}, τ approaches infinity, regardless of the specific values of J and B. Of course, for speeds far less than the maximum, τ>1. This supports the notion that Pcontrol will fail as an adequate explanation for control at behaviorally relevant running speeds. Moreover, as the animal increases in speed, the need for a more complex control mechanism will increase. At a running speed of v=42 cm s^{–1} (the average speed of the fast group of cockroaches) a delay of at least T=30 ms will reduce the preview distance by at least 1.3 cm. Thus, if L=4.4 cm (the average value for fast trials), the preview distance should be at most 3.1 cm. This is slightly longer than our experimentally fitted value of l=2.6 cm for fast trials (Table 1), and therefore the fitted value is feasible.
Because v is measured and l and B/J are fitted (Table 1), we can calculate the nominal value for τ using the formulaτ =(B/J)(l/v) for each speed group. Based on the bestfit PDcontrol parameter, at slow speeds, τ is given by (23) while the value for fast running is while the value for fast running is (24)
Fig. 7B,D shows that Pcontrol cannot stabilize the behavior at high speeds, becauseτ _{fast}>1. PD control is required and we would predict that neural signals from antennae will show a distinct phasic response corresponding to velocity feedback. At the slow speeds tested, however, Pcontrol may be possible, since τ_{slow}≈1, but with Pcontrol the cockroach wallfollowing dynamics would be very highly oscillatory, no matter what the choice of gain, K_{P} (Fig. 7A,C). One expects τ to decrease further at slower speeds, and at the slowest speeds the system would be easily controlled by simple Pcontrol. While we suspect that to be the case, we did not test such speeds; for consistency, we used the escape response behavior to elicit running, so the slowest trials captured for this study were those with continuous nonstop running at over 20 cm s^{–1}. This is distinct from the more intermittent walk/pause style walking seen during exploratory locomotion described by Gras et al. (Gras et al., 1994), and examined (along with fast runs) for wall following by Camhi and Johnson (Camhi and Johnson, 1999). To test whether Pcontrol suffices at these slow speeds one would need to model the intermittent walking behavior; that is beyond of the scope of the present study.
As discussed, the data and analyses presented in this paper refute the Pcontrolled dynamic unicycle model of wall following, and support (though do not prove) a simple alternative, a PDcontrolled dynamic unicycle. The PDcontrolled model matches the data and, according to the theoretical analysis, enables stable wall following. Our experimental and theoretical observations do not preclude more complex and elaborate alternatives. For example, acceleration feedback may also play a critical role in some circumstances (though a more elaborate set of perturbations may be needed to tease this out). Our controlled experiments also do not support or refute more complex neural transfer functions that might be required for following more complex surfaces or avoiding isolated obstacles.
Multimodal role of antennae in mechanosensory integration
Behaviors mediated by antennal feedback involve a complex combination of basal and flagellar mechanoreceptors, not to mention feedback from myriad other sensory stimuli, including vision (Ye et al., 2003) and olfaction (Schaller, 1978). Understanding of the neural control strategies underlying sensorimotor function is further confounded by the need to identify the behavioral context, such as wall following and random exploration (Jeanson et al., 2003), wind following (Bohm, 1995), and tunneling versus climbing (Harley et al., 2005).
We contend that understanding tasklevel neural control of rapid running requires the integration of sensing and mechanics. A neuromechanical model opens up a wide range of tools from control theory – such as root locus analysis and Nyquist's stability criterion – to make specific predictions regarding neural function. The neural processing requirements for stability derived from such a neuromechanical model lead to novel, testable motor control predictions. In the present study, we used a simple neuromechanical model of wall following that predicts the need for neural coding of both antennal distance (proportional) and velocity (derivative) for stable wall following. Based on the results in this paper, our prediction would be to see both a tonic response (position) and a phasic response (velocity) of antenna perturbations. Therefore, an important next step would be to test this hypothesis directly with neural recordings of flagellar receptors and neurons.
List of abbreviations
 CCW
 counterclockwise
 HDF
 highdensity fiber
 LLS
 lateral leg spring
 Pcontrol
 proportional feedback control
 PD
 proportional derivative
 PEP
 posterior extreme position
 POR
 point of rotation
 SLIP
 spring loaded inverted pendulum
ACKNOWLEDGEMENTS
We thank Chanson Chang for his significant contribution in collecting our preliminary data, Dan Koditschek and Shai Revzen for their ideas regarding model fitting, Simon Sponberg for his neuroscience insights and Carey Priebe for his statistical advice. Also, thanks to Devin Jindrich for reading the manuscript. The work was supported in part by The Office of Naval Research (MURI N000149810669) and the National Science Foundation (FIBR 0425878).
FOOTNOTES

↵1 Gallant's approach allows us to find the best fit for the parameters p=(l,B/J,K_{P}/J,K_{D}/J), while accounting for how random variations in the trials lead to uncertainty in the parameters. This is analogous to linear regression, e.g. fitting a line y=mx+b. Here, our `x' data are the states at the start of each stride, and our `y' data are the states at the end of each stride; the slope and intercept in linear regression are analogous to our unknown parameters, p. As is well known in linear regression, random fluctuations in the data affect parameter variances, and we arrive at similar results here, in a nonlinear setting.
 © The Company of Biologists Limited 2006