LibrePilot Forum

General Category => General Discussion => Topic started by: karla on April 15, 2018, 02:18:22 pm

Title: RevoNano and LED using WS281x
Post by: karla 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.

https://www.youtube.com/watch?v=d5YCx55NLRg

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
Title: Re: RevoNano and LED using WS281x
Post by: f5soh 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.
Title: Re: RevoNano and LED using WS281x
Post by: karla on April 15, 2018, 02:40:53 pm
Thanks! will check tomorrow.
Title: Re: RevoNano and LED using WS281x
Post by: TheOtherCliff 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.
Title: Re: RevoNano and LED using WS281x
Post by: mr_w 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.
Title: Re: RevoNano and LED using WS281x
Post by: karla 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.
Title: Re: RevoNano and LED using WS281x
Post by: TheOtherCliff 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.
Title: Re: RevoNano and LED using WS281x
Post by: karla on April 16, 2018, 07:02:33 am
Guys,
Look at this clip and compare to the clip in the first post.

https://www.youtube.com/watch?v=0dMIb3isNm4

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?
Title: Re: RevoNano and LED using WS281x
Post by: mr_w 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.
Title: Re: RevoNano and LED using WS281x
Post by: TheOtherCliff 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.
Title: Re: RevoNano and LED using WS281x
Post by: Bobrcnut 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.
Title: Re: RevoNano and LED using WS281x
Post by: TheOtherCliff 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? :) )
Title: Re: RevoNano and LED using WS281x
Post by: f5soh 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.
Title: Re: RevoNano and LED using WS281x
Post by: karla 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.

(https://forum.librepilot.org/index.php?action=dlattach;topic=4245.0;attach=7428;image)
Title: Re: RevoNano and LED using WS281x
Post by: karla 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
Title: Re: RevoNano and LED using WS281x
Post by: TheOtherCliff on April 17, 2018, 04:45:10 am
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.

Yes, and it probably doesn't have an SWD port, and if you want OpLink telemetry, you have to buy that separately and plug it in a port that doesn't even exist on normal Revo.  The ports and pins that are there act the same as a normal Revo.  Normal Revo does not have those pins in the cable, so to use you must add pins to the connector.

The point I was making is that the code running inside cannot tell the difference and so if the LED works in one place, it should work in the other place.  (I presume the MCU runs at the same frequency.)
Title: Re: RevoNano and LED using WS281x
Post by: karla on April 17, 2018, 09:32:47 am
So far, I've only tried using servo output 6 ...

That did not work right?
I tried it and its like the wiki say, only servo output 1 will work.
I bet you setting up a heli and you only have output 6 free?

Same for me but that means you have 1 out of 6 free, so just move all the outputs down the line one output. So that output 2 plugs to your previous servo 1, and output 3 connects to previous servo 2, etc
Doing that will leave output 1 free to connnect to the LED thingi.

Have a look in my first post config file, that's exactly what's configured there for a heli 450 size.
seems though there are other issues around  :)

Hope it will help you  :)
Title: Re: RevoNano and LED using WS281x
Post by: karla on April 17, 2018, 10:01:45 am
from recent posts from oldtimers I get confused
are revo mini and revo nano different boards?  :o
Title: Re: RevoNano and LED using WS281x
Post by: mr_w on April 17, 2018, 10:15:29 am
Yes, revo-mini is nano-sized normal revolution board, without oplink (but has additional connector for it, it just exposes mcu pins that are used for onboard oplink module in regular revo), has regular f405 mcu running at 168mhz.

revo-nano is the one you have, which has f411 mcu, running at 100mhz and the rest of the oddities.

Title: Re: RevoNano and LED using WS281x
Post by: karla on April 17, 2018, 10:34:32 am
thanks - got it
Title: Re: RevoNano and LED using WS281x
Post by: karla on April 20, 2018, 12:25:38 pm
Done some tests this evening

Doing reboot after each line ...
1. setting FMS to Atti on all positions (just to rule it out for later tests) - no change
2. setting from INS13 to Basic (in case it is ATTI / STAB) (for this test, see when problem happens, as ATTI / STAB / GPS go green) - no change
3. disabling GPS - no change
4. disabling outputs on receiver port - no change
5. disabling telemetry on mainport - no change

