Hello and welcome to our community! Is this your first visit?
Register
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31
  1. #1
    Senior Pilot wooden's Avatar
    Join Date
    Dec 2011
    Location
    Pacific Northwest
    Posts
    4,869
    Blog Entries
    1
    Downloads
    1
    Uploads
    0
    Reputation Points (Add)
    27

    Futaba sBUS RX library

    Couldn't get the PWM outs on my Futaba R6208SB working properly with a Mega and v2.1 shield (read this thread about the dead zone in the middle), so I decided to try the sBUS. Thanks to remspoor, found some already working sBUS code for MWC and another post about the specifics of the sBUS serial data stream. I more-or-less just ported the MWC sBUS code to AQ - it uses 8 channels but can be programmed to use more (I don't know if the AQ code supports more than 8 channels right now?) and they're very very steady.

    HARDWARE REQUIREMENTS:
    sBUS is an inverted serial data stream, so in order for an Arduino Mega to read it correctly, you need to pass the signal through an inverter of some kind. I used an SN74LS00N 2-input NAND that I found in a really old electronics kit, just plugged the signal into both inputs of one of the NANDs and out came a standard serial data stream.

    Click image for larger version. 

Name:	IMG_0031.jpg 
Views:	1425 
Size:	90.6 KB 
ID:	6167Click image for larger version. 

Name:	IMG_0030.jpg 
Views:	1237 
Size:	93.9 KB 
ID:	6166Click image for larger version. 

