the self tuning guitar kit group 5 ece 445: senior design tom damario & kyungjin lee december 4,...

36
The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Upload: tate-maulsby

Post on 30-Mar-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

The Self Tuning Guitar KitGroup 5

ECE 445: Senior Design

Tom DaMario & KyungJin Lee

December 4, 2008

Page 2: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Introduction• Kit provides fast, easy way to tune almost

any guitar automatically

• Combines TI DSP, a simple microcontroller, and a stepper motor

• Gives easy user interface to make anyone could tune the guitar

Page 3: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Features• Universal Design

• 3 different tuning configurations– Standard, Drop-D, Open-G

• Simple operation

• Accurate to +/- 4.906Hz

Page 4: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Objectives• Portability: 100% Battery Powered Device

and should be able to fit in guitar case

• Universal: Device should fit on any guitar

• Functionality: Device should have multiple tuning modes

Page 5: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Tuning ConfigurationsString

Number Standard Tuning Drop-D Tuning Open-G Tuning

NoteFrequency

[Hz] NoteFrequency

[Hz] NoteFrequency

[Hz]

6 E 82.4 *D 73.4 *D 73.4

5 A 110 A 110 *G 98

4 D 146.8 D 146.8 D 146.8

3 G 196 G 196 G 196

2 B 246.9 B 246.9 B 246.9

1 e 329.6 e 329.6 *D 293.6

* Strings that change from standard tuning.Source: http://entertainment.howstuffworks.com/guitar3.htm

Page 6: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Hardware Overview• DSP: C6713 DSK

– Takes analog signal from guitar and runs ADC– Runs FFT on digital signal– Takes difference between desired signal and received

signal

• PIC 16F877A– Takes string number from DSK and outputs to Hex display– Receives two signals from DSK to turn motor

• Motor: Parallax #900-00008– Turns guitar tuning peg until desired frequency is reached

Page 7: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Software Overview• Code Composer Studio v3.3

– Used to connect to DSK– Program/Run DSK– Flashburn

• PIC C compiler and MPLAB IDE– Used to convert .c program to assembly to

load program on PIC 16F877A

Page 8: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Project Flowchart

Page 9: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Output from GuitarWithout Amplification:

•Ave noise level = 22.8mVp-p

•Ave signal level = 150.3mVp-p

•Noise % = 1- { (150.3 - 22.8) / 150.3 } = 15.16%

Noise Level: String 3 without Amplification:

Page 10: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Signal After AmplificationAfter Amplification:Amplifier Circuit:

Page 11: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Original plan: Use C5509AHas built-in A/D

converter

Design to draw low power (Easy to make Portable)

Problems: •Emulator could not detect target DSP chip•Back current between CVdd and DVdd

Page 12: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

C6713 DSK Board

Page 13: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

C6713 Board• DIP switches for

user input• Built-in LED for

tuning config• Analyze the

audio input from guitar to find different frequency in real time

• Send the motor control output to PIC

Page 14: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Flowchart of DSP Software

Holding DIP Switch 3 Analyzes the Signal in

Real Time

Holding DIP Switch 3 Analyzes the Signal in

Real Time

Simplify the output to PIC to control the

motorOnly two bits of

GPIO are required

Simplify the output to PIC to control the

motorOnly two bits of

GPIO are required

To ignore any input when guitar is not plucked, we

add this part in the code.

To ignore any input when guitar is not plucked, we

add this part in the code.

Page 15: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Only Run FFT When String is Plucked

• Without any audio input • With guitar audio input

String 6 Max ≈ 90

String 6Max ≈ 4

Page 16: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Calculating the Frequency

• Lowest sampling frequency of A/D converter is 8kHz

• # of sample = 2048• Step size in frequency

= 8000/2048 ≈ 3.906Hz

• Frequency = (step)(3.906Hz)

1st Peak: 842nd Peak: 1683rd peak: 252

Mean difference ≈ 84Freq = (84)(3.906) = 328.1Hz

Frequency difference = 1.496Hz

Page 17: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Testing the DSP

• To test the user input from DIP switch, use LED on the board and check desired frequency from the memory

• To test the FFT, compare graphs from CCS to make sure the peak frequency of FFT is same as the frequency of input signal

Page 18: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

DSK Challenges• Find the common ground – to solve this problem

we use TP32 as common ground from DSP board

• Find I/O from DSP – Use HPI to output as GPIO• Cannot find the way to send any input to DSP –

Use DIP switch as the user input• Get the right speed for motor to turn, and prevent

any delay

Page 19: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Increasing the Accuracy• Increase the number of samples taken by

the DSP– Would make the running time longer– Requires more memory space

• Formula that filters out unclear guitar inputs– When the first peak of FFT is smaller than

other peaks of FFT

Page 20: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Daughter Card

Page 21: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Wire Wrapping TechniqueDisadvantages:

•Wires not soldered in place

•Time requirement

•Messy

Page 22: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Voltage Regulator for Battery Power

Page 23: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Motor Specifications

• Parallax Continuous Rotation Servo #900-00008

• Stepper Motor• Powered with 5VDC• Torque = 3.40 kg-cm

(47 oz-in)• Need about 37 oz-in

to turn peg

Page 24: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Motor Power ConsumptionString Number

Average Current [A] Max Current [A] Average Power [W] Max Power [W]

Clockwise Counter Clockwise Clockwise Counter

Clockwise Clockwise Counter Clockwise Clockwise Counter

Clockwise

