ppt - San Diego State University

Download Report

Transcript ppt - San Diego State University

Real-Time Measurement of
Prehensile EMG signals
Master Thesis
Saksit Siriprayoonsak
Supervisor: Marko
Vuskovic
Department of Computer Science
San Diego State University
August 24, 2005
Copyright 2005 by Saksit Siriprayoonsak
1
Contents






Introduction
EMG Overview
Apparatus for EMG Measurement
Implementation of EMG Capture Program
Experimental Results
Conclusion
Copyright 2005 by Saksit Siriprayoonsak
2
Multifunctional Prosthetic Hand Control
A research in Robotics Laboratory, SDSU
Copyright 2005 by Saksit Siriprayoonsak
3
Object of Thesis
Main purpose:
 Design and develop hardware and software for
measuring surface EMG signals from real
human muscles in real-time.
Immediate application:
 To control the existing SDSU multifingered robot
hand.
Copyright 2005 by Saksit Siriprayoonsak
4
EMG Overview
• EMG – Electromyography
• Electromyography measures the electrical impulses of muscles at
rest and during contraction.
• Amplitudes of EMG signal range between 0 to 10 mV (peak-to-peak)
or 0 to 1.5 mV (rms).
• Frequency of EMG signal is between 0 to 500 Hz.
• The usable energy of EMG signal is dominant between 50-150 Hz.
Source:
http://www.delsys.com/library/papers/SEMGintro.pdf
Copyright 2005 by Saksit Siriprayoonsak
5
Amplification of EMG Signals
Factors to be considered:
• Boost signal to TTL standard level (± 5 V.)
– Enough gain
• Noise/Artifact problem
– Filter, stability of electrodes attached to skin, proper
grounding
• DC offset or bias problem
– Bias adjustment
• Power consumption
– Consume less current
Copyright 2005 by Saksit Siriprayoonsak
6
EMG Measurement Stages
Copyright 2005 by Saksit Siriprayoonsak
7
EMG Amplifier: Electrode and Extension
• Stereo phone wire with 3 conductors
– Positive input to preamplifier
– Negative input to preamplifier
– Shield as the input of body reference circuit
• Velcro strap for securing the electrode to the skin
Copyright 2005 by Saksit Siriprayoonsak
8
EMG Amplifier: Electrode and Extension
(cont.)
•
•
•
•
Plastic piece and snap on for holding electrode elements
Dimension of 1 inch between electrode contacts
4 electrode extensions and 1 body reference extension
Total of 9 electrode contacts
Copyright 2005 by Saksit Siriprayoonsak
9
EMG Amplifier: Power Supply
• Dual Supply
– Positive Power Supply
– Negative Power
Supply
• Two 9-volt batteries
connected in series
• Capacitors provide
stability of electrical
current.
Power Supply Unit Circuit
Copyright 2005 by Saksit Siriprayoonsak
10
EMG Amplifier: Preamplifier
• Industry standard instrumentation amplifier
op-amp (INA2128)
– Accuracy: providing high bandwidth at high
gain and output offset current
• Differential amplifier circuit with 2 inputs
• High gain to boost the EMG signals
• Body Reference Circuit or Feed Back
(OPA2604)
Copyright 2005 by Saksit Siriprayoonsak
11
EMG Amplifier: Preamplifier (cont.)
BURR-BROWN INA2128 Application Information
Copyright 2005 by Saksit Siriprayoonsak
12
EMG Amplifier: Preamplifier (cont.)
Preamplifier with Body Reference Circuit (1 channel)
Gain Equation:
Find RG at Gain = 1,000:
50k
RG
RG 1
50k 
 
2
2 (Gain  1)
1
50k 
 
2 (1000  1)
 25.025 
Gain  1 
where
RG
 R1  R 2
2
Find Gain at RG = 22 ohm:
Copyright 2005 by Saksit Siriprayoonsak
Gain  1 
50k
 1137.364
2  22
13
EMG Amplifier: Averaging Body Reference Circuit
• Common body reference circuit for 4 channels
• Using summing amplifier circuit and sign changing circuit
Inverting Summing Amplifier Circuit
For independent R1, R2, R3, and R4:
Sign Changing Circuit
(Inverting Amplifier Circuit)
For independent R1, and R2:
V V
V
V 
Vout   RF  1  2  3  4 
 R1 R2 R3 R4 
For R1= R2= R3= R4:
Vout  
Vout  
R2
Vin
R1
For R1= R2:
RF
V1  V2  V3  V4 
R1
Vout  Vin
Copyright 2005 by Saksit Siriprayoonsak
14
EMG Amplifier: Average Body Reference Circuit
(Cont.)
Average Body Reference Circuit
Common Body Reference Output:
VoutA  
1k
 Bodyref1  Bodyref 2  Bodyref3  Bodyref 4 
