Sensory organs are not stationary in the world, and thus sensation can reflect motion of the organism equally as well as stimuli from the environment. Nervous systems must integrate signals of external and internal origin to disentangle a sense of self out of the total sensory input. To examine the representation of self-motion in the nervous system, we use rhythmic whisking behavior in the rat vibrissa system as a model for active sensing. First, we characterize the motor plant underlying this behavior through recordings of behavior and muscle activity. These data inform a biomechanical model that establishes the motor plant for whisking and its physical constraints. Having thus defined the control problem of whisking behavior, we investigate its representation in the vibrissa region of primary motor cortex. We found that single units recorded in the behaving animal accurately represent the rhythmic component of the whisk cycle and that small populations of units accurately encode the amplitude and offset position of individual sweeps of the vibrissae. Finally, we compared this data to recordings in the vibrissa region of primary somatosensory cortex. We find that sensory cortex more reliably encodes the rhythmic component of whisking while motor cortex more reliably encodes slower kinetic parameters. These data are consistent with a model that sensory cortex encodes vibrissa position in a normalized coordinate system with the transformation into absolute coordinates requiring a motor copy signal. More generally, our results bear on what may likely be a more general segregation of representation within the nervous system