TL;DR Is there an easier way to XY map a hollow matrix of square

gplus
(dalemorris164) #1

TL;DR
Is there an easier way to XY map a hollow matrix of square panels, with pixels on the inside edge (please see picture attached), so that;

A) Doesn’t require XY mapping every pixel - as this size of install would need a 108x189 size array. The amount of Null pixels would be huge!

B) is trivial to make patterns across the whole matrix instead of on individual panels.

C) Preferably it would be similar to the XY coordinates in Jason coon’s Tree, but for a 2D plane instead. I have looked into this a little bit, but not enough to wrap my head around yet.


Just wondering if anyone has some input on a project I am about to step into.

A friend of mine bought an LED infinity dance floor (4x7 tiles) from China about a year ago. The build quality was poor and the type of LED limited the amount of control.

He’s asked me to rip out the base panels and refit with some better LEDs. There’s 28 tiles in total and I have now fitted 4 of them with WS2813 pixels @ 60LED/m

Each side is 26/27 pixels long giving a total of 107 pixels for each tile

I am using the ESP32 feather with @Jason_Coon 's wonderful Octo level shifter shield. I plan to use parallel output to 7 rows, with 4 tiles in each row. That gives a total of just under 3000 pixels.

I have parallel output working fine (Thanks for your code input @Sam_Guyer - not to mention all the guys from FastLED behind the scenes! @Daniel_Garcia @marmil @Marc_MERLIN the list goes on…! ) …but my patterns are a bit disjointed due to the way they are wired…

Each panel has the first pixel starting from the top left corner, going downwards, all the way around until it reaches the top left corner again. I have then soldered a joining piece to some 1.0mm 3 core flex cable, onto an XLR connector, and straight into the next panel in the chain.

Because of this, when I output a rainbow pattern the colours of two adjacent tiles is out by a factor of 3/4 (I.e - side 3 of tile 1 is next to side 1 of tile 2 etc, if that makes sense)

I was looking at pixel mapping them (have done this before on the stairs project and a few others) but this time it’s a different ball game. This time the array I would be creating would be 108x189 pixels which gives a total XY map of 20,412pixels (including the null pixels) so it just isn’t that appealing to do it that way.

I have briefly looked at the alternative XY mapping in which the pixels are given a coordinate on a grid and mapped to a 0-255 array. But just can’t seem to get my head around it.

So, before I invest some time into mapping this out properly, are there any recommendations about mapping each particular layout?

The pattern is repeating squares, so there must be a better method somewhere. I’m not really sharp on my maths anymore since leaving uni.

But any help is greatly appreciated…

(dalemorris164) #2

Thanks for the input everyone! Definitely made some food for thought…

@Will_Tatam
This is very valid point! I think I will stick to the hardcoded / standalone version just for now and allow the possibility to upgrade to the e1.31 protocol in due course. At least then I have a backup system for if the DMX / Artnet / e1.31 protocols fail for any reason. If it cant find a signal, it reverts back to the standalone, so if I do it this way I have a fall back plan in place.

Im interested in these apps or desks that are designed for matricies, do you have any experience with them, or are there any you can recommend? I wouldn’t mind buying a sample to test with.

@Jason_Coon
Thanks for the example mate that helped visualise it a lot better. Ive just had a look through your code for the race gates and theres one small thing I don’t understand…

Where you have declared your arrays of X and Y coordinates, it starts off with an increasing Y value and X stays constant (until in reaches 30), then the Y stays constant and the X increases [to go down the left hand side and then the bottom left to right]

Then your Y value decreases and X is constant, as I expected, to travel up the right hand side. But what I don’t understand is why in the last portion of the array they both remain constant until they reach the end (i.e - X stays at 31 and Y stays at 0).

I would have assumed the X would have decreased until it reached 0 again to get back to the top left corner…or am I missing something here?

Also did you use a small script to scale the value into 0-256 or was it done manually? Many thanks as always Jason you’ve been great…!

@Yves_BAZIN
The full matrix will be 7 tiles wide by 4 tiles high.

Each tile will have 107 pixels in total with roughly 26/27 pixels per side (it doesn’t matter that each side is not identical for this purpose)

So that gives a total of 2996 pixels in the full matrix

@Louis_Beaudoin
That looks a very interesting project, would love for my matrix to look like that by the end. I think that (correct me if I’m wrong) they are using a camera to track the motion of the people stood in front of it and then making the matrix to react accordingly. which would be a super cool feature I could add on later (I’m not even going to begin to contemplate doing this until I have all these tiles built and installed - he wants this in before Christmas :open_mouth: )
But I suppose that type of thing could be added at a later date if required. I noticed also he was using a fadecandy by Adafruit, I actually have one of these lying around somewhere just haven’t had the time to play around with it properly yet.

For this project I aim to use the ESP32 with Jason Coon’s webserver to control the patterns / leave the matrix to cycle through patterns on its own. Then later on I will add audio reactivity (have built something similar with a teensy 3.2 + audio adapter board about a year ago but that was a full audio reactive ~40x40 matrix made from WS2812B).
After that I want to link it to some sort of DMX compatible protocol so it can be controlled from the DJ desk, and maybe just maybe I can then look into human presence reactivity.

Whoooaaa this project has just spiralled out of control haha

Thanks for the advice people you’ve all been great as always!!

(Jason Coon) #3

@dalemorris164 ah, you’re right! I need to check and redo that map.

Here’s the spreadsheet I used. It still helps to have a sketch to visualize before entering the values. I use the autofill (select a series, then drag the dot in the lower-right corner of the selection) to fill long series of incrementing, decrementing, and constant values. Then I use the JOIN function to create the arrays from the series: =JOIN(",", B2:B121)

(Jason Coon) #4

I’ve fixed the maps, thanks! https://github.com/jasoncoon/rgb-led-race-gate/commit/c388ffa16d6a1df5604282187454623be47b9185

And here’s the sketch I used for the 30x30 gate:
missing/deleted image from Google+