Student Projects

cancel
Showing results for 
Search instead for 
Did you mean: 

A robot arm to play the Theremin

Contact Information:

Country: UK
Year Submitted: 2018
University: University of Birmingham
List of Team Members (with year of graduation): Xuanyi Chen (2018)
Faculty Advisers: Dr.Tim Jackson
Main Contact Email Address: XXC796@student.bham.ac.uk

 

Project Information:

Title: A Robot Arm to Play the Theremin


Description: This project uses a robot arm with servo motor to play the Theremin producing notes of a specified pitch.


Products: NI: NI myRIO-1900

                        LabVIEW 2017 Software Bundle

                    Non-NI:

                          A Moog Etherwave Plus Theremin

                          A robot arm with servo motor (MG90S)


The Challenge:

Figure 1 the ThereminFigure 1 the Theremin

The Theremin is an electronic musical instrument, which was invented in 1919 by the Russian scientist Léon Theremin. The Theremin can be played by the performer without physical contact. There are two antennas on it, the horizontal circular antenna is used to control the volume and the vertical straight antenna is used to control the audio frequency.

Figure 2 operation principles of Theremin (http://asmir.info/theremin_classic.htm)Figure 2 operation principles of Theremin (http://asmir.info/theremin_classic.htm)

The audio frequency is controlled by the performer’s hand or anything else close to the vertical antenna. From figure 2, there are two high frequency oscillators inside the Theremin (around 350 kHz). One of them is a fixed-frequency reference oscillator, the frequency of the other is varied by the capacitance of the hand close to the antenna. The difference between the two frequencies will decide the audio frequency, and the difference is equal to the frequency of the note being played. The proximity of the performer’s hands to the antennas affects the capacitance of the antenna, which determines the frequency of the associated oscillator.

It almost goes without saying that the Theremin is a very difficult instrument to play, requiring a good musical ear and a high level of co-ordination.  Even a very small change of the distance between the performer and the antenna will cause a large change in audio frequency. For the skilled player, this enables fine control over pitch and dynamics. For the less skilled, the beauty of the instrument could be enjoyed if a robot could play it. The inspiration for this project derived from Pianola, which is a kind of self-playing piano. A Pianola contains a pneumatic or electro-mechanical mechanism that operates the piano action via pre-programmed music recorded on perforated rolls. There are normally paper, but in some instances are metallic. If the action of a musical instrument can be controlled by specified program, usually, it’s more accurate, with no error. And for the self-playing piano, people can enjoy it even without any piano skills. Can we do the same for the Theremin?

 

The Solution:
Plan:

  1. Choose the robot arm to play the Theremin
  2. Use myRIO to measure the audio signal from the Theremin

      3.png

  1. Build a closed loop control to get specified note from the Theremin

 

 

  1. Build the robot arm with servo motor (MG90S)

Figure 3 build a robot armFigure 3 build a robot arm

In this project, a robot arm that can receive the control signal and provide precise control is needed. So I chose a robot arm the core component of which is the MG 90S servo motor. A sheet of grounded aluminium foil is attached to the robot arm to form a “hand” which forms the capacitor with the antenna. Otherwise, the antenna of Theremin cannot sense the robot arm. For the robot arm, we can simply use the myRIO-1900 to generate the PWM signal to control it. And the PWM signal can be adjusted by building a feedback loop.

The robot arm is normally controlled from a joystick. The goal here is to replace the joystick with the electronic control system.

 

 

  1. Measure the audio signal from the Theremin

For the measurement of the audio signals, choosing an appropriate sampling rate is very important. If an improper sampling rate is chosen, there may be some severe distortion in the audio signal’s acquisition. As I am going to adjust the control signal of the robot arm by comparing the actual frequency with the target frequency, the distortion will affect the actual value of audio frequency, making it difficult to form an effective feedback loop.

44.1 kHz (44100 Hz) is the sampling rate of audio CDs giving a 20 kHz maximum frequency. 20 kHz is the highest frequency generally audible by humans, making 44.1 kHz the logical choice for most audio material.

 Figure 4 measurement of the audio signal from ThereminFigure 4 measurement of the audio signal from Theremin

In this part, the audio I/O port on the myRIO-190 can be used to acquire the audio signal from the Theremin and analyse it. Also, the FPGA module in LabVIEW is used in this part. The change of audio frequency which can be distinguished by humans is 3 Hz. So, I used a calibration audio signal of 1 kHz to make sure the error of the measurement is acceptable.

 

  1. Set the feedback loop for the system to get specified notes

Figure 5 control the servo motor in robot arm (http://www.societyofrobots.com/actuators_servos.shtml)Figure 5 control the servo motor in robot arm (http://www.societyofrobots.com/actuators_servos.shtml)

Changing the pulse width of the PWM signal which applied to the servo motor will make the motor move to a specified angle. If I set the error between target frequency and actual frequency as the feedback value, the control signal of the robot arm can be dynamically adjusted. When the actual frequency is far from the target frequency, the robot arm will move quickly, when the actual frequency gets closed to the target frequency, the robot arm will move relatively slowly until the target frequency is achieved. In this part, the PID controller in Real-time module is used. A time delay is set for the robot arm, to balance the operational speed of the robot arm and other hardware.

Figure 6 LabVIEW codeFigure 6 LabVIEW code

Figure 7 robot arm and circuitFigure 7 robot arm and circuit

Explain the benefits using LabVIEW and NI tools: NI myRIO-1900 is the key device of the project which achieves audio measurement and PWM generation in one step, this made the structure of the circuit quite easy. LabVIEW allows for rapid code prototyping, there are lots of functions and VIs which can be directly used, this greatly reduced my development time. I am able to establish a fast and reliable control system to operate the robot arm, using control signals from the myRIO-1900 to replace the joystick interface which is normally used to control the arm.

Level of completion: fully functionally
Time to build: 14 weeks
Additional revisions that could be made: As the antenna on the Theremin is extremely sensitive, it seems the overshoots and oscillations during the control process are inevitable. The Theremin changes the frequency very quickly whereas the control system is slower, if a control system with smaller response time can be applied, a sequence of notes can be played by more complex code in LabVIEW.

 

Link to Video




Attach Poster

poster.png

Contributors