Detailed Design Review

Total Page:16

File Type:pdf, Size:1020Kb

Detailed Design Review

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

Page 1 of 41 Design Review: Table of Contents

Function Diagram 3 Front End 4 Customer Needs for the Front End 5 Strap Design 8 BOM: Stra 10 Filter, Controller 11 Customer Needs for the Filter and DSP 11 Unfiltered EMG data 13 Filter types 14 Exploration of Crosstalk 15 16 DSP 537 Architecture 19 CONTROL SYSTEM OPERATION 22 PROCESSING REQUIREMENTS AND SPECIFICATIONS 23 Audio System 25 Audio Analog-to-Digital Converter (ADC) 25 Wireless System 26 RC Car 28 The QFD as it relates to the RC Car. 28 Microcontroller 29 Development Board 31 Programmer 33 RC Car Pseudo Code 35 Visual Feedback 37 BOM: RC Car 40 Bill of Materials 41

Page 2 of 41 Design Review: Functional Diagram

R i g h t T h u m b L e f t T h u m b L e f t F i n g e r s R i g h t F i n g e r s

D S P D S P : A m p l i f i e r D e v e l o p m e n t F i l t e r a n d C o n t r o l l e r G r a s s T e c h . B F 5 1 1 ( f o r B o a r d B l a c k F i n n 5 3 3 B l a c k F i n n 5 3 3 ) R F T X S p e a k e r

T r a n s m i t t e d C o m m a n d s S o u n d L e f t M o t o r R F R X M i c r o C o n t r o l l e r R i g h t A T t i n y 2 3 1 3 M o t o r F o r w a r d R e v e r s e

Figure 1: Overall System Functional Diagram

Page 3 of 41 Design Review: Front End

R i g h t T h u m b L e f t T h u m b L e f t F i n g e r s R i g h t F i n g e r s

D S P D S P : A m p l i f i e r D e v e l o p m e n t F i l t e r a n d C o n t r o l l e r G r a s s T e c h . B F 5 1 1 ( f o r B o a r d B l a c k F i n n 5 3 3 B l a c k F i n n 5 3 3 ) R F T X S p e a k e r

T r a n s m i t t e d C o m m a n d s S o u n d L e f t M o t o r R F R X M i c r o C o n t r o l l e r R i g h t A T t i n y 2 3 1 3 M o t o r F o r w a r d R e v e r s e

Figure 2: Front End Functional Diagram

Page 4 of 41 Customer Needs for the Front End d e r i s s r e o s t . d r e

a r e d o t g e o

m r n p e t i o s c o t s n

r s o t e e l l n y o s u s l e c t e t o c o o i a m t n s r o i o e m t l t c e e e

t h f t t f u d t p s r c o i u o r t o o

r o s e

o s e d t t s t r n n m h n c e s d r t u t e o n i o t e o o a l v c a i o c c l w r e o c m r p a l u d

e f d r o s a d l g s e o p f u

r t o

n n o b d f i n e l

w d d a h n e

t a l h d e e t 5 u n o s o b t d s n m t f o

e e

n a r i t u a n r o y i h s a c g n e l y i

t d b n l f g p h w i i

e a t f

i x n e a u a s y h e u c r e t b t o e i o e G i t a

s p r f r t e t r

n s f e f e p h

M o a s s o t u e t n a b f a c e u

E e s i n o s m l r h i g b d i d e t t a m l s p h n t o d t t e t h g a w u p s r t t s s o e n u i g n f r o f o n A e u t e s r P t n e

o t h o e s r f d

e e s n e s m t n i l r o o h f

s m o g o i r t a y i r l s s r l t r t p n u i e g i a h p e e c c a a a t c l s s r r n r e g i i e c u a i o t e a m a l e o

