Archive for December, 2014

h1

Blocking Patents with Open Source Prior Art

December 29, 2014

An Embedded.fm podcast listener asked a question on Twitter about using open source as prior art to block future patents. So, of course, I’m going to answer on my blog.

I asked podcast guest Judith Szepesi of HIPLegal, LLP for advice. Note that she pointed me in the direction, any wrong turns I take are my own.

As of 2013, the US is a “first to file” country. It used to be a “first to invent” which meant that if you invented something and could prove it (dated, signed notebooks!) then if someone else patented it, you might swoop in and eat their lunch. But now that we are “first to file” it is all about getting to the patent office in time. This also means it is a bit easier to say when prior art is truly prior.

Prior art” is the sum of all public information that lead up to your patent. If your idea is in the prior art, it isn’t novel. For example, if I wanted to patent dilithium crystals used to control an antimatter reaction, there is a lot of Star Trek prior art that would say “no, someone thought of it first.” To get a patent, the idea has to be new (novel). The Star Trek prior art would show that my idea isn’t novel.

(We are not going to discuss how novel, that bar is a moving target. By the way, none of this is legal advice. Get your own intellectual property lawyer. I’m just here to babble.)

So how does this involve open source? With the explosion of open source hardware projects, there is the incredibly legitimate fear that you might build something awesome, share it with the community, and have someone patent it. (The open source 3d printing world turned into a bit of a blood bath. I’d add links but they are all so vitriolic. Ahh, here’s one that gives some back and forth.)

But isn’t open source code enough prior art to block a patent? Maybe. Probably not. You have to publish something in a way that makes it easily available to Examiners. The keyword there, of course, is “easily”: a source code repository on github is not easily findable.

You have two options to make your open source project easily findable prior art.

First, you could patent it yourself. Nothing blocks another patent quite effectively as being the first to file. You can still make it open source and/or freely licensed (we love you, Tesla!). However, patenting is expensive (though it can be cheaper for a small business, get the numbers before you assume a $50k price tag, look through the excellent NOLO Press’ Patent It Yourself: Your Step-by-Step Guide to Filing at the U.S. Patent Office, most of your fees will be lawyers’ so make it really easy for them).

The second way to create prior art (without filing patents) is by publishing. Now we are back to easily findable. The USPTO (US Patent and Trademark Office) has a list of publications they look at, called Non Patent Literature (NPL). If you look at the list, IEEE and ACM can’t be a surprise, those are well respected journals. On the other hand, there are a number of journals that make their living charging people for publishing prior art and providing copies to the Patent Office. Judith also mentioned that some examiners are using Wikipedia as well,  but, of course, that is not static, and thus not directly cited in their findings. Make sure your idea’s wikipedia page has good, respectable links.

To be considered prior art, you want your information to be well-indexed and dated. Consider Archive.org (they make the wonderful wayback machine). That’s indexed and dated. A series of journals from IEEE is indexed and dated. Your latest homepage is not.

I like Hackaday: their site is dated but not indexed. Could that change and it become a source for the patent office to use? Judith seemed hopeful about the idea in general: “I do see a future in which open source communities create a curated prior-art database.  There are a few starting up now, in software, and I do think they will become a significant source of prior art going forward.”

To summarize, the Examiners focus their searched on patents and easily searched publications. They aren’t going to come to you. You have to go to where they are looking if you want to establish prior art.

One final note: if you aren’t familiar with patents.stackexchange.com, it is a good place to look and provides some communication between USPTO and engineers with questions, even open source questions. It is also a reasonable place to try to establish prior art that wasn’t in the standard NPL (but by then you are fighting defensively). You can also submit prior art for a given patent directly to the USPTO:  Third Party Inquiries and Correspondence in a Published Application.

h1

I’ve got an IMU in my pocket and it wants out

December 23, 2014

I have this idea for another ring…

I ordered an Adafruit 9-DOF IMU board for a client who went on holiday vacation before signing the contract so now I’ve got this board burning a hole in my pocket. Given how much I spent at their site, Adafruit sent along a free Trinket board. At the same time, I was starting slides for a presentation entitled “Introduction to Inertial” and working out scheduling details to have ThingM’s Tod Kurt on our Embedded podcast. Combine all these things and what do you get?

