SBUS Trainer input

erskyTx runs on many radios and upgrade boards
ersky9x was a port of er9x for use on the sky9x board.
User avatar
MikeB
9x Developer
Posts: 16724
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

SBUS Trainer input

Post by MikeB » Tue Sep 02, 2014 10:37 pm

I've just been testing a new feature in ersky9x. Following a request from Wayne at Aloft Hobbies, I've added the ability to use a SBUS signal as the trainer source into the COM2 input of the SKY board, the 9XR-PRO, and the serial port in the battery bay of the Taranis.
This is all working, and I've also added PPM9 to PPM16 mix sources to allow all 16 channels to be used.
This make the implementation of a wireless trainer system quite easy.
I've passed the code to Bertrand and this feature should also therefore be in openTx.
I'll hopefully post a test version of ersky9x tomorrow sometime with this in.
There is an option in the TELEMETRY2 menu for the COM2 Function. You select either "Telemetry" or "SbusTrain".
If necessary, I should be able to extend this to allow COM1 to be used for this function for those who need COM2 for telemetry.

Given the support for 16 trainer channels, I'll look to extend the Bluetooth as trainer to use 16 channels as well. It might make sense to use SBUS protocol over Bluetooth rather than the existing protocol, which is very simplistic.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!


User avatar
jhsa
Posts: 19205
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: SBUS Trainer input

Post by jhsa » Tue Sep 02, 2014 10:49 pm

Nice one Mike. Question. Do you mean send ALSO the Sbus signal over bluetooth, or replace the existent serial completely?
I'm asking because of some of us still using the arduino and also the DJT that doesn't have sbus..
Of course I am thinking about the trainer communication between the radio and eepskye.. or am I missing something? :)
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: SBUS Trainer input

Post by bertrand35 » Wed Sep 03, 2014 5:25 pm

Thanks Mike. This one is ready for tests in the nightly builds here:
http://jenkins.open-tx.org/nightly-21/
(backup your eeprom as it will be automatically converted on first start)
You will also have a 3rd timer in this version, with timer names etc. = a preview of OpenTX 2.1

User avatar
MikeB
9x Developer
Posts: 16724
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: SBUS Trainer input

Post by MikeB » Wed Sep 03, 2014 6:34 pm

An update from Wayne. He really wanted to use a pin in the module bay, so he can produce a "plug and play" module. I discovered that pin 2, which is for a "heartbeat" signal from the XJTs (internal and external), is wired up, but not used by the XJT. As luck would have it, it is wired to a processor pin the supports a currently unused USART. So, a quick bit of code, and I have the SBUS signal read and processed from pin 2 in the module bay of the Taranis. (Code e-mailed to Bertrand).

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
Kilrah
Posts: 10412
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: SBUS Trainer input

Post by Kilrah » Wed Sep 03, 2014 6:43 pm

The heartbeat signal is actually present, but the XJT has an open collector output. So there might be a conflict during the heartbeat pulse.


User avatar
MikeB
9x Developer
Posts: 16724
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: SBUS Trainer input

Post by MikeB » Wed Sep 03, 2014 9:14 pm

I put my 'scope on it, before I connected the SBUS signal, and there was no obvious signal present, just noise pickup from the PXX input signal.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
jhsa
Posts: 19205
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: SBUS Trainer input

Post by jhsa » Wed Sep 03, 2014 9:22 pm

jhsa wrote:Nice one Mike. Question. Do you mean send ALSO the Sbus signal over bluetooth, or replace the existent serial completely?
I'm asking because of some of us still using the arduino and also the DJT that doesn't have sbus..
Of course I am thinking about the trainer communication between the radio and eepskye.. or am I missing something? :)
Sorry Mike, I might be getting to much sun on my head lately ;) but I don't really understand what is going on.. maybe it is just a stupid question? or am I completely lost here? Will eepskye continue to send a trainer signal that the arduino understands? Or will the arduino have to be programmed with the Sbus protocol for the trainer? or maybe we are talking about 2 different things? :) :roll: :roll:

thanks,

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
MikeB
9x Developer
Posts: 16724
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: SBUS Trainer input

Post by MikeB » Wed Sep 03, 2014 9:44 pm

I won't be changing the eepskye output any time soon, if ever, don't panic!

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
jhsa
Posts: 19205
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: SBUS Trainer input

Post by jhsa » Wed Sep 03, 2014 10:04 pm

MikeB wrote: don't panic!
Ha ha, ok.. :) Thanks Mike. As I said, too much Sun on my brain.. :mrgreen:
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
Kilrah
Posts: 10412
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: SBUS Trainer input

Post by Kilrah » Wed Sep 03, 2014 10:30 pm

MikeB wrote:I put my 'scope on it, before I connected the SBUS signal, and there was no obvious signal present, just noise pickup from the PXX input signal.
That was my observation, so I asked Adela. The signal IS driven by the module as open collector, but due to the circuitry in the radio not pulling it up it's barely noticeable. It should still pull your SBUS signal down though.

