1 Introduction

Stroke is one of the leading causes of acquired disability in adults with up to 80% of the post-stroke population exhibiting asymmetry in their body postures and gait patterns [1]. Gait asymmetry is characterized by prolonged swing time and decreased stance time on the affected limb. Research has shown a correlation between asymmetrical walking gait and slower gait speed with higher fall risks in stroke survivors [2]. Thus, independent walking that enhances stance time and weight bearing on the affected limb (resulting in symmetrical gait pattern) is an important goal in stroke rehabilitation that would also decrease fall risk [3]. In this work, we developed a low-cost portable device, named ‘Walk-Even’, that can measure, analyze, and correct gait asymmetry in real time during rehabilitation training. The device utilizes a microcontroller and custom-made insoles embedded with force sensors to detect gait asymmetry and provide corrective feedbacks in the form of audio and electrotactile feedback to the user in real-time. The hardware and software design of the Walk-Even device are described in the following sections. We evaluated the validity and reliability of the device on healthy young adults against a commercially available gait assessment system. In addition, a pilot study with six post-stroke patients (four experimental and two control) was conducted to verify the effectiveness of the Walk-Even device in improving gait symmetry after an 8-week training.

1.1 Prior work

Conventional gait rehabilitation utilizes hands-on activities including weight-bearing, weight-shifting, and lower extremity strengthening exercises coupled with manual and verbal cueing/feedback provided by a physical therapist to facilitate normal gait patterns [4]. Despite being effective, such treatment is labor-intensive and requires a high attentional demand from the treating therapists. In recent years, several researchers have explored the use of assistive technologies for gait assessment and training to help address the limitations seen in the conventional gait training. Robot-assisted and virtual environment training systems have been developed for gait training in post-stroke patients [5,6,7,8,9,10]. While these systems show effectiveness in gait rehabilitation, a major drawback of such system is the requirement of costly hardware, which places a limit on general clinic and home use. Alternatively, many researchers developed stand-alone portable devices for gait assessment and training [11,12,13,14,15]. Howell et al. [15] and Bamberg et al. [13] developed low-cost sensor-embedded insoles for gait analysis, though the systems do not provide feedback for gait training or correction.

Functional electrical stimulation (FES) has been used for stroke rehabilitation [12, 16,17,18]. FES supplies an electrical stimulation to specific muscles to elicit a contraction. Kafri [18] applies FES as a compensation method for reduced muscle activation in post-stroke individuals. More closely relevant to our work, Pappas combined FES with gyroscope-based gait detection shoe insole to provide timely activation of electrical stimulation sequences to assist patients with drop-foot dysfunction to make close-to physiological motion [14]. Experiment with two subjects with spinal cord injury showed improved gait pattern. However, the main drawback of FES is that rather than correcting gait abnormalities by behavioral modification, individuals become reliant on the external stimulation to initiate muscle contraction.

Another approach in gait rehabilitation involves eliciting the nociceptive withdrawal reflex (NWR) at the sole of the foot. This spinal reflex results in hip flexion, knee flexion, and ankle dorsiflexion [19], and can be timed accordingly to facilitate the leg swing during the end of the stance phase of gait. Additionally, real-time external feedback in the form of either auditory, sensory or visual guidance has also been used by Muto et al. [12] and Redd and Bamberg [11]. Muto developed accelerometer-based gait compensation device, called Walk-Mate, for which the user wears the sensor on both ankles and receives an audible sound upon foot–ground contact to help regulate their gait. After a 5-day training, patients show improvements in gait symmetry while training with the device, but these improvements were not maintained post-training. The authors hypothesized that the lack of retention is attributed to either the inadequacy of the auditory feedback or to the lack of training intensity. Redd and Bamberg [11] developed a system with real-time multisensory (auditory, visual, and vibrotactile) feedback to elicit changes in gait symmetry during stance in three healthy and young participants. The results indicated that the feedback can influence the subjects’ gait; however, the quality of the feedback modalities must be modified to improve the usability of the device. The device was not tested on subjects with gait abnormalities. Recently, a vibrotactile device was also developed to correct gait asymmetry in stroke patients using biofeedback [20]. The device was only tested on the patients in a single session and was not used in conjunction with any physical therapy training.

Unlike FES, sensory feedbacks reinforce behavioral changes to gait rehabilitation. There is still a scarcity of a feedback-based rehabilitation program till date, which emphasizes reduced swing time and increased weight bearing on the affected limb, using behavioral modification techniques. Portable low-cost device that can be used in clinic and real environment will also enhance behavioral change and retention, which motivated us to design the Walk-Even device [21].

2 Materials and methods

2.1 System overview

In human locomotion, a gait cycle is the time period initiated by the contact of the heel of one foot with the ground, termed heel strike, and ends at the subsequent heel strike of the same foot. A normal gait cycle is composed of 60% swing phase and 40% stance phase. The swing time refers to the duration when the person’s foot is off the ground. This swing phase starts with the toe of the foot leaving the ground, termed toe-off, and ends with the heel strike of the same foot. Stance time refers to the time a person spends on their foot while the other foot is off the ground. As shown by existing research, post-stroke patient with paresis on one side usually exhibits prolonged swing time and decreased stance time on the affected limb. These gait parameters provide the basis of the operation of the Walk-Even device. The device is designed to be compact and modular to allow for easy usage. The major components of the device are shown in the block diagram in Fig. 1. They consist of the sensor-embedded insoles, biofeedback units, and the control unit which includes a microcontroller with wireless and data recording capabilities. Visual feedback is not suitable here since the system is designed to be used during standing and walking in real indoor/outdoor environment. Additionally, since stroke survivors also exhibit certain level of neurological complications, vibro-tactile stimulation was not selected. Hence, auditory and electrotactile simulation are chosen as the feedback modalities of our device. Electrotactile simulation is provided as a light electrical stimulus.

Fig. 1
figure 1

Block diagram of device

The biofeedback and control units of the device are housed inside a compact enclosure that can be worn by the patient around his/her waist. The electrode of the electrotactile feedback unit is placed on the user’s thigh on the unaffected side. The device and component placement on the patient is shown in Fig. 2.

Fig. 2
figure 2

Device component placement on patient

Two types of feedback can be provided based on the gait parameters that are used to determine gait asymmetry: Swing Feedback and Stance Feedback. In Swing Feedback mode, audio and electrotactile stimulation are given when the swing time of the affected limb exceeds a threshold obtained from the swing time of the normal or unaffected side. Along with the audio feedback, the electrotactile feedback generates an electrical stimulation on the unaffected side to encourage the patient to step down to shorten his/her prolonged swing. The process is illustrated in the flowchart in Fig. 3a.

Fig. 3
figure 3

Flowcharts describing a Swing Feedback, b Stance Feedback

In the Stance Feedback mode, an audio feedback is used to remind the patient to put more weight and keep their affected foot on the ground in order to prolong their stance. The audio feedback is activated when the affected leg establishes a heel strike and stopped at a pre-defined time period. This process is shown in the flowchart in Fig. 3b.

The following sections described the hardware design of the biofeedback and the control unit of the Walk-Even device as well as the software algorithm for calculating the gait parameters.

2.2 System component design

The main system components consist of the force sensing insoles, the biofeedback units, and the control unit. Customized circuits are designed for force sensor measurement and biofeedback generation.

2.2.1 Sensor-embedded adjustable insoles and interface circuit

The device utilizes force sensors that are placed on the insoles under the heel and the ball of each foot to measure contact force. The insole consists of separate front and back pieces and can be easily adjusted to fit any shoe size (Fig. 4a). Each insole contains six TekScan force-sensitive resistor (FSR) sensors: three at the front towards the toe and three at the back towards the heel (Fig. 4b). The heel and toe force readings are used to detect the gait parameters, specifically heel strike and toe-off.

Fig. 4
figure 4

a Sandals with custom force sensing insoles. b Locations of FSRs on the insole

The resistance of the FSR is inversely proportional to the amount of force applied on the sensor. The circuit to convert the FSR resistance to voltage is shown in Fig. 5. It utilizes an inverting amplifier with low pass filter. To remove contact bounce noise from the FSR, the filter cutoff frequency, set by R1 and C2, is chosen to be around 6 Hz. This is a trade-off with the speed of the circuit. While decreasing the cutoff frequency reduces the noise, it slows down the response of the circuit.

Fig. 5
figure 5

Force sensor interface circuit

Altogether 12 opamp circuits are required to interface with the 12 FSRs. The outputs of the FSR circuits then are read by the microcontroller which converts the voltages to force readings, using linear equations derived from experimental data that characterize the voltage to force relationship of each individual FSR.

2.2.2 Audio and electrotactile feedback circuits

The device’s audio feedback is delivered by a piezo speaker mounted on the control unit worn on the waist of the patient. The volume is adjustable through a knob on the control unit.

The electrotactile feedback is provided in the form of a short electric stimulation that delivers a tingling sensation to the subject. The stimulation is delivered by a switched-mode DC-DC converter that boosts the voltage from a regular 9 V battery to over 200 V. The output of our device is regulated at an appropriate magnitude and pulse width to provide only an unpleasant sensory stimulation, without stimulating any unintended muscular activity that can alter the patient’s gait. Commercial reusable electrode pads connected to the electrotactile unit are placed on the thigh of the non-affected leg to deliver the stimulation.

The schematic of the boost converter circuit is shown in Fig. 6. At the top is the 555 timer to provide the switch-mode waveform needed by the booster.

Fig. 6
figure 6

Boost converter circuit

The converter is designed to run in discontinuous mode in order to deliver the required high voltage output. Based on the output amplitude and current drain, the switching frequency is set to 160 kHz with a duty cycle of 63%. This results in a maximum output voltage of 230 V which is sufficient for our application. This high voltage is delivered to the patient through electrodes by the high speed solid state relay (SSR). The relay behaves as a switch controlling when the electrotactile stimulation is delivered to the patient and is controlled by the microcontroller to set the pulse width and frequency of the electrical stimulation. The pulse width is adjustable from 80 to 250 µs in 12 discrete steps. The frequency, however, is fixed at 250 Hz. The strength of the electric sensation felt by the patient is determined by the level of the electric current. To allow adjustability of the stimulation amplitude to accommodate individual patient’s tolerance, a guard resistor implemented by a 50 kΩ potentiometer is placed in series with the output. The potentiometer is adjustable through a knob on the control unit. The patient can adjust the level of electrotactile stimulation to suit his/her comfort level.

Using a standard test load of 500 Ω, without the guard resistor, testing has shown that the device is capable of delivering a 115 mA current at 80 μs pulse width and a frequency of 250 Hz (Fig. 7). These values are within the range of most commercial TENS devices [22].

Fig. 7
figure 7

Output voltage across a 500 Ω test load at 80 μs pulse width

2.2.3 Control unit and user interface

The control unit consists of an Arduino MEGA microcontroller to control the overall operation of the Walk-Even device. The microcontroller is programmed with the gait detection algorithm to calculate the gait parameters from the force readings from the insoles. It also contains a microSD card to allow data to be recorded. The operator can control the Walk-Even device wirelessly to operate in different modes from the graphic user interface (GUI) on a computer as shown in Fig. 8. The wireless communication is achieved by two XBee modules—one connected to the microcontroller and the other to the computer. The interface also includes a diagnostic mode to allow the operator to view the FSR voltage values in real-time on the GUI, which is important for troubleshooting.

Fig. 8
figure 8

Graphical user interface running on PC

The device has three operating modes: record, feedback, and zero. In the Record mode, the system saves each individual gait cycles with their corresponding swing and stance times to the microSD card and displays the averages for gait, swing, and stance times on the GUI at the end of the recording process.

In Feedback mode, in addition to recording data, the device will provide the biofeedback to the patient at the appropriate time based on the gait parameters calculated. The interactive GUI also allows the operator to choose between Swing and Stance Feedback modes, as well as changing the pulse width of the electric stimulation and adjusting the key parameters for the gait calculation. The Zero mode is used to calibrate the insoles for use on a new patient. The details of the gait detection and zeroing algorithms are described in the next section.

The complete circuitry for the device is shown in Fig. 9. It measures 10 cm × 13 cm and includes the boost converter and FSR circuits on a custom PCB, beside the Arduino and the wireless shield. The wire harness at the top goes to the force sensing insoles.

