karla

  • ****
  • 475
RevoNano and LED using WS281x
« on: April 15, 2018, 02:18:22 pm »
Greetings,

I feel reluctant to post this since its so vague and strange, but I am stuck and need some ideas in what direction to check.
(following the manual here https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12812390/Setup+WS281x+Led )

Problem: I cant get the LED to work for more than some 1-4 sec at LiPo startup, when using my final heli configuration settings on the board, after that it freezes to solid red or solid blue or solid black at random.
please see little clip.



So my first analysis is that there is no hardware issue with any of these 3 hw units.
What really puzzles me is that when loading the heli uav file to the test RevoNano, then it works just fine  :o
I expected it to not work, since its not working on the heli revonano.

I could take the reference RevoNano and test replace it for the current heli one and see if it will work.
That is however some serious hours to do.

Before doing that - any one any ideas?

Best
« Last Edit: April 15, 2018, 02:38:47 pm by karla »

f5soh

  • *****
  • 4476
    • LibrePilot
Re: RevoNano and LED using WS281x
« Reply #1 on: April 15, 2018, 02:38:32 pm »
How about the power voltage ?
WS2812B has absolute voltage range from +3.5V to +5.3V max.

karla

  • ****
  • 475
Re: RevoNano and LED using WS281x
« Reply #2 on: April 15, 2018, 02:40:53 pm »
Thanks! will check tomorrow.

Re: RevoNano and LED using WS281x
« Reply #3 on: April 15, 2018, 10:36:07 pm »
I thought I remembered seeing a post that WS2811 LEDs are somewhat broken in Nano and that there is only one output that works and it is the normal servo/ESC output.  I would try the different servo/ESC connectors on the Nano to see if one of them works better.

Since running into issues long ago and since fixed, whenever I set up such a board, I make sure that the WS2611 WS2811 is the only output on that bank.  Readers can look at the Output page to see what I mean.
« Last Edit: April 15, 2018, 11:18:09 pm by TheOtherCliff »

mr_w

  • *
  • 207
    • LibrePilot
Re: RevoNano and LED using WS281x
« Reply #4 on: April 15, 2018, 10:45:22 pm »
Actually, the "only one output" thing is not a bug but rather choice to dedicate single pin (S1) that would otherwise be non-functional PWM output when ws2811 led is in use. That pin (S1) is the one that uses (advanced) TIM1 which is the only timer that can drive ws2811 led on F411 mcu found in nano. F411 has no second advanced timer (TIM8) like regular size F405.

Other pins could also be used without problems, but S1 output would not be able to output PWM(Sync), OneShot and MultiShot.

DShot would work.

EDIT:

I have just checked your config with my nano and single ws2812b (the actual B version) led. This works as expected.
« Last Edit: April 15, 2018, 11:08:50 pm by mr_w »

karla

  • ****
  • 475
Re: RevoNano and LED using WS281x
« Reply #5 on: April 16, 2018, 02:41:44 am »
Thank you all!

How about the power voltage ?
WS2812B has absolute voltage range from +3.5V to +5.3V max.
It's 5.47V, my BEC output 5.5V but can be set to 5.0V.
However, How come it works just fine after I do an Upgrade & Erase and only set WS2811LED_Out to ServoOut1?
Volt is the same 5.47 but it works fine.


Since running into issues long ago and since fixed, whenever I set up such a board, I make sure that the WS2611 WS2811 is the only output on that bank.  Readers can look at the Output page to see what I mean.
It is the only output on that bank.


I have just checked your config with my nano and single ws2812b (the actual B version) led. This works as expected.
I also have a RevoNano that works fine with that config file, however I would really like to understand why the other unit do not work.

Re: RevoNano and LED using WS281x
« Reply #6 on: April 16, 2018, 03:11:55 am »
I have just checked your config with my nano and single ws2812b (the actual B version) led. This works as expected.
I also have a RevoNano that works fine with that config file, however I would really like to understand why the other unit do not work.

