Thursday, January 3, 2013

Conference Panel Part 3: MATH!

In Part 1, I taped down some LEDs and learned how to code with Arduino.
In Part 2, I tried some ideas for construction and geometry.

In Part 3, It's time to build an actual prototype.

As I get ready to cut and drill material, it's time for a layout.

The "guestimated" layout worked pretty well, and I learned some important things about the geometry of the structure.


The light cells are demarcated by the dividers, not the LEDs.
A "shared" 0,0 point just adds CPU cycles and significant code space to calculate the color of the cell. Either skip it entirely or let it mix naturally from the neighboring cells.
With 50 LEDS on the double strand, 10 spokes of 5 LEDs
And with no LED in the center, that makes 6 cells per spoke,

I want each cell to have about the same brightness.
The LEDs put out a cone of light 120° wide...  A little inverse-square for the falloff, figure in the reflectivity of the card material...
That's going to be one heck of a mathematical model.
I just need a relative width for the each ring.
Calculating the difference between the area of the arc for outside boundary and the inside boundary would give the area, but maybe there's an even simpler way?

10 spokes is dodecagon. Close enough to round for estimation purposes.

If each spoke is 18° wide (180° divided into 10 spokes), how do we calculate the area of a given cell?

Let's split the 18° isosceles triangle into two 9° right triangles.
Area = 1/2 × r1 (height) × b
And since that's only half the full 18° slice, Area = r1 × b.

How do we get b?

"Slope" of 9° = tan(9) = 0.158384440324536
So base (b) =r1 × 0.1584.
And area = r1² ×  0.1584

My math skills are too rusty to try and solve this multidimensional problem, but that's why we have computers!
I'll just step through all the possible divider positions and determine which configuration has the lowest standard deviation in area.
My first inclination is to just Monte Carlo the model and find a "good enough" solution, but there are a number of assumptions we can make that should make the experiment set small enough to calculate the whole thing.


  • Because the area grows with the square of the radius, no ring can be thicker than its inner neighbor
  • Because of the above assumption, no ring can be thinner than the total radius ÷ number of rings

I'm looking for an excuse to practice coding in Python so that's the language I'll use.
You can see the code at GitHub.
Without the optimizations, the program took over an hour to run on my laptop.
With those tests, it took about 28 seconds.
The solution is: [40, 57, 70, 81, 91, 100]
So these are percentages of the radius for each divider to yield a consistent area for each cell.
Let's see what that looks like:

The area-based division is closer to my proof-of-concept model, but the center disc is much larger than I want.

Modify the program to remove the center disk from the calculations and fix its size at 24%, and we get:

Which seems like a reasonable compromise.


While I want to build a bigger display, I also want this to be easy to construct.
Art board and plastic come in 20" x 30" and 40" x 30"sizes.
Biggest power supply is 2-3/8" (60mm) wide
Proof-of-concept model is 1-3/4" deep.

The matrix displays for the base are 1.2" tall. (1.6 with the driver board.)

Transporting the 30" cardboard proof-of-concept was easy. 40" panels are a little too big to comfortably carry around.

This will have to ship or go in checked baggage, so it will need a solid case.
SKB Cases sells an audio mixer case that seems about the right size.
Pelican has a similar case, and flat shipping case that would handle a 40" wide version.
These cases are expensive. Cheapest one would be over $500 with foam and accessories.

I'm mostly concerned about crushing damage, but lightweight case might be adequate.
Philly Cases has lightweight plastic case  with plenty of room for about $200.

So a good transportable size is 32 to 36 inches wide.
Next build will be 34" wide (17" radius) with a 2.5" base yielding a height of 19.5 inches.

Yeah, Yeah... Since I only need the ratios of the radii, I didn't need to calculate the are of the wedge. I could just use the whole circle instead with the old π r².

No comments:

Post a Comment

Please leave your comment here.