However I have not physically disconnected the cables from the board...
Should I?
Title: Re: RevoNano and LED using WS281x
Post by: TheOtherCliff on April 21, 2018, 03:35:56 pm
Then it sounds to me like you really have a hardware problem.  :(

Thanks for help making sure there is not an interaction with those parts of firmware.

The only other things you might try would be (some of these you probably already tried and don't need to try again):
- starting from Erase Settings, just enable LED and see if that works (makes sure that there is no setting that causes this)
- moving that LED to a system where other LEDs are known to work (known good different MCU and known good different power)
- moving a known working LED to the system where it fails (make sure it is not the LED)
Title: Re: RevoNano and LED using WS281x
Post by: karla on April 22, 2018, 03:24:39 pm
Thanks Cliff,
Have tried most of that but just dawned on me I have not yet tried disable the current/volt sensor.
The interesting part is that it does work if I start with a fresh reboot of standard settings.
Its puzzling but in good hope to identify what the cause is.
Will try this next time I get home, on a business trip now.
K
Title: Re: RevoNano and LED using WS281x
Post by: Bobrcnut on April 24, 2018, 10:43:57 pm
   Just a brief update:  Doesn't work with my Revo Mini.  I redid my heli setup so that I could try out the LED strip on servo output 1.  Still doesn't work, but it DOES at least light up...  Using servo output 6, it did nothing at all, but using servo output 1, one of the 6 LEDs lights up solid green as soon as battery power is connected, and never changes during flight mode switching, arming, rebooting, etc.  I'm using a Matek WS2812B 6-LED strip, with no other peripheral devices connected to the Mini.

Title: Re: RevoNano and LED using WS281x
Post by: mr_w on April 24, 2018, 11:22:41 pm
@Bobrcnut

Can you post your config?
Title: Re: RevoNano and LED using WS281x
Post by: Bobrcnut on April 25, 2018, 11:04:02 pm
   mr_w, thanks for offering to help.  I want to run some more tests before uploading my .uav file... I recall that, when I was working with quadcopters and WS2812 LEDs, the 2812s were sometimes sensitive to the difference between supply voltage and signal line voltage.  Since I have my BEC set for 6V out instead of 5, that may be a factor, so I'll experiment with that first and see what happens using 5V and a very simple setup that has only an arming switch, 3 flight modes, and LEDs assigned to servo output #1.

   I'll be baaaackkkk....   ::)
Title: Re: RevoNano/RevoMini and LED using WS281x
Post by: Bobrcnut on April 26, 2018, 08:43:39 am
   ..Made some progress here.  Step by step:

-- Disconnected ESC, connected it to a separate receiver with nothing else connected to the Rx, provided battery power to the ESC via the same 4S Lipo as always, and used Tx stick programming to reset the ESC back to all default values, which include standard 5V BEC output.  (All other ESC parameters were already set to defaults.)  Measured with a DVM... 5.20 volts steady.  Previously, it was 6.02 volts steady.

-- Reconnected ESC to Revo Mini, then connected Revo Mini to LP via USB.  Did NOT reconnect Lipo. 

-- Went back into LP/System/HW Settings/WS2812 and set it to Servo Output 1, made no other changes at all, Saved the new settings, and disconnected from USB.

-- Disconnected the pitch servo from Servo output 1, connected the 6-LED strip instead.

-- Turned Tx back on, powered up the heli and Revo Mini using Lipo only, no USB connection to LP.

-- AND:  it's working.  All 6 LEDs started flashing single white blinks.  Servos responded to Tx as before.  Flipped the Arm switch, flash pattern changed to green.  Flipped the Flight Mode switch, green flash patterns changed to properly indicate each of the 3 Modes.

-- Reconnected to LP via USB... no change, flash patterns still responded to Tx switch changes.

   ...All this leads me to one conclusion, and one question:

-- For my specific setup (simple Trex450 DFC Heli, no accessories other than LEDs, LP 16.09), and a Revo Mini from Hyperion, the problem was in fact due to BEC output voltage levels.  It may be that my specific Revo Mini doesn't handle 6V well... I have another Revo Mini (never used) that I'll test this weekend, and see what THAT one does.

-- The only remaining anomaly is that the Wiki 'HowTo' section for LEDs says I should be getting blue flashes instead of green, but the flash patterns do match the HowTo.  Should that be a concern? 

Next step is to figure out how to shift all my heli output channels up by 1 so that I can keep the LEDs connected to Servo Output 1 (seems to be the only acceptable LED port on the Mini).

Title: Re: RevoNano and LED using WS281x
Post by: TheOtherCliff on April 27, 2018, 10:28:57 am
You really only need to move whatever is on channel one.  Just move it (only it) to the end instead of shifting them all down one place.  :)
Title: Re: RevoNano and LED using WS281x
Post by: mr_w on April 27, 2018, 11:53:56 am
We need to split this topic. I think Bobrcnut has regular revo (maybe mini) and not Nano like the OP and topic states. So different rules apply.

Title: Re: RevoNano and LED using WS281x
Post by: Bobrcnut on April 27, 2018, 05:17:24 pm
  mr_w, I apologize if I've 'cluttered up' this thread.. I'm not only new to Librepilot, but also new to this forum and I haven't yet absorbed all the subtle differences in protocols and courtesies between the various RC forums.  Since my LED issue seems to be resolved, I certainly have no objection to removing (or moving) my posts. 

For the record, I am in fact using only Revo Minis right now, not the full-size Revo or the Nano.
Title: Re: RevoNano and LED using WS281x
Post by: karla on April 27, 2018, 05:31:27 pm
For the record, I am in fact using only Revo Minis right now, not the full-size Revo or the Nano.

Are you using the Atom board?
https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/2818090/CC+Hardware+Configuration
Title: Re: RevoNano and LED using WS281x
Post by: karla on April 27, 2018, 05:41:48 pm
You really only need to move whatever is on channel one.  Just move it (only it) to the end instead of shifting them all down one place.  :)

Thats true. However, it can get really confusing to keep track of the heli setup of the swash plate servos if you do.
Title: Re: RevoNano and LED using WS281x
Post by: Bobrcnut on April 28, 2018, 06:35:13 am
   Karla, the board I'm using is shown in mr_w's post #18 on page 2 here in this thread, the one shown in the upper photo.  Here's a link to its user's manual:
https://d3vs3fai4o12t3.cloudfront.net/media/attachment/file/h/p/hp-fccc3dminif4-man.pdf

Librepilot detects and treats it as an original Revo, not as a Nano or Atom or Mini. 
Title: Solved: RevoNano and LED using WS281x
Post by: karla on April 29, 2018, 12:25:35 pm
Thank you Bobrcnut.
Also,

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.

I changed the BEC output to 5.0V and now the LED is working fine even with all peripherals like GPS, Current sensor, Camera switcher, OSD and telemetry is enabled.
Thank you all.
Title: Re: RevoNano and LED using WS281x
Post by: Bobrcnut on April 30, 2018, 11:10:31 pm
Karla:  Thank you for checking.  I was 'led' (no pun intended) astray by the Matek web site, which says 4-7V for the LED strip I'm using.