4.7k
1k
VoutA 
1k
 1k  1k 
    
  Bodyref1  Bodyref 2  Bodyref3  Bodyref 4 
 1k  4.7k 
1
  Bodyref1  Bodyref 2  Bodyref3  Bodyref 4 
4
VoutB  
Copyright 2005 by Saksit Siriprayoonsak
15
EMG Amplifier: Filter
• Suppress noise that has been amplified by
the preamplifier
• Help to sink any DC current that cause
bias to the output
• Select particular signal frequency range
• Use RC High Pass Filter of 12 Hz
Copyright 2005 by Saksit Siriprayoonsak
16
EMG Amplifier: Filter (cont.)
RC High Pass Filter
Cutoff Frequency:
 1 
f cutoff  

 2 RC 
RC High Pass Filter
Cutoff Frequency of 12Hz
Cutoff Frequency of 12 Hz:
1


f cutoff  

 2  91k  150nF 
 11.66
 12Hz
Copyright 2005 by Saksit Siriprayoonsak
17
EMG Amplifier: Amplifier and Bias Adjustment
• Provide abilities to amplify and adjust
reference level of output signals
• Individual amplifier and bias adjustment
unit for each channel
• Use Non-Inverting circuit for amplifier unit
• Use Voltage Follower Offset Adjustment
circuit for bias adjustment unit
• Provide Gain of 21 times
• Provide Offset of ± 9 volts
Copyright 2005 by Saksit Siriprayoonsak
18
EMG Amplifier: Amplifier and Bias Adjustment
(cont.)
Non-Inverting Amplifier Circuit
Non-Inverting Output:
 R 
Vout  Vin 1  3 
 R1 
 R 
Gain   1  3 
R1 

Copyright 2005 by Saksit Siriprayoonsak
19
EMG Amplifier: Amplifier and Bias
Adjustment (cont.)
Amplifier Circuit with Gain Adjustment
Amplifier Circuit with Gain Adjustment
Amplifier Gain:
At
R40  0:
 R 
Gain  1  40 
 R35 
0 

 1 

 10k 
1
At R
40
 200k :
 R 
Gain  1  40 
 R35 
 200k 
 1 

10k 

 21
Copyright 2005 by Saksit Siriprayoonsak
20
EMG Amplifier: Amplifier and Bias Adjustment
(cont.)
Case 1: at 0% of R2 : ( R2  0 ohms; Vadj  Vcc volts )
Gain  1 
R3
R1
 R 
Vout  Vin 1  3   Vcc
 R1 
Case 2: at 50% of R2 : ( R2 
R3
Gain  1 
Offset Adjustment for Voltage Follower
Output of the circuit:
Vout  (Vin  Gain)  Vadj
where : V1  Vadj  V2
R2
ohms; Vadj  0 volts )
2
R1 
R2
2


R3
Vout  Vin 1 
R
 R1  2
2






Case 3: at 100% of R2 : ( R2  R2 ohms; Vadj  Vcc volts )
R3
Gain  1 
R1  R2

R3 
Vout  Vin 1 
  Vcc
 R1  R2 
Copyright 2005 by Saksit Siriprayoonsak
21
EMG Amplifier: Amplifier and Bias Adjustment
(cont.)
Case 1: at 0% of R2 : ( R2  0 ohms; Vadj  Vcc volts )
Gain  1 
R38
R37
 1
1k
10k
 1.1
Bias Adjustment Circuit
Output of the circuit:
Vout _ final  Vout ( Amp)  9V
where :
 9  Vout _ final  9V volts.
R
Case 2: at 50% of R2 : ( R2  2 ohms; Vadj  0 volts )
2
R38
Gain  1 
R
R37  41
2
1k
 1
50k
10k 
2
 1.029
Case 3: at 100% of R2 : ( R2  R2 ohms; Vadj  Vcc volts )
Gain  1 
R38
R37  R41
1k
10k  50k
 1.017
 1