Category Nu. Specification Units Ideal Marginal l L S V W E R H G A E E W W D Front End A Directs/Protects Ergonomic EMG wires A2 Design, size ft 4±1 3 3 1 Universal Fitment Ergonomic of glove A3 Design, size ft 2±0.5 1 1 1 Universal Fitment Ergonomic EMG wires A4 Design, size in 8±5 1 3 Asthetic value The "Fonze" ("coolness") A5 Factor N/A N/A N/A 3 1 Secures EMG Location of pads in place A6 pads N/A N/A N/A 1 1 Durable A7 Material N/A N/A N/A 1 3 3 9 Comfortable to Ergonomic wear A8 Design, size in 8±5 3 1 3 3 3 1 1 Safe Electrodes Current into and Wires A9 the body A None None 1 3 3 1

Electrode Size A10 Radius Cm 2 1 33 9 3 3

Page 5 of 41 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 Strap Anthropometric Data Measure Converted Spec Circumference Elbow Breadth is the diameter of the Elbow Strap 8.2 10.1 around elbow elbow Circumference Wrist Strap Wrist Breadth is the diameter of the wrist 6.6 8.2 around wrist Length of wrist Connecting Relates to the Wrist to Elbow Distance 41.1 16.2 to elbow Tube No anthropometric data exists for such a Height from Thumb Strap measure, convenient since it is not N/A N/A wrist to thumb necessary to know.

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.

Page 6 of 41 Page 7 of 41 Figure 3: Three-Dimensional View of the Strap

Page 8 of 41 Figure 4: Strap Components with Measurements

Page 9 of 41 BOM: Strap

