Monthly Archives: October 2011

Still more on my Arduino/Gameduino Satellite Tracker…

I need to think up a better name for this project. Calling it the “Arduino/Gameduino Satellite Tracker” is just too damned cumbersome for words.

Progress was slow today. I woke up around 4:00AM with a sore throat and a miserable cough. A quick trip to the urgent care clinic when it opened reassured me that I didn’t have strep throat, but I do have some kind of upper respiratory infection going. Lots of rest today. I did spend a couple of hours listlessly programming and watching the Tigers/Rangers game though, the main result being I now plot the position of the sun on the map:

While the text at the bottom still says “ISS”, the satellite being tracked is actually AO-51. As you can see, it is a polar orbiting satellite, and reaches much greater latitudes than the ISS.

I’ve been trying to remodularize the original Plan 13 code in BASIC, and that has made me go through the code and restructure it a bit. The solar calculations in Plan 13 are actually a bit odd: it goes through the trouble of converting the sun’s orbital elements into the same epoch as the satellite you are watching, mostly so you can reuse the “T” variable. It’s actually quite a bit simpler to just use the sun’s orbital elements directly, and that means the sun can be a completely independent object.

I’ve also got a bit more hardware on the way. I decided I wanted to store a fairly large number of satellite elements, so I ordered some AT24C1024 serial EEPROMS with a capacity of 128Kbytes. I can easily chain up to 4 of those together, to store 512K which should be more than enough.

I’ve also got some Zigbee radios coming, so I can send new orbital elements and synchronize the time easily from my desktop. (It’s mostly an excuse to play with Zigbee, but it will make for a nice setup).

After the clinic this morning, I stopped by Fry’s in Walnut Creek and found that they carry OSEPP’s clones of the Arduino. I’d rather spend my money at Sparkfun, but it’s nice to have a local supplier for those moments where immediate gratification is essential. I bought one of their OSEPP FIO boards, which have sockets in place for Zigbee modules. What I didn’t realize is that these boards aren’t programmable over USB: I’ll have to get one of those FTDI serial boards. For now, it will sit in its plastic case until I have need of it. It is cool that the FIO is actually cheaper than the Zigbee shield that I ordered. I’ll figure out some reason to use one.

I’ll shoot another video once I get multiple satellites loaded and some improvements in the user interface.

Addendum: It dawned on me that one way to test my solar calculations was to run them at the same time every day and see if the sun traced out an Analemma, the figure-eight shaped curve that you might have seen on a globe and given very little thought to. What’s cool is my simulation shows this effect pretty clearly.



iPhone 4S Disappoints? What the hell is wrong with you people?

I’ve had this rant percolating in my head for the last few days, and can’t let it carry into the weekend, so you all with have to bear with me.

First, the caveat: I’m a happy iPhone/iPad/MacBook user. These products are (for me) so clearly better than the products from other manufacturers that they replaced that they have become a part of my daily life. I always have my iPhone. I almost always am carrying my iPad. I do the bulk of my recreational programming on my Macbook. That being said, I’m not relentlessly tied to the upgrade cycle: my MacBook is an old white one (so old in fact the latest Mac OS X release can’t be installed on it). I have a first gen iPad, and will probably not upgrade until the next generation comes out. I have an iPhone 4, but partly upgraded so I could cycle my old one to my sibling.

And I recognize that other products might be preferred by other people. People have specific reasons for picking the products they like. Many people refused to buy iPhones when they were tied to AT&T, and AT&T customer service sucks. It wasn’t ever clear to me that any other cellular carrier had better service, but who am I to argue? Some people like the (quasi-) open source model of Android. Or the cost of phones. Or whatever features float your boat. If you bought an Android phone and are happy with it, who am I to argue? Enjoy.

But I’ve read an astonishingly large number of reviews about the iPhone 4S intro lately which make the claim that the phone is “disappointing”. And I simply don’t get it. Here is one to check out:

Why Apple’s iPhone 4S Disappoints.

I’ll quote:

The iPhone 4S is hugely disappointing.

Let me repeat: Apple’s new iPhone 4S — with the fastest processor in a smartphone by miles, perhaps the most advanced and smartest voice command assistant on a piece of consumer technology ever, and the basic design and feel of the most wildly popular and beloved cell phone of all time — is a big fat, tremendous letdown of a device, and the event where Apple CEO Tim Cook announced the new iPhone was the Al Capone’s vault of product launches.

This boggles my mind: the author is conceding that it’s fast and pretty, with cool voice recognition and a great camera, but it’s disappointing?

What the hell is wrong with you people?

The phone delivers a bunch of cool features. The voice recognition technology seems very cool to me, integrated in a way we haven’t really seen in consumer applications. The camera is shoots 1080p video and has image stabilization. And of course it folds in all the features that my iPhone 4 will get next week as part of the iOS 5 upgrade,

It’s a terrific upgrade.

Am I going to pay the carrier-mandated extortion to go out and upgrade? No, to be honest, I probably am not. But to label this release as disappointing?

What the hell is wrong with you people?

