19
Multichannel Waveform Generator By Samuel Goldfinger Heng Wei Hsu Chien Tung Shih Final Report for ECE 445, Senior Design, Fall 2014 TA: Kevin Bassett 12 December 2014 Team 25

Multichannel Waveform Generator

  • Upload
    others

  • View
    16

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Multichannel Waveform Generator

Multichannel Waveform Generator

By

Samuel Goldfinger

Heng Wei Hsu

Chien Tung Shih

Final Report for ECE 445, Senior Design, Fall 2014

TA: Kevin Bassett

12 December 2014

Team 25

Page 2: Multichannel Waveform Generator

ii

Abstract

The device is a multichannel current generator. The design is intended for use on human skin which

correlates to an impedance close to 30 kΩ. There are five steps in the system for outputting the

intended waveforms: control and user interfaces, waveform generation, variable amplification, a voltage

to current amplifier and switches to control which electrodes send outputs. After testing, issues arose

around having the output waveforms as currents but control was successfully demonstrated for

waveform shape, frequency and intermediate amplitude of the voltage signal.

Page 3: Multichannel Waveform Generator

iii

Contents

1. Introduction .............................................................................................................................................. 1

2 Design ......................................................................................................................................................... 1

2.1 Block Diagram ..................................................................................................................................... 1

2.2 Control/User interface ........................................................................................................................ 1

2.2.1 The 3-wire SPI interface ............................................................................................................... 2

2.3 Waveform Generation ........................................................................................................................ 2

2.3.1 Circuit schematic of waveform generation .................................................................................. 3

2.3.2 Input and Output waveforms....................................................................................................... 3

2.3.3 Waveform generation calculations .............................................................................................. 5

2.4 Variable Amplification ......................................................................................................................... 5

2.4.1 Circuit Schematic.......................................................................................................................... 6

2.4.2 Circuit Calculations ....................................................................................................................... 6

2.5 Howland Amplifier .............................................................................................................................. 6

2.5.1 Overview ...................................................................................................................................... 6

2.5.2 Schematic ..................................................................................................................................... 7

2.5.3 Calculations .................................................................................................................................. 7

2.5.4 Waveform .................................................................................................................................... 8

2.6 High Side Switches .............................................................................................................................. 9

2.6.1 Overview ...................................................................................................................................... 9

2.6.2 Schematic ..................................................................................................................................... 9

2.6.3 Notes ............................................................................................................................................ 9

3. Design Verification .................................................................................................................................. 10

3.1 [Component or Block] ....................................................................................................................... 10

3.1.1 Testing Procedures ..................................................................................................................... 10

4. Costs ........................................................................................................................................................ 12

4.1 Parts .................................................................................................................................................. 12

4.2 Labor ................................................................................................................................................. 12

5. Conclusion ............................................................................................................................................... 13

5.1 Accomplishments .............................................................................................................................. 13

Page 4: Multichannel Waveform Generator

iv

5.2 Uncertainties ..................................................................................................................................... 13

References .................................................................................................................................................. 14

Appendix A Requirement and Verification Table ................................................................................... 15

Page 5: Multichannel Waveform Generator

1

1. Introduction For current myoelectric, prosthetic arms, research shows that the majority of prosthesis abandonment

is because the devices lacked feedback with which to simulate having the limb actually there. The Bretl

Research Group is attempting to use numerous feedback modes, including what is called electrotactile

stimulation. Essentially, the magnitude of a current sent is correlated to the level of stimulation

provided to the prosthesis user, and thus touch or other bodily functions such as proprioception can be

modeled. Therefore, a portable multichannel current generator could interface with the existing

prosthesis to return some level of functionality back to amputees.

2 Design The design is composed of five general sections: control/user interface, waveform generation, variable

amplification, a howland amplifier and switches to regulate which channels pass current. Each individual

component will be looked at in more detail below.

2.1 Block Diagram

Figure 1: Top level block diagram of the circuit

2.2 Control/User interface The control and user interface of the project is MSP430F5529 launch pad. The controller deals with

three main modules, waveform generation, variable amplification and high side switches.

In the waveform generation part, the controller sends data by 3-wire SPI interface to control waveform

generator (AD9833). The interface uses states to describe different situations such as different

frequency and different waveform. Users can choose different states easily to control the output of

waveform generation.

User Interface / System Control

Waveform Generation

Variable Amplification

Howland Amplifier

High Side Switch

Page 6: Multichannel Waveform Generator

2

In variable amplification part, the controller uses 3-wire SPI interface to send data controlling the digital

potentiometer (MCP41010), which is used in a programmable, non-inverting gain amplifier to amplify

the output of waveform generation.

In high side switches part, the controller sends either high or low voltage signal to make high side

switches turn on or off.

2.2.1 The 3-wire SPI interface

Figure 2: Waveforms of SDATA, CS and SCLK

The 3-wire SPI interface includes SDATA, Chip Select (CS) and SCLK. In SPI system, the slave chip reads

SDATA when the CS is low and the SCLK is at falling edge. In figure 2, channel one is SDATA, channel two

is SCLK and channel three is CS. Therefore, slave chip receives in this case.

2.3 Waveform Generation Waveform generation for the design is predicated on the interaction between the MSP430 and the

AD9833. Inputted to the AD9833 from the MSP430 are the frequency of the waveform and the shape of

the wave (sine, square or triangle) through 3-wire SPI interfacing as well as 28 bits resolution for the

frequency. Finally, at the pulse wave outputs of the AD9833, there is a coupling capacitor to remove DC

offset and produce biphasic waveforms.

Page 7: Multichannel Waveform Generator

3

2.3.1 Circuit schematic of waveform generation

Figure 3: Schematic of AD9833 with coupling capacitor

Note that MCLK, SDATA, SCLK and FSYNC (Chip Select) are all inputs from the MSP430. Also the 1nF

capacitor at the 10 pin is the coupling capacitor.

2.3.2 Input and Output waveforms

The below graph, figure 4, shows the output of the AD9833 chip. Notice the 100 Hz frequency as defined

by the MSP430, which will remain constant for the outputted waveforms. Figure 5 shows the waveform

before (channel 1) and after (channel 2) the coupling capacitor, with the notably removed DC offset.

Figures 6 and 7 display sine and triangle waves respectively with and without DC voltage, both at the

100 Hz frequency.

Figure 4: Output waveform of AD9833

Page 8: Multichannel Waveform Generator

4

Figure 5: Square wave output waveform of AD9833 and coupling capacitor

Figure 6: Sine wave output waveform of AD9833 and coupling capacitor

Page 9: Multichannel Waveform Generator

5

Figure 7: Triangle wave output waveform of AD9833 and coupling capacitor

2.3.3 Waveform generation calculations

The equation of frequency output is:

is a register, which is used to store data from controller, is reference clock and is

output frequency. Since the MCLK is 32 kHz, if the waveforms are intended to be 100 Hz, by calculation:

is the code that should be passed to the AD9833.

2.4 Variable Amplification The variable amplifier operates as a non-inverting amplifier with a digitally controlled potentiometer

(MCP41010).

Page 10: Multichannel Waveform Generator

6

2.4.1 Circuit Schematic

Figure 8: Schematic of variable amplification

2.4.2 Circuit Calculations

In a non-inverting amplifier, the equation of gain is:

The desired voltage at output is 2.3mV and the minimum input voltage, from waveform generator

AD9833, is 0.7mV. Therefore, the maximum gain is 3.83 and the maximum resistance of MCP41010 is

2.83k .

The output resistance equation from MCP41010 is:

In order to get the gain from 1 to 3.83, controller sends data from to and the resolution is

39 .

2.5 Howland Amplifier

2.5.1 Overview

The Howland Circuit is designed to take a voltage input and pass it through with a set amplification that

produces a current output of the same frequency and wave type with current magnitude and is

Page 11: Multichannel Waveform Generator

7

independent of external load.

2.5.2 Schematic

Figure 9: Schematic of Howland amplifier

2.5.3 Calculations

The current of and are:

The output current equals to the sum of equation (1) and (2).

For ideal amplifier, input voltage at pin 3 and pin 2 are equal and output voltage at pin 6 is two times the

input voltage.

Page 12: Multichannel Waveform Generator

8

Combine equations (1), (2) and (3). The output current equation is:

By modifying the equation, the gain equation is:

