Thursday, October 7, 2010

The trombone and the swing

I've been spending so much time lately doing things that I want to blog about, that I never seem to find the time to update this blog. I'm pretty keen, however, to post something about each of the projects I've completed for the two robotics classess I'm undertaking, so here is some of what I've done since I last posted...

NXT Trombone (ME-84: Assignment 2)
From ME-84: Introduction to Robotics
ME-84: Introduction to RoboticsThe second assignment in ME-84 was to create an NXT-based musical instrument AND use it to perform a "recognisable" tune. I had been intending to modify a diagnostic program I'd created, based on a RoboCup Junior IR Soccer Ball and the HiTechnic's IR Seeker, but my eldest son challenged me to make a trombone, so that's what I did.

It took one afternoon to build the first version of my trombone. The idea is that the notes depend on the position of the slider, and are produced when you blow into the sound sensor mouth piece. I had originally wanted to make it look more like a real trombone, but thought it more important to see what could be done with a single Edu kit. The ultrasound sensor can be a little flakey, so I knew the slider would have to be long enough to spread out the eight or so positions required. In the end, I was reasonably happy with the performance of the ultrasound sensor (it performed better than I did!). I also wanted to use a formula to generate the correct note based on the ultrasound sensor reading, but I didn't know how to do a x^y calculation on the NXT at the time. In the end I found the hidden vi that maps notes to frequencies, and used that inside a case statement. At home, I asked my boys (who play piano), if they knew any songs that I would be able to play on the trumpet, and they taught me "Ode to Joy". I also learned how to dynamically control the length of the notes being played, using anotherPlay Note (no wait) and a Stop Note block.

Automated Swing (EN-10: Assignment 2)
From EN-10: Simple Robotics
I spent way too much time on this challenge. The assignment was to create a piece of playground equipment that included sensors and motors. I took this task as an opportunity to follow up on the swinging robot that I'd worked on during a biometics workshop back in August. The idea is to use motors to simulate the motion of a child on a swing, using the motors as legs.

Following some gentle encouragement from my wife, I made the robot look more like a swing seat. I'm pretty happy with how the NXT brick functions as seat, and it helps with the story of this robot as being a model of an "assistive device".

By estimating the period of the swing based on the length of the swing, and then doing some tweaking on top of that, I was able to come up with a motion that worked fairly well. The swing could start from rest and work up to a decent swing motion. The following video shows the robot in full swing (it had been started from rest)...



Of course, it would be much more impressive if the robot "knew" when to swing the legs based on the position of the swing. As a result I spent most of the following week trying to make use of a HiTechnic Accelerometer sensor to time the swing.

In the end, I gave up because of signal/noise issues. Between the vibrations naturally in the swinging and the extra acceleration caused by the motors, it proved to difficult for me (at this time) to solve the timing problem. I would however like to come back to this one when I know a bit more about filtering...

No comments:

Post a Comment