Name:	IMG_0029.jpg 
Views:	1272 
Size:	92.5 KB 
ID:	6165

    I had already changed the LED locations on the v2.1.2 shield because I wanted to use right angle headers for the motors/RX pins, but now that sBUS works, I may remove all the RX pins, turn the motor pins around, and move the LEDs back to their proper places.

    SOFTWARE REQUIREMENTS:
    Currently, sBUS is only supported in the dev branch. Once you've downloaded the development code (beware, dev branch is not 100% free of bugs), it's as simple as uncommenting "//#define ReceiverSBUS" and "//#define SERIAL_SBUS Serial2" if you're using a Mega2560 with v2.1 shield or AQ32. It uses serial port 2 (Serial2) so it only works on boards with multiple serial ports. You can change the serial port if you like (change Serial2 to Serial3, Serial1, etc.).

    UPDATE: I've now updated the sBUS library to be compatible with AQ32/Baloo boards, configurable to whatever serial port you choose. In UserConfiguration.h, there is a variable right under where you #define ReceiverSBUS that controls where the microcontroller will look for sBUS data (on AQ32 I've tested it on both Serial2 and Serial3, only Serial2 on v2.1 but it should work on other serial ports with Mega based boards). Also, I've updated it to work with up to 10 channels, so if your TX has 10 channels, feel free to comment out #define LASTCHANNEL 8 and use #define LASTCHANNEL 10! The STM32 compatibility and 10 channel capability have not been merged with the dev branch quite yet, just waiting on Kenny to clear it through and everything will be in the dev branch!
    Last edited by wooden; 09-25-2012 at 10:32 PM.
    push the envelope, watch it bend

  2. #2
    AeroQuad Lead Software Architect Kenny9999's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Jean-sur-Richelieu, Quebec, Canada
    Posts
    2,332
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    7
    Ah... Ok, then, you are the guy from the pull request!

    I Have make a couple of comment that I want you to do, Just some cleanup and indentation to make it more readable! Cause, Not always to me to do it!

    Also... since it's on Serial1... this is in conflict with GPS, so, it's one or the other!
    Truly superior pilots are those who use their superior judgment to avoid those situations where they might have to use their superior skills"- Author unknown

  3. #3
    Senior Pilot wooden's Avatar
    Join Date
    Dec 2011
    Location
    Pacific Northwest
    Posts
    4,869
    Blog Entries
    1
    Downloads
    1
    Uploads
    0
    Reputation Points (Add)
    27
    I thought PPM was on Serial1, which is why I put it there. Is Serial2 the one reserved for RX?
    push the envelope, watch it bend

  4. #4
    AeroQuad Lead Software Architect Kenny9999's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Jean-sur-Richelieu, Quebec, Canada
    Posts
    2,332
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    7
    Actually, there is no one available,

    PPM don't use a Serial at all

    Serial0 = normal connection
    Serial1 = GPS
    Serial2 = Slow telemetry with modem
    Serial3 = Wireless telemetry

    So, using one will remove the possibility to use one!

    Don't know what Kha will thing of it, but, may be we could use Serial3 instead of Serial2 for slow telemetry since they are really similar! and free Serial2 for that!

    I'm open to suggestion!
    Truly superior pilots are those who use their superior judgment to avoid those situations where they might have to use their superior skills"- Author unknown

  5. #5
    Senior Pilot wooden's Avatar
    Join Date
    Dec 2011
    Location
    Pacific Northwest
    Posts
    4,869
    Blog Entries
    1
    Downloads
    1
    Uploads
    0
    Reputation Points (Add)
    27
    Is there any situation where both slow telemetry with modem and wireless telemetry would be enabled? If you're using the slow telemetry over audio, seems pointless to run wireless telemetry, too IMO. Also, since I don't have the correct stuff to do telemetry over audio, I'll just change it to Serial2 for now. No problem moving one wire.
    push the envelope, watch it bend

  6. #6
    AeroQuad Lead Software Architect Kenny9999's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Jean-sur-Richelieu, Quebec, Canada
    Posts
    2,332
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    7
    Like I said, I would like to have another opinion, but, I agree with you...

    Put it on Serial2 for now and add a excluding condition to prevent user problem. And we will see in the future if there is any problem with that! Slow telemetry can stay on Serial2 for now. We already have some user for it!
    Truly superior pilots are those who use their superior judgment to avoid those situations where they might have to use their superior skills"- Author unknown

  7. #7
    Moderator AeroQuad Core Software Developer kha's Avatar
    Join Date
    Apr 2011
    Location
    Espoo, Finland
    Posts
    2,033
    Blog Entries
    2
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    12
    We could make these selectable in UserConfig... like

    #define Receiver_SBUS Serial3
    ...
    #define SlowTelemetry Serial2
    ...
    //#define WirelessTelemetry Serial2
    ...

    and then in lib have something like
    ...
    #if defined (SlowTelemetry)
    init_ST(){
    SlowTelemetry.begin(1200);
    }
    ...

  8. #8
    Senior Pilot wooden's Avatar
    Join Date
    Dec 2011
    Location
    Pacific Northwest
    Posts
    4,869
    Blog Entries
    1
    Downloads
    1
    Uploads
    0
    Reputation Points (Add)
    27
    It's on Serial2 for now. I've committed what I think should be a final version that checks the start and stop bits before filling the rcChannel buffers. I've had it on for 5+ minutes now and it's still reading the RX like a champ, at least at 10Hz telemetry over USB I see no errors and the sticks never twitch in Vehicle Status. I flew it inside earlier today before adding the check for the stop bit, worked well enough to get off the ground in rate mode.

    For those who are wondering what kind of RX they'd need for this, here ya go:

    Futaba R6208SB, came with my Futaba T8FG TX. It's on the very pricey side at $139, but it does give you the choice of PWM or sBUS (or both).


    Futaba R6203SB, a little cheaper at $79. Probably quite the same as the 6208 but without many PWM channels.


    Futaba R2008SB, $59. FHSS compatible, I don't believe this works with FASST TXs.


    And there are probably many others. The RXs are a little expensive but it is definitely a step up from PWM as the channels are all digital and jitter free. I've never tried PPM so I can't compare the two.
    push the envelope, watch it bend

  9. #9
    Senior Pilot wooden's Avatar
    Join Date
    Dec 2011
    Location
    Pacific Northwest
    Posts
    4,869
    Blog Entries
    1
    Downloads
    1
    Uploads
    0
    Reputation Points (Add)
    27
    Flew using sBUS for at least 5 battery cycles this weekend, worked great!
    push the envelope, watch it bend

  10. #10
    Senior Pilot xtrmtrk's Avatar
    Join Date
    Jan 2012
    Location
    Bellevue, Washington USA
    Posts
    1,168
    Blog Entries
    10
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    5
    Hobby King sells this receiver for Spektrum transmitters that has an S-Bus output port. I wonder if you could use it like you're using the Futaba. It'd be fantastic to be able to get rid of 6 wires. I may have to buy one and do some experimenting. It's a pretty good looking deal - 7 channels with satellite and failsafe for only $18.
    2013 Carnage (so far!): 26 propellers, 1 frame, 5 arms, 1 motor mount, 2 motors, 2 ESCs, 1 GPS


 
Page 1 of 4 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •