I’m pissed.  Let me tell you why.

It all started with this tweet:

As I understand it, a team from the DoD presented at the conference, and in certain circles, the presentation was not well received.

In fact, it seems some folks took complete offense to the fact DoD was presenting at all, and some when so far to say Code for America was some how colluding with the DoD.

This is utter rubbish.

First, if CfA were working with the DoD – WHO CARES?

Please, help me understand why anyone would object to helping the DoD become more effective and efficient?

Are you so narrow minded to think making food stamps easier to obtain is noble, but protecting and defending the nation is an immoral cause?

I literally *can* *not* think of a more ill-informed, conceded, and arrogant position than that.

Seriously, the last post on my blog was about how inspired I was at the last CfA conference – this recent dust up literally makes me angry, mad, and pissed.

I have dedicated nearly my entire professional career to protecting and defending our nation.  And I truly was inspired at the last conference.  Truly.

Further, I am about as far left as one can be on certain issues.  Yet I see the need to help, and I express my patriotism every day simply by going to work and doing my job well for the good of our nation.

To anyone who questioned the presence of the DoD at the conference, I have this to say to you:

You don’t have the market cornered on good ideas or public service.

You don’t have any standing to question the integrity, morals, or commitment of CfA, DIUX, or the DoD.  Period.

You think you have perspective?  You think you have the right to question why they were there?  You know what – you do.  Because we protect and defend the flag you sleep under every single day.

Show us some respect.

More importantly, until you walk a mile in our shoes, watch your tone.

Until you help defend our nation and make it safe, shut your mouth.

Friends, an open mind is a two way street, and anybody who is not open to every viewpoint is someone who is part of the problem.

You are not better than us.  And you are not helping.  You are not cultivating the karass.  And that is sad.

You are simply narrow minded, divisive, and polarizing.

If you can not see the value of helping everyone, including those charged with protecting your freedoms every single day, then you are not practicing the fundamental premise of CfA – “improve how government serves the American public, and how the public improves government”.

 

Hi, Hello. It’s been a while since I’ve sat down and written something.

I’ve been watching The West Wing on Amazon and I’ve realized two really important things:

1 – My father never said “I’m proud of you.”

2 – I don’t say “I’m proud of you” enough.

Why is that important?  Well, it is a sign of encouragement. I’m really hoping that no one in my life needs to hear “I’m proud of you” to remain important, but I do realize it is a nice thing to hear and something that folks close to me should hear from me more often.

Why am I bothering to right this?  Well – because of #1.  I don’t recall a single moment in history where my father (or my mother) told me they were proud of me.  I’m pretty sure they were – but they never said it.

So what?

We’ll it’s a matter of pragmatism.

If they never said it, then it might not be true.

This is an example of uni-directional pragmatism.  That is, saying it makes it true, but not saying it does not mean it is true.

I am left wondering – is it true?  I believe it is, but I don’t know.  Since I can’t ask them, I’m left wondering…

An insecure person would probably wonder forever and assume the negative – they were not proud.  But I’m what I call mostly secure.  I’m usually secure, and therefore, I usually don’t need reinforcement and I believe they were proud!

Now, in my family, reinforcement was non-existent.  Not because it wasn’t warranted, or because it wasn’t deserved, but simply because it wasn’t talked about.  To reinforce during a time of need implies you know it is a time of need.  That implies an higher level of understanding and a higher level of awareness – that simply did not exist in my family

That’s OK, because I’m trying to change that.  How?  Well, by saying “I’m proud of you.”

Simple.

My son will know I am proud of him.  No matter what he does in life, I will support him. He will know – right or wrong – if I think he needs to do better.  He will also know – right or wrong – whatever he does, I will be there for him.

He’s a good kid, and being there for him is easy.  I suppose he could take a wrong turn and make supporting him difficult, but I am committed to supporting him – so I will.

Only time will tell what type of person he grows into, but I am confident he will be someone I will rally around and support at all costs.

So here we are – today.  Wondering.  Proud?  Not so proud?  I think Proud.  No reason not to be.  On nearly all fronts.

Life could certainly be less complicated, and in return, less enjoyable.  I have chosen to enjoy life a little more, step out from my comfortable zone a lot, and push forward to the future.

I hope my son learns to be proud of his father, of his children (should he have some), and ensure at all times the people that surround him know they loves him, trust him, treasures him.

I do.

If nothing else in this life, I hope I can accomplish that goal.  And many more.

Peace out my friends.

Swim fishy, swim…

 

Today is the last day of the Code for America Summit.  I am simply inspired.

I attend a lot of conferences, seminars, and work events.  This one is different.  Very different.

For two days I immersed myself with people who are committed to using technology to change the way government interacts with citizens.  Honestly, 28 years of working with and for the government, that is a novel concept.