Fig. 9
figure 9

Complete device circuitry

The complete specification for the device is given in Table 1. The total cost of device fabrication did not exceed $500. Figure 10 shows the device worn by a patient during testing. The control unit is worn on the subject’s waist, with cat5 cables connecting it to the force sensing insoles. The electrodes for the electrotactile stimulation are placed on the subject’s thigh.

Fig. 10
figure 10

Walk-Even device worn by a post-stroke patient during the training

Table 1 System specifications

2.3 System algorithm

The following subsections describe the algorithms developed for gait measurements and feedback activation. The microcontroller computes the left and right toe and heel forces at 10 ms intervals by summing up the force sensor values from the respective FSRs, three for the toe and three for the heel on each foot. An example of the recorded force waveform is shown in Fig. 11. Because the force values depend on the subject’s weight, gait pattern, and the insole placement, calibration has to be performed to determine the force threshold values, which are used in the training to accurately compute the gait parameters. The calibration and gait detection rely on the detection of peak and minimum (no load) force values at the heel and the toe.

Fig. 11
figure 11

Sample force readings in pounds recorded by the device for the left leg (red heel, blue toe). (Color figure online)

2.3.1 Insoles calibration

The aim of the calibration, the Zero Mode in the GUI, is to measure the no-load force and peak forces of each foot. Based on these readings, the algorithm then fine-tunes the gait calculation thresholds to more accurately measure the gait parameters during the training.

The sandals and insoles are first fitted on the subject. Then the subject is asked to lift each foot one at a time for 5 s. This detects the no-load forces of each foot, which are min_heel and min_toe. Then the subject is asked to walk for a distance of approximately 10 meters in order to obtain the average peak forces of each foot—avg_heel_peak and avg_toe_peak. Based on these readings, the algorithm then calculates the gait detection thresholds as follows:

$$ \begin{aligned} midpt\_heel = & \left( {min\_heel \, + \, avg\_heal\_peak} \right)/2 \\ midpt\_toe = & \left( {min\_toe \, + \, avg\_toe\_peak} \right)/2 \\ toe\_thres = & min\_toe + \left( {avg\_toe\_peak \, - \, min\_toe} \right)*0.1 \\ \end{aligned} $$
(1)

The thresholds are calculated for both the left and right sides. The calibration is performed every time the insole is removed or adjusted. Note that the target swing and stance times for the feedback are also obtained during this calibration phase.

2.3.2 Gait detection algorithm

The gait detection algorithm consists of two separate processes—one to detect the heel strike and another to detect the toe off. They process the heel and toe force data from the insoles using the thresholds (midpt_heel, toe_thres) determined by the calibration.

2.3.2.1 Heel strike detection

The heel force data is continuously updated by the detection algorithm. If the heel force is equal to midpt_heel and is increasing, the algorithm marks this point as a heel strike. It then waits for the force to reach the peak value. Once past the peak, the algorithm waits for the heel force to fall below (min_heel + Δ), where Δ is a pre-defined small margin, before restarting the process to detect the next heel strike.

2.3.2.2 Toe-off detection

The algorithm monitors the toe force value and starts the toe-off detection process when the force exceeds the midpoint_toe threshold. The algorithm then checks for the force to reach the peak value. Once past the peak, the algorithm waits for the force to reach toe_thres. It then marks this point as the toe off, and restarts the process to detect the next toe off.

The gait detection algorithm then calculates the stance time, swing time, and gait cycle time as follows: Gait cycle time = heel strike to heel strike; Stance time = heel strike to toe off; Swing time = toe off to heel strike.

This is illustrated in Fig. 12.

Fig. 12
figure 12

Gait parameters calculation using predetermined thresholds

There are separate processes to detect the left and right heel strikes, as well as the left and right toe offs. The swing times and stance times are calculated separately for the left and right leg as well. These gait parameters are recorded onto the microSD card.

If Swing Feedback mode is active, the audio and electrotactile feedback turns on when the swing time of the affected limb exceeds a pre-defined value, to encourage the patient to shorten his/her swing. For Stance Feedback mode, the audio feedback turns on at the heel strike of the affected limb and stops after a preset time, to encourage the patient to prolong his/her stance. The target swing and stance times for the feedback are obtained during the calibration process, and can be adjusted accordingly during the training.