User avatar
MikeB
9x Developer
Posts: 16724
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: SBUS Trainer input

Post by MikeB » Thu Sep 04, 2014 12:06 am

According to the schematic I have, there is a 10K pullup in the radio, and I still didn't see it getting pulled down. I'll have a closer look tomorrow.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
MikeB
9x Developer
Posts: 16724
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: SBUS Trainer input

Post by MikeB » Thu Sep 04, 2014 9:05 am

Just checked the heartbeat signal from the XJT. It is not only open collector, but also has a 500 ohm resistor in series with the output. This means the SBUS input is able to override the heartbeat signal.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
Kilrah
Posts: 10412
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: SBUS Trainer input

Post by Kilrah » Thu Sep 04, 2014 9:06 am

Cool, all good then!

Sent via mobile

User avatar
Philipp
Posts: 122
Joined: Sat Jan 11, 2014 9:01 pm
Country: -

Re: SBUS Trainer input

Post by Philipp » Fri Sep 05, 2014 12:01 pm

MikeB wrote:An update from Wayne. He really wanted to use a pin in the module bay, so he can produce a "plug and play" module. I discovered that pin 2, which is for a "heartbeat" signal from the XJTs (internal and external), is wired up, but not used by the XJT. As luck would have it, it is wired to a processor pin the supports a currently unused USART. So, a quick bit of code, and I have the SBUS signal read and processed from pin 2 in the module bay of the Taranis. (Code e-mailed to Bertrand).

Mike.
I really like the direction this is going and truly appreciate the work and energy you put into it! I love the idea of being able to put receivers etc. in the module bay of the Taranis, especially for wireless trainer systems!
Would it be possible to also enable CPPM input on pin 2 of the JR module bay? This would be great for simpler receivers that do not support SBUS or other DIY projects.

Greetings,
Philipp

User avatar
MikeB
9x Developer
Posts: 16724
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: SBUS Trainer input

Post by MikeB » Fri Sep 05, 2014 4:18 pm

I've already scheduled work on that for this weekend! I've taken time off from coding today to go flying!

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
jhsa
Posts: 19205
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: SBUS Trainer input

Post by jhsa » Fri Sep 05, 2014 6:19 pm

Good you went flying Mike. I hope you had a great time :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
MikeB
9x Developer
Posts: 16724
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: SBUS Trainer input

Post by MikeB » Sat Sep 06, 2014 9:45 pm

All basically working. I can select between CPPM on the Jack (trainer) input, SBUS on pin 2 in the module bay and CPPM on pin 2 in the module bay. Just got a few minor things to tidy up.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
Philipp
Posts: 122
Joined: Sat Jan 11, 2014 9:01 pm
Country: -

Re: SBUS Trainer input

Post by Philipp » Wed Sep 10, 2014 6:26 pm

This sounds awesome!