Many commenters seem to ask “where is the pizzazz?” To me that seems like going into a restaurant, ordering a meal and then asking why they didn’t add more sugar. We all like sugar, after all. Or maybe we should put gold leaf on our food, just so we can crap out precious metals!

The implicit (or often explicit) claim that all this criticism seems to have is that the people who buy Apple products do so merely to show off their wealth. That the iPhone is bling, without any substance. That it doesn’t matter what actual features anything Apple has: the fanboys will dash out to buy them anyway.

The truth is actually exactly the reverse. People buy them because they love them. People love them because they are good. It is pure cynicism to presume that someone who chooses an Apple product does so purely on vanity.

The iPhone and iPad are great (but by no means perfect) products. In my opinion, they are simply take more care and provide better service for their products than alternatives. If that ever ceases to be the case, then I’ll take my business elsewhere. Thus far, I haven’t seen the better product.

Scrappy introduces my Arduino/Gameduino Satellite Tracker

My cat Scrappy decided it was time to film a brief progress video of my Arduino/Gameduino satellite tracker. I completed the basic port and testing of my Plan13 implementation to C++ for the Arduino, and got it running pretty well. It doesn’t seem to be much more compact than Bruce Robertson’s qrpTracker code, but it isn’t any worse, and I like the way I modularized and call it a bit better. Eventually all this code will be released on this website for anyone crazy enough to want to build one for themselves.



More progress as it occurs.

First ever image of fourth-order rainbow

Long time readers of my blog may remember that I’m interested in rainbows (not unicorns, just rainbows). A while ago, I wrote a simple simulation that showed the formation of the primary and secondary rainbows by simulating the refraction of water inside a single raindrop. These two bows appear opposite the sun in the sky. But I never thought to try to simulate the higher order rainbows (caused by greater numbers of refractions inside water drops) because, well, I didn’t think that they existed.

But they do. And this week the first known photos of them appeared.

Short Sharp Science: First ever image of fourth-order rainbow.

Unlike the primary and secondary bows, these are actually in the direction of the sun. Very cool. I bet that I could modify my old rainbow tracer to make pictures of these things. Perhaps if I get a few moments this weekend.

Steve Jobs, 1955-2011

Yesterday, I was sitting at my desk at Pixar when a Twitter alerted me to the passing of Steve Jobs. I remember feeling mostly shock. While I knew that he was ill, and this was the likely outcome from his stepping down as the Apple, I still couldn’t help but feel a bit amazed that such a vibrant individual could be taken from us.

I didn’t know Steve on any kind of a personal level, but he’s had a direct influence on my life. In 1991, I left my job at Princeton University to join Pixar and work on their RenderMan project. I flew out from Newark to SFO, and was met by my manager, Mickey Mantle (no, not that Mickey Mantle). While collecting my baggage, he informed me that Steve had that very day laid off 30 employees (mostly having to do with the struggling hardware side of Pixar’s business), and that they had considered laying me off as well, but felt that it was unfair, so had decided to keep me on working on Pixar’s RenderMan software. Thus, I narrowly avoided the Sword of Damocles, and began my twenty year (and counting) career at Pixar.

Perhaps understandably, I tried to avoid the direct attention of Steve Jobs. I did, after all, narrowly avoid being laid off on my first day, so perhaps that wasn’t as cowardly as it appears now. And it was certainly true that for all his genius, Steve didn’t always exhibit the greatest of people skills (a flaw which I’ve come to recognize more in myself, and therefore forgive in others more as I get older). But I got to experience the “reality distortion field” on numerous occasions, and grew to appreciate his vision and his passion. His charisma, his ability to captivate audiences with his vision of the future, and his ability to create companies (both Pixar and Apple) which were great organizations which create great products speak to his great talent and particular genius.

This morning, Carmen reminded me of a story. This must have been shortly after we began dating, maybe in early 1995. She had checked out a book (she remembers it as The Mac Almanac) that gave the history of Apple, and she showed me some line which read something like “.. and then Steve Jobs left Apple, never to be heard from again”. She remembers that I grabbed the book from her, crossed out the line and wrote in “WRONG!” in bold letters. She was shocked that I would deface a library book, but I stand by the editorialization. At the time, Steve had founded NeXT and Pixar, and from my sideline vantage point, was poised to do amazing things.

I never could have imagined how amazing they would turn out to be.

Steve firmly believed that the way to change the world was to make great products, whether they were computers or films. He also believed that the best products took the best people doing their best work. At Pixar, I’ve been lucky to interact with some of the greatest talents in the film and computer graphics industry, and I credit Steve (alongside Ed Catmull and John Lasseter) for helping to create this atmosphere of excellence which still inspires me to wake up and come to work every day.

Early Facebook alum Jeff Hammerbacher’s was quoted after leaving Facebook “The best minds of my generation are thinking about how to make people click ads. That sucks.” This expresses the (in my opinion, totally deserved) cynicism about the business models of the information technology sector. They think that you are their product: they are selling your eyes and attention to others to make money. This reminded me of the sales pitch that Steve gave to John Sculley to lure him away from Pepsi-Cola. Steve asked Sculley if he wanted to “sell sugar water for the rest of your life, or come with me and change the world?”