3 Results and discussion

3.1 Validity and reliability study

To verify our device’s validity, we compared its measured gait parameters (gait cycle time, stance time, swing time) with the measurements obtained from the commercial product Zeno Walkway (ProtoKinetics LLC, Havertown, PA). The testing involved six healthy young adult subjects wearing Walk-Even while walking at a normal pace on the Zeno Walkway. Two conditions were tested: normal walk and simulated asymmetrical walk (by wearing 7 lbs of weight around the right ankle). Each subject performed at least three trials in each condition. The mean, standard deviation, and Pearson’s correlation coefficient of the test results are shown in Table 2. The results show good correlation (>0.80) for the gait, swing, and stance times for both normal and asymmetric test conditions. Note that for the validation test, since feedback is not required, a lower heel-strike detection threshold was used. For feedback operations in real-time, the higher heel-strike threshold, as shown in Fig. 12, is needed due to the sensor noise.

Table 2 Validity analysis of Walk-Even with Zeno-Walkway

The Bland–Altman plots for the measured gait time, swing time, and stance time between Walk-Even and Zeno Walkway are shown in Fig. 13a–c respectively for the normal walking condition. The plots for the asymmetric walking condition are shown in Fig. 14. The results show good agreement between the two devices for both conditions. The mean difference in measured gait time is approximately 2 ms for the normal walking condition, and 3 ms for the asymmetric condition. This is acceptable given the sampling time uncertainty of the devices (The sampling period of Walk-Even is 10 ms and Zeno is 8.333 ms). For the swing and stance time of the normal walking condition, the mean difference is −13 and 13 ms respectively. The symmetric nature suggests that Walk-Even is calculating a lower swing time and corresponding higher stance time compared to Zeno, due to a lower toe-off detection threshold. For the asymmetric walking condition, the mean difference for the swing time and stance time is 21 and −22 ms respectively. This suggests that, with the added weight, Walk-even now uses a higher toe-off detection threshold compared to Zeno, which is expected. Recall that Walk-Even calculates the thresholds based on the minimum and maximum force detected during zeroing. We believe that a custom rather than a fixed threshold is better at gait detection for patients with abnormal/asymmetric walking condition.

Fig. 13
figure 13

Bland–Altman plots for normal walking condition: a gait time, b swing time, c stance time

Fig. 14
figure 14

Bland–Altman plots for asymmetric walking condition: a gait time, b swing time, c stance time

We also assessed the reliability of our device by measuring the gait parameters of 17 healthy subjects performing 4 normal walking trials, with the data collected one week apart. The intra-class correlation coefficients (ICC) were then computed, and shown in Table 3. It can be seen that the test–retest reliability produced very consistent results.

Table 3 Reliability analysis of Walk-Even

This confirms that our device is capable of evaluating gait and record data in real time, and able to show good validity and reliability with the commercially available device.

3.2 Preliminary results

Preliminary testing was conducted on six post-stroke patients at the CSULB pro-bono neurologic clinic [23]. The subjects were 4 males and 2 females with the age range of 51–66 years. They were selected based on the following criteria: post-stroke duration greater than 6 months, no cognitive impairment, ability to stand and walk 10 m independently without assistance, and no other orthopedic or neurological co-morbidities that would affect balance or gait.

The subjects were randomized into the experimental and control groups. Two subjects in the control group (Subjects 5 and 6) received 20 min of conventional gait training that included therapeutic exercises, weight-shifting activities, stepping and walking over-ground with manual as well as with verbal guidance. Four subjects in the experimental group (Subjects 1–4) received 20 min of gait training with the Walk-Even device. Furthermore, all the subjects received additional strength training for 20 min. Thus, all the subjects received a total of 40 min of training per session, twice per week, in an 8-week training. Within the experimental group using the Walk-Even device, two subjects (Subjects 1 and 2) received audio feedback based on the stance time (Stance Feedback), and the other two subjects (Subjects 3 and 4) received a combination of electrotactile and audio feedbacks based on the swing time (Swing Feedback). The asymmetry ratio, which is calculated as follows, was one of the measures used to evaluate the training effectiveness.