Copyright 2005 by Saksit Siriprayoonsak
22
A/D Interface Card
•
•
•
•
NI 6220 M-Series Multifunction DAQ
Clock Speed: 8 Hz, up to 1 MHz
Analog Input Resolution: 16 bits
Number of Analog Input Channels: 8
Copyright 2005 by Saksit Siriprayoonsak
23
Final Product Assembly
• Circuit designed and tested on breadboard
• Schematic created by Multisim8
• PCB layout created by Ultiborad7
Copyright 2005 by Saksit Siriprayoonsak
24
Final Product Assembly (cont.)
• A schematic diagram is drawn using
Multisim8.
• Netlist contains all circuit connections.
• Netlist is transferred to Ultiboard7 for PCB
layout.
• PCB is a double layer (top copper layer
and bottom copper layer)
• Through holes connect between 2 layers.
Copyright 2005 by Saksit Siriprayoonsak
25
Final Product Assembly (cont.)
PCB shipped by the manufacturer
Copyright 2005 by Saksit Siriprayoonsak
26
Final Product Assembly (cont.)
PCB after soldering
Copyright 2005 by Saksit Siriprayoonsak
27
Calibration Procedure
• Each channel is individually calibrated.
• Input is equal to output (100 mV.)
• If an arbitrary gain is needed, the output is desired gain
value multiplied by input.
Copyright 2005 by Saksit Siriprayoonsak
28
EMG Capture
• Provides 3 play modes: Real-Time,
Record, and Playback mode.
• Able to save and open EMG data to/from
file.
• Display features:
– Voltage scales
– Time scales
– Readout of exact values
Copyright 2005 by Saksit Siriprayoonsak
29
EMG Capture: User Interface
Copyright 2005 by Saksit Siriprayoonsak
30
EMG Capture: Main Parameter Subpanel
• Working with Real-Time mode and Record
mode.
• Maximum Buffer Size (Samples per Channel)
• Sampling Rate (Hz)
Copyright 2005 by Saksit Siriprayoonsak
31
EMG Capture: Play Mode
Copyright 2005 by Saksit Siriprayoonsak
32
EMG Capture: Real-Time Mode
START
-
Start real time mode
STOP
-
Stop real time mode
Pause
-
Freeze output display for
examine interesting segments
or save the data
Resume
-
Resume real time mode
Save
-
Save data in buffer to file
Copyright 2005 by Saksit Siriprayoonsak
33
EMG Capture: Record Mode
START
Save
- Start to Record the
signals in specific
time range in
seconds.
- Save the data to file
Copyright 2005 by Saksit Siriprayoonsak
34
EMG Capture: Playback Mode
Open
- Open EMG data file (.emg)
Standard window open dialog
Copyright 2005 by Saksit Siriprayoonsak
35
EMG Capture: Voltage Scale
• Voltage scale is
independent for each
channel.
• Alternative voltage
scales:
–
–
–
–
–
200 mV/Div.
500 mV/Div.
1 V/Div.
2.5 V/Div.
5 V/Div.
Copyright 2005 by Saksit Siriprayoonsak
36
EMG Capture: Time Scale
• All channels use the
same time scale
• Alternative time
scales:
–
–
–
–
–
–
–
1 mSec/Div.
5 mSec/Div.
10 mSec/Div.
50 mSec/Div.
100 mSec/Div.
200 mSec/Div.
400 mSec/Div.
Copyright 2005 by Saksit Siriprayoonsak
37
EMG Capture: Time Slider
• Scroll time slider to view data from beginning to the end.
• The numbers on the left and right corner correspond to
the time stamp of the first and the last sample shown on
the output display screen.
• ‘5.416’ is 5 seconds and 416 milliseconds.
Copyright 2005 by Saksit Siriprayoonsak
38
EMG Capture: Readout
• Read extract value at pink vertical line
• Need not to compute the value of scale
• Unit: Time (sec) , Voltage (V)
Copyright 2005 by Saksit Siriprayoonsak
39
EMG Capture: Output Display
• Displays 4 channels
• Voltage: 4 divisions
– 2 positive divisions
– 2 negative divisions
• Time: 15 divisions
• Maximum Display:
– ±10 volts with 5 volts/Div.
– 6 seconds with 400
mSec/Div
Copyright 2005 by Saksit Siriprayoonsak
40
EMG Capture: Status Bar
• Guide user through the usage
• Display important message
eg. Number of samples that went into the buffer.
Copyright 2005 by Saksit Siriprayoonsak
41
EMGC Implementation
• Developed by using Microsoft Visual C++ tool
• GUI developed with MFC (Microsoft Foundation Class)
library
• Runs on Windows 2000 machine which has A/D
interface card installed
• A/D Interface Card: Multifunction Data Acquisition
(DAQ), M-6220 series from National Instrument
Company
Copyright 2005 by Saksit Siriprayoonsak
42
EMGC Implementation: Output Buffer Structure
struct SOutputData
{
int output_ii;
double time;
double volt1;
double volt2;
double volt1;
double volt1;
};
//Iteration start from 0
//Time stamp in Second
//Voltage value for CH1, CH2, CH3, and CH4
CArray <SOutputData, SOutputData> dumpDataArray;
• CArray class from MFC Library used to store
input signal data.
• CArray can dynamically shrink and grow if
necessary.
Copyright 2005 by Saksit Siriprayoonsak
43
EMGC Implementation: Creating Voltages and Time Scales
//For Calculation
double voltScaleSet[5]= {5.0, 2.5, 1.0, 0.5, 0.2};
//For Screen Display
CString voltScaleStrMap[5]
//unit in volt/div
= {“5 Volt/Div”, “2.5 Volt/Div”,
“1 Volt/Div”, “500 mVolt/Div”, “200 mVolt/Div”};
• Use spin control to select the scales.
• Spin control increase/decrease spin value by a
specific number of steps.
• Use spin value as the index of scale array.
Copyright 2005 by Saksit Siriprayoonsak
44
EMGC Implementation: Draw Grid for Graph Output
• Use CDC class (Class Device-Context object) to draw
output on the screen.
• The CDC class is a class from the MFC library.
• CDC provides various kinds of drawing functions
(working with drawing tool, converting the coordinates,
drawing rectangles, drawing circles, drawing text,
changing the color)
Copyright 2005 by Saksit Siriprayoonsak
45
EMGC Implementation: Draw Grid for Graph Output (cont.)
private:
//Variables for drawing output
int _maxTimeDiv; //Max number of divisions to display on Output-Panel
int _maxVoltDiv; //time axis = 15 divisions
//volt axis = 4 divisions (2 positive Divs)
//
(2 negative Divs)
int _ptsPerDiv;
//How many points are there in 1 division.
//1 point = 0.1 milimeter
//Default 100 points = 1 division is 1 cm wide
// ** Base on: Display Resolution= 1024 x 768
int _maxDrawPtsX;
int _maxDrawPtsY;
// _maxTimeDiv*_ptsPerDiv, Max Drawing Point for
// time
// _maxTimeDiv*_ptsPerDiv, Max Drawing Point for volt
//Default x=1500, y=400
Copyright 2005 by Saksit Siriprayoonsak
46
EMGC Implementation: Draw Grid for Graph Output (cont.)
Copyright 2005 by Saksit Siriprayoonsak
47
EMGC Implementation: Drawing Graph Output
The output can be drawn by using (x,y) coordinate to
specify position to draw.
Function CEMGCDlg::voltToDC()
 _ ptsPerDiv
  _ maxDrawPtsY 
