Like a lot of classically trained musicians, I sing secretly at wine glasses in restaurants and at other people's fancy dinners. If the glass is lead-crystal, there's a certain note, the resonant frequency, you can find, can hold it beating against the inside of your ribcage. Theoretically, one could shatter the glass with this note, held long and loud enough. But while my pitch is good, I am not a particularly skilled vocalist, and I lack the volume, or anything very close to it.
You should arrange to see shatterglass someday, in person or on video. It's neat. The whole glass writhes. The rim beats like a heart, pulls itself into an oval, then back the other way. The little puddle of light in the shadow of the glass dances like the ripples on the bottom of a pool, unfolds itself spidery over the table. The glass, this solid fragile thing, comes alive, shimmers on the edge of movement and stillness, all potential unspoke.
(If you're better than I am, eventually it just shakes apart, but I can't ever get that far.)
The robot works like this: it has cameras. The cameras look around at how fast things are moving by the robot, and it guesses what speed it's moving at. Then it fires its thrusters in the opposite direction to slow itself down. So if the robot is going really fast, it wants to fire its thrusters a long time, say half a second, and if it's going slowly, it wants to fire them much less, say a hundred milliseconds.
So there's an amount here, a coefficient that says 'if the robot is moving at this speed, fire the thrusters this amount. If the robot is moving at half the speed, fire the thrusters half as long'. This amount that calculates observation from response is called 'gain'. In an ideal universe, the robot would see how fast it was going, and use its gain to figure out exactly how long to fire the thrusters for, and bring itself to a perfect stop.
This isn't an ideal universe. The robot sometimes can't figure out how fast it's going, say, if a goofy researcher is doing zero-gravity somersaults right in front of one of the cameras. (I would never do such a thing! La la la. Must have been some other white-haired roboticist.) The solenoids that control the thrusters aren't perfectly accurate. Sometimes (gasp!) the vision code makes mistakes - vision, like AI, is about probabilities and best guesses, and often wrong, and I gave the robot fairly naive algorithms.
So we were trying to figure out what the robot's gain should be, which is a very complicated process. It's easy to do for a set of equations, and very hard to do for a real, imperfect robot.
The Configure The Robot Dance goes something like this: I shove the robot with a broom. The robot looks around, sees that it is moving, and fires its thrusters in the opposite direction. But it overcompensates and is now moving in the opposite direction. So it looks around and fire its thrusters in the original direction. And overcompensates again. Whee! At about this time, I tell one of my teammates to turn off the robot, in a sentence specially constructed to contain every profanity I know. Then we insult the robot's parentage, until we realize that the parents are either us, or the very sexy CNC mill. :)
(It's just a zoom to the left, and then a whoosh to the right, focus your cameras, and blame everything in si-i-ight!)
Then we tinker with gain, thruster instrumentation, the configuration routines for the camera, thruster pressure, center of gravity, and the like for a while. Someone sends for a pizza. Someone else contemplates the remblance of a particular screwdriver to a throwing knife. Then repeat the Configure The Robot Dance again.
So, let's look at this too-far-forwards, fire-thrusters, too-far-backwards bit. If you draw a graph, it looks like this:
Someone shoves the robot with a broom, and it's moving to the left quickly. Then it fires its thrusters, slows down, speed goes towards zero, reaches zero, keeps going down - moving to the right now, the robot fires its thrusters again, speed goes up towards zero, keeps going up, too high. Too far to the left, fire, too far to the right, fire, too far to the left, fire...
Doesn't that look like a sound wave?
All the AI, all the solenoid delays and vision granularities, gain and pressure and weight, focus the sound like the curve of a wineglass. The robot actually thinks and moves by singing.
And as soon as I realized that, all we had to do to get it to work, to find its position and hover there, was teach it the right notes. Resonant frequency. The note that shimmers on the edge of stillness and motion, the note that makes it come alive.
I can do that. I've been doing that to wine glasses in fancy restaurants for as long as I can remember. I know what that's like, the wierd underchords you get when you're not at quite the right note, the way everything begins to shimmer when you're close.
And now the robot works, a thing of metal and machining and music.
This makes me very happy. So happy, in fact, that you all had to sit through a livejournal post about it. :)
Page Summary
October 2008
|
teaching robots to sing
So what's the damping like? If you stop driving it with the broom, how many periods does it go through before it stops oscillating (detectably)? We're actually testing five different feedback routines with different characteristics - that's our actual research, with hypothesis and control and all those scientific trappings. :) This was just one little project as part of an undergrad AI class, long ago in a state far away. I'm susceptible to the romance of it, though. I mean, aren't people meant for higher things than driving or picking bell peppers? It wouldn't be any less annoying, because this is a robot that operates in zero-gravity - there's not enough friction to damp steady-state errors. Wouldn't you get Zeno's robot that way? Undercompensating in a frictionless environment, it would start moving to the left, fire thrusters left, continue moving left, fire thrusters left, continue moving left, fire thrusters left -- and never *quite* stop moving left, until it bangs a wall or the edge of the universe or runs out of fuel. At least overcompensation has the robot oscillating around an approximately set point. (ObYouObviouslyShouldBeAPhysicist) Holy crapola -- this is what you do? Most unexpected, but then again, I never had any expectations of anyone -- it's neat that you ran across my LJ and now to see what you're up to is also particularly fascinating. Reminds me of when I ran into Derek last year ^_^ I didn't expect it either! I actually went and got my first degree in art - computer animation. But I kept getting deeper and deeper into the computer, trying to make it do what I wanted, and I discovered something wierd. Science is when you start with the entire universe, and take it apart looking for the pieces that combine to make everything - the laws of physics, or the chemical elements. Art is when you start with the simple pieces - a color, a line, a shadow, and build them back into the world. I'm currently at CWU for a masters in Teaching English to Speakers of Other Languages to help prepare myself for teaching in Japan with the JET program and other similar programs. I like where I'm going ^_^ Well, it's hardly a universal view - lots of people have told me that Science is wonderful and rational and art is all fluffy and useless, or that art is wonderful and creative and science is all rigid and oppressive and squashes ingenuity.
(no subject)
- 1) neat! i gotta get some tech toys i can talk about. 1) Yes, yes you do. :) wait-- does this mean you can tame the magic beastie by throwing a harness of blinky lights over its head? because whenever the lights move it will think it's moving and adjust to follow? that's poetry. and then there's the timbre of different instruments' resonances. there's something entirely different about that shimmer on a flute and on a cello -- but they are both delicious. |