Self-tuning documentation

Self-tuning monochord guitar

Self-tuning monochord guitar

Introduction

The objective of first project is to plan, design, and build a self-tuning fretless monochord guitar. It was built a kind of robotic instrument, where it is possible to play a few notes around middle C (~261Hz). The instrument is self-tuning, i.e., it has a sensor measuring the sound/vibration generated by the string, and a mechanism for tensioning to generate different pitch.

To accomplish this task a simple feedback loop is required where the tensioning mechanism is the actuator, the sound produced by the vibration of the string is the measured output and the user selected note to be played is the setpoint. The system also includes a second actuator, the motor which will handle the plucking of the string, which is outside of the basic feedback control loop.

1. Mechanical Design

The design of the guitar is centered around the use of an atmega microcontroller to handle the sensor and motors for strumming and tensioning applications.

The single-string unit needed support and tension which was similar to a traditional guitar for repeatability of the sound and feel of the string. Like most components of this project, the string mounts went through numerous design iterations until the design was perfected.

The initial design involved a plywood piece with two dowel pins mounted perpendicular to the surface. The dowel pins were installed with grooves at the top to support the string and restrict motion side to side as the string was plucked. This design was initially chosen as it was simple and quick to construct for testing. The group soon found that the string made a very noisy signal when played with the dowelling. The sound was had a notable “twang” and was difficult for the sensor to process as there was a significant amount of noise. The observation was made that the string was not sitting in the dowel groove exactly and was as a result vibrating between the wooden walls increasing the noise in the signal and giving a poor guitar sound.

At this point the group took the next step of looking at an actual guitar and observing the string mounting on it. The string mounts, or guitar bridge, were found to support the string at a single point rather than other a certain length axially as the previous design had. The new design would attempt to mimic the real guitar setup with a mounts that featured a pointed tip for the string to rest on.

1.1 Tensioning System

An important criterion of the project was to have the system be self-tuning, meaning that a mechanism was required to accept a value from the microcontroller indicating which direction the tension is to be changed in. This was accomplished but using a tuning peg directly from the guitar which takes a rotational input and translates it to linear motion of the string as it wraps around the peg. The user tab of the tuning peg was attached to the stepper motor.

1.2 Picking System

The guitar string produces a sound by strumming a guitar pick over it near the tip of the pick. As this system was purely used for tuning the string, speed of the strumming was not a consideration in the design. In order to achieve the motion of the pick across the string a servo motor was used. The servo motor was an obvious choice for this application as it is simple to interface and would give us enough sweep to strum the string, as well as meeting the systems speed and torque requirements.

The height at which the pick crosses the string has a direct effect on the sound produced which is why the original picking system had a modified pick with a slot running down the center, allowing the user to adjust the height and consequently the sound. The pick was attached to an arm mounted to the servo motor shaft. This arrangement allows for much versatility also due to the holes in the mounting arm. The issue with this was that although the pick was attached tightly to the arm it still managed to come loose through testing and then struck the string improperly. The original system was replaced with a fixed arm and pick position held together by bolts and super glue, which provided a more robust design.

2. Electrical Design

A guitar sting is basic in construction but inherently complex in dynamics. A guitar string’s vibration produces frequencies that cover the entire spectrum and include a fundamental plus all harmonics (overtones). The frequency spectrum of a typical guitar string tuned to a B3(247Hz) as the fundamental and all harmonics at. The system design objective is to tune the guitar string to a set note by filtering the fundamental frequency and adjusting the system accordingly. This is achieved by implementing a feedback design to read the current frequency and compensate for error. A motor, controlled by the microcontroller, adjusts the tension to match the new set note and a user interface creates a modular and portable system. 

2.1 Feedback System

Any control system requires a form of feedback to adjust the system towards a set stable state. The guitar tuner system has a basic feedback loop using a simple op-amp comparator in combination with a magnetic pick-up coil connected to the microprocessor, ATmega328P, to form an active feedback loop that determines the current string frequency. This method is discussed below.

2.2 Sound Sensor Detection Module

The three pin sensor module contains a simple op-amp comparator circuit with an adjustable DC voltage reference threshold and an electret microphone. The amplitude of the input frequency is compared to a set threshold, and the comparator outputs a saturated square-wave signal at the input frequency. A potentiometer adjusts the DC reference threshold so the output signal is active only when the input voltage is above the reference threshold. This feature is used as a sensitivity tuner to remove the unwanted, lower amplitude harmonics.

3. Software Design

The system of a self-tuning fretless monochord guitar was built using the Arduino Duemilanove (“2009”), which is a board based on the ATmega328 microcontroller. Some features of this board are 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. The firmware was developed based on a state machine in which each activity executes separately. This scheme was chosen because of its better understanding and organization.

The system has these main points: the user selects the note to be tuned, the string is plucked, the frequency is read and possible noises are treated, based on frequency value take a decision on what direction the stepper motor should go to tension the string, verify if it has achieved the selected tension, if it is correct, the system go to initial state and wait for user action, otherwise, repeat commands until it reaches the note. Each of those states has some features inside which will be described in next paragraphs.

At the first state the battery level is taken to indicate its actual power in a user interface provided by LCD display and the home screen of system is shown to user. After that, a conditional loop is executed until some button is pressed. There are three choices, the first button is used when some frequency is selected freely using a potentiometer, values range between 207Hz and 294Hz. The second button, when selected, set a fixed frequency value to ‘B’ note (247Hz). And then, the last button set a fixed frequency for ‘C’ note (261Hz).

After note selection, the LCD is updated with that frequency set by the user and then moves to a Tuning screen, which shows the expected and current frequencies, the current is update every time after plucking string until it reaches the expected set by user. Now the system is able to go through next step when the string is plucked in order to analyze its frequency.

1 thought on “Self-tuning documentation

  1. web hosting

    I wish to express my love for your kindness in support of people who require help on in this field. Your personal dedication to getting the solution across was remarkably beneficial and has specifically helped workers just like me to reach their dreams. Your amazing helpful tips and hints implies a lot a person like me and a whole great deal more to my peers. Many thanks; from everyone of us.

Leave a Reply