One thing you don’t get is something that will easily fit on a ring. Still, if it could, what would I want it to do? Maybe I’ll even get boards made…

The idea stemmed from a magnetometer first. I’ve read about anklets with several cell-phone motors and a magnetometer that subtly teaches you which way is north. I’d love a little ring that glowed white when I was facing north, red when west, and green for east. It would be dark for south. It would be a neat little beacon.

Never mind that the almost-always-on LED will drain a battery fairly quickly so ring mounted will need to be easily rechargeable. Never mind that I’ll need an accelerometer to tilt compensate the magnetometer (oh! must add why to the presentation!). Of course, adding an accel does give me a way to turn it off and on.

Well, if I’m to make the ring, I need to write the code. Hardware is not my forte but if I get it working well, I can probably get help laying out an ATtiny and a magnetometer/accelerometer chip. Though, as long as I’ve got a whole IMU to play with, I might as well use it all.

I spent a few days stripping the Adafruit sensor code of anything I considered unnecessary (floating point? gone! functions that make the sensors interface generic? gone!) so it would fit on the ATtiny in the Trinket (5000 bytes of code space! whee!). And then I wised up and realized I was going to spend all my time making atan2 tables, I should do the prototype on a regular Arduino.

It is funny how 32k feels HUGE and the ATmega is blazingly fast compared to the ATtiny. I stopped rewriting the Adafruit code and started writing the code I wanted. This was a good decision as it gives me more time to play (and since that’s what this is for me, making it seem like work was a good way to get frustrated and move on to another, more fun project).

I think the accelerometer mode should be the simplest. It should glow red if gravity is felt in the X direction (positive or negative), green if Y, blue if Z. This would let me talk about how accelerometers are used as gravity sensors the majority of the time. While free fall detection and actual acceleration are interesting, mostly we want our devices to know which way is down. (Since I’ll use double taps to move between accel, gyro, mag, and off modes, discussing gestures will be natural.)

For the gyro mode, the LED will light proportionally to how fast the rate sensors see movement. This will go nicely with my notes about how rate sensors are only useful when things are moving.

The mag mode will be the North Star implementation I described before.

I started out wanting a ring on a Trinket. Now I want a multi feature demo tool in a box.

(Note: I cross posted this project log from a new Hackaday project. I’ll be putting build details over there as I get it working. I’ll probably post here when I write less technical stuff.)

h1

Books I’m giving my brother for the holidays

December 21, 2014

Last year, I gave my brother a bunch of books for the holidays. He professed to enjoying receiving them all. He hasn’t said which ones he liked reading. But, as a I said last year, we aren’t great communicators.

I also suspect he most liked me setting up his email even more: a “friend” had previously set up his email and it intentionally misspelled my brother’s last name. I, of course, sent the gifts to the correctly spelled name, my head being unable to cope with that sort of breakage. Anyway, I made a corrected email address and then forward the old account to the new one and sent him all the passwords (which he expected me to remember this year, hah!).

When I called to ask for his daughter’s addresses, we chatted for a few minutes. He said he’s reading a lot these days and would love more books, especially science fiction. I got excited, exclaiming I have the perfect gift. Sadly, he’s already read Andy Weir’s The Martian– three times! At least I know I’m on the right track.

