Thread Tools
This thread is privately moderated by grmis, who may elect to delete unwanted replies.
Feb 23, 2017, 03:52 PM
Registered User
grmis's Avatar
Thread OP
Build Log

3-channel DIY video diversity system for FPV, *without RSSI*


Here is some project that I have recently started : a video diversity system, *without RSSI*.

This this system monitors and compares the video quality of the composite video signals, and switches to the best one. Of course the idea is not new: see for instance the Oracle diversity or the Eagletree ground-station. But the present one is meant to be DIY.

Compared to the popular RSSI-based systems, the advantages a video-based diversity are :
- No need to open the receivers to get the RSSI [Receiver Signal Strength indication] signals. You just have to plug in your different receivers, and they can be of different types.
- There is no need to calibrate the RSSi signals of the different receivers (this is often the tricky part).
- It is also frequent to get a strongly distorted image, while the RSSI is high.
- When the reception level is low (flying far for instance), some receivers have RSSI close to zero, although the image is still viewable. In that case an RSSI-based system is not really efficient.

So far I only tested the system on the bench (video soon : see the post below). I just made some basic indoor tests with 3 receivers in the 0.9G band, and it seems to pick
the best image reasonably well. Of course I still have to test it in real conditions.

A few comments on the hardware:

- Cheap (<20$)
- Some LM1881 chips are used to extract the (horizontal) sync. information from the composite video signal, as in Oracle's system.
- NodeMCU/8266:
* Thanks to this relatively fast processor (ESP8266 running at 160Mhz), it can perform a real-time analysis of each video *line* (horizontal sync pulses every ~64 micro seconds for a clean image), on several inputs (here 3). Since there are still some free CPU cycles, one could add some functions, like driving an Oled display, etc.
* These boards became very popular, due to their Wi-Fi capabilities (IoT). In fact we are not using the Wi-Fi here, but these boards are also interesting because of their clock frequency (10 times that of a standard arduino), their ease of programming (USB+Arduino IDE), and their low cost (~4$). I am using here a NodeMCU board, but a WeMos D1 mini would be fine too, and physically smaller. Later the Wi-Fi capabilities could be used to configure the system using a smartphone.

- Max4545: This witch is relatively fast (~200ns to switch), and the switching time is therefore a tiny fraction of a video line (invisible in practice). Note: I initially tried to use some Pericom chip [PI5V331] as switch. The PI5V331 is used in some popular RC video switches (like the one sold by Hobbyking). However there was too much cross talk between the sources. I did not have any such problem with the Max4545. Note also that one can order some free 4545 samples on the Maxim Integrated site.

About the code:
- For optimal performance, the sync. pulses are monitored using interrupts (and a timer).
- I may post the (Arduino) source later, but I first have to test it in 'real' conditions.
- A link to the source code is in post #3 below

If you are interested in this project and/or if you have some comments or suggestions, please post some comment here !

Greg.

EDIT [1/03/2017] Version 1.1 of the schematics: added 1nF capacitors on LM1881 outputs (see post 4 below) & Wemos D1 module
EDIT [4/04/2017] Source code on GitHub (post #3)
Last edited by grmis; Apr 04, 2017 at 03:03 AM. Reason: link to the source code added in post #3
Sign up now
to remove ads between posts
Feb 23, 2017, 03:53 PM
Registered User
grmis's Avatar
Thread OP
Short bench test of the first prototype:

DIY Video diversity controller without RSSI (0 min 36 sec)
Last edited by grmis; Feb 25, 2017 at 06:16 AM. Reason: new short video
Feb 24, 2017, 06:20 AM
Registered User
grmis's Avatar
Thread OP
If someone wants to test this "beta" version, here is the source code:

https://github.com/grmis-fr/Video-Diversity

G.
Last edited by grmis; Apr 04, 2017 at 02:53 AM.
Mar 01, 2017, 11:38 AM
Registered User
grmis's Avatar
Thread OP
After some more bench tests, I found that a problem occurs if there is no reception at all, so that the image just showing some black and white "snow". In such a case, the LM1881 produce (spurious/random) sync pulses at high rate. The ESP8226 is then overwhelmed by interrupts, and this produces some reboot of the micro controller (due to the watch dog timer [WDT] of the ESP8266).

Fortunately, there seem to be a very simple solution: adding a 1nF capacitor between the output pin of the LM1881 and the ground, so that (together with the LM1881 internal resistance) it acts as a low-pass filter. This way, the noise which takes place at frequencies that are much higher than a normal video line (64 micro seconds for PAL) is suppressed. Now the ESP8266 does not crash anymore :-)

