Show Posts
Pages: [1] 2 3 ... 10
1  Using Arduino / LEDs and Multiplexing / Re: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 on: April 14, 2013, 01:57:42 am
Thank you! smiley I do try. the next article will be about the construction of the cube itself. Unfortunately, based on progress so far,  I estimate that it will be done only about 6 to 8 weeks from now  smiley-confuse
2  Using Arduino / LEDs and Multiplexing / Re: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 on: April 13, 2013, 06:36:26 pm
Thanks smiley
3  Using Arduino / LEDs and Multiplexing / Re: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 on: April 13, 2013, 05:26:32 pm
Hi guys!

Here's the next article in the series: the driving circuit for the 8x8x8 LED cube, based on CrossRoads' design:
http://iqjar.com/jar/building-an-8x8x8-led-cube-the-driving-circuit/
4  Using Arduino / LEDs and Multiplexing / Re: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 on: March 30, 2013, 05:24:58 pm
Yepp smiley

Unfortunately the project is advancing slower tan expected. Also, spring is coming, so I'll have less time for it than in the winter. But even if slowly, I will make it happen smiley And those articles on my blog will be written as I complete the steps in real life (the driving circuit, the 8x8x8 cube soldering and the software).

I've just found a great youtube video, by the way, in which Kevin Darrah explains multiplexing and bit angle modulation. The part that I found interesting is that the LEDs can be dimmed from software, so I'll make sure to include that in my code:
5  Using Arduino / LEDs and Multiplexing / Re: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 on: March 30, 2013, 04:13:32 pm
OK, all problems are now fixed. After soldering in all the resistors for the anode layers and cathode columns, the ghosting is completely gone with 30 microseconds software delay after turning everything off before turning a new layer on (during multiplexing). I've updated the schematic and the printed circuit design accordingly:







Unfortunately the printed circuit has now grown to 14 x 12 cm because I had to fit 72 more resistors on it. I've already ordered one from a guy in town who makes PCBs, it cost me about 17$, let's hope it's perfect smiley

As I wrote earlier, these resistors increase the power consumption of the cube by 72 mA in passive mode (when everything is off), which is something that I'm not happy with at all, but it's still better than ghosting...
6  Using Arduino / LEDs and Multiplexing / Re: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 on: March 27, 2013, 06:09:56 pm
Unfortunately I've found an unwanted side effect of my new solution. The problems just don't seem to go away smiley

As soon as I've started using the cube in real, multiplexed mode, trying out all LEDs in a test pattern, I've noticed that in one column from the 16 that I have in total, the top 3 LEDs are dimly lit all the time. The lowest LED is fine, the one above it, in the same column, is dimly lit, the third one (even higher in the same column) is dimly lit, but not as much as the second one and the fourth one is also dimly lit, but not even as much as the third one. If I remove the 1K resistor which connects the lowest anode layer to ground, then this unwanted effect goes away, but then I'm back to the ghosting smiley-razz
The even more interesting thing is that if I disconnect that column completely from the driving circuit, the top 3 LEDs in that column are still dimly lit, as described above, but when they should really light up at full brightness, they don't (because that column is disconnected). But if the column is disconnected, then it means that they are not grounded at all, so how can they light up, even dimly? And why only this column? And why only when I add a 1K resistor between the lowest anode layer and the ground?  smiley-eek
7  Using Arduino / LEDs and Multiplexing / Re: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 on: March 27, 2013, 05:14:27 pm
When I started feeling that the ghosting problem just beats me and felt like giving up, somebody really nice has sent me a link to an article written by a guy who was struggling with the same issue:
http://scriptkiller.de/en/a55/computer_electronics/10%25C2%25B3_(10x10x10)_led_cube/
I don't know why I haven't found this article myself, because I did search a lot for ghosting in LED cubes. Anyway, thank you, Robert, for sending this to me!

The guy who had the same ghosting issue states the following:
Quote
"Eliminating Ghosting
Problem: If high-side layer switches are (almost) unloaded, they will take a long time to completely switch off (due to capacitances at the drain of the FET, I guess and in the wiring).
It can clearly be seen that the voltage does not reach 0V during one multiplexing cycle. Thus some LEDs may be switched on very dim although they should not. The solution is to add a load-resistor of 1kOhm between the drain of each high-side P-FET and ground. At 5V there will only be 5V/1kOhm = 5mA flowing through each of these load resistors, but the effect is magnificient"

