Thread Tools
Old Jul 30, 2016, 01:56 PM
darven is offline
Find More Posts by darven
Registered User
Discussion

Serial output from FS-IA6 (Semi I-BUS)


Hello there fellow RC people.

i would just like to document a finding a made.
I searched high and low for a Serial/IBUS output from a FS-IA6 receiver without success.

But i did find this post by Alex that were intresting.
https://www.insidegadgets.com/2015/1...r-fpv-display/

i tried to get more information about the clock and data pin without success. i doubt its plain SPI communication.

but when i got fed up with those pins i tried to poke about and try to find a IBUS protocol, like what it is on the IA6B receiver.

One pin poked my intrest. i applied a UART filter on it and got some data.
(Pin 11, check attached image.)

The whole packet size is 31 bytes long.
1 Starting byte
14 channels @ 2 bytes each (28)
2 checksum bytes.
every 3.85ms
at 115200 baud rate.

*** Difference from IBUS Protocol. ***
The IBUS protocol has two starting bytes and calculates the checksum differently.
***

Sample packet:
Code:
55 DD 05 DC 05 EB 03 DC 05 E8 03 D0 07 D2 05 D9 05 E8 03 E8 03 DC 05 DC 05 DC 05 DC 05 23 4C
0x55 is the starting byte.
then we have the data for each channel.
Code:
1501,  1500,  1003,  1500,  1000,  2000,  1490,  1497,  1000,  1000,  1500,  1500,  1500,  1500
And then the checksum, in this case its
Code:
23 4C
Get them by doing:
Code:
  rcValue[ 0] = (data[ 2] << 8) + data[ 1];
  rcValue[ 1] = (data[ 4] << 8) + data[ 3];
  rcValue[ 2] = (data[ 6] << 8) + data[ 5];
  rcValue[ 3] = (data[ 8] << 8) + data[ 7];
  rcValue[ 4] = (data[10] << 8) + data[ 9];
  rcValue[ 5] = (data[12] << 8) + data[11];
  rcValue[ 6] = (data[14] << 8) + data[13];
  rcValue[ 7] = (data[16] << 8) + data[15];
  rcValue[ 8] = (data[18] << 8) + data[17];
  rcValue[ 9] = (data[20] << 8) + data[19];
  rcValue[10] = (data[22] << 8) + data[21];
  rcValue[11] = (data[24] << 8) + data[23];
  rcValue[12] = (data[26] << 8) + data[25];
  rcValue[13] = (data[28] << 8) + data[27];
Then to calculate the Checksum:
Code:
int checksum = (data[30] << 8) + data[29];
int myChecksum = 0;
for( int c=0; c<14; c++)
  myChecksum += rcValue[c];

if( myChecksum == checksum )
  Serial.println("Checksum valid!");
And i got the FS-i6 transmitter with the modified 10ch firmware.
and it transmits all the 10 channels

Hope someone might find this useful and i apologise if it has been documented before.

I dont think you can input this directly into popular flightcontrollers right now. someone needs to write a snippet to wait for the starting byte and calculate the checksum .

But i believe it will be very easy for a Atmega based MultiWii controller.
Sign up now
to remove ads between posts
Old Jul 31, 2016, 10:02 AM
androck is offline
Find More Posts by androck
Registered User
Hi,

thank you very much. With your help I successfully transfered this to betaflight.
It works with the PIN visible in your image. I use the stock FS-IA6 but should work
also with the modded 10ch firmware.

I will soon set this as a PR to betaflight. If you want I can upload hex files for your TARGET (FC Board) for testing.

diff --git a/src/main/rx/ibus.c b/src/main/rx/ibus.c
index 507df1e..5d12b87 100755
--- a/src/main/rx/ibus.c
+++ b/src/main/rx/ibus.c
@@ -42,9 +42,9 @@
#include "rx/rx.h"
#include "rx/ibus.h"

-#define IBUS_MAX_CHANNEL 10
-#define IBUS_BUFFSIZE 32
-#define IBUS_SYNCBYTE 0x20
+#define IBUS_MAX_CHANNEL 14
+#define IBUS_BUFFSIZE 31
+#define IBUS_SYNCBYTE 0x55

#define IBUS_BAUDRATE 115200

@@ -125,14 +125,14 @@ uint8_t ibusFrameStatus(void)

ibusFrameDone = false;

- chksum = 0xFFFF;
- for (i = 0; i < 30; i++)
- chksum -= ibus[i];
+ chksum = 0x0000;
+ for (i = 0, offset = 1; i < IBUS_MAX_CHANNEL; i++, offset += 2)
+ chksum += ibus[offset] + (ibus[offset + 1] << 8);

