Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Multi-Disciplinary Engineering Design Conference Kate Gleason College of Engineering Rochester Institute of Technology Rochester, New York 14623 Project Number: 06520 DESIGN OF AN INTELLIGENT TEMPO METER J.E.Gifford (Electrical Engineering, Sponsor) Scott DVileskis (Electrical Engineering) Frank Gill (Mechanical Engineering) Jeremy LaDuke (Industrial Engineering) ABSTRACT musicians is playing and report this information back to the user in real time. This feedback allows the user to control their own tempos accordingly, even if the music slows down or speeds up intentionally. Outfitting the drummer in a small ensemble or the bass drummer in a marching band with such a device, provides them with a practical and reliable method of regulating the whole band’s tempos during a performance. Although many types of instrumental music groups such as orchestras and concert bands typically utilize a conductor to set and monitor their performance tempos, several other types of groups such as marching bands, rock bands, and jazz bands typically depend on the drummer or drum section to perform this crucial function. This design project explored the feasibility of creating a device to be used as a drum accessory to provide real-time feedback to the drummer about the tempo at which they are playing, in order that they can maintain an appropriate tempo for the entire band during a performance. The “tempo meter” device resulting from this exercise can, in fact, be an extremely effective tool due to its ability to accurately determine performance tempos despite varying rhythms in the drum part being performed. INTRODUCTION The sponsor for this project is a bass drum player in a marching band and was looking for an unobtrusive but effective means of monitoring the band’s average speed (or tempo) during parades. The device traditionally employed by musicians to maintain consistent tempos is a metronome. However, metronomes are of limited usefulness in performance situations because they are only capable of providing a constant reference tempo; when the tempo of the performance drifts or shifts intentionally (which is a normal and common occurrence) the metronome is by definition incapable of following along and therefore becomes useless. What is required in order to solve this problem is a tempo meter – a device capable of monitoring the tempo at which a musician or group of There is already one tempo meter device which is commercially available: the Tempo Ref [1]. However the implementation of this particular device severely limits its usefulness. It simply displays the duration between each two consecutive notes as an average tempo. If all of the notes being played are of the same duration, then the value displayed should be fairly consistent and therefore somewhat useful. However, this sort of music wouldn’t be very interesting to listen to. Typically a drummer is playing various different rhythms according to the music, in which the durations between notes are always changing. Therefore, it was the sponsor’s desire to investigate the feasibility of designing a better tempo meter, one capable of determining the tempo of the music with reasonable accuracy despite its various rhythms. The primary goal of the project team was to design and construct one working unit to be used by the sponsor on various bass drums during parades. A secondary goal of the team was to attempt to design the device in such a way that it could be used for other types of drums (snare drums) and for other applications, such as a rock concert or a for a practice aid. The device resulting from this project addresses each of those goals. © 2006 Gifford, DVileskis, Gill, LaDuke Page 2 Proceedings of the Multi-Disciplinary Engineering Design Conference NOMENCLATURE Design Requirements: The first step in designing the tempo meter device was to determine the sponsor’s requirements for the device from a user’s perspective. The most important design parameters for this project were that the device reliably and accurately report the tempo over a wide variety of rhythms and tempos and that the displayed value be easy to read in various light conditions. However, there were several other key parameters which were important with respect to making sure the final product would be useful for its intended purpose. Specifically, the device had to be unobtrusive, which meant being relatively small (less than 3”x4”x1”) and lightweight (less than one pound). This also meant that the device must be mounted to the drum in a manner that wouldn’t interfere with playing the drum, i.e. not attached to the heads, the rims, or the mallets/sticks. Nor was it acceptable for the device mounting to require any permanent modifications to the drum. There was also a requirement that the device have at least ten hours of battery backup as well as requirements that it be both rugged, rain resistant, and esthetically pleasing. Concept Generation: The next step in the design process was to take the initial requirements and start brainstorming ideas for an implementation to meet those requirements as well as ideas for enhancements or improvements on the original sponsor’s concept. In varying degrees, this process lasted the entire duration of the project, modifying the design concept in order to (hopefully) improve or add value to the final product. Two of the most significant enhancements to the original concept were the addition of a metronome mode and the addition of a time-of-day clock. Neither of these features directly enhance the tempo meter function of the device, but both add significant value to the overall package without adding much complexity or cost to the design of the device itself. Microphone Sensor Voltage vs. TIme 1 0 Voltage (volts) DESIGN PROCEDURE The first sub-system implementation to be determined was the impulse sensor, or “trigger”, mechanism. Many different sensor technologies were investigated, including accelerometers, contact microphones, audio microphones, and others. Figures 1 and 2 contrast the responses of a contact microphone and a Piezoelement sensor to a single strike of a bass drum. The Piezo trigger generates a signal with a greater amplitude and a much quicker decay, both of which make detecting distinct impulses easier. Therefore, it was determined that the best solution was to use industry-standard drum triggers or drum pads, which utilize Piezo elements to generate an analog signal where a sharp spike indicates that the drum or pad has been struck. It was also decided, after much debate, that the device would have a phono jack connection for an external trigger, but no built-in sensor device. These two decisions, taken together, allow for greater flexibility of the tempo meter, in that it can be used with a standard drum pad or any of many different styles of drum triggers depending on the application. It also allows the device to be used as a practice aid by connecting a trigger attached to a snare drum via a standard patch cable to the tempo meter which can be placed on a nearby music stand. This approach also reduces the cost of manufacturing the device itself. 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 0.16 0.18 0.2 -1 -2 Time (seconds) Fig. 1 Contact Microphone Piezo Sensor Voltage vs. Time 3 2 1 Voltage (volts) ADC: analog-to-digital converter BPM: beats per minute (standard unit of tempo) LED: light emitting diode LCD: liquid crystal display PCB: printed circuit board RTC: real time clock beat: the "pulse" of the music, evenly spaced at a constant rate; when marching, each footstep is one beat impulse: a single strike of the drum; one note in the music; a single trigger event; impulses may or may not coincide with beats rhythm: the pattern of notes or impulses; typically more complex than a straight beat tempo: the rate of the beats, in BPM 0 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 -1 -2 -3 -4 Paper Number 06520 Time (seconds) Fig. 2 Piezo Sensor Proceedings of the KGCOE Multi-Disciplinary Engineering Design Conference The next sub-system to be addressed was the display. Numeric LED displays were discussed but rejected due primarily to the large resulting current draw on the battery-based power supply. The discussion then turned to LCDs. Different types of LCD screens were looked at, e.g. reflective vs. transflective vs. transmissive, color vs. monochrome, numeric vs. graphic. A monochromatic reflective-type display was chosen, again primarily due to current draw concerns. The selected LCD draws under 5mA, whereas a similar backlit LCD draws over 100mA. A graphic LCD (128x64 pixels) was chosen in order to facilitate displaying both the tempo value and time-of-day simultaneously on the same screen in different font sizes. This also allowed for greater freedom later in the development with respect to the appearance of the display and the operation of the various modes. Another sub-system which was the subject of much deliberation was the power supply. The original idea was to use a single 9 volt cell, but there were concerns about the inefficiency of generating 5 volts (or 3 volts) from 9 volts via a linear regulator. The next idea was to use a battery of four AA 1.5 volt alkaline cells with a low-dropout regulator to generate the 5 volts. In the end, this was replaced by a battery of four AAA 1.5 volt alkaline cells with a 5 volt LDO. This reduces the overall battery life of the device, but the resulting reduction in physical size of the device was deemed to be a worthwhile tradeoff. There were also discussions of supporting AAA 1.2 volt NiMH rechargeable cells, but the resulting 4.8 volt supply wouldn’t be sufficient to power the various 5 volt components, so this idea was dropped. Component Selection: The first component selected was the LCD panel. These tend to be more customized and less standardized than most of the other components in the system, so it became necessary to find an LCD that was actually available that met the criteria stated above and then work around this particular component. For example, the LCD panel that was selected has a built-in LCD controller chip but doesn’t have a built in negative supply to drive the LCD screen. Therefore, it was necessary to also source a +5/-5 volt dual output switching power supply. The LCD screen is driven off the –5 volt supply, and all of the other components (microcontroller, filter op-amp, RTC, LCD controller) are driven off of the +5 volt supply. The backup supply for the RTC is a single 1225 3 volt Lithium cell, which will maintain proper RTC backup for ten years. Page 3 choice was restricted to microcontrollers that the team were already familiar with, specifically the TI MSP430 and the Microchip PIC families of processors. The final decision was in favor of a PIC18F series part over the MSP430, because the MSP430 is only available as a 3 volt surface mount package. Using the PIC avoided the need for 3V/5V buffers between the microcontroller and the LCD controller logic. There was also an attempt to select all through-hole components rather than surface mount components for ease of prototyping and assembly (even though a commercialization strategy for this device would obviously include using surface mount components). The particular PIC selected was the PIC18F2515 (a 28-pin part), because it had the required number of I/O pins (20+) and more than enough Flash (48kB) and RAM (4kB) to implement this application. It also has a built-in I2C bus interface (for the RTC) and a 10-bit ADC (for the impulse detection). The remaining component selection was relatively straightforward. Experimenting with various Piezoelement drum triggers showed that the dominant frequency is around 3kHz. Therefore the values on the first-order active filter input stage were selected to provide a cutoff frequency of 5kHz, and the ADC was configured to sample at 10kHz (twice the cutoff frequency). Likewise, a 25MHz crystal oscillator was chosen for the PIC in order to guarantee enough processing power to process ADC interrupts at 10kHz. Pushbuttons were selected for the power and function controls from a manufacturer who produces both alternate-action switches (for the power switch) and momentary switches (for the three function switches) in the same form factor and also produces matching caps, so that they would be guaranteed to fit properly. Prototyping: Once components were selected and the schematic was created, components were ordered and two perf-board prototypes were built. Also, two PICkit II in-circuit programmers were ordered. The corresponding development environment and ‘c’ compiler are freely downloadable from Microchip, so that was all that was needed to get development platforms up and running. A 5-pin header and a couple of extra resistors are all that is required on the target boards in order to use the programmer. Therefore, the final product will also include the incircuit programming header, allowing for further enhancements in the future if desired. Once the electrical design and component selection were verified through testing of the prototypes, a custom PCB was laid out and ordered. Another critical component selection was the microcontroller. There are countless microcontroller families available to choose from, many of which could have been successfully utilized in this design. So in order to make the decision manageable, the © 2006 Gifford, DVileskis, Gill, LaDuke Proceedings of the Multi-Disciplinary Engineering Design Conference SOFTWARE DESIGN Impulse Detection: The PIC’s Timer0 module is configured to timeout every 100us. The high priority interrupt handler (which services Timer0 timeouts) thus initiates an A-to-D conversion every 100us unless one is still in progress. It also increments a global tick counter every hundredth timeout (every 10ms) which provides a mechanism for the rest of the system to keep track of time accurately. The A-to-D acquisition and conversion process normally takes around 20us to complete, at which point the low priority interrupt handler queues the result. Once every 10ms tick, the low level handler also inspects all of the samples collected since the previous tick. All of the signal’s peaks are rectified and averaged. If the peak-average for one tick’s worth of samples is more than twice that of the previous tick’s samples, then it is considered an impulse and the duration since the previous tick is queued up for the tempo determination algorithm to process at a later time. Back-to-back impulses are disallowed in order to avoid double registering impulses. Tempo Determination: The real heart of this device is the tempo determination algorithm. This starts with the impulse detector, which cues up the durations between impulses. Any durations over 2.5 seconds are ignored (not queued) in order to provide a sort of holdover function. Whenever the application runs and sees that a new impulse has been detected, it adds the new duration to a running tally that it keeps. When the tally surpasses 3.5 beats worth of time at the current target tempo, the application runs the tempo algorithm to determine the new target tempo and then displays the new value. This effectively means that the tempo display will be updated roughly every four beats, which seems to be a reasonable compromise between too often (every beat?) and not often enough. Also, the algorithm inspects the last eight beats worth of impulse timings (rather than just four) in order to improve the stability and accuracy of the calculated value. When it runs, the algorithm inspects all of the impulse durations within the current sample set and attempts to categorize each of the durations as a whole note, half note, quarter note, eighth note, sixteenth note, dotted half note, dotted quarter note, dotted eighth note, or dotted sixteenth note based on the current target tempo. Anything shorter than a sixteenth note is ignored. It also has to allow for a certain amount of slop in its categorization of the notes (20% under the reference or 25% over the reference). If the algorithm doesn’t find a majority of the durations in the current sample set that are categorizeable based on the current target tempo, then it assumes that the tempo has changed and attempts to re-categorize each of the delays assuming that the tempo is somewhere in the Page 4 range of 75-149BPM. Unfortunately, there has to be a default range because of aliasing, e.g. quarter notes at 120BPM are by definition identical to eighth notes at 60BPM. Also because of aliasing, it is possible for the algorithm to get “confused” for short periods of time, but it generally corrects itself quickly. Overall Functionality: The device has three different operational modes: metronome mode, tempo meter mode, and clock set mode. The device defaults to metronome mode at 120BPM upon power-up. The target tempo of the metronome can be adjust up or down within a range of 40-180BPM by tapping or holding the UP or DOWN buttons. These buttons increment or decrement the target tempo 1BPM each time they are tapped and scroll 10BPM per second after being held down for 1 second. In this mode, the target tempo value is displayed on the LCD, but flashes at the specified rate (with a 50% duty cycle). Any impulse detected from the trigger input will automatically toggle the device into tempo meter mode. The TAP button emulates an impulse when tapped, so tapping this button will also toggle the device from metronome mode to tempo meter mode. Once in tempo meter mode, the current metronome target tempo becomes the starting target tempo for the tempo meter. It is still displayed on the LCD, but no longer flashes. As long as there are impulses being detected (less than 2.5 seconds apart) the target tempo value will continue to be updated and re-displayed every four beats. Tapping either the UP or DOWN buttons in this mode toggles the device back to the metronome mode. In all modes, the mode is displayed across the bottom of the screen, and the time-of-day is displayed in the upper-right corner of the display. Simultaneously pressing both UP and DOWN toggles the device into clock set mode. In this mode, instructions are displayed explaining what each of the buttons does. The UP button increments the minutes field, and the DOWN button increments the hours field. Holding either of these buttons for over 1 second will scroll the appropriate field. The tap button returns the device to the metronome mode, but the most recent target tempo (from either mode) is maintained. The clock stops advancing while in the clock set mode, and the new time value (with seconds set to zero) is written back to the RTC upon exit from this mode. There was an overall design goal to keep the user interface simple and for it to require as little interaction as possible. In most cases, the procedure is to turn on the power and start playing, which is about as simple as it can be. Various parameters that could have been user adjustable (such as the number of beats between updates) were hard-coded in order to maintain this ease-of-use. Paper Number 06520 Proceedings of the KGCOE Multi-Disciplinary Engineering Design Conference MECHANICAL DESIGN Material selection: Due to the limited time frame for this project and the sponsor’s limited budget for this project, it was decided to mill the case out of aluminum billet. The aluminum stock was donated to the team, and the milling was performed on a CNC machine at the RIT campus. Aluminum would be an unlikely choice for the case material if this device were to be mass produced; plastic would be a much more likely choice. However, for a single working unit (which doubles as a proof-of-concept) aluminum is a very attractive option. It is relatively lightweight, yet extremely strong, thus providing the necessary ruggedness. It also makes for a very sano finished product. Case design: The case itself is designed in two halves: a top (front) half and a bottom (back) half. The two halves are located to each other by way of matching stepped edges around their mating surfaces. There are four #6-32 flathead stainless screws with sealing Orings that connect the two halves of the case together. The mounting holes for these screws are arranged in a non-symmetric pattern in order to provide proper alignment of the two case halves. The PCB is mounted to four mounting bosses located in the top half of the case by way of four 4-40 screws. Two of these bosses are located directly between pairs of pushbuttons, in order to provide as much support for the buttons as possible. Most of the components are mounted to the front of the PCB, but the batteries are all mounted on the back of the PCB for easy replacement. The potentiometer for adjusting the contrast on the LCD and the in-circuit programming header are also located on the back of the PCB. All of the machine screws inside the case (PCB and LCD mounts) are Loctited in place to protect against vibration. The case screws should be held in place by the O-rings. The case also has holes for each of the four buttons, and an opening for the LCD screen. The LCD opening is filled with a piece of Lexan to protect the surface of the LCD, and the Lexan is slightly recessed into the aluminum case to protect itself. In order to improve the rain resistance of the device, the Lexan window is sealed to the aluminum with an appropriate silicone sealant. Input jack: The input is a 2-conductor (mono) 1/8” female phono jack which mounts in the side of the top case half. The design team originally planned on a 1/4” jack, which would have allowed for the use of a standard patch cable to connect the trigger to the tempo meter device. However, the 1/4” jack was replaced with an 1/8” jack in order to save valuable space inside the case. This allowed the case to be significantly smaller than would otherwise have been possible. At worst, this would require the use of a simple 1/4”-to-1/8” adapter. In the sponsor’s case, the Page 5 trigger will be customized to have the appropriate male jack connected directly to it. Therefore, this is a minor issue. Also, this device can be used with more than one drum at a time, such as a snare drum and bass drum of a drumset, by simply connecting two triggers together in parallel with a simple Y-adapter. This particular arrangement would significantly improve the performance of the tempo determination algorithm when used with a drumset, because it would be able to see (hear?) more of the rhythm being played. Mounting bracket: A bracket was designed specifically for attaching the tempo meter device to the shell of a marching bass drum. The bracket is a U-shaped metal piece with a pivot hole in each side which locate on pivot pins milled into the case. The bracket snaps onto these pins, and a thumbscrew is used to hold the device in place relative to the bracket. A curved slot for the thumbscrew allows for a wide range of mounting angles to accommodate various sized bass drums as well as various sized bass drummers. The bracket itself is mounted to the bass drum by way of two strips of 3M DualLock recloseable fastener, which is plenty stout enough to hold the device steady on top of the drum during a parade. SPECIFICATIONS Default tempo: 120BPM Metronome tempo range: 40-180BPM Tempo meter fallback tempo range: 75-149BPM Tempo precision: +/-1BPM Input filter cutoff frequency: 5kHz Sampling rate: 10kHz Input noise threshold: 0.25Vp-p Display size: 128x64 Tempo size: 24x48 Clock size: 8x16 Battery life: ~15hrs Clock backup: 10 years (@ 25ºC) Overall Dimensions: 100x77x40mm RESULTS The primary result of this project is that the concept has been proven to be feasible. The sponsor is satisfied with the overall result, both in performance and appearance, and expects to use the device to monitor parade tempos for many years. The physical thickness of the device exceeds the original requirements, but in all other aspects, the design met the requirements set forth by the sponsor. The sponsor was also interested in the commercialization possibilities for this type of device. © 2006 Gifford, DVileskis, Gill, LaDuke Proceedings of the Multi-Disciplinary Engineering Design Conference Therefore, manufacturability became a secondary design goal for the design team. However, the realities of a twenty week project schedule and a limited sponsor budget severely limited their options. One example of this is the choice of case material. While plastic would be a much more cost-effective solution for mass production of a device such as this, the $20,000 cost of having a mold created made aluminum the material of choice for a single unit. If the sponsor was to pursue a commercialization strategy for this device, a major part of the ensuing effort would be to rehash 90% of the electrical and mechanical design of the device. This is because many of the components selected for this project were necessarily commercial-off-the-shelf items, but would be better implemented as custom pieces designed specifically for this application. This includes the LCD, phono jack, pushbuttons, and battery holders. Obviously, the PCB, case, and bracket would also require a redesign. The primary goals of these changes would be to reduce the overall size of the Page 6 device and to reduce the per-unit cost in a mass production scenario. ACKNOWLEDGEMENTS The design team would like to extend its thanks to Dr. Daniel Phillips (mentor) for his assistance and guidance and to David Krauter and Amy Kennicutt for their research into the marketability of the concept. Also, thanks go to John C. Gifford and to REDCOM Laboratories, Inc. for their generous donations of materials that helped make this project a reality. REFERENCES [1] Parsons, M., 2003, “LT Lug Lock Tempo Ref”, Modern Drummer, 27(12), pp. 48-49. Paper Number 06520