Robotic Xylophone
![Phil Pilgrim (PhiPi)](https://forums.parallax.com/uploads/userpics/612/nMG83RHE7MV61.gif)
I've been trying to build stuff to inspire my students about the possibilities for wedding microcontrollers to mechanical systems. In that spirit, I made this mechanical xylophone:
[video]
To those for whom the video does not display, it's here.
The xylophone is controlled by a Propeller programmed in Spin. It uses two servos: a HobbyKing HK15138 standard servo to control the mallets' rotational positioning and a Turnigy TGY-9018MG 9G metal-gear servo to operate the mallets striking the bars. I had tried a cheaper plastic-gear servo for the latter, but it quickly wore out -- not surprisingly, given the punishment it receives.
The bars are cut from 3/4" x 1/8" aluminum bar stock purchased from the local hardware store. I bought a three-foot-long piece and computed the lengths to yield 8 bars, spanning one major scale, with a little bit left over. The tonal frequency of each bar is proportional to the square of its length. The eight bars comprise one full octave, with two semitones separating the notes, except for between the third and fourth and seventh and eighth notes, which are separated by one semitone. (A semitone is 1/12th of an octave.)
Each bar is supported at its nodal points, which are 22.4% of the way from each end. This allows the bar to vibrate freely. The supports are covered with a self-adhesive layer of felt. I found that this was necessary to eliminate some nasty pinging noises as the bars were struck by the mallets. The mallets are wooden balls I found at the hardware store, press-fit onto laser-cut 3/32" Delrin stock. The "sounding board" is cheap 2.7mm plywood doorskin. Unlike stringed instruments whose vibrations are transmitted to the sounding board through a "bridge," a xylophone's vibrations are transmitted through the air to the sounding board (or resonant pipes) beneath.
The reason for two mallets is to minimize the distance the rotational servo must travel between notes. Also, the centers of all the bars are positioned equidistant from the rotational servo's axis.
All the parts, except for the bars are laser-cut. The bars were initially cut on a horizontal bandsaw, then trimmed to their precise lengths with a vertical disc sander, with the aid of a dial caliper. These could have been machined on a CNC mill from 1/8" aluminum plate with more precision -- especially regarding the hole locations -- but I was in a hurry and chose the more manual method just to get the job done.
Attached is an archive of the Spin program that controls everything. It's programmed to play the meager repertoire at random, separated by five-second gaps, with the proviso that the same tune cannot be played twice in succession. Each tune begins with a tempo (number of quarter notes in one minute), followed by bytes packed with duration and note info. Although it supports eighth notes, they cannot be played at a tempo much over 120.
-Phil
[video]
To those for whom the video does not display, it's here.
The xylophone is controlled by a Propeller programmed in Spin. It uses two servos: a HobbyKing HK15138 standard servo to control the mallets' rotational positioning and a Turnigy TGY-9018MG 9G metal-gear servo to operate the mallets striking the bars. I had tried a cheaper plastic-gear servo for the latter, but it quickly wore out -- not surprisingly, given the punishment it receives.
The bars are cut from 3/4" x 1/8" aluminum bar stock purchased from the local hardware store. I bought a three-foot-long piece and computed the lengths to yield 8 bars, spanning one major scale, with a little bit left over. The tonal frequency of each bar is proportional to the square of its length. The eight bars comprise one full octave, with two semitones separating the notes, except for between the third and fourth and seventh and eighth notes, which are separated by one semitone. (A semitone is 1/12th of an octave.)
Each bar is supported at its nodal points, which are 22.4% of the way from each end. This allows the bar to vibrate freely. The supports are covered with a self-adhesive layer of felt. I found that this was necessary to eliminate some nasty pinging noises as the bars were struck by the mallets. The mallets are wooden balls I found at the hardware store, press-fit onto laser-cut 3/32" Delrin stock. The "sounding board" is cheap 2.7mm plywood doorskin. Unlike stringed instruments whose vibrations are transmitted to the sounding board through a "bridge," a xylophone's vibrations are transmitted through the air to the sounding board (or resonant pipes) beneath.
The reason for two mallets is to minimize the distance the rotational servo must travel between notes. Also, the centers of all the bars are positioned equidistant from the rotational servo's axis.
All the parts, except for the bars are laser-cut. The bars were initially cut on a horizontal bandsaw, then trimmed to their precise lengths with a vertical disc sander, with the aid of a dial caliper. These could have been machined on a CNC mill from 1/8" aluminum plate with more precision -- especially regarding the hole locations -- but I was in a hurry and chose the more manual method just to get the job done.
Attached is an archive of the Spin program that controls everything. It's programmed to play the meager repertoire at random, separated by five-second gaps, with the proviso that the same tune cannot be played twice in succession. Each tune begins with a tempo (number of quarter notes in one minute), followed by bytes packed with duration and note info. Although it supports eighth notes, they cannot be played at a tempo much over 120.
-Phil
Comments
Your 2-servo radial layout is pure awesauce, and the fact that you made your own bars is amazing, both tone and tune are perfect. I am absolutely in awe and a bit jealous of this great achievement. Once again, everything PhiPi does is at an extremely finished and professional level.
It's funny, I'm at the opposite end of the build spectrum. I slam-build once (rarely a v2.) with whatever is laying around. Messy but functional, with found objects, plenty of superglue drips, etc. Over the years I have rationalized this on several counts:
1) I'm not a finish guy, I just want to see something work. Once it works, I'm happy and I move on.
2) My brief attention span requires me to finish a project before I get bored with it and get distracted by something newer and shinier.
3) I'm a toy guy, where the KISS principle rules. Usually my ugly "works-like" prototypes are accompanied by a pretty "look-like" rendering by a professional artist to get the idea across to imagination-free marketing types.
4) My crude building techniques demonstrate that the mechanisms don't require hyper precision, and can be readily mass produced or duplicated by others who are not master craftsmen.
That last point has been driven home many times recently after writing several DIY magazine articles. Getting people to get off their butts and scratch-build these days is difficult. Things need to look easily achievable, or people just turn the page. I build quick & dirty in hopes of making people say "sure, I can do that good or better".
PhiPi, you are in an amazing classroom situation where you lead by example. Your students see how high you have set the bar and I'm sure they are motivated by your enthusiasm as much as by the grades they get. Jeepers, how I would love to be in your classes!
Thanks for the kind words!
LOL! I doubt that 88 servos could keep pace with that! There are still cases where biology can trump technology!
-Phil
We built a xylophone for an exhibit for a children's museum in Las Vegas. One octave, with the longest aluminium bar being 24". I was project manager, and I learned a lot from this site:
http://www.nerdkits.com/videos/robotic_xylophone/
and this site:
http://www.mmdigest.com/Tech/breen_xylo.html
(The spreadsheet was very handy.)
I found the location of the nodes are critical. No solenoids on ours, just low tech mallets.
I don't know if your kids are inspired but I sure am!
Very true, but you have to be careful what you buy. I started by buying a toy xylophone at a local shop. 'Took it out, played a "scale," and noticed that something was just not right. The C->C octave was okay, but the intermediate tones were all equally spaced -- definitely not the way a major scale is tuned. So I took it back. That's when I decided just to get some aluminum bar stock from the local hardware store and make the bars from scratch.
-Phil
Nothing to add, except some day do a version with jars (if you're not a John Candy/Eugene Levy Shmenges fan, you might not fully appreciate this video):
-Phil
-Phil
-Phil
Come to find out it was our own Phil! Very, very cool!
As others have said, I love the simplicity of it.
Thanks for sharing.
https://en.wikipedia.org/wiki/Glass_harmonica
So what are you thinking? A three-servo challenge?
That's really neat, my wife want's one, and what do you know, I have the aluminum laying around.
servo could give you some fancy move's.
I'd need a lot more than that! Might need both of Publison's Parallax USB Servo Controllers!
But, yes, a radial arrangement does have that cool factor -- especially if the bars are somewhat pie-shaped.
And, yeah, a radial arrangement with four mallets at 90 degrees to each other could be controlled by something akin to a helicopter swash plate, thus reducing maximum travel. Hmmm ...
I'm now thinking about a set of chimes, hanging radially about a common center. I think two servos would do it: one for X; the other for Y. Each would operate a Delrin or UHMW (for slipperiness) panel with a slot in it, the two slots being arranged at right angles to each other. The mallet shaft, affixed on center at the top end, would hang downwards through the slots ...
-Phil
Does a pie shaped give you the same tonal quality?
-Phil