I have just updated the schematics accordingly (see post 1). Notice that I also replaced the NodeMCU board by a Wemos D1 mini, which is physically smaller and nevertheless has all the pins we need here (and I checked that it works). Stay tuned !
Apr 01, 2017, 01:16 PM
Baris ALP
hd27's Avatar
Nice.. great project! Did you test it in outdoor, any news?
Apr 02, 2017, 02:29 AM
Registered User
grmis's Avatar
Thread OP
Thanks for your message. No outdoor test yet... but I should be able to fly with it within a week or so.
May 21, 2017, 03:31 PM
Registered User
stringwhisperers's Avatar
I watched your video and noticed some screen tearing. Does that mean you can successfully reconstruct a single frame from multiple receivers?If so , i suspect it might clean up the usual fpv feed which tears white lines in video even in perfect conditions.Do you think setting the ''N'' parameter in your sketch much lower would work fine for that purpose?
May 22, 2017, 09:48 AM
Registered User
grmis's Avatar
Thread OP
Hi,

I am not completely sure what you mean by ' reconstruct a single frame from multiple receivers', but a switch from one receiver to another can occur at any time during a frame (and the switch itself is very fast). In that case the upper part of the frame is from one receiver, and the lower part comes from another. In principle all the receivers are getting their signals from the same camera. So, their respective signal are perfectly synchronized, and there should be no 'tearing' when switching from one to another. Now, if none of the receivers is getting a good image, then the diversity system may switch more or less randomly from one source to another, and you may see some horizontal bands on the screen, each one coming from a different receiver.

Concerning the parameter N in the code, I observed hat it should not be decreased too much, otherwise the system sometimes accidentally (and for a fraction of a second only) chooses a receiver with a lower image quality. But this certainly deserves some further tests and investigation.

Greg
May 27, 2017, 06:11 AM
Registered User
stringwhisperers's Avatar
Thank you for your very informative answer.Looks like switching between receivers for discarding artifacts is not doable and sync quality solely may not represent the quality of the video.Do you plan on developing this more or is it an one off project?This looks like a nice alternative for the rssi based projects.
May 27, 2017, 04:17 PM
Registered User
grmis's Avatar
Thread OP
Hi. It is not 'off' at all... but unfortunately I do not have a lot of time to work on it. Still, I did a few flights with is this afternoon (in the 5.8Ghz band [quad] as well as in 1GHz band [flying wing], each time with an omni antenna and a patch antenna), and the result was quite good.
I noticed some (very) small black spots in the image, corresponding to each switch. I may introduce some slight hysteresis in the code, to limit the number of switches. I am also planning to order another 5.8Ghz receiver, to try this system with three receivers and three antennas at the same time.
Last edited by grmis; May 27, 2017 at 05:40 PM. Reason: typo
May 27, 2017, 04:58 PM
Registered User
stringwhisperers's Avatar
Do you plan on posting a flight video?It would be interesting how it handles 5.8 ghz.
May 27, 2017, 05:44 PM
Registered User
grmis's Avatar
Thread OP
Yes, I will do that. Unfortunately my Eachine DVR just died a few days ago (maybe my fault), so I need to order a new one...
Jun 21, 2017, 04:45 AM
Registered User
grmis's Avatar
Thread OP

ground station with video diversity


The diversity controller is now installed in my ground station. For the moment I am using it with just two video receivers (either .9Ghz or 5.8Ghz, depending on the model), one with an omni directional antenna, and the other with a patch antenna.
Sep 26, 2017, 06:24 PM
Registered User
Awesome

Would it be possible to switch the audio feed together with the video feed?
Sep 27, 2017, 02:03 AM
Registered User
grmis's Avatar
Thread OP

audio


In principle this should be relatively easy. One should however add another switch. I guess that adding a second max4545 to handle the audio signals would be ok (but I haven't tried).
It would be controlled by the same digital signals as the other 4545, so a priori there would be nothing to change in the code.


Quick Reply
Message:
Thread Tools