Difference between revisions of "Guitar Tuning Project"

From Mech
Jump to navigationJump to search
Line 27: Line 27:


===Unit Gain Voltage buffer===
===Unit Gain Voltage buffer===
The output of the voltage buffer is always the same with the input.
The unit gain voltage buffer is used here for two benefits:
1. It serves as an impedance match. The input impedance of this voltage buffer is infinitely small while the output impedance of this voltage buffer is infinitely large.
Thus it can fully receives the signal from preceding circuit and output the full signal to succeeding circuit.
2. It prevents the preamplifier circuits to interfere with succeeding circuit.
[[Image:GTTP_Voltage buffer.jpg]]

===Rectify and low pass filter===
===Rectify and low pass filter===
===Voltage Comparator===
===Voltage Comparator===

Revision as of 19:30, 6 December 2008

Guitar Tuning Project (GTTP)

Overview

Project Goal --- Achieve guitar tuning function. By manually plucking a guitar string, the system will determine whether the frequency is higher or lower than the set frequency. Based on the results, the system will tune the string's vibration frequency to the set frequency with a small error range (0.5Hz?).

System Diagram

   The whole system is shown in following figure. 
   The microphone and preamplifier convert the sound wave into a voltage wave and amplify it into AC voltage signal. This AC voltage signal goes into 2 directions. The 1st 
   direction goes into a unit gain voltage buffer and then converted into a DC signal after rectifying and low-pass filtering. This DC signal provides the volume information of the 
   sound wave to the PIC. The 2nd direction goes into a Band-Pass filter. Because the AC voltage signal from the preamplifier contains a lot of environmental noise as well as 
   harmonic waves. The band-pass filter can let a narrow band pass. The band-pass properties are controlled by the centering frequency set by a programmable waveform generator 
   communicating with PIC. After the band-pass filter, the signal is a fairly clean sine wave signal. This signal experiences half-wave rectifying and amplifying. Later it goes 
   into the voltage comparator and becomes a square wave. This square wave is connected to the I/O pin of the PIC and the sound frequency is calculated by the PIC based upon this 
   signal. With the calculated frequency of the current sound wave of the string, PIC compares it to the accurate frequency of the string stored in the program and generates 
   corresponding control signals to control 6 DC motors using H bridges to tune the guitar string till the string's frequency approximates the standard frequency by a limited error 
   (0.5Hz?)
  GTTP system diagram.jpg

Circuit Design and building

Microphone and preamplifier circuit

The microphone converts the sound into the change of capacitance, which causes a voltage change of Vin. The capacitor C4 is used here to block DC signal only allowing AC signal to pass. The gain of the preamplifier is set to (R9+R7)/R7=101.


GTTP Microphone and preamplifier.jpg

Unit Gain Voltage buffer

The output of the voltage buffer is always the same with the input. The unit gain voltage buffer is used here for two benefits: 1. It serves as an impedance match. The input impedance of this voltage buffer is infinitely small while the output impedance of this voltage buffer is infinitely large. Thus it can fully receives the signal from preceding circuit and output the full signal to succeeding circuit. 2. It prevents the preamplifier circuits to interfere with succeeding circuit. GTTP Voltage buffer.jpg

Rectify and low pass filter

Voltage Comparator

Programmable Function generator (Using AD9833)

Band-pass filter (Using LMF100)

Software coding

Algorithm

The basic algorithm is shown in the picture. First, we decide whether volume of the current sound is above certain threshold, when below the threshold, the frequency reading tends not be meaningful; when above the threshold, the frequency reading is compared with the set frequency, the corresponding control signal is sent to H bridges to control motor to tune guitar till it reaches the set frequency. GTTP Algorithm.jpg

Mechanical Design and machining

A head fit accustomed to the guitar is designed and machined. 6 DC motors are mounted on the outer surface of the side aluminum plate. 6 knob couplings are machined. The knob coupling is shown as following. The slot is to fit the knobs of the guitar while the hole in the other is to fit into the shaft of the DC motor. There is a set screw hole letting a set screw to hold the shaft tight to the hole.

GTTP Headset.jpgGTTP Knob.jpg