Go Down

Topic: Futaba SBUS reverse engineered to work with Arduino (Read 90765 times) previous topic - next topic

joe147

Hi all,


I am trying to implement a sensor to a drone to avoid obstacles. I want to control the pitch channel so that when the drone senses an obstacle in front, the Arduino will overwrite the pitch channel, the drone will pitch up, and move back to avoid the obstacle.

I am using a 8 channel Futaba R2008SB radio receiver. I downloaded the Arduino libraries:

FUTABA_SBUS library: https://github.com/mikeshub/FUTABA_SBUS
Streaming library: http://arduiniana.org/libraries/streaming/

I used a 74LS14 hex inverter.
I connected the SBUS signal of the radio receiver to input of an inverter, the output of the inverter to the RX of the Arduino.
The TX of the Arduino connected to the input of another inverter, the output of the inverter to the RC signal of the Pixhawk.

I opened the serial monitor and set it to 115200 baud, however, there is no numbers displayed on the serial monitor.

I am wondering if the code is suitable for 8 channels, or am I required to modify the code to suit 8 channels? Does the code work if some of the channels between the radio transmitter and the radio receiver are inverted? Also, I am not sure whether my circuit connections are correct.

I do not understand SBUS protocol. I am interested to learn about how the bytes affect the channels.

I hope to receive help please, I would appreciate your help. Thanks.

Below is the code:

Code: [Select]
#include <FUTABA_SBUS.h>
#include <Streaming.h>


FUTABA_SBUS sBus;


void setup(){
  sBus.begin();
  Serial.begin(115200);
}

void loop(){
  sBus.FeedLine();
  if (sBus.toChannels == 1){
    sBus.UpdateServos();
    sBus.UpdateChannels();
    sBus.toChannels = 0;
    Serial<<sBus.channels[0]<<","<<sBus.channels[1]<<","<<sBus.channels[2]<<"\r\n";
  }
}

Eagle71

Hello

@caiopoit  here is a Project you search for. But it is in German:

http://fpv-community.de/showthread.php?32899-FrSky-TARANIS-Hardware-Mods&p=477461&viewfull=1#post477461

You have to download the LIB's too, because they where modified for the MICRO!
And copy the Futaba-sbus and RC Dir's into your Arduino-Libs-Dir


The Inverter with npn-Transistor on Top of Page 5 do his work! I Use about 12kohm Pullup and 5,7kohm Basis resistor.

mturneruk


Hey all..

I would be very grateful anyone can help.

I have been using the fantastic Futaba SBUS Library on an Arduino Mega to read channel data from a  FRSky X8R / Taranis. I am using the inverter described here.

I get frequent Lockups, where the transmitter will stop responding and my robot will just going until i reset the Arduino. Sometimes after 20 seconds, sometimes after 5 mins. I have built several robots which use this library and I have experienced the same problem on all.

I am using the stock FUTABA_SBUS_h Library and RX SerialPort 3 on the Mega to receive the Sbus Data.

It's starting to drive me crazy. Any help much appreciated.
I have no idea how to debug.

jbarchuk

#78
Apr 15, 2017, 05:02 pm Last Edit: Apr 15, 2017, 05:04 pm by jbarchuk
using the fantastic Futaba SBUS Library on an Arduino Mega to read channel data from a  FRSky X8R / Taranis.
...several robots which use this library and I have experienced the same problem on all.
Have you tried a Futaba Tx/Rx? If not you've bet the farm on the skills of the Chinese reverse engineering department. They're notorious for de-engineering things, lowering parts specs, leaving parts out, and changing critical circuit points just to save a few nickels. Which often leads to failure

szabi

Hey guys.

I know it's an older thread, but I thought I'll post a version of my Futaba S-BUS Library. It might be useful for some.

The library can be cloned (the latest version) here.


I've attached the latest build, but try and use the one from the above link always as that's going to be the latest version.


Szabi

Go Up