The Department of Defense does not think that way – we are not educated, trained, or encouraged to work *for* citizens.  We are encouraged to work for the warfighter, or the mission.  Indirectly this support our citizens, but very indirectly.

What I saw over the last few days is a group of people who have banded together to literally make government better.  A lot better.  As best as it can be.

And it was inspiring.

I am not the inspired type.  I don’t have epiphanies, I don’t have life changing movements, and I don’t get emotional about these things (I’ve written about that before).  I am most certainly committed to my job and passionate about making things better, but that is not the same as emotional.  At least not in my eyes.

I had the opportunity to meet, talk with, engage with people who have no idea what the beltway is.  What defense contractors care about.  What the politicians of DC push.  People who have their own challenges for sure, but who are committed to solving the hard problems of the world to make a better society.

My inspiration is really the open-ended question of how can I apply this level of commitment to the greater good to the Department?  How can I make a difference?  How can I Cultivate the Karrass?

With any luck I will return to the conference next year and I will have applied some of what I learned to make a positive and lasting difference.

Perhaps luck doesn’t have anything to do with it, but I am sure it will be no small feat.  Perhaps I’ll do it in my current agency, or a different one, but I am committed to doing.

For the first time – perhaps ever – I have a near and long term career goal and it makes me happy about being a government employee (I don’t like the term “civil servant” for obvious reasons).  Over the coming weeks I need to plan how I can engage smartly, drive change, and demonstrate usefulness.

Over the coming months I need to read this again, and remind myself how a small band of committed individuals can change the world.

So I’ve started making Youtube videos rather than detailed text articles.  I actually find the medium easy to consume and far easier to produce.  More importantly, I think younger folks consume video much more easily than blogs or other “printed’ medium.  If you have some time, check out my videos.

Unlike most youtubers, I don’t have a single theme.  I plan on doing videos about whatever I’m working on at the moment.  Right now that’s 3D printing, CNC, and some electronics.  So if that interests you – check it out.

-Tom

 

Because I can never remember how to do this, instructions on how to add an existing project to source control using Git.

  1. Create new repository using Github web interface
  2. cd to project directory
  3. >git init
  4. >git add .
  5. >git pull <repos> master
  6. >git commit -a -m “initial checkin”
  7. >git remote add origin <repos>
  8. >git push origin master

I don’t recall doing #5 the last time, but it was required this time…

 

 

It’s late. I’m tired.  This is the exact moment all hell broke loose with my CNC machine.

 

IMG_4849

 

Little did I know 2 of the 4 wires detached from the X axis and caused the problem.  3 wasted boards later I figured it out.  What I said is not so safe for work – “m**** f*****”.  Well, I actually said it a couple times. And a multitude of other profanities. At this point, all I can say is “Screw you gravity all the other laws of physics – my projects are far more important than your immutable laws of physics.”  Hmphf.

I recently converted from SVN to Git and needed to break my legacy SVN repositories into separate git repositories. This turned out to be much harder than I thought.  After a lot of googling and much trial and error, here’s the process I settled on:

  1.  Create new remote repository new-repo
  2. Clone new-repo locally
  3. Execute command line:

    > cd new-repo
    > git remote add old-repo https://github.com/cyberreefguru/old-repo.git
    > git pull https://github.com/cyberreefguru/old-repo.git master
    > git rm -r old-folders
    > git mv files-around-as-necessary
    > git commit
    > git push

Hope it helps someone.

So.  Wow.  It’s been a long time.

It’s been a long, stressful couple of months/years.

Sitting here thinking about all that has been and all that could be.  Interesting.

Nothing more.  Interesting.

So – where have we been?  Well, ranging from way far to the good and fairly far to the bad.  I don’t think I’ve ever been really far to the bad, but for me, I’ve been pretty far.  The last few years haven’t really been that bad.  But I will say they have been – unpredictable.

For me that is bad.  It’s not horrible.  But it’s not great either.

So, I sit here and ponder the future.  Recently I connected with an old “friend”.  Someone who I respect and admire.  Or I respected and admired.  There are fewer and fewer reasons to respect or admire him. He has not been a good friend over the last few years.

I like to think I’m predictable.  I like predictable.  He is never predictable.  He never has been.  But the other night, after many, many, many months of not hearing from him, we connect.  Not one-on-one of course. That would require a lot of energy.  But a group setting.  Many minutes/hours go by before we actually talk face-to-face.

I guess at this point I’m sort of immune to the dynamic.  But the nuance is not missed on me.  Friend of 12+ years.  Meet each other at happy hour after not seeing each other for 6+ months.  And 2+ hours laters he acknowledges I’m there.  Nice.

Ok, so it’s not about me.  Yeah.  It turns out, like always, it’s about him.  Yeah, him.  Always him.