How much effort would it be to implement a binding procedure for CPPM capable receivers?
I am thinking of the OrangeRX R615X in particular (http://hobbyking.com/hobbyking/store/__ ... _CPPM.html).
Bind Mode is entered by pulling the CPPM signal pin low while applying power to the receiver.

Why would one want to do this?
Here's why:
Features:
[...]
• Compatible with DSM2/DSMX 1024/2048 aircraft radio and module systems
• CPPM output allowing for single line connection with compatible CPPM devices
[...]

Specification:
Channels: 6
Input voltage: 3.7~9.6V
Size: 19.5x30x10mm, 43x22x13mm with case
Weight: 3.7g / 9.8g with case
Input voltage range is ideal for the stock 6S NiMH pack and might work for a 3S LiFe aswell, an additional BEC / VREG might be necessary for a 3S LiPo though.
Conncetions to the Taranis are trivial, only [CPPM_IN] eg. [HEARTBEAT], [VBAT] and [GND] needed, these are found in the correct order next to each other in the JR module bay of the Taranis, meaning one could use a regular 3 pin female to female servo lead and just plug it in.

For reference: (http://eastbay-rc.blogspot.de/2014/01/t ... n-out.html)
[thumbnail=left]http://3.bp.blogspot.com/-tsTSoDzvDGQ/U ... Pinout.jpg[/thumbnail]
Of course binding via a menu option is not necessary, one could simply use a regular bindplug or a tactswitch, I just think it would be really neat and quite useful if you want to teach all your Spektrum friends how to fly a particular model of yours.

What do you think?

User avatar
MikeB
9x Developer
Posts: 16724
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: SBUS Trainer input

Post by MikeB » Wed Sep 10, 2014 6:47 pm

Not directly possible. The heartbeat signal (pin 2) has a transistor buffer that make the pin input only. It would probably need pin 5 to be wired in parallel with pin 2 to be able to drive the signal low when required.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
MikeB
9x Developer
Posts: 16724
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: SBUS Trainer input

Post by MikeB » Wed Sep 10, 2014 8:59 pm

I can confirm the R615X does work in CPPM mode. I tested this in my Taranis running ersky9x with the R615X connected to GND and pin 2, but separately powered. The student Tx was a 9XR-PRO with a prototype DSM2/X Tx module, already bound to to the R615X.
To use the power pin in the module bay will need some extra code to turn it on in the Taranis.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
Philipp
Posts: 122
Joined: Sat Jan 11, 2014 9:01 pm
Country: -

Re: SBUS Trainer input

Post by Philipp » Wed Sep 10, 2014 9:02 pm

Would this interfere with the function of the internal XJT module? Pin 5 is used for the SMART Port, right? Wouldn't the internal module pull this pin low while receiving telemetry, or are there separate inputs for that?

User avatar
MikeB
9x Developer
Posts: 16724
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: SBUS Trainer input

Post by MikeB » Wed Sep 10, 2014 9:32 pm

Yes, it would probably need some extra circuitry, and may not work at all. In that case, maybe we can use pin 1. This is specific to the external module connector, and has a transistor driver with a 10K pullup resistor.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
Philipp
Posts: 122
Joined: Sat Jan 11, 2014 9:01 pm
Country: -

Re: SBUS Trainer input

Post by Philipp » Wed Sep 10, 2014 9:43 pm

I personally think using pin 5 is too complicated and does not go well with the idea of keeping this plug and play. Pin 1 should work without additional circuitry, however one would lose the PPM output which limits you to using the internal module. Therefore it might be the best option to use a pushbutton and keeping this pressed while plugging the receiver in.

Or did I get something wrong?

User avatar
MikeB
9x Developer
Posts: 16724
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: SBUS Trainer input

Post by MikeB » Wed Sep 10, 2014 10:25 pm

If you are connecting to the module bay connector then surely, you are losing the option of using an external Tx module anyway so must be using the internal module.
Connecting to the external module pins, while there is a module in the bay will be difficult.
You can currently (is in ersky9x, should be in openTx), use SBUS on the serial connector in the battery bay. I'm looking into allowing CPPM on the receive pin of this connector. I think there is an unused timer associated with this signal, so it should be possible to implement. You can, of course, use CPPM on the trainer jack.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
Philipp
Posts: 122
Joined: Sat Jan 11, 2014 9:01 pm
Country: -

Re: SBUS Trainer input

Post by Philipp » Thu Sep 11, 2014 6:42 am

I am going to integrate a R615X in my diy DM9 spektrum module, thats why I do not want to sacrifice pin 1 for binding. ;) That's just my personal use case though, others might appreciate binding via pin 1. This could be useful for the plug and play modules Aloft seems to be interested in making.
I did not know that pin 2 is a buffered input, I was thinking of it as a regular 'Arduino style' GPIO which would have made binding very easy.

User avatar
Philipp
Posts: 122
Joined: Sat Jan 11, 2014 9:01 pm
Country: -

Re: SBUS Trainer input

Post by Philipp » Fri May 22, 2015 8:58 am

For reference: viewtopic.php?f=40&t=4868&p=97508#p97508
Thanks for implementing this feature, Mike! It's awesome :D

mrunx
Posts: 6
Joined: Thu Apr 21, 2016 4:13 pm
Country: -

Re: SBUS Trainer input

Post by mrunx » Mon May 02, 2016 11:13 pm

Mike, thanks for implementing this!
One question, though. Is it possible to *concurrently* use the trainer port (jack) on my Taranis?
I'd like to use the Quanum 3-axis no-drift head tracker (http://www.rcgroups.com/forums/showthread.php?t=2440420) connected to the jack (providing channels 6-8), and the Linker on CPPM (with a D4R) in the module bay for a spotter to gain control of channels 1-4.
Is that currently possible?


Sent from my iPhone using Tapatalk

User avatar
MikeB
9x Developer
Posts: 16724
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: SBUS Trainer input

Post by MikeB » Tue May 03, 2016 7:51 am

I doubt it currently works. Are you using ersky9x or openTx on your Taranis?

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
jhsa
Posts: 19205
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: SBUS Trainer input

Post by jhsa » Tue May 03, 2016 8:10 am

Just so we understand, would that mean using the PPM/Serial pin in the module bay as an input? If so, that for sure offers a few possibilities, like dealing with 2 different trainer inputs at the same time. With the new trainer profiles in ersky9x it would be a piece of cake managing both inputs. Good for FPVers for example..
Not sure how hard it would be to implement it as I have no idea about programming other than flashing LEDs, and only if they are of the same color :mrgreen: ;)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
MikeB
9x Developer
Posts: 16724
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: SBUS Trainer input

Post by MikeB » Tue May 03, 2016 9:25 am

No, the PPM pin is still an output. On the Taranis, pin 2 is defined as a "heartbeat" signal (input) from the module, but we can use this to input CPPM or SBUS as a trainer input for wireless trainer operation.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!


Post Reply

Return to “erskyTx (was ersky9x)”