LibrePilot Forum

Development => Firmware General => Topic started by: kicekilla on May 07, 2017, 10:22:14 pm

Title: Sbus inverter option
Post by: kicekilla on May 07, 2017, 10:22:14 pm
I assume that LP inverts the sbus signal as it comes into the fc like other firmwares... my question is there a way to turn off the sbus inverter such as in betaflight for use of receivers that output uninverted sbus signal?

maybe is the systems tab somewhere? I couldn't find it but might not be implemented into the code I guess.

Thanks : )
Title: Re: Sbus inverter option
Post by: TheOtherCliff on May 08, 2017, 01:27:27 am
The inverter is programmable (on/off) because it must be off for other protocols.

There isn't an option to do this in the setup.  It is a fairly simple code change.

You have a receiver that puts out inverted (non-inverted from uart standpoint) SBus?
Title: Re: Sbus inverter option
Post by: kicekilla on May 08, 2017, 04:24:59 am
I figured it would have to be a slight code change as i hadn't heard of this before betaflight... I wouldn't know where to begin there really haha my programmong skills are very limited.

the rx is the FuriouFPV LR1000. outputs non-inverted sbus. rx binds well to my tx and provides telemetry, but I don't get any rc activity in the input tab. I got the rssi activity to show up in the gcs at some point on some other protocol (i tried them all for kicks, i think it was dsm)

http://furiousfpv.com/product_info.php?cPath=29&products_id=426

The inverter is programmable (on/off) because it must be off for other protocols.

There isn't an option to do this in the setup.  It is a fairly simple code change.

You have a receiver that puts out inverted (non-inverted from uart standpoint) SBus?
Title: Re: Sbus inverter option
Post by: TheOtherCliff on May 08, 2017, 07:22:11 am
If you are building your own firmware...

For example for Revo: in flight/targets/boards/revolution/firmware/pios_board.c

It might be (I have not verified it) as simple as changing this around line 865:
    if (hwsettings_mainport != HWSETTINGS_RM_MAINPORT_SBUS) {
        GPIO_Init(pios_sbus_cfg.inv.gpio, &pios_sbus_cfg.inv.init);
        GPIO_WriteBit(pios_sbus_cfg.inv.gpio, pios_sbus_cfg.inv.init.GPIO_Pin, pios_sbus_cfg.gpio_inv_disable);
    }

to this:
//    if (hwsettings_mainport != HWSETTINGS_RM_MAINPORT_SBUS) {
        GPIO_Init(pios_sbus_cfg.inv.gpio, &pios_sbus_cfg.inv.init);
        GPIO_WriteBit(pios_sbus_cfg.inv.gpio, pios_sbus_cfg.inv.init.GPIO_Pin, pios_sbus_cfg.gpio_inv_disable);
//    }

to make a version of firmware that turns off the Sbus inverter.
Title: Re: Sbus inverter option
Post by: kicekilla on May 08, 2017, 08:29:20 am
thank you, found it in the firmware and will look into learning how to modify/compile a custom firmware to try it out.

just following the CONTRIBUTING.md right now... is that the right place to start haha?  first custom firmware build here.
Title: Re: Sbus inverter option
Post by: TheOtherCliff on May 08, 2017, 08:58:53 am
The wiki has instructions on how to set up and build everything.
Title: Re: Sbus inverter option
Post by: kicekilla on May 08, 2017, 05:04:41 pm
Perfect, I will give it a shot. Thank you for the help!
Title: Re: Sbus inverter option
Post by: kicekilla on May 08, 2017, 05:40:31 pm
Would the code modification you posted earlier be the same for cc/cc3d? Might try on one of my many there as to not muck with my revo.

I can find the appropriate code, just not sure if it has a different coding than the revo.
Title: Re: Sbus inverter option
Post by: Brian on May 08, 2017, 06:42:59 pm
This seems to be becoming more popular.  I also have a receiver that (supposedly) outputs non-inverted sbus, although I looked at it on a scope and it sure looks inverted to me.  I haven't tried hooking it up to an FC yet, but plan to tonight.  I also have a configurable inverter on it, so I can try inverted or not.

In any case, we probably should add an option for non-inverted sbus to the standard firmware/GUI.
Title: Re: Sbus inverter option
Post by: f5soh on May 08, 2017, 07:52:42 pm
Quote
In any case, we probably should add an option for non-inverted sbus to the standard firmware/GUI.

Just need this pull request merged:
https://bitbucket.org/librepilot/librepilot/pull-requests/418/lp-480-pios-board-com-port-setup/diff#Lshared/uavobjectdefinition/hwsettings.xmlT37
Title: Re: Sbus inverter option
Post by: kicekilla on May 08, 2017, 08:04:02 pm
I don't know why manufactures would start switching it up... but I was just intrigued by the LR1000's long range, small size, and dualway telemetry. Just can't get it to work.

