hzeller / rpi-rgb-led-matrix

Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
GNU General Public License v2.0
3.71k stars 1.17k forks source link

512x32 Flickering #1346

Open henri-ngl opened 3 years ago

henri-ngl commented 3 years ago

Hi

First of all thank you again for the amazing work that you made with this library.

So i have a setup with 8 64x32 panels (as the picture) and i see some occasional flickering, meaning multiple short higher brightness lines.

6 panels are powered with an 5V-60A and the other 2 (+ the raspberry) with an 5V-40A all those with an 1.5 mm power cable. Screenshot from 2021-10-14 11-13-23.

I made everything you recommanded on the README and WIRING but nothing changed. And when i measure the voltage with an multimeter it's constant (i think i didn't see the drop because it's too fast and i dont have an oscilloscope).

So my question is that is there anything that i can add or change in my config? I want to add capacitor in parallel on the led screen to have an constant voltage, do you think it can resolve the problem?

hzeller commented 3 years ago

You're not giving much information about if you use parallel chains, what Pi you're using or if you're using level shifters. I assume you have done all the things mentioned in the troubleshooting section already.

Shorter, higher brightness lines are typically a problem when using an Adafruit HAT without the pwm modification, but you said you followed the wiring page so you don't have an Adafruit HAT, then this should work.

In general though I would strongly suggest to not just wire it up directly to the Pi but add logic level shifters, e.g. by using one of the active adapters. The Pi's GPIO pins are directly wired to the CPU and driving things quickly due to longish wires can be a problem.

There could also be a problem if you are using an underpowered Raspberry Pi, such as a Pi Zero, which only has one core and low CPU frequency. But assuming you have a adequate Pi, make also sure to do the isolcpu setting (the library will show a message on startup if that still needs to be done; EDIT: I see you have a rpi-rgb-led-matrix fork that doesn't include that output of the isolcpus message yet, so you might not see it with your version).

Are you using a single chain where everything is connected to or multiple parallel chains with the V-Mapper ? With 512 pixels, a single chain might be borderline too many pixels to push out, and it will result in the core doing the pushing require essentially 100% CPU, which is something you'd like to avoid; you'd like to see a CPU load that is slightly less than 100% for that core, otherwise the kernel will regularly interrupt it and you'd see glitches (though it would typically look more like dark glitches than bright glitches - the bright glitches are still mostly indicative of not using PWM). So to mitigate, I suggest to use three parallel chains that you then map to one big row using the V-Mapper

Since your set-up of panels is not divisible by three, let's just pretend it is by just connecting one panel less to one of the chains, so chains with chain 1 having 2 panels, chain 2 and 3 having three of your panels. Looking from the top, you then wire up the different chains to the different sub-sections (each connected subsection indicated with a -)

[64x32]-[64x32] [64x32]-[64x32]-[64x32] [64x32]-[64x32]-[64x32]
              ^                       ^                       ^
        chain#1                 chain#2                   chain#3

Then we pretend that each of the sub-chains has a length of one, but with a '192x32' 'panel' it it

  --led-parallel=3 --led-chain=1 --led-cols=192 --led-pixel-mapper=V-mapper

This will now present you with a canvas of 576x32 pixels (but some of the pixels are not visible as there is only two panels on one of the chains). Also higher refresh rate and no expected glitches.

Finally with regard to power: if all the above is done, only then I'd look into power and consider capacitors, but I don't think that is the problem in this case. You show that there are multiple power supplies involved, mostly important here is, that all GNDs of these power supplies are solidly connected separately (don't rely on the panels to properly connect GND of all of these reliably).

henri-ngl commented 3 years ago

Thank you for your response and you right, i didn't gave a lot of informations.

So i have a raspberry pi 4 with an Adafruit hat an this is the config:

Screenshot from 2021-10-15 10-57-52

I left that one ligne on the hat because i want to add another 4 panels to have an 768x32

And the options are:

options.rows = 32
options.cols = 256
options.chain_length = 1
options.parallel = 2
options.hardware_mapping = "regular"  
options.gpio_slowdown = 5
options.brightness = 80
options.pwm_bits = 8
options.disable_hardware_pulsing = True
options.scan_mode = 0
options.pwm_lsb_nanoseconds = 50 
options.pwm_dither_bits = 0
options.show_refresh_rate = 0
#options.pixel_mapper_config = "V-mapper"

And i had to lenghten the power cable (by solding another cable with the same diametre on them) of some matrix for them to arrive to the power supply. Can that be a problem too?

hzeller commented 3 years ago

So if you have multiple chains, you don't have an Adafruit HAT, because that does only have one chain.

Anyway your problem is this line:

options.disable_hardware_pulsing = True

If you switch off hardware pulsing, then you will have glitches in the output.

henri-ngl commented 3 years ago

Oh you right i made an error. Is the Electrodragon Hat. And that was the problem. Thank you Hzeller

henri-ngl commented 3 years ago

Everything is perfect