DETAILED DESIGN REVIEW:
Wireless Assistive Control System
Project 08027
Todd Bentley, ISE
Vianna Muller, EE
Benjamin Danziger, EE
Peter “PJ” Drexel, EE
Jay Radharkrishnan, EE
James Corcoran, CE
Dr. Edward Brown, Advisor
November 2nd, 2007
RIT Multidisciplinary Senior Design 1
Design Review: Table of Contents
Function Diagram3
Front End4
Customer Needs for the Front End5
Strap Design7
BOM: Strap9
Controlling Hand Movements10
BOM: Electrodes10
Test for Deciding Electrodes10
Filter, Controller11
Customer Needs for the Filter and DSP11
Unfiltered EMG data13
Filter types14
Exploration of Crosstalk15
DSP 537 Architecture21
Control System Operation26
Processing Requirements and Specifications28
Audio System30
Audio Interface30
Audio Amplifier Design31
BOM: Speaker Amplifier31
Wireless System32
RC Car34
The QFD as it relates to the RC Car.34
Microcontroller35
Development Board36
Programmer38
RC Car Pseudo Code40
Visual Feedback42
BOM: RC Car45
Bill of Materials46
Design Review: Functional Diagram
Figure 1: Overall System Functional Diagram
Design Review: Front End
Figure 2: Front End Functional Diagram
Customer Needs for the Front End
Category / Nu. / Specification / Units / Ideal / Marginal / Puts EMG wires and electrodes close to desired location / Length of wires sufficient for most operators / Strap length sufficient to wrap arm of most operators / Velcro strong enough to hold without loosening / Wear resistant straps / Easily stored for extended periods of time / Rating of the appeal of the glove to the customer. / High strength thread used for construction / Guaranteed safety by manufacturer / Amplifier no more than 5 lbs / Electrodes must be grounded consistently / Wires should be thin and insulated / Wires must be easily able to connect to electrodes / DocumentationFront End / A
Directs/Protects EMG wires / A2 / Ergonomic Design, size / ft / 4 / ±1 / 3 / 3 / 1
Universal Fitment of glove / A3 / Ergonomic Design, size / ft / 2 / ±0.5 / 1 / 1 / 1
Universal Fitment EMG wires / A4 / Ergonomic Design, size / in / 8 / ±5 / 1 / 3
Aesthetic value ("coolness") / A5 / The "Fonze" Factor / N/A / N/A / N/A / 3 / 1
Secures EMG pads in place / A6 / Location of pads / N/A / N/A / N/A / 1 / 1
Durable / A7 / Material / N/A / N/A / N/A / 1 / 3 / 3 / 9
Comfortable to wear / A8 / Ergonomic Design, size / in / 8 / ±5 / 3 / 1 / 3 / 3 / 1 / 1
Safe Electrodes and Wires / A9 / Current into the body / A / None / None / 1 / 3 / 3 / 1
Electrode Size / A10 / Radius / Cm / 2 / 1 / 3 / 3 / 3 / 3
Anthropometric Summary(cm)
Wrist Breath / Elbow Breadth / Wrist to Elbow
Female / Male / Female / Male / Male
5th / 95th / 5th / 95th / 5th / 95th / 5th / 95th / 5th / 95th
4.6 / 5.9 / 5.3 / 6.6 / 5.7 / 7.7 / 6.4 / 8.2 / 31.9 / 41.1
The wrist to elbow dimension requires a maximum only since anyone with arms shorter than 41.1 centimeters will simply have a bit of slack between the wrist and elbow points.
Summary of Specs and Anthropometric Basis
Desired Spec / Strap / Anthropometric Data / Measure / Converted
Circumference around elbow / Elbow Strap / Elbow Breadth is the diameter of the elbow / 8.2 / 10.1
Circumference around wrist / Wrist Strap / Wrist Breadth is the diameter of the wrist / 6.6 / 8.2
Length of wrist to elbow / Connecting Tube / Relates to the Wrist to Elbow Distance / 41.1 / 16.2
Height from wrist to thumb / Thumb Strap / No anthropometric data exists for such a measure, convenient since it is not necessary to know. / N/A / N/A
The final column represents a conversion of the anthropometric data from a diameter to a circumference and converting the measure from centimeters to inches. The final lengths of each strap will need to overlap so an additional 3 inches was added for the Velcro overlaps.
--For the length of the wires from the electrodes to the pack anthropometric data was used combining the 95th percentile for the reach of the human male and the waist to shoulder height for the same male. The length of the thenar-to-pack wire was found to be 4.5 feet and the length of the finger flexors-to-pack wire was determined to be 3.5 feet. This would allow the operator to control the vehicle with his or her arms over their head.
**All Data Collected from NHANES/NCHS databases and Bodyspace by Stephen Pheasant.**
Page 1 of 46
Figure 3: Three-Dimensional View of the Strap
Figure 4: Strap Components with Measurements
Page 1 of 46
BOM: Strap
Primary SourcesItem / Quantity (Roll) / Total Price
1" Nylon Webbing / 1 - 50 ft Roll / $22.90
1" Nylon Web Tubing / 1 - 50 ft Roll / $20.50
2" Nylon Webbing / 1 - 50 ft Roll / $30.50
1.0" Duragrip ™ Black Hook Std / 1 - 25 ft Roll / $12.50
1.0" Duragrip™ Black Loop Sew-On / 1 - 25 ft Roll / $12.50
1" Ladder Locks / 10 @ $1.17 / $11.70
500 Denier Cordura Plus® / 1 yd / $13.40
Sub-total / $124.00
Est. Shipping / $20.00
Total / $144.00
Controlling Hand Movements
One potential problem is the differences in a person’s movements were that they produce varying signals. A solution to the problem is to have a hand controller that would limit the variation of movements from operator to operator. This hand controller would consist of something that will require the user to push inward using all four of their fingers, thus maximizing the potential created by their flexors. Also, this hand controller will be spring loaded, but testing purposes we would simply grip the controller we have now with reasonable force. On top of the hand controller, there will be an analog stick much like the current video game controller we are currently using. Ultimately, the analog stick would have to move in only one direction but for out tests we will only move it medially. This will control the contraction of the thenar muscle group in the thumb by forcing the user flex their thumb inward.
BOM: Electrodes
Item / Source / Amount / Cost / Status1025 passive electrode / The Electrode Store / 3 boxes / $165 / arrived
DDN 20 passive electrode / The Electrode Store / 20 packages / $110 / arrived
Part # 243 (with GND) / Noraxon, USA, Inc / 1 / TBD / getting quote
Part # 242 / Noraxon, USA, Inc / 1 / TBD / getting quote
This BOM pertains to the needs of the IRB and will depend on the following test.
Test for Deciding Electrodes
In order to decide which electrodes will work best, first we have to decide which type of electrode is preferred: active or passive. Active electrodes have a preamplifier closer to the muscle, thus improving the signal. Passive do not have this feature and depends on the amplification provided by the Grass Technologies QP511.
To compare, the Meditrace passive electrodes will be used in a series of movements with the electrodes places on the appropriate locations on their arm. Then, placing the active electrodes in the same locations and performing the same movements. Finally, the signals will be compared, after taking into account numerically for the pre-amplification by normalizing the gains, which makes a visual determination of the noise possible. Whichever produces the least noise will be the better choice. Our prediction is that the active electrodes will prevail. However in the case where there is no significant difference between the two signals concerning noise, the passive electrodes would be preferred since they are less expensive.
Design Review: Signal Processing
Figure 5: Data Processing Functional Diagram
Customer Needs for the Filter and DSP
Category / Number / Specification / Units / Ideal / Marginal / After A/D conversion, there is a large number samples / Number of inputs for each command and clarity / Documentation / Transfer RateFilter/DSP / B
Sampling Rate / B1 / Range / second / 10,000 / ±250 / 9 / 1
Acquisition Lines / B2 / Input / N/A / 4 / >4 / 9 / 1
Line to Transmitter / B3 / Output / 1 / 1 / 9
Line to Speaker / B4 / Output / N/A / 1 / 9 / 1
Implementation of Filter in the system
The 4 lines of on analog data enter DAQ and leave digitized and enter MATLAB. From here the filtration process will start. As of right now, a sampling frequency of 500Hz is being used, the thumb uses 5k amplification and the forearm muscle uses 50K amplification. After the data is obtained, the RMS is taken and then it will be filtered.
The movements used to obtain data will be categorized as A, B, C and D. The A and B movements are on the right arm and the C and D movements are on the left arm. The A and C movement uses the forearm muscles and the B and D movements use the thumb muscle.
In senior design II, the filtration process ADC will happen inside of the DSP along with the filtering. After the data is filtered, it is sent the control system to figure out how to handle the data further.
Some unfiltered data can be seen on the following page. Note that the period of activity is a rough estimate.
Page 1 of 46
Unfiltered EMG data after RMS
Figure 6: an example of the A movementFigure 7: another example of the A movement
(50K amplification)(50K amplification)
Figure 8: example of the B movementFigure 9: another example of the A movement
(5K amplification)(5K amplification)
Page 1 of 46
Filter types
From the International Encyclopedia of Ergonomics and Human Text, it is seen that the three main filters to look at are a Low pass, a High pass and Notch filter.
The low pass will be used with a 600hz cutoff frequency when working with surface EMG and 1000Hz when working with fine wire EMG to prevent aliasing. It is suggested to use an analog filter for this.
The High pass filter would be used with a 15 cutoff, due to the rapid hand movements to remove movement artifacts. It is suggested to use a 4th order Butterworth filter.
The notch filter is used at 60Hz to get rid of noise from power lines.
From Muscles Alive by J.V. Basmajian, the limits of the EMG frequencies were observed to be 20Hz to 1000Hz
Working with RMS data
When working with the EMG signal, we want to work with the RMS data (root mean squared). In order to replicate this on the grass QP511, the RMS function will have to be performed on the DSP.
An equation similar to this will have to be used.
Exploration of Crosstalk
Shown in the following graph is data obtained of a person doing the A movement with electrodes on both the arm and thumb. 50K amplification was used was the forearm while 5k was used on the thumb.
Figure 10: Crosstalk on Movement A
In the next graph is data obtained of a person doing the B movement with electrodes on both the arm and the thumb muscle group. 50K amplification was used was the forearm while 5k was used on the thumb.
Figure 11: Crosstalk on Movement B
With these two movements, there is minimal cross talk to be seen.
Smoothing Techniques
We looked at a couple of smoothing techniques to handle the data. We tried a moving average technique to make the data more workable.
Here is the code for the moving average:
Figure 12: Moving Average Code
Page 1 of 46
Figure 13: Both the original and smoothed signalFigure 14: The smoothed signal
Figure 15: The unsmoothed signal
Page 1 of 46
Control System
A proper model of the situation is necessary before designing the control system. This section extensively describes the model and logistics of the control system. How the control system fits into the overall project architecture is shown in the block diagram below. The controller and the digital filter is both implemented in the DSP processor.
Figure 16: System architecture under scrutiny
The Control system was designed qualitatively by modeling the situation at hand. For instance, the situation is presented where a muscle is flexed from its initial rest position at point (a) in the figure below to the point (b) and returned back to its original rest position. The user’s motion does not have to be like this; however it represents the range of force exerted by any muscle. The EMG data is recorded to process and develop the control system in a similar manner.
Figure 17: The range of movement of muscle under scrutiny
The figure 3 below shows how this can be represented through a graph. The points (a) and (b) from figure 1 is shown on the figure 2. This graph can be seen as the input to the controller. The only exception is that 4 different muscles excerpt properties in a similar manner. The 4 different muscles exhibit the same range of force. IT SHOULD BE NOTED THAT THESE GRAPHS ONLY MODEL THE SITUATION AND DOES NOT REFLECT ANY EMG DATA.
Figure 18: Controller input model
For this project we have 4 different muscular inputs that translate to subsequent outputs that go through a wireless transmitter to the RC car. For instance how one input is related to the output is shown in figure 4 below.
Figure 19: Relationship of EMG input data to move left to the output on the RC car
It can be noted that the EMG data to move right works in a similar way, except the output will be taking into account the range in which the tires of the RC car turn right. However, the input-output relation to move forward and backward is slightly different. This is more clearly shown in figure 5 below.
Figure 20: Relationship of EMG input data to move forward to the output of the RC car.
Here, it can be seen that the input is tied to the velocity of the RC car to move forward. The same relationship is applied to move the car backward. This whole modeling idea is influenced from fuzzy logic modeling. However, the lack of overlapping membership functions, made full fledged implementation of fuzzy logic unnecessary and impractical. However, concepts from fuzzy logic are used in this digital controller.
A much clear representation of this modeling is shown in figure 6 below.
Figure 21: The explicit modeling of the control system
Everything explained till now is shown in the figure above. How the force excerpted by the muscle should translate to the movement of the RC car is explained in the figure above. A further explanation of how this is done in the DSP processor is explained below.
DSP 537 Architecture
Figure 22: BF537 Board Architecture
It can be seen from the figure above that the processor does not have an in-built ADC or DAC. The ADC and DAC are both peripheral devices on the Development board.
General-Purpose IO
This section describes general-purpose IO signals that are controlled by means of setting appropriate registers of the flash A or flash B. These registers are mapped into the processor’s address space, as shown below.
Table 1: Flash Memory Map on BF533
Flash device IO pins are arranged as 8-bit ports labeled A through G. There is a set of 8-bit registers associated with each port. These registers are Direction, Data In, and Data Out. It could be noted that the Directionand Data Outregisters are cleared to all zeros at power-up or hardware reset. The Directionregister controls I/O pins direction. When a bit is 0, a corresponding pin functions as an input. When the bit is 1, a corresponding pin is an output. This is an 8-bit read-write register.
The Data Inregister allows reading the status of port’s pins. This is an 8-bitread-only register.The Data Outregister allows clearing an output pin to 0 or setting it to 1.
This is an 8-bit read-write register.
Table 2: Flash A configuration registers for Ports A and B
Figure 8: ADC connector jack on the development board
The EMG signals need to be hooked up directly the four input pins of J5, these input pins are hooked up to the ADC at pins 16-19, and pins 22-26.This is clearly shown in the figure below. Also, the analog signal is amplified by ADI amplifier that has a 120 dB open loop gain, low noise, low input bias current and low offset voltage.
Figure 23: Audio Codec with ADC and DAC pins
The figure above also shows the pins for serial communication, these are pins SCK MOSI MISO and PF4 (Pins: 50, 51, 2, and 49). The MOSI signal is for the SPI bus, and MISO is the pin through which data is brought to the board through the 90-pin connector. This is clearly shown in figure 9 and 10.
However, the reset for the ADC (AD1836) is controlled by the GPIO pin PA0 in flash A. How it is connected on the 90-pin connector is shown in figure 10 below. Also, the pins of interest are circled in red as seen in the figure. The GPIO’s subsequent connection on the processor is shown in figure 11. The serial peripheral interface (SPI) of the ADSP-BF533 processor connects to the AD1836 audio codec and the expansion interface. The SPI connection to the AD1836 is used to access the control registers of the device. The PF4 flag of the processor is used as the devices select for the SPI port. The SPI signals are available on the expansion interface and on the SPI connector (P6). The inputs are available on the board as two stereo headphone jacks. These inputs are then connected to IN1R+/-, IN1L+/- and IN2R+/-, IN2L+/- respectively on the AD1836 chip. This is clearly shown in figures 8 and 9.
Figure 24: J2 connector on the Development board
Analog-to-Digital Converter (ADC)
The AD1836 is a high-performance, single-chip codec providing three stereo DACs and two stereo ADCs. A SPI port is included, allowing a microcontroller to adjust volume and many other parameters. On the ADC, the analog inputs are multiplexed on a single ADC per channel.As shown in the figure below the left channels are multiplexed on one ADC and both right channels are multiplexed on the other ADC. In the figure below, it can be seen there are four inputs to the ADC. The four EMG signals will be hooked up to these inputs. Therefore, the right arm’s data will be connected the AIN2L1 and AIN2L2, and the left arm’s data will be connected to AIN2R1 and AIN2R2. These inputs are selected because the ADC will be operating in the Time-Division Multiplexed (TDM) mode.
Figure 11: Functional Block Diagram of the ADC(AD1836)
Control System Operation
How the control system functions will be explained in detail in this section. At this point, it is assumed that the digital filter cleans out the raw EMG data. The filtered EMG data is fed to the controller; this is clearly shown in the figure below.