1 Introduction

According to the report of World Health Organization [1], there were 17.5 million people died from cardiovascular disease in the whole world in 2005. The quantity was about 30% of the global mortality. Among the death, 7.6 million people died of the heart diseases, and 5.7 million died of the apoplexy. By 2015, it is estimated, nearly 20 million people will die of heart diseases and apoplexy [1].

Those stroke survivals may be left with physical impairments, which could deeply affect their daily activities and quality of living. The disability after stroke has become painful for the patients and resulted in heavy burden to the patient’s family as well as the society. Rehabilitation therapy is the only hope to improve the patient’s condition. The hemiplegia resulted from strokes is usually a sudden neural damage. It can be controlled and overcome, or the functions can be resumed by using medicine and rehabilitation programs for a long period of time. However, patients with asymmetrical lower-limb functions have difficulties in performing continuous and smoothing reciprocal movements with the lower limbs, such as walking and cycling. Muscles tend to atrophy if they are lack of exercises, even if neural functions are resumed, but are unable to control the muscles. The functional electrical stimulation cycling system is designed for this purpose.

To enhance residual functions of partially motor-disordered patients, electrical stimulation (ES) combined with cycling exercise has been utilized as a rehabilitation technology recently [2]. Functional electrical stimulation (FES) applies the electrical current into excitable tissues in order to supplement or replace the functions lost in individuals with neurological deficits. FES systems have been used for restoring functions of paralyzed lower and upper extremities following strokes, spinal cord injuries, head injuries, cerebral palsy and multiple sclerosis. FES has been commonly adopted as clinical practice to retrain muscle strength, correct drop foot, help avoiding incontinence, and control breathing, as well as served as a functional orthosis for patients with central nervous system (CNS) lesions. Recently, there has been increasing interests in the application of electrical stimulation (ES) to enhance residual functions of people who are suffering from partial motor disorders [3], such as stroke patients or incomplete spinal cord injury patients. It is also called functional electrical therapy. In contrast to FES which is essentially a peripheral intervention, functional electrical therapy combines the peripheral and central systems to provide alternative treatment schemes for subjects with partial motor disorders, as well as enhance functional daily activities and to improve their physical fitness. That is, functional electrical treatment has emerged as one of the major rehabilitation modalities for subjects with motor disorders to provide enhanced functional activities [4].

To overcome asymmetrical lower-limb movements, several treatment modalities have been utilized to facilitate the appropriate movements. Among various auxiliary devices, cycling-assisted FES has shown to be an effective measure for bipedal lower-limb movements because cycling exercises are symmetrical and gait-like exercises. The beneficial effects of cycling exercises via functional electrical stimulation (FES) have been well demonstrated to enhance cardiopulmonary functions [5], to augment muscle forces and to improve human motions with muscle disabilities like strokes [6], and incomplete spinal cord injuries [7]. An additional advantage of FES-cycling is that the individual with paraplegia can safely perform the exercises. The results of such a program can also enhance the candidacy of individuals on FES standing and walking.

The previous technology is to use cycling speed and angle encoder position to judge and control the output dose of functional electrical stimulation. If the cycling speed is lower, the strength of the active muscles is smaller, that the electrical stimulation output should be more, and vice versa. Major components in the FES cycling system include controllers, constant current stimulators and angle encoders. The controller is to generate stimulation patterns after receiving feedback signals from crank angle or its derived cycling speed for sending control signals. According to controller signals, the stimulator can deliver a suitable stimulation current and pattern to muscles of leg to achieve synchronized cycling action.

To achieve smooth cycling, it is essential to design stimulation patterns with appropriate control strategy. Stimulation patterns define when and which muscle should be stimulated (Fig. 1). Stimulation pattern design was commonly based on the subject’s muscle activation sequence during cycling exercises. Varied closed-loop control methods have been employed in many other FES application fields. For stroke subjects, the muscle is under hybrid activation. The muscle force generated is from the combined volitional and electrical stimulation (ES). The raw electromyography (EMG) represents the residual muscle force of stroke subject whereas the peak-to-peak of stimulus EMG indicates the force enhancement benefiting from ES. However, the recorded EMG signals during stimulation of a stroke subject exerting a movement are the combination of the volitional and the induced components. This method maybe useful for correcting the walking ability of the patients effectively, but muscle conditions of patients varied. The dose required to stimulate the muscles should also be varied to avoid the side effects. If it is just to adjust the dose by cycling speed or mechanical pedaling positions, it tends to cause users’ discomfort. Whether the old technology can achieve the different training functions depends on the individual.