2.5.4 Waveform

Figure 10: Output waveform of Howland amplifier

Page 13: Multichannel Waveform Generator

9

2.6 High Side Switches

2.6.1 Overview

While an output signal is sent to each channel, whether the signal is passed or not should be able to be

controlled. To do this, there is a high side switch for each channel, which is essentially a combination of

a pFET and nFET, controlled by high or low inputs from the MSP430.

2.6.2 Schematic

2.6.3 Notes

A zener diode was used across for the pFET to limit that voltage drop to 15 volts since must be

less than 20 volts. The current going into the pFET’s gate is limited to around .5 mA due to the two

resistors forming a voltage divider. IN is either high or low voltage resulting in passing current or an

open for the nFET, which corresponds to turning on or off the channel.

IN

GND

Interface to skin

Howland Output

Figure 11: Schematic of high side switches

Page 14: Multichannel Waveform Generator

10

3. Design Verification

3.1 Block Level Requirements and Verification

Component Requirements Verification

User Control/Interface

(MSP430)

1. Output current frequency (up to 100 Hz -7 bits)

2. Output current amplitude (8-bit resolution)

3. Output switch’s state

Since all of the outputs are digital, these can all be verified by hooking the microcontroller up to a computer and reading the outputs.

1. Vary intended frequency 2. Vary anticipated current 3. Test different switch

configurations

Waveform Generator (AD9833)

1. Output an analog sine, square and triangle wave at 2.3 volts

2. Retain frequency components up to 100 Hz

1. Put the output of the AD9833 to an oscilloscope to check the waveforms in comparison to digital inputs

Variable Amplifier (LM353

+ MCP41010)

1. Amplification up to 18 times 2. Control potentiometer to have

variable gain 3. Retain waveform figure

1. Display potentiometer with respect to input from the microcontroller

2. Send in all three waveform types and display output waveforms

Howland Amplifier

1. Must have variable current up to 2.3 mA for all three waveforms for an assumed skin impedance of 30 kΩ.

2. Change current amplitude levels based off analog input

3. Converts an imputed voltage to corresponding current

1. Use a waveform generator to test the different waveform types as well as the current’s upper boundaries using an ammeter.

2. Modulate inputted voltage magnitude and use an ammeter to verify corresponding changes.

High Side Switch 1. Sends no current to at the circuit output when nFET is passed 0 and passes some current for 1

2. Does not significantly alter waveform passed

3. Limit below 15 volts (pFET

blows out at 20)

1. Send various inputs into switch and confirm output is the same with nFET ON.

2. Ensure no current is passed when nFET is OFF.

Table 1: Requirements and Verification

3.1.1 Testing Procedures

To verify the requirements created, step through each block of the circuit to ensure that the proper

waveforms were being sent between components of the design. With problems interfacing the

Launchpad with the PCB that will be discussed later, signals were directly inputted to the variable

Page 15: Multichannel Waveform Generator

11

amplifier from the AD9833, which was operated by the MSP430 on a separate breadboard, such that the

circuit had the same layout despite not all functioning on the board. For safety purposes, the amplifiers

started at low voltage until sufficient confidence in the circuit’s abilities, since the ideal maximum

voltage for the circuit is in the 70 volts range.

Page 16: Multichannel Waveform Generator

12

4. Costs

4.1 Parts

Part Number of Part

Manufacturer Retail Cost

($)/unit

Bulk Purchase Cost ($)/unit

Actual Cost ($)

AD9833 3 Analog Devices 10.05 5.25825 30.15

MSP430 1 Texas Instruments 10.19 10.19 10.19

MCP41010 3 Microchip 1.34 0.97 4.02

ERJ-2GEJ102X 9 Panasonic 0.10 .002 0.90

ERJ-2GEJ104X 21 Panasonic 0.10 .002 2.10

PNM0805E5002BST5 9 Vishay 1.155 0.924 10.395

LTC6090 3 Linear Technology 3.99 3.99 11.97

LF353 2 Texas Instruments 0.59 0.54 1.18

SI3437DV 9 Vishay 0.97 .34075 8.73

SI3460DV 9 Vishay 1.7 .658 1.53

MMSZ5245B-TP 3 Micro Commercial Components

