r/FastLED • u/heppej • Jan 22 '24
Support Intermittent LED Flashing Issue with Python-Controlled ArtNet & Teensy 4.1 Setup
Hello everyone,
I'm currently working on a project involving a Python program that sends ArtNet data to Teensy 4.1 nodes, controlling a series of WS2813 mini LEDs. I've encountered a peculiar issue where the LEDs flash randomly – for a single frame, the intensity of the LEDs increases unexpectedly.
Notably, this issue doesn't occur when I use MadMapper, suggesting that the problem lies within my Python code rather than the hardware. I've experimented with various framerates and scrutinized the ArtNet packets, but found no obvious cause like a sudden increase in intensity values. It mostly occur in the far end of the strip.
I'm reaching out to see if anyone in the community has faced a similar problem and could offer insights or solutions. Your assistance would be immensely appreciated!
The project's code is extensive, but the primary areas of interest are within animationProcess.py and ArtNet.py. I suspect the issue might be related to timing or data transmission but am open to all suggestions. The flashes are there still with low framerates. https://github.com/JeppePH/AmbientAsylum
Videos of the issue: https://we.tl/t-sPgtN521zt
Looking forward to any advice or shared experiences with similar setups. Thank you in advance!
3
u/pixelcontrollers Jan 22 '24
I recall having similar issues and it was the way I wrote the firmware on the teensy. I was waiting for x amount of universes before I framed. I ended tweaking the code so it would frame creatively and if it didn’t it would frame based on a timer at last resort. I think I also framed when I saw an art sync packet. Been a while since I wrote it. Anyways my test bench software worked just fine because all universes were sent. When the prototype was sent to a studio they were using a Grand MA system and it didn’t work as well. I would see some glitches etc. after cleaning up the frame code it took care of the issue.
It could be the python code…But I wouldn’t rule out the firmware code on the teensy either.
2
u/Fluffy-Wishbone-3497 Jan 22 '24
I had that happen. Teensy 4.0 FastLED on a 32x32 (1056) SK9822 LEDs and using the spi hardware pins 11, 13.
I had to make DATA RATE 6 MHz.
AND
this will sound crazy but I made the leads about 5” long from teensy to the first led of the matrix, It’s almost as if the closer I got the mcu to led #1 the less flicker at the end, even with power to both ends… Sounds wacky but it’s working at incredible frame rates without any kind of flickering, I wished I didn’t have to slow it down but it goes crazy at 8-24 MHz. I had to get a longer usb cable so I could shorten the leads. It’d be neat if it worked for someone else!
2
u/pixelcontrollers Jan 28 '24
Ok some things we need to consider. The teensy is a 3.3v logic and most pixels are 5v. If you’re NOT using a buffer / driver chip to get the logic to 5v then our tolerances will be tight to work with . In those situations the shorter the better when using spi /nrz (pixel) signaling over wires.
So how do we over come this? Use a 5v driver, use impedance matching resistors on the data line, use a uAmp driver in the midst of the wire (to reform and send the signal) or use differential signaling (rs485 transmitter chip and receiver chip).
If already using 5v, Some hacks that take minimal parts is to use a 30 -100 ohm resistor between the controller data out and the wire going to your pixel. The other is to use a f/amp null pixel / uamp in line going to the pixel.
If in a noisy environment and the distance is far then the differential is your best option but requires two wires for each data pin with a diff chip on the send and a diff chip on the receive. This will require you to make a custom board or shop for diy differential boards that may be out there.
1
u/heppej Jan 28 '24
Latest Status on the Problem: I got some good suggestions from u/pixelcontrollers and u/Fluffy-Wishbone-3497, which initially seemed to resolve the problem. However, when installing the system with longer cables, the issue returns. Adjusting the clock speed helps minimize the flickering in most scenarios, but at a certain cable length (5 meters), the flickering intensifies dramatically. Lowering the clock speed too much results in a complete loss of signal. Anyone?