Sounds like a hardware problem with one of the MCU subsystems.  I recall that the LED uses a certain set of hardware features.  Something like DMA to output the data.  Alessio or mr_w might be able to advise as to what other features might be affected and thus be unreliable on that particular board.

karla

  • ****
  • 475
Re: RevoNano and LED using WS281x
« Reply #7 on: April 16, 2018, 07:02:33 am »
Guys,
Look at this clip and compare to the clip in the first post.



Its exactly the same hw set up, even lipo is the same, the only thing changed is the sw configuration (attached).
An upload & delete and then change config WS2811LED_Out to ServoOut1, thats all, and it works beautifully.
How can this not be a sw/config problem?
« Last Edit: April 16, 2018, 07:28:50 am by karla »

mr_w

  • *
  • 207
    • LibrePilot
Re: RevoNano and LED using WS281x
« Reply #8 on: April 16, 2018, 12:45:46 pm »
And when you put back the configuration file from first post, does it stop working again?

Can you try disabling peripherals one by one (GPS, ...) with rebooting between changes, to see if it starts working somehow? In my case your original configuration worked good, though I did not have GPS and receiver attached.

Re: RevoNano and LED using WS281x
« Reply #9 on: April 16, 2018, 08:22:30 pm »
Hmmm, a common theme?

Flyable setup: After 4 seconds it stops working.
Works with no GPS.

In both cases when it was working the GPS did not get a fix, and ATTI / STAB was red?

Once you get it broken again, try (one at a time, with a test after reboot for each line):  :)
- setting FMS to Atti on all positions (just to rule it out for later tests)
- setting from INS13 to Basic (in case it is ATTI / STAB) (for this test, see when problem happens, as ATTI / STAB / GPS go green)
- disabling GPS

You might also look at stack remaining for the various tasks.

Re: RevoNano and LED using WS281x
« Reply #10 on: April 16, 2018, 09:42:08 pm »
For what it's worth, I have the same (or very similar) problem using  Revo Mini.  I'll try some of the suggestions above and report back.  In my case, it's never worked, and firmware updates/reboots make no difference.  So far, I've only tried using servo output 6 because the Mini uses different connectors for the Flexi Port, and the Wiki does not address the Revo Mini version in the 'HowTo' for external LED.

Re: RevoNano and LED using WS281x
« Reply #11 on: April 16, 2018, 10:28:06 pm »
From what I understand, the Revo Mini should be exactly the same as the standard Revo for all places where they have the same connection (even though the connection has a different connector style).

There may be differences in component quality and there may be various filter components missing, but the code should run the same.

(Historical note:  What we simply call a Revo is actually a Revo Mini because the original, unreleased Revo was a different board set.  What we call a Revo, TauLabs calls a RevoMini.  So is this a RevoMiniMini? :) )

f5soh

  • *****
  • 4476
    • LibrePilot
Re: RevoNano and LED using WS281x
« Reply #12 on: April 16, 2018, 11:09:36 pm »
Quote
From what I understand, the Revo Mini should be exactly the same as the standard Revo for all places where they have the same connection (even though the connection has a different connector style).

Revo mini uses a flexiIO port with 8 pins (instead of 10pins in original Revo) and they removed the pin3/pin4 used for WS281x leds.
So Revo Mini do not work in all places, but only servo connectors.

karla

  • ****
  • 475
Re: RevoNano and LED using WS281x
« Reply #13 on: April 17, 2018, 01:41:47 am »
So far, I've only tried using servo output 6 because the Mini uses different connectors for the Flexi Port, and the Wiki does not address the Revo Mini version in the 'HowTo' for external LED.

The HowTo article of this
https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12812390/Setup+WS281x+Led
was recently updated and now cover the RevoNano case.



karla

  • ****
  • 475
Re: RevoNano and LED using WS281x
« Reply #14 on: April 17, 2018, 01:51:44 am »
And when you put back the configuration file from first post, does it stop working again?

Yes, putting the 'real' config file back, it stops working again and behaves just like in my first post here.
I will try to disconnect gps and other units as soon as I have some time
Thanks