Fast forward.  We’re leaving.  I let me him know that over the last 2+ year he has been “flighty”, “recluse” and “unreliable”.  My wagon isn’t tied to his carriage so I’m not apologetic….he apologies.  Then we talk about what’s “next”. “Let’s get together” he says.  Sure – “how about next weekend?”; “I’m busy”…..”maybe you and <insert ex’s name here> can come see me?”.

……

“Well, we would except I’m not married anymore.”…….long, awkward, pause…..”I didn’t know.”……Yeah, no.  You didn’t.  That would require some level of communication and “friendship”.  Long explanation later – with many excuses why he should of known…we part ways.

On the way home in the car the phone rings – “Hi”….”I’m sorry, I would of been a better friend if I had known”….”Well, if you were a good friend, my situation should not change how ‘good’ of a friend you would have be”…”But it’s water under the bridge – we need to move on”….”I’m glad you see it that way – let’s get together soon”…..

So, my dear, this is why I cherish you.

You stand by me.  When I stop and look around, I see you.  No one else.  I see you.

I called you afterwards and could not remember why.  That is why.  I see you.

I have some friends.  You have many.  I cherish my friends because they are few and far between. I don’t try hard to keep in touch, so the friends I still have are “all in”.  They know me and I know them.  I doubt we have ever spoken about it, but they know.  It’s just how I roll.  I’m committed to them without any need to interact with them or be with them or hear from them. If they need something, I’ll be there.  If I need something, I expect them to be there.

This is where you and I are different.  You want, need, and like interaction.  I don’t.  In fact, I don’t like it.  If for some god forsaken reason I need it, it will be a thing.  A real thing.  I’m not sure it has actually happened, but it may have.  Once or twice.

So listen to me when I say – I….called…..You.  That’s a thing.  A real thing.

So, I called you to say – thank you for being there.  Through thick and thin.  I will admit we – you and I – created a lot of the thick and thin, but you have been there.  In fact, you have been there when I didn’t know I needed someone.  You have been there when I wanted someone and when I didn’t want someone.  You annoy me and I love you because of it.

I will never be able to adequately express to you how much “being there” means to me.  So believe me when I say – it’s a thing.  A real thing.  143…

Construction (Sort Of)

In Part 1 we learned about the requirements, and in Part 2 we talked about the design.  Now the rubber meets the road.  I did the research and the design.  Now I needed to manufacture some printed circuit boards and put the design to the test.

Laying out the PCB was a little cumbersome since all the chips wouldn’t fit neatly on a normal sized Arduino shield, so I had to make the board a little larger than “normal”.  Not a big deal, but a little less ideal than the perfectionist in me wants.

After the boards were manufactured, I order some solder stencils and set out to solder everything.  Since the board is almost exclusively surface mount, this would be my first foray into assembling a surface mount device (SMD) PCB on my own.  I’ve done it professionally, but in that case I paid other professionals to do it for me.  I’m way too cheap to pay someone to do it, so I did it myself.  I’ll probably write about that experience separately – it worked out very well and I am super pleased with the results.

Driver Shield and LED Strip PCB

Driver Shield and LED Strip PCB

Driver Shield

Driver Shield

Once the boards were done I had to write all the software for the Arduino.  Writing the initial code was fairly easy, but getting it work properly was a huge pain.  The design / build process was orderly – test the driver first, then test the columns, then put the pieces together.  All went well.  Once I could turn LEDs on and off using the full complement of capabilities, I turned my focus to the multiplexing an driving a 48×16 array.  This is it got really complicated and really frustrating.

I spent many hours futzing with Arduino timers, optimizing the software, and really worrying about how many CPU cycles each routine was using.  In the end, I had to collapse most of the time critical code into a single routine and give up any hope of controlling the full array using the full depth of intensity settings

Embedded Software Design 501

Yes, I said 501.  This is not 101 territory.

This design contains a matrix that tis 48×16, which is 768 “nodes” individually addressable.  Each node has a 12-bit pixel depth, or intensity level.  Microcontrollers don’t understand 12 bit, so we get to round up to 16-bits, or 2 bytes. Easy enough – 48x16x2 = 1,536 bytes to fully control the entire matrix.  Oh, good software engineering says we double buffer the bit maps to avoid any “hiccups” with display intensity, so we need 3,072 bytes.

Now, I spent nearly a decade designing and implementing embedded solutions professionally, so I was very conscience of how much memory my program used.  However, I did not set down in advance and calculate it out like I did above.  Had I done that, I would have predicted, and avoided, many, many hours of exasperation.  You see, the Arduino microprocessor only has 2K of SRAM, and approximately 500 bytes is used by the bootloader, leaving only ~1500 byte free for the user.  So, I had approximately 50% of the RAM available to me that I needed.

Rather than the compiler flagging me and saying “hey, idiot, you have allocated more than than is available”, the code uploaded fine and operated fine.  For a while.  Then it started behaving oddly.  It didn’t stop working – it just stopped working properly.  More importantly, code that used to work, stopped working properly.

