Developing a Real-Time Functional Electrical Stimulation System with NI Tools
Author(s):
Ramu Perumal - University of Delaware
Anthony S. Wexler - University of California
Stuart A. Binder-Macleod - University of Delaware
Industry:
Life Science
Products:
PXI/CompactPCI, LabVIEW
The Challenge:
Developing a real-time functional electrical stimulation (FES) system that delivers customized stimulation patterns, acquire and store data, monitor the muscle responses to stimulation, and modify the stimulation patterns in real time to reflect physiological alterations in muscle responses.
The Solution:
Using the multithreading capability of LabVIEW to simultaneously deliver stimulation patterns through the PCI-6602 board, acquire and monitor the data through the two PCI-6024E boards, and modify the stimulation patterns in real time to reflect physiological alterations in muscle responses.
"The main benefit of the new system is its tremendous flexibility for testing patients in a variety of experimental settings. This was possible because of the multithreading capability of LabVIEW, which enabled us to use software timing to generate the required stimulation patterns very accurately, run DAQ, and perform a real-time feedback in parallel."
Enabling FES through Mathematical Models
FES is the use of electrical stimulation to activate artificially the muscles of patients with central nervous system dysfunction to help them to restore functional movement, such as standing or walking. However, rapid muscle fatigue has hindered the practical use of FES. One approach to reducing fatigue is to identify stimulation patterns that minimize fatigue and maximize force. We employ mathematical models with parameters identified by experimental tests to identify the stimulation patterns for each patient. Then we need to deliver these patterns very precisely and accurately through computer-controlled hardware.
The bars in each pattern represent 0.6 ms pulses. The bottom train is a constant frequency train (CFT) with a constant interpulse interval of 50 ms – hence the name CFT50. The middle train is a variable frequency train (VFT) that has the initial two pulses spaced at 5 ms apart and the remaining pulses are equally spaced. The top train is a doublet-frequency train (DFT) with pairs of pulses separated by 5 ms. We also separate each pair by constant intervals. The number of pulses in each train can vary from a single pulse up to 50 pulses.
Background to the Application
We evaluate muscle performance in response to the stimulation patterns using a KinCOM dynamometer. We seat patients on the dynamometer and place a force transducer above the ankle joint. For electrical simulation, we place a pair of electrodes over the thigh muscles for electrical stimulation. We use a Grass stimulator driven by a PC to stimulate the muscles through the electrode pair. In response to the stimulation, the muscle produces force, and the leg may move depending on the settings of the dynamometer. When there is no leg motion, we term the muscle contraction as isometric. When there is motion, we term the contraction as nonisometric. We use a DAQ board to collect and store muscle force, angular position, and velocity data on the PC for later analysis.
Previously, our laboratory used customized software in LabVIEW to deliver the stimulation patterns through the AT-AO-6/10 board and acquire data through AT-MIO-16 board. This system, however, could not modulate or truncate the stimulation patterns as a function of muscle performance. This shortcoming was due to fact that the software had no control over the pulses after we loaded the stimulation patterns into the AT-AO-6/10 board.
Requirements of the New System
The above shortcoming motivated our laboratory to develop highly reliable and flexible software in LabVIEW on a Windows 2000 PC-based platform.
The requirements of the new system are to:
- Operate under isometric and nonisometric modes
- Deliver the stimulation patterns with negligible timing errors between each pulse and between each train
- Modulate or truncate the stimulation trains automatically at the user-defined muscle performance level, such as switching from a constant frequency train to a variable frequency train when the muscle force falls below a desired level due to fatigue
- Acquire and store muscle performance data for subsequent analysis
- Write the data in a form that is compatible with existing analysis software
- Interface easily with the user
- Provide safety mechanisms to prevent undue stimulations being delivered to the patient
Timed Transistor Transistor Logic (TTL) pulses from the PC drive the Grass stimulator. The Grass stimulator puts out a corresponding amplified pulse at each rising edge of the TTL pulse. Then the amplified pulse is delivered to the patient’s muscle through electrodes placed on the muscle. The muscle produces force and motion of the leg. We use a DAQ board on the PC to acquire the muscle force, angular position, and velocity data from the KinCOM.
Implementation
LabVIEW is ideal for building an application to meet the above requirements. It includes necessary functionally required to build the user interfaces and manage the I/O boards. The multithreading capability of LabVIEW is inherently suitable for parallel execution of pulse generation, data acquisition (DAQ) and storage, and feedback to monitor the muscle performance. For pulse generation, we used the PCI-6602 counter/timer board. For data acquisition and feedback, we used the PCI-6024E boards. We used separate PCI-6024E boards for data acquisition and feedback to ensure that the DAQ loop operates continuously, while the feedback loop ran in tandem with the pulse generation loop.
With the main user interface, the user can select one of the many modes for running the test with the option of choosing the required muscle performance data for feedback. The user has the option of setting the DAQ and feedback parameters through the “Preferences” button. When the user chooses a particular test mode and hits the “RUN” icon, the user is taken to that test mode interface. The program prompts the user to load the text file, which contains the information about the stimulation trains. Then the use is prompted to supply the file name where the acquired data will be stored. Through the “Experiment Setup” block, the user can set the experimental variables to the desired values. When the user hits the “START” button, the codes begin to execute and the pulse-generation loop puts out TTL pulses in a timed manner, according to the information in the text file. The feedback loop monitors the muscle performance data in real time, so the stimulation loop switches to a different stimulation pattern or truncates the stimulation and stopping the experiment, depending on user specification. The feedback loop operates in “asynchronous mode,” so it yields to the time-critical pulse generation loop when required. The DAQ loop runs at the user-defined sampling frequency and writes binary data continuously to the RAM to circumvent the time-consuming process of writing data to the hard disk. At the end of the experiment, the acquired data is written to the hard disk for later analysis. In addition, the application also can run in the no feedback mode, where the user can run data acquisition and pulse generation modes independently or in combination for isometric or nonisometric testing.
Performance Evaluation
The current system was intensively tested and met all the requirements stated above. Even though the application relied on the CPU clock for its timing purposes, it delivered pulses accurately with a maximum random error of 0.5 ms between each pulse without compromising the application’s real-time feedback and data acquisition performances. We are currently using this system in our laboratory and a clinical research setting.
System Benefits
The main benefit of the new system is its tremendous flexibility for testing patients in a variety of experimental settings. This was possible because of the multithreading capability of LabVIEW, which enabled us to use software timing to generate the required stimulation patterns very accurately, run DAQ, and perform a real-time feedback in parallel. The feedback capability built into the application replaces the need for an experimenter to monitor the patient’s performance during each testing session. In addition, the programming capabilities of LabVIEW enabled us to use National Instruments inexpensive plug-and-play boards for a real-time application in FES.
For more information, contact:
Ramu Perumal
University of Delaware
126 Spemcer Lab, Dept. of Mechanical Engineering
Newark, DE 19716
Tel: 902-831-3011
Fax: 302-831-3619
Related Case Studies
Performing Advanced Nuclear Power Plant Research with NI ToolsThermoSoniX: A Novel Infrared- and Ultrasonic-Based System for Non-Destructive Testing Built With LabVIEW, IMAQ Vision and DAQ
LabVIEW Program to Study the Viscoelastic Response of Polymers Using an Optical Mouse as the Sensor
Deploying a Managed Pressure Drilling System Based on NI LabVIEW and NI Compact FieldPoint
Testing a Vehicle’s ECUs Using NI TestStand, NI LabVIEW, and PXI
|
|

