We developed a novel, wearable system that couples motion sensing and electrical stimulation in real time to study motor adaptation in new environments. In two experiments we established key information needed in the development of our system including 1) pain habituation patterns and motor adaptations to knee pain while walking, 2) a model of electrical stimulation magnitude as a function of pain perception, and 3) gait-phase-dependent modulation of pain intensity. Over three 10-minute walking bouts, we observed significant pain habituation (p<0.001) to the tonic electrical stimuli after 60-210 seconds. However, by interleaving rest periods (10:10 min stimulation to rest), pain intensity returned to initial values at the start of the subsequent walking bouts (p=0.417, p=0.043). Participants also exhibited consistent local motor adaptation to the painful stimuli, consisting of greater knee flexion (1-3 degrees) throughout the gait cycle (sig. comparisons p<0.012) and across the walking bouts. We used the method of constants to model the pain intensity-stimulation magnitude relationship over 400 stimuli. A linear model fit the data well for intensities >1/10, though a piecewise linear (Adj R 2 =0.874) or exponential model (Adj R 2 =0.869) was required to fit the perception data across the stimulus intensity range (0-5/10). Finally, participants did not report gait-phase dependent modulation of pain intensity while walking with tonic electrical stimulation. Our wearable system supports new motor adaptation experiments in novel contexts not previously possible. These results show the system induces localized pain perceptions and motor adaptations in complex movements (walking) while providing guidelines to structure future experimental pain studies.