« July 2007 | Main | September 2007 »

August 29, 2007

Accelerometer and USB Bit Whacker

Trying out new sensors for my PIC projects can be tedious with only LEDs or 2-line LCD displays to provide feedback.  When I don't quite know what you are looking for, there can be some fiddling around to get things going. The USB Bit Whacker makes this first prototyping step really easy. With the 18F25xx or 18F45xx USB enabled chips from Microchip and some software created by Brian Schmalz (the USB Bit Whacker software), you can see how your new sensors are going to act with a PIC chip in just a few minutes.

The UBW lets you control pin input and output though the USB port on your computer with a few simple commands.  Using standard USB/Serial drivers on the computer (available from Microchip and elsewhere), you can interact with your UBW through a terminal application or any language the speaks serial. That's all there is to it. I built an 18F4550 board that uses Brian's UBW firmware with a minor modifications. But for real speed, just buy one ready to go from Sparkfun (shown in the photo).

UBW and Accelerometer 

I got a new +/- 2g accelerometer and a UBW from Sparkfun and wanted to see them in action right away. Using my UBW from Sparkfun, I added some header pins and used some jumper wires to hook things up as shown in the photo (this part takes about 2 min if you move slowly). The accelerometer is a 2 axis (x-y) device that offers voltages at the outputs between 0 V and Vcc (roughly) that are proportional to the acceleration along the x and y axes. Since there isn't any difference between the acceleration due to gravitational force and that due to changing speeds, the device can work dynamically to measure motion (acceleration) or pseudo-statically, to measure orientation in a gravitational field.

Plot of Accelerator Voltages


 

(Click for full-size image)

  With a few lines of Python code reading the serial port, I was able to log data from both axes of the accelerometer as I slowly rolled the accelerometer along my desktop. The resulting data is shown in the plot below.  As you can see, I rotated the device through 360 degrees in about 22 seconds, taking a few readings per second.

Links:

* Sparkfun -- Lots of cool stuff here!
* UBW at Sparkfun
* UBW Homepage
* Accelerometer data sheet
* Accelerometer at Sparkfun 
* Python data logger application

August 13, 2007

Climbing 14ers -- Challenger Point and Kit Carson Peak

All the info you could want on climbing Colorado's 14,000 ft + peaks can be found at 14ers.com, so I won't write much about the route. But I thought you might like to see the pictures.  It was a beautiful spot and a great weekend of climbing with perfect weather. Thanks Joel for planning a great trip.

 

 

www.flickr.com
Dr. Skippy's photos tagged with kitcarson More of Dr. Skippy's photos tagged with kitcarson

August 06, 2007

Survivor Bias – What does “random” survival look like?

Imagine a sales team of 1,000 salespeople working for Acme Widgets. The management philosophy at Acme Widgets for the last 20+ years has been that they let the bottom 20% of performers go every year and replace them with 200 new salespeople to keep the sales force at 1,000. In this way, they keep the best people around and give newcomers an opportunity to join the group of winners.

Under this (contrived?) scenario, what is the composition of the sales force?  Can I identify a veteran salesperson who survives many years based on their sales skills? Does the sales force look different if the salespeople survive based on skill or due to random attrition of 20% per year? 

To try to understand where my intuition might lead me astray, I ran a simple model of random attrition of 20% of the sales force every year for 20 years.

Below is a table showing surviving sales people from each year back to 1982.  These are the sales people who are still working for Acme Widgets.  For example, 14 of the 200 new recruits in 1995 are still with Acme Widgets, while only 2 of the 200 newbies in 1987 have survived.

 

Year

Employees remaining who started in Year

2007200
2006160
2005128
2004102
200382
200266
200152
200042
199934
199827
199721
199617
199514
199411
19939
19927
19916
19905
19894
19883
19872
19862
19851
19841
19831
19821

 

Now imagine the conversations between the new recruits and the old timers... 

First, all the old timers will have noticed that new recruits “just aren’t made like they used to be.”  That is, they drop out at an alarming rate. Notice the large gaps between the numbers of survivors in the first few years.  “You can’t count on these guys being around long.” Thankfully, the old timers don’t disappear nearly as fast.

Second, stores old timers tell of their sales exploits are likely to be of “skills needed for survival”—otherwise why would they have survived so long when nearly all of their contemporaries are gone? (And there is no one around to argue otherwise—“Survivor Bias”.) 

Further, everyone except the first year recruits has survived their entire time at Acme Widgets. So anyone you talk with will report that they are among the successful. The shorter-timers may be skeptical of their long-term prospects, but the longer they survive the more likely they are to identify as a survivor.

Third, more than half of the sales force has been there for 3 years or longer. This looks like stability. The high attrition rate would horrify the survivors if it left empty desks (or bodies).  But Acme keeps the floors clean and the total sales force at 1,000 persons. On any given day, the desks are full and the sales team is hard at it selling the Widgets.

Does a sales force that identifies and keeps skilled sales people look any different? If so, how? 

In our random example, 10% of the group at any given time has survived 10 years or more. These could be the “old horses” (had some big years early on so Acme keeps them around) or the superstars (had many big years). Does our perception of the proportion of the population that are superstars merely fall out from laws of random attrition?

These numbers come from random selection of the bottom 20%.  Without models of individual attributes, this I what the population looks like. 

I don’t want to argue against skill nor against promotion on merit. But I find the fit of the World to this randomness explanation troubling…

Here is the table for 40% attrition per year.  This might be appropriate for something more risky like forecasting markets (or anything really).

 

YearEmployees remaining who started in Year
2007400
2006240
2005144
200486
200352
200231
200119
200011
19997
19984
19972
19961
19951
19941
19930

 


Hosting by Yahoo!