Now, this solution in itself is nothing new. It's kind of what CrossRoads has suggested many days ago. I tried it back then and it didn't work. I tried it today, it didn't work either. BUT it has lead me to an acceptable solution. The reason it did not work in the past or today is that I expected this resistor to magically make the excess current vanish instantly. Obviously, that's not the case. You have to give it time. In other words, you have to combine this hardware solution with the software solution of switching everything (all anodes and cathodes) off and waiting a bit. Luckily I was inspired enough today to try this.

So, I added 1K resistors between the drains of the MOSFETS and ground (in other words I've grounded the anode layers through 1K resistors). It's important to really use 1K resistors, not higher, my experiments have shown that higher value resistors are beneficial, but don't work as well as 1K resistors. Unfortunately this means 5mA power usage per anode layer in passive mode (that's about 40 mA for a 8x8x8 LED cube), but it seems that it's the price that needs to be paid. After adding these resistors I've added an intermediary software step between switching layers, which turns all anodes and cathodes off and waits a little (as little as 30 microseconds).

After this the ghosting was almost completely gone, but I've noticed a second ghosting, out of sync with the one that I've just eliminated. This second ghosting was extremely dim, but it was there. The solution I've found for this second one was to add 10K resistors between each cathode column and the positive 5V rail. Unfortunately in a 8x8x8 LED cube with 64 cathode columns this adds another 32 mA power usage in passive mode. I guess it's something I'll have to live with. I can't say I'm happy about all this passive power usage, but I don't know a better solution.

With all these resistors added, the ghosting is almost almost almost completely gone. There is still an extremely faint, dim ghosting, but it is almost impossible to notice. You have to look at the LEDs from their top, where they give off most light and in perfect darkness and even so you can barely see it. It's not perfection, but it's quite close. In a working LED cube with real animations there will rarely be darkness. The light of the lit LEDs will make this last trace of the ghosting unnoticeable.

I hope this helps everybody who might bump into the same problem.
Thank you guys, for helping me!
8  Using Arduino / LEDs and Multiplexing / Re: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 on: March 25, 2013, 04:00:17 pm
Some other things I've tried tonight:
1. Added one more 3.3K resistor in parallel with the existing one between the MOSFETs' gate and sources.
2. Shorted the 220 Ohm resistor at the MOSFET gate.

None of these made any difference.

One more thing I found: the dim flickering (or ghosting or whatever) appears between step B and A in my previously shown code, just as I thought. In other words, the anode planes are just not shutting down quickly enough, so when some cathodes are switched on, the LEDs briefly turn on in the previously turned on anode plane (which is turned off before or simultaneously with the cathodes being turned on). I'm saying before or simultaneously, because if I turn the anode plane off and turn on the cathodes immediately (right after), then I get some quite visible ghosting-flickering. But I've tried to add a delay between step B and A, like this:

Code:
    //Step B: turn ON one anode plane, keep all cathodes OFF
    digitalWrite (53, LOW);   
    SPI.transfer (B00000000); SPI.transfer (B00000000); SPI.transfer (B00000000); SPI.transfer (B00000000); //All cathodes OFF
    SPI.transfer (B00000001); //One anode plane ON
    digitalWrite (53, HIGH);
    delay(1000);
   
    //Delay step (C): turn everything OFF (all anodes and cathodes)
    digitalWrite (53, LOW);
    SPI.transfer (B00000000); SPI.transfer (B00000000); SPI.transfer (B00000000); SPI.transfer (B00000000); //All cathodes OFF
    SPI.transfer (B00000000); //All anode planes OFF
    digitalWrite (53, HIGH);
    delayMicroseconds(25);
   
    //Step A: turn all anode planes OFF, turn one cathode ON
    digitalWrite (53, LOW);
    SPI.transfer (B00000000); SPI.transfer (B00000000); SPI.transfer (B00000000); SPI.transfer (B00000001); //One cathode ON
    SPI.transfer (B00000000); //All anode planes OFF
    digitalWrite (53, HIGH);
    delay(1000);