What rx do you have?


This seems to be becoming more popular.  I also have a receiver that (supposedly) outputs non-inverted sbus, although I looked at it on a scope and it sure looks inverted to me.  I haven't tried hooking it up to an FC yet, but plan to tonight.  I also have a configurable inverter on it, so I can try inverted or not.

In any case, we probably should add an option for non-inverted sbus to the standard firmware/GUI.
Title: Re: Sbus inverter option
Post by: Brian on May 08, 2017, 08:36:46 pm
It's a similar Rx from Banggood (probably a clone of some sort).

https://www.banggood.com/Mini-FrSky-8CH-LR1000-Receiver-Long-Range-Compatible-FrSky-X9D-Taranis-Taranis-Plus-XJT-p-1132192.html
Title: Re: Sbus inverter option
Post by: kicekilla on May 08, 2017, 10:14:30 pm
Let me know if you get it hooked up and working with no firmware change.

I also tried an sbus > ppm converter on mine to no avail.
Title: Re: Sbus inverter option
Post by: Brian on May 09, 2017, 05:01:09 am
My receive is working perfectly with no inversion on the Revo main port configure as S.bus.  The only problem I had was with the input configuration wizard.  RSSI is output on channel 9, and that was confusing the wizard, but I was able to configure the channels perfectly using the manual process, which I prefer anyways.

I don't know why they say that the s.bus on mine is not inverted because it clearly is.
Title: Re: Sbus inverter option
Post by: kicekilla on May 09, 2017, 05:38:25 am
Interesting. yeah when I setup another rx with rssi telemetry on a channel like that I also have to use manual setup or the wizard thinks its a different channel.

i picked up my first FC that is not a CC/CC3d/Revo to test mine on betaflight bc maybe my rx is just shot.. Ill test it on that in a few days when it gets here
Title: Re: Sbus inverter option
Post by: f5soh on May 09, 2017, 08:53:22 am
Quote
RSSI is output on channel 9, and that was confusing the wizard
You just need to declare manually the channel 9 under the Rssi line, save and Rssi is ignored for normal wizard usage.
Title: Re: Sbus inverter option
Post by: Schugy on November 03, 2017, 09:40:42 pm
My Walkera RX-SBUS also uses inverted SBUS signal. It supports PPM too but I'd like to use SBUS with my CC3D. Only got some flicker (Channel 18, 1, 2, 3 ...).
https://www.youtube.com/watch?v=Ajv27eNmla8
SBUS inversion seems to be pretty common.
Title: Re: Sbus inverter option
Post by: mr_w on November 04, 2017, 10:12:48 am
SBUS is by default "inverted", which means opposite (inverted) of what common UART uses. SBUS inactive line is logic low level, and active bits are represented as logic 1 (high level). UART uses the opposite way, but as it is more common it is considered as "normal", and SBUS as inverted.

On the other hand, cheaper receivers use cheaper hardware that doesn't have the capability of "inverting" the serial signal to fully comply with SBUS standard, and of course omitting external inverter (on rx side) makes thing even cheaper. Therefore, some RXes do indeed have somewhat non-standard SBUS that uses "non-inverted" UART type protocol.

Anyways, back to LibrePilot, current next does support turning off the inverter. The option to do so is accessible in HwSettings object through System tab.
Title: Re: Sbus inverter option
Post by: Schugy on March 17, 2018, 09:58:58 am
Now I'm clueless. I've installed the latest next release and activated the non_inverted SBUS option. Non-inverted there is no activity to be seen. With standard SBUS I have this "Channel 18+ used Channel" flicker.
I wonder what strange kind of SBUS the Walkera RX-SBUS uses. Maybe it's a sync problem. I have 3 receivers and they all work the same way. And they work flawlessly with my RC-Ware RX2SIM USB dongle (http://rcware.com/rx2sim.php) in SBUS mode. But this has nothing to do with the topic (SBUS inverter option) anymore and I'll start a thread for it.
Title: Re: Sbus inverter option
Post by: TheOtherCliff on March 17, 2018, 04:32:21 pm
Generally speaking you do NOT want "non-inverted" option.  It is non-standard.  :)

If the normal channels work at all, then you have it set correctly.

The 18+ may be from some extra (non-control) receiver signal like RSSI where the RC receiver is trying to tell the FC how strong the RC signal is, so the FC can do RTB/RTL/RTH when it is out of range, or the FC/OSD can issue warnings if it is almost out of range.  These extra signals can sometimes get in the way of running the transmitter wizard when it asks you to wiggle the roll stick and it sees the extra signals before you wiggle the roll stick.