Friday, August 29, 2008

How to skina cat, part 1.5

I am clearly an idiot. My smoothing "signal reduction" attempt last night just added more noise. I looked at the first graph today, and realized I just need to get rid of the "spikes." After doing that, I get:

Picture 3

Now, there we go. Eight unique states which occur only once per cycle. That means I should be able to uniquely map the head positions to these values.

Thursday, August 28, 2008

How to skin a cat, part 2

Controlling this robot kitty has been more difficult than the bear. You can't expect much from a $30 toy. Given the price, its quite ingenious. It's just not modder-friendly.

I've been focusing on the head. There is a single motor. The build these toys using DC motors, as they are cheaper than servos. The eyes, mouth, ears, and up-and-down head movement are all controlled by this motor, with a pretty complex gearing. The feedback to the microprocessor comes from a "wiper." It has three contacts that become closed as the motor spins to various angles. Here is where the difficulty lies. Interpreting this signal to deduce the position of the head.

I started by just getting the raw voltages from each of the three sensors. The arduino outputs these as numbers between 0-1023. After a few experiments, I found that when the wiper contacts are engaged, the values are around 1023 +-. Anything less than 1000 i think is basically "off." So my next step was to translate each of these to a binary value. 1 if >1000, 0 otherwise. So now I have three binary numbers. I tried to keep track of these as I watched the head go through its cycles, but it was pretty futile.

My next insight came in translating these 3 binary values to a single decimal number so that I could graph them. I assigned a 1, 2, and 4 to each binary digit and added them up. The original graph looked like this:

Noisy signal

A lot of noise, but definitely a pattern. Making progress...

The next step was to try to clean up this signal. I played around with the binary translation scheme a bit, but then I decided to smooth the values by averaging across the previous numbers. This took care of the spikes and irregularities. Eventually, I ended up with a smoother signal:

Better Signal

Now its a lot easire to compare the actual head states to the signal. My main roadblock now is to come up with some efficient algorithms to process these signals. I've been able to clean them up quite a bit, but there is still some work to make the final translation to discrete states. The problem is that I have a total of 14K of program space on the Arduino, and half of that is taken by the motor controller and the wiimote that will probably be attached. That means I'll have to come up with some cheap algorithms to figure this out.

How to skin a cat, part 1

Tip: Start at the lower abdomen, and cut toward the neck.

Look at the cute kitty

How to skin a cat

How to skin a cat

How to skin a cat

How to skin a cat

How to skin a cat

Wednesday, August 27, 2008

Mythbusters - Season 7

"By the way, I should point out, this is not a real space suit. It's just my wear around town space suit."

Tuesday, August 26, 2008

olio

1. I really love the local music scene. The Precinct is currently my favorite place to go to listen to live music. On Sunday nights the Sea Monsters play. They are composed of a number of local musicians, and feature a weekly guest artist. Regulars include Christian McNeil and Jesse Dee, who are just, frankly, the balls. The best guest artist I've seen so far is Gretel, with guitarist/singer Reva Williams. They're supposed to playing this Thursday; hopefully I'll be able to go see them.

2. I'm conducting a monetary/social experiment at work. There is a small table outside my office. A few weeks ago, I noticed a stack of four or so pennies sitting there. I decided to add one penny to the stack everyday; I have plenty of them, because as we all know, pennies are practically worthless these days. My question is, what is the tipping point where a stack of pennies becomes enough money to take? A stack of 15 pennies isn't worth the bother of taking, but what about $20 worth of pennies. What is that point at which a pile of pennies becomes worth taking? I'll let you know.

3. Dreams. To quote The Cranberries, "It's never quite as it seems." A good percentage of my dreams are about the same thing. Never the same dream, but always a common theme. For whatever reason, I have to go back to high school. PISD (Plano Independent blah blah) has changed their graduation requirements, and for whatever reason they are retroactively enforcing them. Forget that I have a bachelors, masters, and Ph.D. They have deemed my high school diploma null, and until such time as I fulfill their requirements, all subsequent degrees are nullified. Sometimes, I have to go back and take a math class; and not to be snobby, but I always feel in my dreams nonplussed. Here I am with more education than the high-school math teacher, but I am subject to their trigonometry or algebra or whatever lessons and tests. Sometimes, it requires me going back to band. I have to repeat my senior year of band to graduate. In real life, it is possible that I feel a small tinge of guilt for blowing off the last semester of band. At that point, I really didn't care. My trombone had basically broken, but I had no desire to fix it. I wasn't going to continue to play trombone; I knew I was done after graduation. I essentially faked the last semester. At that point, I had discovered that there was a bigger social scene than the band geeks. I started dating Jenn, and really didn't care about band so much anymore. So, to sum up my ramblings, in my dreams I am usually back at PESH, trying to finish one or more classes. The most recent dream, I had to take a history class. I stand up in the middle of the lecture and start ranting about how bullshit this is. I have a job on the otherside of the country that I need to be at, but instead I have to move back to Texas for a year to finish high school. No one seems to sympathize though. Well, thats it. Go to work Freudians; why do I have this unfinished business in high school?