6 0.35 0.17 0.45 0.18 1.75 0.85 2.25 0.9

5 0.33 0.18 0.36 0.18 1.65 0.9 1.8 0.9

4 0.31 0.19 0.34 0.2 1.55 0.95 1.7 1

3 0.34 0.19 0.35 0.2 1.7 0.95 1.75 1

2 0.29 0.19 0.31 0.2 1.45 0.95 1.55 1

1 0.3 0.19 0.31 0.18 1.5 0.95 1.55 0.9

Max Power Consumed: 2.25 Watts (String 6 Clockwise)Average Power Consumed: 1.25 Watts

Page 25: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Motor Resolution• Find Hz/Degree for each peg using

motorRes.cwhile (input(PB1)==1) //Push Button 1 is pressed, rotate clockwise

{

delay_ms(500); //wait for button to be depressed so that exact

//number of pulses measured

for (k=0; k<85; k++) //send 85 pulses to motor

{

output_high(motor);

delay_ms(1);

output_low(motor);

delay_ms(20);

}

}

• Adjust k until motor turns exactly 360⁰

Page 26: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Data Taken from Pic.c

String Number Clockwise 360⁰ Turn [Steps]

Counter Clockwise 360⁰ Turn [Steps]

Clockwise Resolution [⁰/Step]

Counter Clockwise Resolution [⁰/Step]

No Load 51 49 7.06 7.36

6 56 84 6.43 4.29

5 60 81 6 4.44

4 60 81 6 4.44

3 60 84 6 4.29

2 62 81 5.81 4.44

1 63 86 5.71 4.19

Page 27: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Motor Resolution (continued)

String NumberFrequency at θ =

0⁰ [Hz]Frequency at θ =

360⁰ [Hz]Frequency at θ =

720⁰ [Hz]Frequency at θ =

1080⁰ [Hz]

6 52.63 82.65 105.26 125

5 82.65 108.7 129.87 142.86

4 119.05 144.93 166.67 181.82

3 156.25 196.08 223.21 263.16

2 211.86 250 280.9 333.33

1 297.62 333.33 362.32 384.62

Θ = Standard Tuning – Frequency of 360 Peg Turn⁰

Page 28: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Motor Resolution (continued)String Number Equation

6 f = 0.067θ+795 f = 0.056θ+1104 f = 0.058θ+1403 f = 0.097θ+1902 f = 0.110θ+2501 f = 0.081θ+330

Observations:

•Strings 6-4 have different slopes than strings 3-1 due to manufacturing process

Page 29: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Motor Resolution Results

String NumberFrequency/Rotation [Hz/⁰] Rotation/Step [⁰/Pulse] Resolution [Hz/Pulse]

Clockwise Counter Clockwise Clockwise Counter Clockwise Clockwise Counter Clockwise

6 0.067 0.067 6.430 4.290 0.431 0.287

5 0.056 0.056 6.000 4.440 0.336 0.249

4 0.058 0.058 6.000 4.440 0.348 0.258

3 0.097 0.097 6.000 4.290 0.582 0.416

2 0.110 0.110 5.810 4.440 0.639 0.488

1 0.081 0.081 5.710 4.190 0.463 0.339

Average Clockwise Resolution = .467 Hz/PulseAverage Counter Clockwise Resolution = .340 Hz/Pulse

Page 30: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Motor Challenges• Motor designed to run on up to 6VDC

– Running on 5VDC reduced torque

• Running daughter card and motor on same power supply reduced current to motor– Gave motor separate battery– More power supplies tied to common ground

• Needed to slow motor & still provide adequate torque

Page 31: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Motor Bracket

Page 32: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Future Improvement• Increase Frequency Accuracy

• Flashburn

• Create PCB with DSP chip embedded– No need to have unused board components– Power consumption at a minimum

• Convert entire project to battery power

– Reduces size

• Increase Number of Tuning Configurations

Page 33: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Ethical Considerations• Complies with IEEE Code of Ethics

• Tried to make kit as universal as possible– One guitar maker will not benefit over others

Page 34: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Cost AnalysisItem Manufacturer Cost Per Item Quantity Total Cost

C6713 DSK Board Spectrum Digital $415.00 1 $415.00PIC 16F877A Microchip $3.71 1 $3.71

Voltage Regulator Estek $0.90 2 $1.80Crystal Oscillator Fox $0.40 1 $0.40

Capacitors/Resistors/Diodes N/A $0.10 15 $1.50Hex Display HP $10.56 1 $10.56Battery 9V Duracell $4.00 2 $8.00Protoboard Silicon Labs $15.00 1 $15.00

DaughterCard Spectrum Digital $99.99 1 $99.99Code Composer Studio v3.3 Texas Instruments $995.05 1 $995.05

Guitar Tuner TU-80 Boss $24.95 1 $24.95Audio Cable 20' Peavy $19.95 1 $19.95

Stepper Motor #900-00008 Parallax $12.99 1 $12.99Mounting Bracket Machine Shop $50.00 1 $50.00

TOTAL $1,658.90

Parts:

Labor:

$40.00/Hr x 2.5 x 200Hr x 2 People = $40,000

Total = $40,000 + $1,658.90 = $41,658.90

Page 35: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Special Thanks

• Professor Gary Swenson

• Ben Graf

• Texas Instruments University Division

• ECE Machine Shop

• ECE Parts Shop

Page 36: The Self Tuning Guitar Kit Group 5 ECE 445: Senior Design Tom DaMario & KyungJin Lee December 4, 2008

Questions

???