Described is a system for controlling epidural spinal cord stimulation. Using an Unscented Kalman Filter (UKF), the system receives sensed physiological signals from a subject and, based on the sensed physiological signals, estimating an unobservable state of a target area on the subject. A central pattern generator is then used to generate a stimulation pattern based on the unobservable state. The stimulation pattern is applied to the target area (e.g., spinal cord) of the subject using an electrode array. Receiving feedback, the UKF continuously updates a model of the spinal cord, which results in adjustment of the stimulation pattern as necessary.