Saturday, August 23, 2008

Obama-Biden

Hey,

I just made a donation to help the Obama campaign prepare for the general election and receive a first edition Obama-Biden Car Magnet.

Make a donation now to receive your own:

https://donate.barackobama.com/obamaandbiden

Thanks!

Monday, August 18, 2008

Michael McDonald

So, I never really thought to much of this guy. I was vaguely aware of "Yah Mo B There" and none to impressed (but, who am I too judge?). But, amazingly, I just read that he was involved in both Steely Dan and The Doobie Brothers. What the hell? Mr. McDonald, I apologize for ever questioning you. Two of the greatest bands of the 70's?!?! Jesus, I'm an idiot for ever doubting.

In related news, Paris Hilton officially rocks balls:

See more Paris Hilton videos at Funny or Die

Wednesday, August 6, 2008

Dune

The novel (not the movies) is one of the greatest pieces of art in the last 50 years. Its astute and almost prescient observations of the importance of Mid-Eastern oil in politics, global-economics, religion, and culture earns it:

Monday, August 4, 2008

No. 1 on my birthday

What song was number one on the day I was born?

Escape (The Pina Colada Song) - Rupert Holmes

I lose. By whatever criteria, I lose horribly.

Thanks to the internet!

So, about a week ago, I posted the video of the evil teddy bear to my blog. I had put it there to show my two readers. Within a day, it had exploded across the internet with 20,000 hits on YouTube!

I think the culprits are the wonderful people from Adafruit (Buy from them!!!). I mentioned where I got the motor controller and I think someone from there posted my video and pictures to:

Make

From there, my favorite gadget blog picked it up. This is where I got the most hits from.

Gizmodo (Hi Giz, you guys rock!)

From there it traveled on to other places in the land of the interwebs:

The Robot Blog


Destructoid

And, last, but not least

gaygamer.net

("For boys who like boys who like joysticks" is there motto. I doubt mine was the only bear on there, if you catch my drift!)

Thanks the Internet!! Lots of great feedback. Surprisingly I only read one negative comment!

Evil Teddy Robot Instructions, part 1

Unfortunately, I didn't document the project at all along the way, so everything here is from memory.

See a couple of posts ago for the big parts you will need.

First, get yourself a BJ Bearytales. Now, you're going to want to field dress the bear carefully. The skin is attached to the body in some key places. I would start with a slit vertically up the abdomen, and then go across the neck. Be careful on the head. The nose and the ears and a few other places are attached to the skull. The tricky part is the back. The backpack is holding on the skin here. What you need to do is take out the backpack screws. The manufacturer thought it would be funny to use these annoying little triangle screws. I was able to get them with a flathead screwdriver; they're not screwed in too tight. (Don't be afraid to have fun mutilating your little friend; he would do the same to you if he got the chance)

OK, now you have the bear stripped. You'll see a yellow wire going down his left arm and around his hand. I wasn't sure what this was at first, so I went ahead and removed it. It turns out to be the antenna to trigger his hand accessories. If you plan to use the accessories, then leave it be.

If I remember correctly, the circuit board should be exposed now. You can unscrew it if you want and pull it off a little. Be sure not to sever any of the wires yet, you are going to want to keep track of which ones are which. I started by removing the skull. There are 7-10 screws holding the skull on, including two on the neck. Take all of these off. The last thing holding on the back of the head is a little spring clip on the neck. Carefully pull this back and remove the back head plate.

You should now see a green gear box. I don't think it is screwed on, but It is attached to the mouth, ears and eyes. I would first, move the ears out of the way (no need to remove them, just unhook them from the gear box). If you look through the eye holes and mouth from the front you should see how they connect to the gear box. Carefully slip these off the hooks using a small screwdriver or other small tool. You should now be able to remove the gear box.

Notice where the wires go on the gear box. Two of them attach near the bottom, and the other three attach near the top on the side. The two bottom wires drive the motor. The top three are for sensing the position of the gears. This is to make sure he doesn't slip a gear and stop mid-blink, horrifying your children with his half-blunk hollow eyes. You can remove the sensor circuit board with a screw-driver, I think. It is interesting to see how its set up. I think the middle wire is either ground or power and the other two are for sensing. I didn't use them for anything, but they would be extremely useful to get feedback from the head. I just didn't have enough pins on the Arduino to do this.

So at this point, I cut the head motor wires about halfway between the gearbox and the circuit board (to leave myself enough room on both sides to re-attach if I needed to). This time you can start to play with the motor using your own power supply. You'll see that if you run it in one direction it will drive the eyes and ears in a periodic cycle. That is, he blinks, he wiggles his ears, blink, wiggle, blink, wiggle, blink, ad infinitum. If you run it the other way he'll quickly run his mouth half-way and then get stuck in a horribly loud clicking lock-jaw position. They key to mouth is you run the engine a little bit one way, and run it a little bit back the other way. If you run it just a little bit it will keep the eyes and ears from blinking. I think it disengages them when you run it one way, and then reengages them when you run the other.

That should be enough for you to play around with now. I'll update more soon, including a picture of the original circuit board with a rough pin-out listing.