With that intermediate step C, after which I wait 25 microseconds, letting the previously turned on anode plane turn off, the flickering-ghosting (which occurs at the intersection of the anode plane turned on in step B and cathode column turned on in step A) is much less visible. Barely visible. But here's where it gets interesting! I tried increasing that 25 microseconds delay, even up to 100.000 microseconds, but the situation didn't get any better compared to when the delay was just 25 microseconds. However, if I reduce the delay to 0, then the flickering-ghosting gets much worse.

What is going on here?  smiley-roll
9  Using Arduino / LEDs and Multiplexing / Re: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 on: March 24, 2013, 06:39:18 pm
I've just tried again one of CrossRoads' older suggestions: ground the anode layers through some resistors. I used 5.6K. No change. The ghosting persists smiley-sad
10  Using Arduino / LEDs and Multiplexing / Re: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 on: March 24, 2013, 05:33:46 pm
When multiplexing. I only turn off a layer before turning on the next one because of this ghosting. In the past, when I had the 4x4x4 test cube's circuit on solderless breadboards, turning the previous layer off and aiting 75 microsecs before turning the next layer on, helped. But in theory, there should be no need for this.
11  Using Arduino / LEDs and Multiplexing / Re: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 on: March 24, 2013, 04:53:24 pm
Yeah, real life tends to need attention smiley-razz

God forbid giving the LEDs 8mA! I'm running them at around 1.5 mA and they are still way too bright!

I've done some further experiments and I can now explain as clearly as possible the ghosting effect, through some short pieces of code. No multiplexing involved, nothing funny, just plain old turning on/off cathodes and anode layers using SPI transfers:

Code:
void loop ()
{
    //Step A: turn on all the 16 cathodes and turn off all the 4 anodes
    digitalWrite (53, LOW);
    SPI.transfer (B00001111); SPI.transfer (B00001111); SPI.transfer (B00001111); SPI.transfer (B00001111); //All cathodes ON
    SPI.transfer (B00000000); //All anodes OFF
    digitalWrite (53, HIGH);
    delay(1000);
   
    //Step B: turn off all the 16 cathodes and turn on 1 anode
    digitalWrite (53, LOW);
    SPI.transfer (B00000000); SPI.transfer (B00000000); SPI.transfer (B00000000); SPI.transfer (B00000000); //All cathodes off
    SPI.transfer (B00000001); //One anode layer ON
    digitalWrite (53, HIGH);
    delay(1000);
}

The expected behavior here is that no LED turns on ever, because there isn't any moment of time when both a cathode and an anode layer are simultaneously ON. Well, unfortunately that's not what happens. The LEDs in the layer which is ON at step B keep lighting up briefly and dimly after each full cycle (step A + step B). I'm not sure whether this happens between step A and B or between step B and A, but it only happens once during a full cycle. My bet is that it happens between step B and A (and not between A and B) because the anode layers turned on at step B don't turn off quickly enough. But I'm not sure that this is what really happens because I tried adding some code both between step A and B and between step B and A which turns off everything (all cathodes and all anodes) and waits for the turn-off to happen (software delay). No matter how much delay I added, the blinking didn't even get shorter, it remained the same. I even added 600 ms delays (which is extremely much!), nothing changed.
The way I see it, what happens is that when you turn on an anode layer, some small amount of current gets into that layer and it somehow stays there until it can get away somehow. It only seems to be able to get away through the LEDs when some cathodes are turned on. And while it gets away through the LEDs, the LEDs light up. This is my best explanation so far.
12  Using Arduino / LEDs and Multiplexing / Re: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 on: March 24, 2013, 04:02:59 pm
Hi, Hippynerd! smiley

Yepp, it was this thread.
I did try to experiment with that (disabling output while transfering data), did not help.

You're right, this is doing stuff which is a bit hard to understand, you're certainly right about that smiley But at least now I knwo for sure that the ghosting is related to the parts of the circuit around the MOSFETS. And I know that the problem is that the anode layers are not turning off fast enough. I've also found out that the gravity of this lag (of the anode planes) depends on the value of the resistors between the gate and source legs of the MOSFETS. The higher the resistor value, the longer the lag. Maybe the value of the 220 Ohm resistors between the anode driving shift register and the gates of the MOSFETS might also have a say in it, I did not experiment with that yet.