**THE MOST FRUSTRATING PART OF EMBEDDED PROGRAMMING EVER**

So after many hours of adding print statements, changing code, commenting things in and out, I finally narrowed the issue.  When I commented some code out, it worked fine; when I commented it in, it failed.  First and most classic sign of a memory problem.  When and finally sat down and did the math.  Duh! I am an **idiot**.

(For the record, adding print statements actually made the problem worse by using up even more RAM.  Great, eh?)

Compromise time.

I needed the double buffering, so my only choice was to narrow the intensity density.  But cutting it in half still pushed the memory requirements to ragged edge.  Remember when I said the boot loader uses “approximately” 500 bytes.  Yeah, well, that approximately is super important when literally every byte matters.  After a lot of debugging, it turns out I was using about 20 more bytes than were available, **if** I called more than 2 subroutines.  And which subroutine I called changed how much memory was required.

This my friends is called the “stack size” and it is really important.  When you push something on to the stack, it uses memory.  When that memory is used by something else, like say a variable in your interrupt service routine, it tends to, ummm, f*ck sh*t up.  Bad.

Ok, so that’s the lesson learned about advanced embedded system programming.

  1. Know exactly how much memory you need
  2. Know exactly how much memory you have
  3. Only use how much memory you have

Seems basic.  But without an embedded debugger and a super expensive logic analyzer, it can take you days to figure out.  Days and days and day.

In the end, I had to combine a number of functions breaking all normal OO programming “rules”, use direct bit manipulation instead of the stock Arduino functions, and count the number of CPU cycles for certain operations before the code worked properly.

Once I got the code to work properly, I had to assemble the entire thing on the Power Tower itself, which led to much fun and amusement.  All of which will be documented in the next article, Part 4.

In Part 1 I discussed the “requirements” for the project and determined none of the solutions I found on the Internet met my needs.  So to the drawing board I go…

The Design

I combined a couple different ideas into a single solution.  I decided to use a PWM-enabled constant current LED driver for the rows, shift registers to control the columns, and a set of “high side drivers” to provide the voltage and current for the columns.

Now, you might think that using a constant current driver would have “solved” the current problem wouldn’t you?  Well, that’s what I hoped but here’s a quick diversion into EE 101 for the implications for my design.

To save on the total number of output pins, I grouped 3 LEDs together.  To turn the LEDs on I need exceed their combined forward voltage.  For normal red LEDs, that’s about 2.1v; for blue and green LEDs, that’s about 3.2.  I wanted a mix of all colors, so I knew the source voltage had to be between 6.3v (2.1 x 3) and 9.6 volts (3.2 x 3).  The “closest” normal voltage is 12v, which is what I settled on.  That means the anthode would be connected to 12 volts while the cathode would be connected to ground.

LED Schematic

LED Schematic

As mentioned above, I decided to use to a constant current driver to control the rows, which puts the constant current driver at the cathode (i.e., ground).  As such, I need to drive the LEDs at 12 volts, but also use a constant current driver at the cathode.  Additionally, I need more current at the anthode than a single microcontroller ping can provide (~500mA vs 30ma).  Therefore, I need some sort of transistor at the anthode and there is where things get complicated.  Nearly every simple switching circuit I found would only work properly if the source voltage does not exceed the voltage controlling the transistor.  In my case, the control voltage is a normal logic level of 5 volts, but the source voltage is 12 volts.

I researched a lot of different configurations before I finally found a solution that meets the needs.  In short, I needed a “high side driver” – a driver that lets a small range of “drive” voltages control a larger range of “source” voltages.  Fortunately, there are a couple ICs on the market that (mostly) met my needs.  I really wanted to switch an entire column with a single control circuit, but an entire column would be approximately 840mA and all the solutions I found maxed out at 500mA.  So, I needed two ICs per column, leading to 16 “columns”.

After it was all said and done, I needed up with up to 48 rows, and up to 16 columns in the final design.  I combined two TLC5947 (code complements of Adafruit) constant current drivers with 2 74595 shift registers for the columns. The shift registers feed a pair of A2982 high side drivers that provide the current to the LEDs. In this configuration, each column can provide up to 500mA allowing me to switch approximately 25 rows at a time.  That almost perfectly separates the design in half; the 5947 provides 24 rows and the 74595/A2982 pair provide 8 columns at 500mA.  Double everything and I have 48 rows x 16 columns, or 768 control lines.  Theoretically, I can control 768 triads of LEDs, which is a whopping 2304 LEDs!

LED Driver v1.0

LED Driver v1.0

Fortunately, I did not need so many LEDs for my purposes.  Part 3 will document the manufacture, assembly, and testing of the final solution.  Stay tuned.

Next Page »