the pipe dream - gatech.edu

14
ME 6405: INTRODUCTION TO MECHATRONICS Project Report: The Pipe Dream Automated American Slide Whistle Michael Abraham, Abiodun Otolorin, Waqas Majeed 21 st April, 2008

Upload: others

Post on 28-Oct-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: the pipe dream - gatech.edu

ME 6405: INTRODUCTION TO MECHATRONICS

Project Report: The Pipe Dream Automated American Slide Whistle

Michael Abraham, Abiodun Otolorin, Waqas Majeed

21st April, 2008

Page 2: the pipe dream - gatech.edu

 

Table of Contents Abstract......................................................................................................................................................... 3

Introduction .................................................................................................................................................. 4

Vision............................................................................................................................................................. 4

Mechatronics ................................................................................................................................................ 5

Systems Analysis ....................................................................................................................................... 5

Implementation ........................................................................................................................................ 6

Hardware .................................................................................................................................................. 6

Software.................................................................................................................................................... 7

Overview of the mathematics of MIDI.................................................................................................. 7

Motor Controllers ................................................................................................................................. 8

Major Microcontroller Subsystems ...................................................................................................... 8

Conclusion..................................................................................................................................................... 9

Appendix .....................................................................................................................................................10

Pictorial Documentation .....................................................................................................................10

Systems Analysis: Subsystems Diagram using Object Oriented Analysis ...........................................12

Flow Diagrams.....................................................................................................................................13

 

Page 3: the pipe dream - gatech.edu

Abstract In line with the objectives of the introduction to mechatronics course, we undertook a

project that was multifaceted, technically challenging and fulfilling. The Pipe Dream is an orchestra of three Automated Slide Whistles that play music received from MIDI devices. These whistles are driven using a bipolar stepper motor while opto-couplers provide support for sensing the slide’s position. Presently, the devices use manual calibration for note precision. The whistles can be play music from any MIDI originating device e.g. keyboard, directly as well as from any preprogrammed song on another instrument capable of producing MIDI sequence. A well designed pneumatic system provides air supply. Most importantly, this document consists of information detailing our objectives, project scope, implementation challenges, and achievements.

Page 4: the pipe dream - gatech.edu

Introduction A slide whistle is a simple wind instrument that consists of a tube with a mouthpiece, a whistle aperture and a slide/plunger mechanism. Air is forced through the mouthpiece and the aperture splits the air stream creating a standing pressure wave in the tube. Moving the slide varies the length of the tube’s resonating chamber and thus changes the wavelength of the pressure wave and the frequency of sound produced.

 FIGURE 1: METALLIC SLIDE WHISTLE

In line with the objectives of the introduction to mechatronics course, we sought to undertake a project that will provide an opportunity to develop an in-depth understanding in the major facets of mechatronics. In addition, we found the aesthetic value of this project to be quiet appealing. Immediately after the development of the project concept, we performed a thorough analysis of the instrument and various mechatronic components needed to bring the vision outlined in our proposal to reality.

Vision In our project proposal, we specified that the slide whistle should be capable of executing three primary operations upon command: 

1. Self‐Calibration  This will ensure that the whistle always play in tune despite day‐to‐day changes in ambient pressure and temperature. This function will involve slowly moving the slide until target frequencies are achieved. The slide’s position at each target frequency will then be stored in memory and used in the slide position control system whenever music is played. This function will require coordinating the slide actuator with feedback from a microphone. 2. Perform a Pre‐Programmed Song  For the sake of quick and simple demonstrations, a pre‐programmed song that the whistle can perform is essential because it enables the whistle to be demonstrated as a standalone device. 

Page 5: the pipe dream - gatech.edu

3. Perform Music from an External MIDI Source For over 25 years, the digital MIDI (Musical Instrument Digital Interface) signal has been an industry standard. As a result, multiple low‐cost/low‐complexity systems are in place that can produce, record and store MIDI. By adopting the MIDI standard, the whistle will be able to be play songs stored on a computer or be played by a user in real time via a physical MIDI keyboard. The ability to process and perform MIDI signals will make this device exceptionally flexible by providing it the capability to perform any music that a user provides.  

Mechatronics 