I'm kind of hoping CrossRoads is still reading this. He might be the only one who understands what is going on.
13  Using Arduino / LEDs and Multiplexing / Re: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 on: March 24, 2013, 07:27:17 am
I've soldered in the 3.3K resistors between the gates and sources of the MOSFETS. The result is not what I was expecting. Now the ghosting seems to show up a bit more differently. Now when a cathode is on and multiplexed, not just the previous layer is ghosting, but all the layers. The ghosting is dimmer now, but instead of only one ghosting layer, now all the layers are ghosting. Also, no matter how much software lag I introduce, it's not going away. I need a wall to hit my head against  smiley-cry
14  Using Arduino / LEDs and Multiplexing / Re: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 on: March 24, 2013, 04:55:05 am
Interesting, very interesting...
I've put back the 5.6K resistors in parallel with the 47K ones. This should result in an overall resistance of 5K between the gates and sources.
Now I can get away with a delay of only 10 microseconds between switching. Perhaps in the solderless solution there was no proper contact somewhere and the resistance was actually higher than 5.6K. Or perhaps 5K is near the limit where the resistors are weak enough for the ghosting to go away. I'll try desoldering the 47K ones and soldering some 3.3K ones instead. Hopefully that will make everything OK.
15  Using Arduino / LEDs and Multiplexing / Re: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 on: March 24, 2013, 03:37:11 am
Hi there again! smiley

I'm afraid still no video, as my old camera is still broken and I still didn't make the decision to buy a new one. But It's very simple to imagine it with the following test:

First step: write all 0s into all cathodes to keep them all off and write a 1 into one of the anodes to turn it on. As the cathodes are off, no LED will light, so far so good:

Code:
digitalWrite (53, LOW); //Start transferring data
SPI.transfer (B00000000); SPI.transfer (B00000000); SPI.transfer (B00000000); SPI.transfer (B00000000); //All cathodes OFF
SPI.transfer (B00001000); //One anode ON
digitalWrite (53, HIGH); //Done transferring data
delay (600);

Keep it like this for 600 milliseconds (all LEDs OFF even though one of the anodes is ON).

Second step: write a 1 bit into one of the cathodes and a 1 bit into a different anode:
Code:
http://digitalWrite (53, LOW); //Start transferring data
SPI.transfer (B00000000); SPI.transfer (B00000000); SPI.transfer (B00000000); SPI.transfer (B00000001); //One cathode ON, the rest OFF
SPI.transfer (B00000001); //A different anode ON, previous anode OFF
digitalWrite (53, HIGH); //Done transferring data
delay (600);

What should happen here is that the LED corresponding to the turned on cathode and to the NEWLY turned on anode should light up for 600 milliseconds. This does happen, but at the beginning of those 600 milliseconds the LED which is in the turned on cathode column and in the OLD anoe plane, also turns on briefly. Tests show that it turns on for 600 microseconds.

BUT here comes the interesting part!
You know that I wrote last night that the only thing that I did differently with the soldered printed circuit compared to the solderless breadboard solution is that now I have more shift registers chained. Well, I just remembered that it's not true! I have also replaced the 5.6K pullup resistors between the MOSFET gates and sources with 47K resistors with the intention to make the circuit consume less power when the anode layers are off. I have the feeling that this is what made the ghosting so much worse. I did not try changing those resistors back yet, but my hunch seems to be backed by the fact that the old ghosting time with the 5.6K resistors was 75 microseconds and the new ghosting time with the 47K resistors is 600 microseconds. The 75/5.6 and 600/47 ratios are both roughly 8, so I guess the ghosting (the anode turn-off lag) increases linearly with the value of those base-gate resistors.

Now comes the hard part! How low can I go with the values of those base-gate resistors without damaging anything and without having my circuit eat too much power in passive mode? Even if I go really low, I doubt that I'll be able to make the ghosting go away completely. For that to happen I think some other solution is needed. But what, I wonder?  smiley-confuse
Pages: [1] 2 3 ... 10