I made a new list, partially from the ones last year that I’d forgotten or fell off my list. So far I’ve already bought

  • Neil Gaimen’s The Ocean at the End of the Lane. I asked Chris where he thought someone should start with Neil Gaimen and he thought maybe American Gods and I thought maybe The Graveyard Book thought that is young adult. But when I thought about about really-good-books without taking into about the author, The Ocean at the End of the Lane is higher in my personal ranking.
  • Ernest Clines’ Ready Player One. As soon as my brother said The Martian, I thought about Ready Player One. I don’t know why they are linked to me, maybe because I wish I’d written these books. No, not because they are popular but because they are deeply harmonic with the noise in my head.
  • Keeping with fiction, I went ahead with Ender’s Game. In Amazon, it is filed under “Classic Science Fiction” which where it belongs. The movie was not as good as the book (in large part because you couldn’t get a kid as young as in the book). I don’t necessarily like Orson Scott Card and I think the Ender books went on for much too long. But this is a great book and it was on sale.
  • Brandon Sanderson’s Mistborn Trilogy. Chris introduced me to this fantasy trilogy. Sanderson is so prolific, it can be tough to figure out where to start. This trilogy is fairly well encapsulated and a lot of fun. I have only dipped my toe in his other work though Chris gets lost in it.
  • Matthieu Ricard’s Happiness. Written by a molecular biologist turned Buddhist monk, I suspect my brother will like this book more than I did. I quite enjoyed the first 25% and then it lost me a bit in the deeper areas of Buddhism. I’m fully willing to believe (and practice) that happiness is a skill that requires practice and attention. However, I’m a product of Western education, the eradication of self is inexplicable to me unless he means balancing the System 2’s lies to cover System 1’s laziness (from Kahneman’s Thinking, Fast and Slow). That makes sense to me but I’m not sure that’s… Anyway, my brother mentioned an interest in Buddhism and Happiness is the obvious book for him if not for me.
  • Randall Munroe’s What If? Ahh, come on, we all read the wonderful XKCD webcomic with its mix of absurdity, love, and science. And I read the What If? blog with great enjoyment. I suspect my science-loving brother will love this though I worry that he may not be familiar with Munroe’s other work. I wonder if that will decrease his overall enjoyment, I hope not.
  • Allie Brosh’s Hyperbole and a Half. Last year, I got the hardcopy of this for several people. My brother-in-law never laughs aloud and he giggled through it. A visiting friend seemed a bit depressed (in part because he was visiting over Christmas to meet stupid work deadlines and because his cat had recently passed away) and we put this in his stocking, getting a few giggles from him as well. It is a great book that covers some fairly deep territory with panache (and humor). I recommend it to everyone. Though I’m concerned about the color images on a kindle (my brother said he had a color screen, I hope it all works out).