Figure 1
figure 1

Block diagram of whole system.

Thus, summing up the above, it is necessary for a novel and advanced method to design a feedback control which can be used on the functional electrical stimulation cycling system (FES-CS) depending on the individual’s EMG signals. This research is designed for constant-speed motor-drive cycling system for lower-limb paralysis or stroke patients. This system uses ADinstruments Powerlab physiological signal recording system combined with Chart software to process the EMG signals, that uses the intensity of real-time EMG signals obtained from patients, converts the data into digital formats, deals the data with Field Programmable Gate Array (FPGA) biomedical module, converts the data into Digital-to-Analog Converter (DAC) code, and stimulates the muscles through the electrical stimulation circuit.

This research takes direct measurements of the muscle electrical signals (Electromyography, known as EMG) and also uses these signals as feedback controls; through the immediate EMG measurement, the measured signals calculate rebated control from functional electricity stimulation output intensity, and through electricity stimulation to stimulate thigh muscle in order to achieve effective cycling movements. The measured EMG signals delivered from the human body use the recorder of the physiological signals to analyze which kind of states it will be representative, deal with the EMG signals according to different states, output code values from different states, send into FPGA module to operate, and use the operation result to control electrical stimulator.

The aim of this study is utilizing the intensity of real-time EMG signals obtained from patients, to develop an EMG feedback control method for FES cycling system.

2 System Architecture

2.1 Whole Systematic Structure

This system includes four components, the physiological signal recorder with Chart software, the FPGA biomedical module, the DAC, and the electrical stimulation circuits, as shown in Fig. 1.

The first component conveys EMG signals, which is recorded from the physiological signal recorder into Chart software, makes tentative treatments and outputs several digital codes from the software. The second component sends previous data into FPGA system core to do operations. The third component deals with the materials being sent into DAC to do the converting of the compiled code. The fourth component decodes according to DAC result, and exports electrical stimulation to stimulate the human body. With the above, a while EMG biofeedback control functional electrical stimulation system is completed suitably for constant speed motor-drive cycling system. The cycling used in the study is a common one in the market.

2.2 Physiological Signal Recorder

The physiological signal recorder is ADinstruments Powerlab 16/30 with Dual Bio Amp, which is a multi-functional analytical instrument. It can be used for recording the oxygen density of blood, heartbeats, EMG and respiratory rates, and so on. This physiological signal recorder offers the major input parameters of the system. It has 16 channels of analog input. Of this system, the importance of this device is that it can give digital output to FPGA systema core. Chart software is responsible for handling EMG filtering, class analysis, and giving digital outputs to the amplifier. Figure 2 is the software interface of Chart.

Figure 2
figure 2

Software interface of chart.

2.3 FPGA Biomedical Module

The biomedical module used in this system is the Altera EP1K30TC484-3 FPGA development board. This development board utilizes print port interface to connect with the computer. There are one Digital-to-Analog converter (DAC) and four channels of stimulator transformer circuits. The electrical stimulator can join to simulate human body’s load and directly observe the effects of electrical stimulations. Besides, it is not necessary to apply the real electricity into the human body, as shown in Fig. 3.

Figure 3
figure 3

Altera EP1K30TC484-3 FPGA development board.

Electrical Stimulator is combined with a pulse generator, a 4 channel DAC, and 4 stimulator transformer circuits, as drawn in Fig. 4. The pulse generator can arbitrarily adjust necessary frequency and wave width, and DAC is used for adjusting the amplitude of outputs. If the output of the amplitude is bigger, then the export of electricity stimulations will also be bigger. The electrical stimulator provided monophasic rectangular pulses of 300 μs at a frequency of 20 Hz. The maximum stimulation current output can be up to 108 mA. The entire EMG feedback calculation, electrical stimulation pulse and DAC output control circuits are all intergrated in the FPGA chip.

Figure 4
figure 4

Electrical stimulator block diagram.

3 EMG Feedback Control Methods

3.1 Measurement of EMG Signals

When muscle contracts, the electric potential signal will be produced and the amplitude is positively relative with the size of activated muscles at that time. Electromyography is a technique concerning the development, recording and analysis of myoelectric signals. The EMG was monitored by three surface electrodes (contact diameter of 2.2 cm, external diameter of 3.6 cm). Two electrodes were located on the muscle belly along its longitudinal axis at mid-distance between the ES stimulation electrodes; the distance between the electrodes was 6 cm center-to-center [7]. The ground electrode was placed on the bony medial epicondyle area of the femur. The EMG signals were sampled through the Powerlab data acquisition system at a sampling rate of 5 kHz for data storage and signals processing. EMG that directs quantity examines is called Raw EMG [79].

3.2 EMG Signals Processing

The EMG signals are collected into Chart software on PC. Chart can immediately analyze and filter the EMG signals. EMG is very apt to be interfered with by the electromagnetism. During the electrical stimulation period, it will produce great artifact, cause signal judge difficulties. So it must filter to find out some more observed signals [10, 11]. First, stimulus artifact will be eliminated in raw EMG signals, the overall EMG signals are high-passed filtered (cutoff frequency of 20 Hz). Then, the EMG is filtered (narrow band pass filter, 20 Hz) to generate the EMG envelop. The artifact can’t totally be removed after filtering, but it can minimize influence, as Chart display in Fig. 5.

Figure 5
figure 5

EMG signals processing.

3.3 EMG Signal Levels Setup

Use Chart software and set up 3 EMG signal levels according to the intensity of filtered EMG the level. Then, fetch a rational range for the signal, it is usually scheduled inside between 0.02–0.06 mV. Make three suitable patients’ levels respectively of left and right foot. Operate behind the stratum, utilize the software to set up and determine which digital codes should be output when the level reaches, as drawn in Fig. 6.

Figure 6
figure 6

EMG signal levels setup.

When the signal reaches the first level, but does not reach the second and the third levels, the instrument will export digital codes 001. When the signal reaches the first and the second levels, but not the third level, the instrument will export digital codes 011. When the signal reaches the first, the second, and the third levels, it exports 111. When not reaching any level, it exports 000, as shown in Fig. 7.

Figure 7
figure 7

The sketch map of level outputs.

3.4 FPGA Control System

The main functions of this component are to judge the levels, control the system and set up DAC. Level judgment encodes several signals and counts the time of special digital codes. Every level has the basic number of time that must be reached within two seconds. If reached, it judges the myoelectric signal having accorded with this level. If not yet arrived, it will judge the signal of this level being too faint, not being listed in calculating, and will export 0. So, there are 000, 001, 011, 111, four kinds of output forms, representing four levels. Confirm the level, and send the result to the control system, which will differentiate how much DAC analysis degree should give DAC and the electrical frequency and wave width. The frequency is 20 Hz, wave width is 300 μs. And DAC is also responsible for analyzing the coming DAC codes, and controlling electrical stimulation outputs, as shown in Fig. 8.

Figure 8
figure 8

The block diagram of FPGA system.

3.4.1 Level Judgment

Digital encoder sends 6 EMG energy codes; every bit represents one level. The first three bits represent for the left foot, the last three bits for the right foot as shown in Fig. 9. We should examine whether the counting numbers of each level in two seconds reach the basic number of time. The basic number of times of each level is all different, and so it must find out the number of times that each level needs. By measuring the EMG signals of 5 normal and 6 stroke patients, the outcomes are shown in Table 1.

Figure 9
figure 9

Six EMG energy codes, the first three bits are left foot, the last three bits are the right foot.

Table 1 Comparative table of generating voltage and basic number between normal subjects and stroke patients.

Find out each number of time that the level represents. If the number of time is greater than the basic number of time of the third level, exporting 111; if not, check the second level, exporting 011; if not, check the first level, exporting 001; and if no level is matched, exporting 000. As the three EMG energy levels are confirmed, send messages to the control system to be processed, as shown in Fig. 10.

Figure 10
figure 10

The flow diagram for level judgment.

3.4.2 Control System

When EMG energy level is determined, and the system sends the correct code of left and right foot signals, it is necessary to judge the level and the stimulated foot in time, then send the digital signals to DAC to export for stimulating device. The stimulating frequency is 20 Hz, wave width is 300 μs. It is important to judge whether it is a wrong signal or not. As left and right foot being all 111 or 000, it should be a wrong signal, such as Fig. 11. If the patient uses the FES cycling system normally, it must be impossible that left and right foot exert simultaneously, or not exert at the same time. This is a protector for FES-CS, to prevent too large unexpected electric current under abnormal conditions.

Figure 11
figure 11

DAC code procedure.

3.4.3 DAC Controller

When system sends 14-bit EMG energy level codes to DAC controller, DAC controller will encode the signals and choose which stimulating channel to be sent. DAC controller can accurately control the value of the level and which channel should be represented in that time, so that the electrical stimulating device will produce the electric current in the human body. The resolution of DAC is 10 bits [12], which provides 210 output signal levels. It can output current more than 5 mA, and control 4 output voltage depending on the address. Figure 12 is the timing specification of this DAC. When CS is Low, the 16 bits data can be sent in, and according to the SCK positive trigger, it will send in the internal register by order. This Data includes 4 bit address and 10 bits of resolution, the last two bits are neglected bits. A3–A0 are address and control signals, they control 4 outputs. D9–D0 are the resolution of digital to analogue converters, they can adjust the output voltage according to this 10 bits input codes. X1 and X0 are neglected bits.

Figure 12
figure 12

DAC timing specification [12].

3.4.4 FPGA Process Examples

  1. (i)

    When Chart software receives the signal between 0.04–0.06 mV, it sends 011 through Powerlab to FPGA systematic core.

  2. (ii)

    FPGA receives 011 signal, the counter begins. If this counter reaches 4500K, it exports 011; if less than 4500K, determine the level with sequence.

  3. (iii)

    After exporting 011 to the control system, the control system will export corresponding EMG energy code 0101_0101_0000_00 to DAC controller.

  4. (iv)

    DAC controller can compile the codes and set up 0.96 V for electrical stimulator transformer to export, and the device will export 80 mA on human body.

4 EMG Feedback Control FES Cycling System Implmentation

4.1 Whole Procedure

When the physiological signal recorder obtains the EMG signals, through the Chart software, digital codes are sent to FPGA system; the codes are then dealt with level judgment and set up EMG energy level codes, 000, 001, 011, 111, one of these four codes. This code will be sent to DAC controller and analyzed which degree of intensity and channel to choose at this moment, as well as set the pulse width and frequency. After DAC controller accepts these values, it will send the electrical current to stimulate the human body.

4.2 Verification of Result

4.2.1 EMG Feedback Control Electrical Stimulator

Compare the received EMG energy levels got from logic analyzer with the intensity value of electrical stimulating device. Following Fig. 13 listed below are the first level input, and DAC output voltage to stimulator.

Figure 13
figure 13

The first level input and the result.

4.2.2 Synchronous Test of Both Legs

Single-leg EMG feedback can output suitable intensity of electrical stimulation according to the digital outputs. Then, doing synchronous test of both legs; output voltage will be 312 mV (level 1), 184 mV (level 2), 96 mV (level 3). When the error occurs, there will be no output. The test results of synchronous EMG analysis and DAC voltage output are as following Fig. 14.

Figure 14
figure 14

(Left graph) Left leg Level 3, Right leg Level 2. (Right graph) DAC output: Left leg 96 mV, Right leg 184 mV.

4.2.3 Error Code Adjustment

When the EMG signals of both legs encode 111, it must be an error action, therefore, the DAC output would be all locked to zero to avoid mistaken stimulation, which as shown in Fig. 15.

Figure 15
figure 15

When both legs output 111, the output voltage of both legs are 0V.

4.2.4 FES Stimulator Specification

The FES stimulator output frequency is 20 Hz and stimulation pulse duration is 300 μs. The intensity is from 0 to 108 mA. The DAC control code and FES cycling stimulator output intensity are listed in Table 2.

Table 2 FES stimulator specification.

5 Conclusions

This study is very suitable for being utilized and applied for clinics. Use the strength of real-time EMG signals obtained from patients, as a feedback control method for the output intensity of FES cycling system. Combine with constant-speed motor-drive cycling system, which is usually used by lower-limb paralysis or stroke patients, and this EMG feedback control system of FES. It is not necessary to buy an expensive cycling device with angular encoder. Every simple constant-speed motor-drive cycling system will be suitable for this purpose. For the hemiplegic patients with lower-limb paralysis, functional electrical stimulation cycling system is still a very useful rehabilitation tool.