Primary Sources Quantity Item (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

Page 10 of 41 Design Review: Signal Processing

R i g h t T h u m b L e f t T h u m b L e f t F i n g e r s R i g h t F i n g e r s

D S P D S P : A m p l i f i e r D e v e l o p m e n t F i l t e r a n d C o n t r o l l e r G r a s s T e c h . B F 5 1 1 ( f o r B o a r d B l a c k F i n n 5 3 3 B l a c k F i n n 5 3 3 ) R F T X S p e a k e r

T r a n s m i t t e d C o m m a n d s S o u n d L e f t M o t o r R F R X M i c r o C o n t r o l l e r R i g h t A T t i n y 2 3 1 3 M o t o r F o r w a r d R e v e r s e

Figure 5: Data Processing Functional Diagram

Customer Needs for the Filter and DSP h c a y t i e ,

r r n a l o o f i c h

s g s r i d t e h n u n

v a p s o

i i n n

t d i o

g a n f c t

n a o i n l

D r e / p m e A m m m b r u a o m c e s c t u o f

Category Number Specification Units Ideal Marginal A N D Filter/DSP B Sampling (Digital per line) B1 Range second 500±250 9 1 Sampling Lines B2 Input N/A 4>4 9 1 Speaker, Analog Output B3 Output N/A 1 9 1

Page 11 of 41 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.

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 process the data further.

Page 12 of 41 Unfiltered EMG data after RMS T e s t 1 - 2 b e n t h u m b r i g h t 2 4 4

3 . 5 3 . 5

3 3

2 . 5 2 . 5 ) ) v v ( (

e e g 2 g 2 a a t t l l o o v v 1 . 5 1 . 5

1 1

0 . 5 0 . 5

0 0 0 0 . 5 1 1 . 5 2 2 . 5 3 3 . 5 4 4 . 5 5 0 0 . 5 1 1 . 5 2 2 . 5 3 3 . 5 4 4 . 5 5 t i m e ( s ) t i m e ( s ) Figure 6: an example of the A movement with a hold Figure 7: example of the B movement (20K amplification) (5K amplification) T e s t 1 1 L - 2 T e s t A - 1 a r m 4 4

3 . 5 3 . 5

3 3

2 . 5 2 . 5 ) ) v v ( (

e e g g 2 2 a a t t l l o o v v 1 . 5 1 . 5

1 1

0 . 5 0 . 5

0 0 0 1 2 3 4 5 6 0 0 . 5 1 1 . 5 2 2 . 5 3 3 . 5 4 4 . 5 5 t i m e ( s ) t i m e ( s ) Figure 8: example of the B movement with a hold Figure 9: example of the A movement (5K amplification) (20K amplification)

Page 13 of 41 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.

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 telefactor, the RMS function will have to be performed on the DSP.

An equation similar to this will have to be used.

(X 2  X 2  X 2  ...  X 2 ) Xrms  1 2 3 n n

Page 14 of 41 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.

C r o s s t a l k w i t h m o v e m e n t A 4 . 5

4

3 . 5

3

2 . 5 ) v (

e

g 2 a t l o v 1 . 5

1

0 . 5

0

- 0 . 5 0 1 2 3 4 5 6 7 8 9 1 0 t i m e ( s ) 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 thenar muscle group. 50K amplification was used was the forearm while 5k was used on the thumb.

C r o s s t a l k w i t h m o v e m e n t B 4 . 5

4

3 . 5

3

2 . 5 ) v (

e

g 2 a t l o v 1 . 5

1

0 . 5

0

- 0 . 5 0 1 2 3 4 5 6 7 8 9 1 0 t i m e ( s ) Figure 11: Crosstalk on Movement B

With these two movements, there is minimal cross talk to be seen.

Page 15 of 41 Control System

The control system along with the situation is properly modeled here. 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.

DIGITAL CONTROL WIRELESS FILTER SYSTEM Tx

Figure 12: 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 motion any muscle can have. The EMG data is recorded to process and develop the control system in a similar manner.

Figure 13: The range of movement of muscle under scrutiny

The figure below shows how this can be shown through a graph. The points (a) and (b) from figure above is shown on the figure above. This graph can be seen as the input to the controller. The only exception is that 4 different muscles excerpt properties to a similar model. 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.

Page 16 of 41 Figure 14: 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 below.

Figure 15: 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 below.

Page 17 of 41 Figure 16: 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 fully 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 below.

Figure 17: 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.

Page 18 of 41 DSP 537 Architecture

Figure 18: 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/DAC is on the Development board.

General-Purpose I/O Modules The processor supports 48 bidirectional or general-purpose I/O (GPIO) signals. These 48 GPIOs are managed by three different GPIO modules, which are functionally identical. One is associated with port F, one with port G, and one with port H. Every module controls 16 GPIOs available through the pins PF15–0, PG15–0, and PH15–0. Each GPIO can be individually configured as either an input or an output by using the GPIO direction registers (PORTxIO_DIR). When configured as output, the GPIO data registers (PORTFIO, PORTGIO, and PORTHIO) can be directly written to specify the state of the GPIOs.

The GPIO direction registers are read-write registers with each bit position corresponding to a particular GPIO. Logic 1 configures a GPIO as an output, driving the state contained in the GPIO data register if the peripheral function is not enabled by the function enable registers. Logic 0 configures a GPIO as an input.

Note when using the GPIO as an input, the corresponding bit should also be set in the GPIO input enable register. Otherwise, changes at the input pins will not be recognized by the processor. The GPIO input enable registers (PORTFIO_INEN, PORTGIO_INEN, and PORTHIO_INEN) are used to enable the input buffers on any GPIO that

Page 19 of 41 is being used as an input. Leaving the input buffer disabled eliminates the need for pull-ups and pull-downs when a particular PFx, PGx, or PHx pin is not used in the system. By default, the input buffers are disabled.

Once the input driver of a GPIO pin is enabled, the GPIO is not allowed to operate as an output anymore. Never enable the input driver (by setting PORTxIO_INEN bits) and the output driver (by setting PORTxIO_DIR bits) for the same GPIO. A write operation to any of the GPIO data registers sets the value of all GPIOs in this port that are configured as outputs. GPIOs configured as inputs ignore the written value. A read operation returns the state of the GPIOs defined as outputs and the sense of the inputs, based on the polarity and sensitivity settings, if their input buffers are enabled.

The GPIO pins on the processor are also hooked up to various switches on the board, which can be accessed only when the switches are turned OFF.

The figures below show the detailed review of the processor and its GPIOs. Here, four GPIOs are used as the input for the four EMG signals, before they are filtered. These four pins are pins 47, 48, 49, 50 on connector J2 this is connected to the PG ports 8-11. This is circled in figure 9, also the particular EMG input data is also labeled. All four of these pins are hooked up to the PG port on the processor as shown in figures 8 and 9.

Figure 19: GPIOs in the BF537 processor

Page 20 of 41 Figure 20: J2 connector on the Development board It is apparent from the functional diagram that there needs to be one GPIO for the wireless transmitter. This is PG13 which will be connected to the J2 connector.

Page 21 of 41 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.

LEFT INPUT

DIGITAL FILTERED RIGHT CONTROL WIRELESS FILTER DATA INPUT SYSTEM TRANSMITTER

FORWARD INPUT

BACKWARD INPUT

Figure 21: Detailed operations diagram of the control system

The controller accepts the inputs and transmits 8 bits of data as the output through the wireless transmitter. The controller logic is pretty important in deciding the output and is briefly explained here. The truth table clearly shows the situations in which a particular output can be high.

Left (i) Right (i) Forward(i Reverse(i) Left(o Right(o Forward(o Reverse(o) ) ) ) ) 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 0 1 1 0 0 1 1 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 1 1 0 0 0 1 1 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 0 0 Table 1: Truth Table for the input-output relation

The truth table can be summarized to the follow assumptions: Left output is high when the Left input is high and when the Right input is low. Right output is high when the Right input is high and when the Left input is Low. Forward input is high when the Forward input is high and when the Reverse input is low. Reverse input is high when the Reverse input is high and when the Forward input is low.

Page 22 of 41 Depending on the inputs, the output that will go through the wireless transmitter is an 8 bit number. How the 8- bit data is allocated is shown in the figure below.

e e d d u u it it gn gn gn a gn a Si M Si M Bit #: 7 6 5 4 3 2 1 0 Right/Left Forward/Reverse

Figure 22: Bit allocation for the 8-bit output

From the above figure, it is apparent that there are 16 positions for forward/Reverse Directions and 16 positions for Left and Right Directions.

All of this information is integrated using the following pseudo code: a= 4bits of information for right/left turn b=4bits of information for forward/reverse direction If (left amplitude > right amplitude) Then (resulting left turn= (left – right) of a’s left magnitude) If (right amplitude > left amplitude) Then (resulting right turn = (right-left) of signed a’s magnitude) If (right amplitude = left amplitude) Then (a=0000)

If (forward amplitude > reverse amplitude) Then (resulting forward magnitude = (forward – reverse) b magnitude) If (reverse amplitude > forward amplitude) Then (resulting reverse magnitude = (reverse – forward) signed b magnitude) If (forward amplitude = reverse amplitude) Then (b=0000) This clearly means that each direction’s magnitude is divided into 8 divisions. Also, the control system is itself an open loop control system were the only feedback is the user’s eyes. Also it can be seen the user is the actual control system while the digital controller could be seen as a simple interface, since no major control algorithm is being used there.

PROCESSING REQUIREMENTS AND SPECIFICATIONS

For this project the Nyquist frequency is assumed to be around fN= 1kHz. Thus: fS ~ 10 fN = 10kHz Therefore: BW = 10kHz Thus the dynamic range for the Analog to Digital converter is from 1 kHz to 10 kHz. This results in a dynamic range of 23.52dB.

A total of 6 GPIOs are needed, 4 GPIOs for the 4 EMG channels, 1 GPIO as the output from the controller to wireless transmitter. Also 1 GPIO is needed for the audio feedback that was added in this project.

Page 23 of 41 The 4 EMG input signals needs to be sampled simultaneously than serially. Although multiplexing 2 inputs such as forward and reverse as one along with right and left as another might workout.

This results in a resolution of 8 bits or higher. Thus the skew rate is .

The propagation delay for the GPIOs is assumed to be something less than the clock cycle on the DSP board.

Time frame for the DSP

Fidelity of the Signal is tested by conducting the dynamic and static tests. A good shape of the curve is anticipated before it’s generated from various tests. The possibility of getting an unwanted signal is limited.

The 8 bit output has a refresh rate with the maximum of 4800 baud rate. This translates to a maximum transfer of 150 transfers/sec. The normal human eye can perceive about 26 frames/sec. Any, transfer rate higher than that, will work in this case.

Page 24 of 41 Design Review: Audio System

R i g h t T h u m b L e f t T h u m b L e f t F i n g e r s R i g h t F i n g e r s

D S P D S P : A m p l i f i e r D e v e l o p m e n t F i l t e r a n d C o n t r o l l e r G r a s s T e c h . B F 5 1 1 B o a r d ( f o r B l a c k F i n n 5 3 3 B l a c k F i n n 5 3 3 ) R F T X S p e a k e r

T r a n s m i t t e d C o m m a n d s S o u n d L e f t M o t o r R F R X M i c r o C o n t r o l l e r R i g h t A T t i n y 2 3 1 3 M o t o r F o r w a r d R e v e r s e

Figure 23: Audio Capability Functional Diagram

Audio Analog-to-Digital Converter (ADC)

The ADC is AD1871 96 kHz analog-to-digital codec (ADC); it also has a DAC, which is AD1854 96 kHz digital-to-audio codec (DAC). It also has 1 input stereo jack and 1 output stereo jack. This should be enough for Audio evaluation processes. The AD1871 is a stereo audio ADC intended for digital audio applications requiring high performance analog-to-digital conversion. It features two 24-bit conversion channels each with programmable gain amplifier (PGA), multi-bit sigma-delta modulator and decimation filters. Each channel provides 97 dB of THD+N and 107 db of Dynamic Range making the AD1871 suitable for applications such as Digital Audio Recorders and Mixing Consoles. On the other hand, the AD1854 is a high performance, single- chip stereo, audio DAC delivering 113 dB Dynamic Range and 112 dB SNR (A-weighted—not muted) at 48 kHz sample rate. It is comprised of a multibit sigma-delta modulator with dither, continuous time analog filters and analog output drive circuitry. Other features include an on-chip stereo attenuator and mute, programmed through an SPI-compatible serial control port. The AD1854 is fully compatible with current DVD formats; including 96 kHz sample frequency and 24 bits. It is also backwards compatible by supporting 50 ms/15 ms digital de-emphasis intended for "redbook" 44.1 kHz sample frequency playback from compact discs.

The AD1854 has a very simple but very flexible serial data input port that allows for glue less interconnection to a variety of ADCs, DSP chips, AES/EBU receivers and sample rate converters. The AD1854 can be configured in left-justified, I 2 S, right-justified, or DSP serial port compatible modes. The AD1854 accepts serial audio data in MSB first, twos-complement format. A power-down mode is offered to minimize power consumption when the device is inactive. The AD1854 operates from a single 5 V power supply.

Page 25 of 41 Design Review: Wireless Communication

R i g h t T h u m b L e f t T h u m b L e f t F i n g e r s R i g h t F i n g e r s

D S P D S P : A m p l i f i e r D e v e l o p m e n t F i l t e r a n d C o n t r o l l e r G r a s s T e c h . B F 5 1 1 B o a r d ( f o r B l a c k F i n n 5 3 3 B l a c k F i n n 5 3 3 ) R F T X S p e a k e r

T r a n s m i t t e d C o m m a n d s S o u n d L e f t M o t o r R F R X M i c r o C o n t r o l l e r R i g h t A T t i n y 2 3 1 3 M o t o r F o r w a r d R e v e r s e

Figure 24: Wireless Functional Diagram

Wireless System The wireless link between the DSP and RC car consists of a paired ASK transmitter module with an output of up to 8mW depending on power supply voltage and a receiver with a sensitivity of 3uV.  Frequency: 434 MHz

 Range: 500 ft

 Max Data Throughput: 4800bps

 Transmitter Voltage Range: 2 – 12V

 Receiver Voltage Range: 4.5 – 5.5V

 Optional Antenna: 30-35cm of wire

 From development board: 5V

Page 26 of 41 Figure 25: Wireless Transmitter/Receiver Hardware

Page 27 of 41 Design Review: RC Vehicle

R i g h t T h u m b L e f t T h u m b L e f t F i n g e r s R i g h t F i n g e r s

D S P D S P : A m p l i f i e r D e v e l o p m e n t F i l t e r a n d C o n t r o l l e r G r a s s T e c h . B F 5 1 1 ( f o r B o a r d B l a c k F i n n 5 3 3 B l a c k F i n n 5 3 3 ) R F T X S p e a k e r

T r a n s m i t t e d C o m m a n d s S o u n d L e f t M o t o r R F R X M i c r o C o n t r o l l e r R i g h t A T t i n y 2 3 1 3 M o t o r F o r w a r d R e v e r s e

Figure 26: Robot Functional Diagram

The QFD as it relates to the RC Car.

Page 28 of 41 s s s d g n i d o

Ideal Marginal e n o s l i i l v n t s s r o a a a a r e t t h s e m n l / n c e

s p m o l

l e o m y C a l v

c l u i

r y m c a l i F d s c o

i s l R t l y D

a l e a e

E e h f

v t v i i o e s t

l e l e c a c i l o a r e

h e t r r

s e

n i t

e s V o e c l b u

c t t i M s n

h u e e e i l c c M V i i f f h e E V

Category Number Specification Units Proof of Concept C Chassis C1.1 Length in 12 20 1 1 3 1 C1.2 Width in 6 8 1 1 3 1 C1.3 Max Weight lb < 10 < 20 1 1 1 Control C2.1 Transmission range m 150 50 3 1 C2.2 Minimum turning radius ft 2 5 3 1 C2.3 Accuracy of Path in ±3 ±3 1 1 µProcessor C3.1 Sufficient PWMs # 2 2 9 1 Power C4.1 Minimum battery life min 60 45 3 1 C4.2 Minimum battery supply voltage V 6 >6 3 1 Microcontroller The microcontroller being used for the task of controlling the vehicle is the ATTiny2313.  Up to 20 MHz operating frequency

 8bit processor

 15 I/O Lines

 UART compatible pins

 Data and Non-volatile program and data memories

o 2K Bytes In-System Self Programmable Flash

o 128 Bytes In-System Programmable EEPROM

o 128 Bytes Internal SRAM

 One 8bit Timer/Counter

 One 16bit Timer/Counter

 Four PWM Channels

 Operating Voltage Range: 2.7 – 5.5V (@10MHz) Figure 27: ATtiny 2313 Microcontroller

 Typical Power Consumption

Page 29 of 41 o Active Mode

. 1MHz, 1.8V: 230uA

o Power-down Mode

. <0.1uA at 1.8V

Page 30 of 41 Microcontroller Development Board:

Figure 28: Microcontroller Development Board Schematic

Page 31 of 41 Microcontroller Development Board:

Description:

Prototype board for 20 pin AVR microcontrollers with power supply circuit, crystal oscillator circuit, RS232 port, reset IC, status LED, 10 pin STK ICSP port.

 ICSP 5x2 pin connector for in-circuit programming with AVR Programmers  Voltage regulator +5V or 3.3V, LM317  Quartz crystal oscillator circuit: 10Mhz  Reset IC ZM33064  Status LED connected to PB7 via removable jumper  AGND-GND AVCC-VCC jumpers  DIL28 microcontroller socket  RS232 DB9 female connector  RS232 MAX232 interface circuit with Tx, Rx, CTS, DTR/RTS signals  Extension slot on every uC pin  Grid 100 mils  GND bus  Vcc bus

Page 32 of 41 Microcontroller Programmer: Description: AVR-PG1B is programmer based on serial port PonyProg design. It takes the power supply from the target board. The connector is 2x5 pin with 0.1" step and Atmel STKxxx compatible layout.

Figure: Microcontroller Programmer

Page 33 of 41 C9 U1

22p 5 20 Q 4 PA0/XTAL1 VCC V1 PA1/XTAL2 C10 10 MHz 1 2 R3 C11 22p PA2/RESET/DW PD0/RXD 3 3.3Vdc PD1/TXD 1k 100n 0 12 6 1 13 PB0/AIN0/PCINT0 PD2/CKOUT/XCK/INT0 7 U4A 14 PB1/AIN1/PCINT1 PD3/INT1 8 BUT PB2/OC0A/PCINT2 PD4/T0 4 15 9 0 5 VCC 3 16 PB3/OC1A/PCINT3 PD5/OC0B/T1 11 6 VCC Data 2 17 PB4/OC1B/PCINT4 PD6/ICP 2 Right 7 GND Data ICSP 18 PB5/MOSI/DI/SDA/PCINT5 Side 8 GND 1 ICSP 19 PB6/MISO/DO/PCINT6 ANT GND ICSP PB7/UCSK/SCK/PCINT7 0 MO-RX3400 10 GND

ATTINY2313 U6 0 R4 1 15 R5 0 2 A0 Y0 14 R6 100 3 A1 Y1 13 R7 100 Wireless receiver Microcontroller A2 Y2 12 R8 100 Y3 11 R9 100 U3 Y4 10 R10

7 100 LMD18200 Y5 9 R11 100 Y6 7 D Y Y7 100 L

N 3

P DIRECTION INPUT 100 U P

U2 O U 1 9 5 74F138 Left R S 3 5 4 1 1

THERMAL FLAG OUTPUT PWM INPUT LMD18200 G Side R E

1 8 4 2 T T T

CURRENT SENSE OUTPUT BRAKE INPUT W U U U P P P P P O A A 10 11 P N N N R R

I I I OUTPUT 2 BOOTSTRAP 2

T T

2 S 1 E S S N

M C6 OUTPUT 1 V BOOTSTRAP 1 K T T O W I C7 A O O P T 6 R O O C B

B B C5 E U5B R 10n I 10n

D 18 17 7 GND VCC 10n GROUND 6 DC Motor VS POWER SUPPLY

T Steering U T P U

0 T P U

T V2 O U

E 6Vdc O

S G N A E L S F C5

2 1 T L

A N

T 10n T E M U U R P P R Rear R T T E 0 U U U H U7 T C O O R12 1 15 R13 9 8 0 2 A0 Y0 1 2 14 R14 100 3 A1 Y1 13 R15 100 A2 Y2 12 100 Y3 11 100 Y4 10 18 17 Y5 9 R19 GND VCC Y6 7 100 DC Motor Y7 Acceleration Motor Controls 74F138

R16 R18 100 100

R17 100 0

Visual Feedback

Title RC Vehicle Schematic

Size Document Number Rev B 1

Date: Wednesday , October 31, 2007 Sheet 1 of 1 Figure 29: RC Vehicle Circuit Schematic

Page 34 of 41 RC Car Pseudo Code: The RC Car must accept digital control information from a wireless source and translate this information into direction and magnitude information which will control the motors. The RC vehicle will utilize interrupt driven subroutines for both of these tasks. As shown in the Vehicle Circuit Schematic, the wireless transmitter will interface directly to the microprocessor through a digital input on pin 16 (PB4). Upon receiving data an interrupt will be thrown causing the received data to be verified. To indicate the beginning of a data transmission the transmitter will send a header byte having neutral disparity (eg. 0xAA, 0x55). Upon identifying this byte subsequent data will be accepted, otherwise the byte is dropped and further data is not analyzed. Upon receiving a header successfully two additional bytes will be accepted. The first is the data byte and the second is its compliment. If the addition of these two bytes is equal to zero, the first byte will be stored for later use in the motor control subroutine. The design of this communications protocol will limit data transfer to a maximum of 150 samples/sec. The motor control subroutine references a stored byte to update the motor control parameters. This subroutine is executed at a set interval and in effect will control how frequently the robots motor parameters will be changed. This subroutine will parse the stored data byte for direction and magnitude information for the forward/reverse and left/right motors. It is estimated that code requirements to implement the functions necessary for the operation of the vehicle to be approximately 1K bytes. //Receive wireless data //Enter from receive interrupt wait: Read in a byte from the serial connection Clear Receive Interrupt and Disable interrupts

If byte is equal to start byte Get byte1 Get byte2 //We expect byte2 to be the compliment of byte1 If( byte1 + byte2 == 0) store byte1 to MotorByte else Toss bytes else continue to wait for start byte

Enable interrupts

//Setup Motors //Enter from timed interrupt at least 30 times/sec //Forward/Reverse Motor Controls mask upper four bits of MotorByte Set fwd/rvs direction based on bit 3 Set fwd/rvs PWM based on bits 0-2

Move lower 3 bits to mux to update fwd/rvs LEDs

//Right/Left Motor Controls shift MotorByte right 4 mask upper four bits of MotorByte Set left/right direction based on bit 3 Set left/right PWM based on bits 0-2

move lower 3 bits to mux to update left/right LEDs

Figure 30: RC Car Circuit Board Placement Mock-U

Page 35 of 41 Figure 31: RC Car Circuit Board Placement Mock-Up

Page 36 of 41 Visual Feedback Concern was expressed in the proposed control design in the fact that there will be little feedback to the user to indicate how the vehicle is responding to a user’s actions. One mechanism devised to provide feedback on the actions being received by the vehicle is through lighted indicators on the sides and rear of the vehicle. It is intended that these be composed of individual LEDs aligned linearly on the sides and rear of the vehicle (as shown in the images to follow). These lights would range in color from green yellow  red. The different colors will be used to indicate a magnitude of direction. For example, if the user is turning left, the LEDs at the back of the vehicle will light the left half of the LEDs according to the magnitude of the direction. Similarly if a user is driving forward, the lights positioned at the side of the vehicle will light indicating magnitude of direction in the forward or reverse direction. These Lights will be connected to a 3-to-8 multiplexor which in turn will connect to the digital outputs of the ATtiny2313. A total of 8 discrete levels of magnitude will be able to be indicated in the left/right directions and the forward/reverse directions. The lights will be installed behind a plastic cover which lies flush with the truck body. The plastic cover and the packages of the LEDS can be sanded to help diffuse the light and create the appearance of a clean transition between colors.

Page 37 of 41 Figure 32: RC Car Side Lighting Mock-Up

Page 38 of 41 Figure 33: RC Car Rear Lighting Mockup

Page 39 of 41 BOM: RC Car

RC Vehicle BOM Component Quantity Retail Link Cost/Item Total Component Cost ATtiny2313 3 Link $2.88 $8.64 AVR Dev board 1 Link $16.95 $16.95 Power Supply 1 Link $5.95 $5.95 Serial Cable 1 Link $3.95 $3.95 Programmer 1 Link $12.95 $12.95 H Bridge 1 Sampled $0.00 $0.00 DC Motor (Forward/Reverse) 1 From RC Car $0.00 $0.00 DC Motor (Left/Right) 1 From RC Car $0.00 $0.00 Wireless Link 315MHz 1 Link $16.95 $16.95 Wireless Link 434MHz 1 Link $16.95 $16.95 RC Car 1 WalMart $19.97 $19.97

5mm Red LED 20 Link (152805) $0.19 $3.80 5mm Green LED 20 Link (1586197) $0.65 $13.00 5mm Yellow LED 20 Link (152792) $0.17 $3.40 3-to-8 Multiplexor 10 Link (835315) $0.20 $2.00 10 pin 100Ω Resistor network 10 Link (280671) $0.26 $2.60

Total Cost $127.11

Page 40 of 41 Design Review: Bill of Materials

Comprehensive Bill of Materials

Comprehensive BOM System Subsystem Number of Parts Subsystem Cost Total Cost Front End 16 Strap 16 $ 144.00 $ 144.00 Amplifier Signal Processing Audio Proof of Concept 93 Wireless System 2 $ 33.90 $ 127.11 Car with Supplies 91 93.21 Total Parts Total Cost 109 271.11 271.11

Page 41 of 41

Recommended publications