SUMMARY The American cockroach, Periplaneta americana , is reported to follow walls at a rate of up to 25 turns s –1 . During high-speed 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 task-level dynamics of wall following. In the model a torsional, mass-damper 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 closed-loop proportional-derivative 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 best-fit 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.