Systems Analysis After development of the project concept, we performed a thorough systems analysis of the various hardware and software components required to implement the device. Consequently, we were faced with a variety of options for the different hardware subsystems. For instance, we had the option of using air tanks, fans, or micro air pumps in our air supply system (See Appendix). Subsequently, we assessed the advantages and disadvantages of each subsystem in order to make the best selection. In some cases, we had to conduct performance tests before a decision could be made such was the case in selecting air tanks for our air supply subsystem. 

This seemingly simple project actually has a nontrivial level of sophistication. The first concern is that of calibration. Obviously, there will be a one‐to‐one mapping between the position of the slide and the frequency of sound that the whistle produces. The question of error tolerance is of primary concern. How much error in the slide’s position will be allowable? The human ear is sensitive to frequency discrepancies of as little as 5 cents. In this case, 5 cents means 5% of the distance to the next note. For example: The note "A" that is closest to the center of a piano has a frequency of 440 Hz. The next highest note has a frequency of 440 x 2^(1/12) = 466.16 Hz. Five percent of that distance is (466.16 ‐ 440)/20 = 1.3 Hz. This is certainly a steep level of tolerance. How then does a tolerance of 1.3 Hz translate into tolerance in the position of the slide? 

A few quick tests confirm that the frequency range on the whistle is from approximately 300 Hz to approximately 1200 Hz. This translates into roughly 24 distinct notes (2 octaves). The range of motion on the slide is about 12 inches. This means that, on average, the distance between adjacent notes will be approximately 1/2 inch. Five percent of this distance is 0.025 inches or ~0.64 mm. With inkjet printers that achieve accuracy of 150 dpi (tolerance of 0.0067 inches), these tolerances are certainly reasonable.  

A larger control system concern is that of determining exactly how/when to move the slide and actuate the valve so that the slide performs the requested music as accurately as possible. MIDI sends "Note On" and "Note Off" message to the device that is playing the music. Timing the beginning of the notes precisely is far more important than timing the ending of the notes. It is also important to realize that the slide’s transient motion will be heard unless the valve is turned off while the slide is "between" notes. These considerations require the device to have an intelligent way of handling the commands from the MIDI signal and deciding when to move the slide and actuate the valve so that the beginning of each commanded note is achieved on time. This will involve "clipping" the end of each note so that the 

Page 6: the pipe dream - gatech.edu

slide can be given time to transition and settle to its new position before opening the valve again and sounding a new note. 

Implementation  As described above, the hardware specifications required to attain note precision required an in 

depth study of a variety of motors with emphasis on stepper motors because we opted to pursue open loop control. Fortunately, we identified a stepper motor that met our requirements by providing the ideal balance between torque, speed, and precision. However, we were also faced with the construction of a motor drive circuit, which proved to be a daunting task. With time, we successfully identified the circuit components and design. In addition, we had to introduce stepper motor controller chips given the limit number of output pins available on the HC11 in expanded mode.  

In order to slide the whistles, we simply clamped the slides to timing belts attached to the pulleys of the stepper motor (See Appendix). In our proposal, we had expressed a preference for fans in our air supply system but upon testing we realized that fans were unable to generate the pressure required despite our ducting efforts. In light of these, we examined compressed air tanks as a potential alternative, which proved to be efficient. Consequently, a small 5 gallon compressed air tank was purchased. In addition, we acquired pressure regulators and pneumatic valves to control air flow through the whistle based on instructions received from the microcontroller.  

Most importantly, we decided to pursue the development of an orchestra of three slide whistles in order to make the device a more versatile musical instrument. Therefore, we assigned each whistle to a unique MIDI channel. 

Hardware Major Parts 

Name & Description  Category  Cost ($)  Quantity

Stepper Motor  

Mechanical  ~$20  3 

Belts, Pulleys & Idler with Ball Bearings  Mechanical  ~$8  3 

Solenoid Valves  Mechanical  ~$8  3 

Pressure Regulators  Mechanical  ~$8  1 

1/4" Thick Aluminium Sheet 6" x 70" The following are mounting design diagrams developed with SolidEdge Idler Block Idler Block Assembly 

Mechanical ‐ Mounting 

~$60  1 

Page 7: the pipe dream - gatech.edu

Motor L‐Mount Motor L‐Mount Assembly

3/4" Thick Birch Plywood Sheet 4' x 8' durability and aesthetics 

Mechanical ‐ Packaging 

~$50  1 