0.21 .0345 0.63

JMK107ABJ106MAHT 6 Taiyo Yuden 0.32 .02258 1.92

LMK105BJ104KV-F 3 Taiyo Yuden 0.10 .0021 0.30

GRM155R71E103KA01D 6 Murata 0.10 .00258 0.20

GRM155R71E102KA01D 3 Murata 0.10 .00258 0.20

Total 31.015 22.97534 84.415 Table 2: Cost of Parts

4.2 Labor Names Hourly Wage Hours/Week Number of Weeks Cost ($) Cost*2.5 ($)

Samuel Goldfinger 40 15 10 6,000 15,000

Heng Wei Hsu 40 15 10 6,000 15,000

Chien Tung Shih 40 15 10 6,000 15,000

Total 18,000 45,000 Table 3: Cost of Labor

Page 17: Multichannel Waveform Generator

13

5. Conclusion

5.1 Accomplishments Though not exactly as planned, the circuit was able to output waveforms that, if put across skin, would

produce sensations. Additionally, the circuit has control over the magnitude of the signal, frequency,

waveform shape and which channels passed signals. Though the interfacing between the PCB and the

controller ended up malfunctioning, the completed circuit in testing was significantly small and low cost,

which were two constraints based off the marketability of the product.

5.2 Uncertainties Despite the relative success of the project, there are a few additional elements to the project that can

be addressed in the future. First, the aforementioned interfacing between the MSP430’s Launchpad and

the PCB did not ultimately work, that could potentially be resolved by removing the Launchpad all

together and just have the MSP430 chip which would both remove the interfacing issues and reduce the

board size. Additionally, the howland amplifier seems to output voltage instead of current further

testing of the howland amplifier’s waveforms should be pursued as simulations of the circuit did convert

to current. And finally, safety features should be added into the controller to protect against low

resistances such that this device could confidently be tested on human skin.

Page 18: Multichannel Waveform Generator

14

References

[1] John Caldwell, Analog Applications Engineer, Texas Instruments, “A High-Voltage Bidirectional

Current Source”: http://www.ti.com/lit/ml/slyy054/slyy054.pdf

[2] Datasheet of AD9833: http://www.analog.com/static/imported-files/data_sheets/AD9833.pdf

[3] Liam Riordan, “Programming the AD9833/AD9834”:http://www.analog.com/static/imported-

files/application_notes/AN-1070.pdf

[4] Datasheet of MCP41010: http://che126.che.caltech.edu/11195c.pdf

[5] “MSP430x5xx and MSP430x6xx Family User's Guide”:

http://www.ti.com/lit/ug/slau208n/slau208n.pdf

Page 19: Multichannel Waveform Generator

15

Appendix A Requirement and Verification Table

Table 4 System Requirements and Verifications

Requirement Verification Verification status

(Y or N)

1. Output current frequency (up to 100 Hz -7 bits)

2. Output current amplitude (8-bit resolution)

3. Output switch’s state

1. Vary intended frequency 2. Vary anticipated current 3. Test different switch

configurations

Y Y Y

4. Output an analog sine, square and triangle wave at 2.3 volts

5. Retain frequency components up to 100 Hz

4. Put the output of the AD9833 to an oscilloscope to check the waveforms in comparison to digital inputs

Y

6. Amplification up to 18 times 7. Control potentiometer to have

variable gain 8. Retain waveform figure

5. Send in all three waveform types and display output waveforms

6. Display potentiometer with respect to input from the microcontroller

Y N Y

9. Have variable current up to 2.3 mA for all three waveforms for an assumed skin impedance of 30 kΩ.

10. Change current amplitude levels based off analog input

11. Converts an imputed voltage to corresponding current

7. Use a waveform generator to test the different waveform types as well as the current’s upper boundaries using an ammeter.

8. Modulate inputted voltage magnitude and use an ammeter to verify corresponding changes.

N Y N

12. Sends no current to at the circuit output when nFET is passed 0 and passes some current for 1

13. Does not significantly alter waveform passed

14. Limit below 15 volts (pFET

blows out at 20)

9. Send various inputs into switch and confirm output is the same with nFET ON.

10. Ensure no current is passed when nFET is OFF.

Y Y Y