Apple still believes that you are customers, and not product. They make great products so you’ll pay money to be their customers. Great products are really the best business model. If more business leaders believed that, the world would be a better place.

I don’t mean to lionize Steve. There is an annoying tendency to laud the rich and powerful, glossing over their faults, lauding achievements which fell in their laps through luck or circumstance, and overt emotionality when no personal link ties their lives to yours.

But Steve was “the real deal”. Innovator, visionary, and industrialist without peer.

To his family and friends, my condolences on your loss.

To the rest of the world: dare to be different. Steve changed the world. What are you doing today?

Addendum: His great 2005 commencement address at Stanford helps convey a bit of his humanity and his skill at speaking. Great stuff.



More progress on the Arduino/Gameduino satellite tracker…

Okay, I got about half of the Plan 13 code ported to C++. It’s a fresh port of the original BASIC code, but modularized into objects better, and with a few bits of tidiness that C++ provides over basic. I estimate another hour or so to finish the code, if I work carefully and efficiently.

I wasn’t feeling up to working carefully and efficiently this evening, so I thought I’d try to figure out a few mostly cosmetic issues. I had the idea that I wanted to change the map to color, which was easy enough to achieve. Then, I thought a large time display at the bottom. I had an 8×8 character font already in memory, so using it to generate huge characters at the bottom didn’t seem to be that hard. The problem is that the screen is only 50 characters wide, so that makes just six characters. I dummied it up to display six digits of time and the bottom, and it’s simply too big. Check it:

Clearly, the 8×8 character set isn’t quite what I need. I have a 3×5 charset which might do the trick, but I’ll have to get that formatted and loaded into flash. I’ll try that tomorrow.

ISS tracking on the Arduino/Gameduino

Well, tonight I had some mild success! My Gameduino satellite tracker is up and running! It’s not got much in the way of a user interface, but it here you see the ISS position marked with a purple/magenta dot, and then dots showing the position of the ISS every three minutes for the next two hours. My own location is indicated by the small star.

Compare this to the identical time using the tracker from the AMSAT website:

It seems to match up pretty well. I had originally planned to port my own code for Plan13 that I wrote in Python, but I am currently using VE9QRP’s Plan13 qrpTracker for the Arduino. It works pretty darned well, which significantly blunts my enthusiasm for porting code. We shall see.

Addendum: I’m planning on adding some interface elements to allow you to switch between multiple satellites, maybe a rotary encoder + push button. And I have some software changes in mind.

Creating graphics for the Gameduino…

I had a project in mind for the Gameduino, part of which requires the display of a world map. But the Gameduino has a relatively limited amount of memory, and the “background” graphics is character mapped: instead of providing complete flexibility to plot individual points, the Gameduino memory is organized as a 64×64 array of 8 bit memory, each specifying a single 8×8 character. Thus, to make a “map”, we need to generate a character set and then build the resulting image out of those characters.

I began with a 400×200 map that I shrunk down from the image I got from this page and converted to a simple black and white image. I then tried to see how many unique 8×8 tiles there were: in this case, 342 unique tiles were needed to reproduce the image exactly.

But I don’t need to reproduce the image exactly, I just want as close an image as I can find, encoded with as few characters as I can find. I suspect that if I wanted to think about this hard, I could figure out a way to use some fairly strong bit of math to find a good solution. The problem would seem to be a binary vector quantization problem: each tile can be viewed as a 64 element binary vector. The problem is to find a set of 64 bit code words that approximate the distribution of codewords from the image tiles.

But of course I am lazy. When confronted with problems like this, I like to use techniques like simulated annealing to solve them. In fact, I coded up a pretty straightforward hill climbing algorithm. It simply takes a subset of (say) 128 tiles, and sees how closely it can approximate the image using those tiles. In each iteration, it swaps one of the tiles out for a different one, and keeps the new mapping if it lowers the number of error bits. A proper simulated annealing schedule would probably help, but even as slow and inefficient a scheme as it is, it still does a good job.

Here’s an animated gif that flips between the target and the image that I discovered that can be encoded with 128 characters. That still leaves 128 characters to use for, well, alphabets and numbers and the like. Looks pretty good.

I might work a bit more on this, to see if I can get a small bit better, but it’s useable for now.

Addendum: I added a few things that made it a bit better. The previous best map had about 650 bits different. I implemented a simple annealing schedule in my optimizer, and allowed it to use tiles which were not already in the existing pool by simply modifying tiles with single bit changes. This resulted in an image which has only 460 bits different. It’s annoying that it created a new “island” off the east coast of South America, but it’s still pretty good.

Addendum2: Oops, the reason this worked out better is that it uses 192 characters instead of 128. I was playing with different settings as I made changes. 192 characters is the max I could use in this application. That leaves 64 codes, which nicely covers the ASCII codes from 32 (space) to 95 (underscore) and includes all the capital letters and numbers.