I started working on this list last week, making an Amazon gift list so I could pile ideas together. Strangely, this shows me just how much the prices fluctuate. Both What If? and Hyperbole and a Half were discounted 30% when I went to look today (and add another book I was thinking of). Now, I’ve decided to go ahead and leave the list a little broad, maybe a few more things will go on sale, helping me decide what else to get my brother. Some of my other ideas:

  • In the popular science category, I have: Ken Jenning’s Maphead about incredibly interesting subject of geography (yeah, I didn’t think it was possible either), Sam Kean’s The Violinist’s Thumb about genetics (and history of discover), Micheal Pollan’s The Botany of Desire about plants mating habits and how they’ve trained humans to care for them, and James Pennebaker’s The Secret Life of Pronouns about the wonderful world of words and the psychology of interpreting what someone means. Vladimir Dinet’s Dragon Songs about crocodilian (and Russian) mating habits almost makes the list but I think that was because I listened to part of it which set the voice in my head better than the writing did.
  • In science fiction, I have Douglas Adam’s The Ultimate Hitchhiker’s Guide to the Galaxy which contains all five books. I should just buy this one. It is a little pricier than the cheap ones but, gosh, at a per-word price it is improbably cheap. Heck, I should get it for myself, it is time for re-read of these, they make me happy. Talking about a good value even at full price, my list also has Neal Stephenson’s Reamde. What a romp! But my brother isn’t into computers so the attention to detail may be lost on him (and I already got Ready Player One which is somewhat similar).
  • In fantasy (I don’t normally separate sci-fi and fantasy, any advanced technology looking like magic and whatnot, but that previous bullet was getting pretty long. To keep this short, I’ll just put up some books.
  • Last year’s gifts had a lot of urban fantasy so this year, I tried to be shorter in that. I liked Mur Lafferty’s The Shambling Guide to New York City (and the New Orleans sequel). For all that these are full of dead things, it is a more character driven book than some of the others on the list. Other urban fantasy and some pithiness:
  • Back to science fiction or fantasy or whatever
    • Jumper (I love Gould… though I started with Wildside so maybe that is better. But Exo came out this year (Jumper #4) and so this is better path)
    • The Curse of Chalion (Where to start with Bujold? Vorkosigan is awesome but this is standalone. And awesome. But on the pricey side)
    • The Three-Body Problem (I am so looking forward to reading this book myself! I have such high hopes. This may be an example of giving a gift to someone else and hoping they don’t like it and give it back.)
    • Boneshaker (I remain a sucker for Steampunk.)
  • Last (but not least), I really enjoyed the The Best of Instructables. I seldom go to the website (being ad-phobic) and having them in a book has been awesome for inspiration and general interest. But I’m not sure about Kindle. I’d consider sending him Make Magazine but I’m not sure he’d be into that.

Having learned the price fluctuations in ebooks, I’ll watch them for a day or two and sort out what else to get my brother. Though if I was in charge of making profits at Amazon, now that the shipping window is nearly closed, it would make sense to push the prices of all electronic items up a bit for those last-minute shoppers.

What did I miss? Any books you especially enjoyed this year?

h1

Debugging

December 17, 2014

A podcast listener requested a show about debugging. I’m still working out just what he meant by that but between that and working on a Trinket, I find I have a few things to ponder aloud for you.

First, the Trinket is a small board with an ATTiny85 on it. It is a very low power, deeply embedded sort of processor. With all of 8k of code space and 512 bytes of RAM (and 512 bytes of EEPROM), this is a dinky little thing. Plus, with the on-board bootloader, there is only about 5000 bytes of code space. I feel like a kid again.

So why in the world would anyone use the Arduino interface with this? Well, it is what I have, it is what Adafruit had in their tutorial, and I’m too unmotivated to set up a GCC cross compiler (yet).

Usually when I use the Arduino compiler, it is with a proper Arduino board (or the MicroView which is a “proper Arduino board” for this discussion). Debugging is done via printf because there is a serial connection via USB after the bootloader has finished programming the board.

Under “Debugging Tools” on my resume, I have “DVM, oscilloscope, logic analyzer, JTAG, ICE, printf” so I’m fine with printf as a way to determine what is going on with my code. On the other hand, if I can have an on-chip stepping debugger, I much prefer that. But that isn’t an option with the Arduino compiler so I limp along. Nothing I do on an Arduino is all that complicated.

All that said, the ATTiny doesn’t have the serial debug interface. There is no on-chip debugger and no printf. That means debug is usually through GPIO lines and prayer.

There are tools that could help me. I think. But I’m trying to do it the way everyone else is. Or the way I think they are. I’m writing little pieces of code and running them. I’m blinking the little onboard LED once for good, three times for an error. It look a stupidly long time for me to figure out why my byte variable wasn’t getting to 256. It isn’t impossible to work like this but it is a lot harder.

So, yeah, maybe it is time to talk about debugging. We could start with Arduino (and mbed) and debug through printf. Then go into the tools available for that space. Then the SWD interface for the ARMs (i.e. Cortex-M0). What are ITMs and ETMs anyway? We could talk about timing errors due to debugging (both serial and on-chip). We could talk about the extras that are available on some IDEs (mmm… profiling and backtraces!). We could talk about GDB, how it is super powerful but opaque and a pain to the beginner. We could even talk a bit about data logging and error handling (other listeners have requested shows about these).  I wonder if we’d even get into unit tests since some systems I’ve developed for run on-target-hardware via debugger.

I feel a lot more secure and confident when I can see what my chip is doing. I don’t mind using printf but I’m better at getting things done with better tools. Most tools are cheap compared to my time.

So yeah, debugging…

h1

Another Day of Battery Life

December 16, 2014

To make a ring, I needed to minimize everything. Of course, if you’ve seen the picture, you already know I didn’t actually minimize much.

Still, batteries in wearables are a pain. For this wearable with my “you have to take it apart to charge it” methodology, well, longer battery life means this hack will exist longer. The more I take it apart, the more like it is that I’ll repurpose the parts to do something else. (I have this idea for a different ring…)

Minimizing power in Arduino is a topic that has been taken on by plenty of other people. And I happily reused their code and methods(Thank, you Nick Gammon!).

However, when planning a device, it is helpful to determine the size of battery you need. To that end, I made an Excel sheet (sorry, I default there) which I’ve put into a Google spreadsheet so you can see it with the math. The first sheet (words) describes the process in words. The second sheet (numbers) reflects the same information but with numbers. You fill in the orange boxes, it generates the green one.

The first step is to determine the different power states of the device. For Wordy, it is either on (display showing) or sleeping (Arduino asleep, accelerometer configured to wake and interrupt it).

 

My next step was to figure out how much time the system would spend in each of these states. My goal is for the ring to be on for about five seconds every five minutes. Sometimes it will be on more, as I play with it a lot. More often it will be sleeping, such as left on a table overnight. (Note: if you build a Wordy, I strongly recommend setting the ring so it will lose at Pong. Sometimes if you leave it on the X side with no Y tilt, the ring will play Pong by itself indefinitely.) Starting with the idea of five seconds per five minutes means I’ll probably be on the conservative side (unless it plays a Pong marathon without me).

Next, I measured how much current each state. I used my shiny new DVM-with-current-sensing (my old one didn’t have that (though it did have a more melodious beep in resistance mode)). You can use a resistor if you feel like doing it old school style.

(This pic is from my book. If you were unaware I wrote a book, well, yes, I did and it is full of jokes. And dinosaurs. But mostly embedded systems.)

Finally, I calculated how long the device would last given a 40mAh battery (the largest I was willing to use due to size constraints). The result turned out to be much greater than I expected.

This does not have to be the order of events: you might start with the idea of how long you want the device to last and choose the battery accordingly. Or you may have a fixed battery and a predetermined life and need to determine how much time you can spend in each state. Happily, the math works in all the different ways.

Note that this value I got was greatly in excess of my self-imposed goal (which was a puny two hours). It is also greatly in excess of what I said in the build instructions (which was 48 hours). My wear-time was even greater than the estimated value: I charged on Tuesday afternoon and it died on Saturday night.

Though, I’m pretty sure I can do better than these power numbers.

When I measured the MicroView without the accelerometer, the on-state power fluctuated between 10mA and 14mA, depending on how much of the screen was lit. (All current measurements were taken around 3.7V.) If I modify numbers on the spreadsheet, the on-state power of 10mA to 14mA, it changes from 3.5 days to 3.1 days. I switched it back to 12mA as reasonable middle ground.

The accelerometer doesn’t add much to this on-state value. On the other hand, for the sleep-state power, it is a very different situation. The MicroView alone took 0.14mA. The MicroView and accelerometer together take 0.31mA. If I change the sleep-state power from 0.31mA to 0.14mA, the amount of battery life expected changes from 3.2 days to 4.9 days.

The accelerometer datasheet says the accelerometer’s current consumption is 6uA to 165uA. Looking at the numbers above (0.31mA-0.14mA = 0.17mA ~= 165uA), it is clear I should be able to reduce the sleep-state power by reading over the accelerometer datasheet again. (There is also an application note about wake/sleep features.)

Skimming through the app note, I don’t care too much about the precision of the data (though I might in Pong mode but that is an active mode so it is ok to use more power there). It would be no problem to turn the system from 14-bit mode to 8-bit mode.

Sleep mode is limited to 50Hz sampling but that is what I’m sampling at anyway. Why am I still seeing the max current?

Ahh, according to the oversampling chart, I may see 165uA due to high resolution sampling. I can go to 24uA with normal sampling or 14uA with low power. However, I want some filtering either through oversampling or via the low noise setting. The combination of low noise + low power is back to 24uA.

Making only one change (from high resolution to normal sampling) should be enough to increase my battery life from 3.3 days to 4.6 days. That’s exciting. Excuse me, I need to go see if that’ll work and what else I need to change.

[Note: this was crossposted from Wordy’s Hackaday page project log.]