PCB Motor Drive Circuit Stepper Motor Controller Chips  In addition, we used various circuit components such as resistors, capacitors, etc 

Electrical  N/A  3 

Valve Control Circuit  Electrical  N/A  3 

Optocoupler Circuit  Electrical  N/A  3 

Motorola HC11  Electrical  ~$120  1 

 

Software 

Overview of the mathematics of MIDI All MIDI messages begin with an 8‐bit binary "Status Byte." All status bytes have bit 7 set to 1. This is to distinguish Status Bytes  from Data Bytes  (which have bit 7 set  to 0). Status Bytes contain  instructions (what TYPE of operation to execute). Data Bytes contain information about the instructions (which notes to play, etc). Some Status Bytes are not followed by Data Bytes because no extra information is needed. Some Status Bytes are followed by 1 Data Byte. Some are followed by 2 Data Bytes. The only messages that we will pay attention to are messages that tell the instrument to start playing a note or stop playing a note. The MIDI message that means "Begin Playing a C note on Channel 2 at a volume of 64" contains 3 bytes (1 Status Byte followed by 2 Data Bytes): 10010010 01000000 00111100 Bits 4‐7 of the Status Byte  is the "Note On" command: 1001 = "Note On" Bits 0‐3 of the Status Byte  is the Channel Number: 0010 = Channel 2 The  first Data Byte  is  the volume: 64. The  second Data Byte  is  the note: C  is note number 60 by convention Similarly,  to STOP playing  that same note,  the  following message would be sent:  10000010  01000000  00111100 This  is exactly  the  same except  that  the  "Note On"  (1001) part of  the Status Byte  is  replaced by  the "Note Off" command (1000). It is important to notice that the following message could also be used to STOP playing the note:  10010010  00000000  00111100  This is a "Note On" command, but the volume is zero. A "Note On" with zero volume is the same thing as a "Note Off." So, the messages that we want to actually pay attention to begin with 1000 or 10001. (See Appendix for Flow Diagram)  

Page 8: the pipe dream - gatech.edu

Motor Controllers Using the timer, output compare registers and interrupts, we were able to drive the whistles at various frequencies to meet various speed and precision requirements. Notably, this was feasible because the whistles were moved at the rate of one step per interrupt. We dynamically alter the frequency of the interrupts as well as the delay within interrupts to provide acceleration and deceleration when moving between distant notes. (See Appendix for Flow Diagram) 

Major Microcontroller Subsystems  

• Timer 

• Interrupts 

• Output Compare 

• Serial Communication Interface (SCI) 

• Parallel output 

Page 9: the pipe dream - gatech.edu

Conclusion Without any doubt, the development of “The Pipe Dream” has been a conceptual and

technical challenge, which led to an evolution of our project proposal and scope. As a result, we are excited and fulfilled about the feat achieved and the depth of our learning experiences.. However, we see opportunities to significantly improve the performance of the device in the future such as

1. Faster transition between distant notes is highly desirable.

2. A pure closed loop system can be implemented to provide more position accuracy when operating at high speed.

3. Absolute Encoders may be used for better position sensing.

4. Better quality solenoid valves can be used to reduce noise and delay between note on and note off states.

We deeply appreciate the contribution of everyone involved especially

• Prof. Charles Ume, Instructor

• Matt Rogge, Teaching Assistant

• Jin Yang, Teaching Assistant

• Tyler Randolph, Teaching Assistant

• Tom Groshans, Course mate w/ Expert Advise

For more information, photos and videos, please visit our project website on the mechatronics lab website for spring 2008.  

Page 10: the pipe dream - gatech.edu

Appendix 

Pictorial Documentation 

 

FIGURE 2: THE PIPE DREAM – EXTERNAL VIEW

Page 11: the pipe dream - gatech.edu

 

FIGURE 3: THE PIPE DREAM ‐ INTERNAL COMPONENTS

Page 12: the pipe dream - gatech.edu

Systems Analysis: Subsystems Diagram using Object Oriented Analysis 

 

FIGURE 4: HARDWARE ‐ HIGH LEVEL DIAGRAM

Page 13: the pipe dream - gatech.edu

Flow Diagrams 

 

FIGURE 5: SOFTWARE ‐ MIDI FLOW DIAGRAM

Page 14: the pipe dream - gatech.edu

 

FIGURE 6: SOFTWARE ‐ ACTUATION