- rxsum = ibus[30] + (ibus[31] << 8);
+ rxsum = ibus[IBUS_BUFFSIZE - 2] + (ibus[IBUS_BUFFSIZE - 1] << 8);

if (chksum == rxsum) {
- for (i = 0, offset = 2; i < IBUS_MAX_CHANNEL; i++, offset += 2) {
+ for (i = 0, offset = 1; i < IBUS_MAX_CHANNEL; i++, offset += 2) {
ibusChannelData[i] = ibus[offset] + (ibus[offset + 1] << 8);
}
frameStatus = SERIAL_RX_FRAME_COMPLETE;
Old Jul 31, 2016, 03:33 PM
darven is offline
Find More Posts by darven
Registered User
awesome and fast working!

sure thing, i can test them.
I got a Naze32 rev6a10dof board.

but then again, its not IBUS per say, its more like a "ia6bus"
Last edited by darven; Jul 31, 2016 at 03:48 PM.
Old Jul 31, 2016, 05:09 PM
androck is offline
Find More Posts by androck
Registered User

NAZE32 Betaflight


Hi,
I hope you can pick up the file. Too large for the forum.

https://drive.google.com/file/d/0B1E...ew?usp=sharing
Old Jul 31, 2016, 05:15 PM
androck is offline
Find More Posts by androck
Registered User

NAZE32 Betaflight


Hi,

here is a NAZE32 Hex file. Please uncompress before use.

You´re right, I have to find a way to make this special "ibus" selectable, perhabs as cli command...
For this file, you can simply use IBUS receiver type.

Last edited by androck; Aug 01, 2016 at 03:31 PM.
Old Aug 01, 2016, 08:53 AM
darven is offline
Find More Posts by darven
Registered User
naze32 board flashed just fine.
All 10 channels available on the board.

next step is to mount it on my 450 frame and give it a test run.

Cheers and good job androck.
Old Aug 01, 2016, 03:35 PM
androck is offline
Find More Posts by androck
Registered User

Betaflight 2.9.0


Hi,

something seems to be wrong in my setup with BETAFLIGHT 3.0

For this reason I uploaded a 2.9.0 Version
Last edited by androck; Aug 02, 2016 at 01:39 AM.
Old Aug 01, 2016, 05:36 PM
darven is offline
Find More Posts by darven
Registered User
Ok i reflashed with 2.9 version.
Reception works.

But i still seem to have a problem with the receive rate. (nothing changed from the 3.0 firmware)
it seems like its only updating the inputs at about ~20 fps (wild guess).
(check attached images, there i am jerking the throttle up and down in a smooth manner)

i double checked with the logic analyser and the rate of the packets are still at about every 4ms (wich should give about 400fps at best)

i also double checked with anoter receiver that uses cppm and there the graphs are smooth when i jerk the throttle up and down.

is there some way to log how many packets that failed the checksum ?
or should i go for a more extensive test and check the checksums with an arduino to verify that all the checksums are calculated as i stated before?
i only verified the checksum by 3 or 4 packets when i did it before.

keep in mind, none of the inputs are false, its just that it dont update it as much as i would like to, it will probable be more noticable if you fly with it.
Old Aug 02, 2016, 01:43 AM
androck is offline
Find More Posts by androck
Registered User
Hi,

the interframe gap was still configured to 3ms for ibus. I don't know if that's correct. IA6B is already ordered

I reduced the gap time to 500us as I can guess from your screens, and it seems to work better.

Thanks for testing with me...
Old Aug 02, 2016, 06:16 AM
darven is offline
Find More Posts by darven
Registered User
much better!

i measured the timing between the packets and that is a solid 900us.
(no need to upload a firmware just for that but change it for the next one)
Old Aug 03, 2016, 12:34 PM
androck is offline
Find More Posts by androck
Registered User
I was flying today. Works fine.
Old Aug 06, 2016, 04:16 PM
androck is offline
Find More Posts by androck
Registered User

PR to betaflight


Hi,

i finally managed to add a pull-request to betaflight:

https://github.com/betaflight/betaflight/pull/1017

If it gets merged, you can set:

set serialrx_provider = IBUS
set ibus_model = IA6

to support our receiver.
Last edited by androck; Aug 16, 2016 at 03:59 AM.
Old Aug 07, 2016, 01:45 PM
2black0 is online now
Find More Posts by 2black0
Registered User
really2 great thread, we can use cheap rx
Old Aug 07, 2016, 02:10 PM
androck is offline
Find More Posts by androck
Registered User
I hope it will be integrated in Betaflight 3.1
If you need another Target than Naze for testing feel free to ask for it.
Old Sep 28, 2016, 11:18 AM
JeffyW is offline
Find More Posts by JeffyW
Registered User
I noted on the pull request that I'm currently testing it on my SPRacingF3 target. I'd love to see this integrated.


Thread Tools