drawValueY  
 volt   

vScale
2

 

Function CEMGCDlg::voltToDC()
 _ ptsPerDiv 
drawValueX  
   time  startTime 
 curTimeScale 
Copyright 2005 by Saksit Siriprayoonsak
48
EMGC Implementation: Saving Data Buffer To File
• File Extension (‘.emg’)
• Header line contains
– Sampling rate (HZ)
– Record time period (sec)
• Data speparate by a
‘space’.
• Each record separated by
a ‘carriage return’ (put in
front).
Copyright 2005 by Saksit Siriprayoonsak
49
EMGC Implementation: Read File To Data Buffer
• Read header file
– Sampling rate -> computes sampling period
– Record time period -> verifies the data file (completed or in
completed)
• Store data in buffer (dumpDataArray)
struct SOutputData
{
int output_ii;
double time;
double volt1;
double volt2;
double volt1;
double volt1;
};
//Iteration start from 0
//Time stamp in Second
//Voltage value for CH1, CH2, CH3, and CH4
CArray <SOutputData, SOutputData> dumpDataArray;
Copyright 2005 by Saksit Siriprayoonsak
50
Results
Our EMG Amplifier
ME3000 Muscle Tester
A comparison of cylindrical grasp recorded from our EMG amplifier and ME3000.
Copyright 2005 by Saksit Siriprayoonsak
51
Results (cont.)
Our EMG Amplifier
ME3000 Muscle Tester
A comparison of preshaping of cylindrical grasp recorded from our EMG amplifier and ME3000.
Copyright 2005 by Saksit Siriprayoonsak
52
Conclusion
 This thesis presents an implementation of EMG amplifier
device and EMG Capture program.
 Major problems were:
• To reduce noise, moving artifacts, system grounding and DC
bias.
 Problems solved through:
• Proper choice of discrete components (resistors, capacitors, and
ICs)
• Proper design of circuitry
• Final implementation of the device using PCB technology
• Systematic experimentation with the prototype (implemented on
a breadboard)
• Extensive testing of the device after implementation and
executing final corrections.
Copyright 2005 by Saksit Siriprayoonsak
53
Future Work
 EMG amplifier
• Smaller size of the housing unit.
• Eliminate electrode extensions
 EMG Capture program
• Add print feature
• Add properties feature for changing system
parameters
• Improve drawing ability
Copyright 2005 by Saksit Siriprayoonsak
54