$$ {\text{Asymmetry Ratio}} = 1 - \frac{stance \, time \, of \, affected \, side}{stance \, time \, of \, normal \, side} $$
(2)

The ratio gives us a numerical representation of the gait asymmetry, with a value closer to zero indicating better symmetry.

We performed a pre-test, a midway-test at week 4 of the training, and a post-test after the 8-week training. The results are shown in Fig. 15. It was observed that Subjects 1 and 2 who used Stance Feedback showed improvements in their gait symmetry. One out of two subjects (Subject 3) trained with Swing Feedback showed improvement in gait symmetry. For the Control subjects (5 and 6), the gait symmetry did not improve.

Fig. 15
figure 15

Asymmetry ratio progression (with SD error bars) for six test subjects. Subjects 1 and 2 receive Stance Feedback, subjects 3 and 4 receive Swing Feedback, subjects 5 and 6 are Control

A t test was performed between the experimental group and control group. We first calculate the improvement in asymmetry ratio by taking the difference between the pre- and midway-test asymmetry ratios. Here, a positive difference value indicates improvement, while a negative one indicates deterioration. We then calculate the mean and standard deviation of this difference for both groups. The mean for the experiment group is 0.023 with SD = 0.057. The mean of the control group is −0.011 with SD = 0.043. The resulting t-stat value is 0.818 and p value is 0.229. This indicates that no groups improved significantly between pre- and midway-test, probably due to the short length of the training.

Next, the improvement in asymmetry ratio is calculated between pre- and post-test by taking the difference between the pre- and post-test asymmetry ratios. The mean for the experiment group is 0.051 with SD = 0.065. The mean of the control group is −0.053 with SD = 0.0007. The resulting t-stat is 3.185 with p value = 0.016, which indicates that the improvement is statistically significant for the experiment group as compared to the control group between pre- and post-test. This confirms the effectiveness of our device for longer training period.

All subjects also showed an increase in pressure on the affected foot post-intervention as shown in Fig. 16. The evaluation was performed using the TekScan insole system which measures the pressure distribution of both feet during a normal walk, for both pre- and post-intervention. For the experimental group (Subjects 1–4), the average improvement is 51%. While for the control group (Subjects 5–6), the average foot pressure increased by 26%.

Fig. 16
figure 16

Affected side foot pressure for six test subjects, pre- and post-intervention measured with Tekscan F-scan

Similarly, after training with Walk-Even, it is observed that all the experimental group patients transferred their body weight from heel to forefoot earlier which reflects an increased forefoot loading on the affected foot. This can be seen by the decrease in the times when the crossing-point between the heel and forefoot force occurred, as shown in Fig. 17 for a representative subject. The heel to forefoot transfer points for all the six test subjects, pre- and post-intervention, are shown in Fig. 18. The average improvement for the experimental group (Subjects 1–4) is at 17%, while the control group (Subjects 5–6) is at 6%.

Fig. 17
figure 17

Sample of heel and metatarsal (forefoot) forces of the affected side across the normalized gait cycle, pre- and post-intervention of one subject measured with Tekscan F-scan

Fig. 18
figure 18

Heel to forefoot transfer points for the six subjects, pre- and post-intervention measured with Tekscan F-scan. Note that the lesser values in post-intervention indicate earlier transfer of body weight from heel to forefoot

Thus, the preliminary results show the potential of the Walk-Even device in improving gait symmetry, as well as the weight-bearing and distribution on the affected limb. However, further randomized controlled study on many subjects with stroke will be needed to confirm the effectiveness of our device.

4 Conclusion and future work

A novel device, Walk-Even has been developed to measure and analyze gait asymmetry in post-stroke patients, and correct the asymmetry using real-time electrotactile and auditory feedback. The initial testing indicates that the device is accurate in measuring the gait parameters and effective in improving gait symmetry using feedback. The device is portable and low cost and has the potential for use in a non-clinical setting for patients that can walk independently. A more extensive testing with stroke patients is still ongoing. In our future work, we also intend to incorporate pressure-based corrective feedback based on the differences in the foot pressure on both sides, to supplement our current time-based approach.