Arduino SBUS to Servo (PWM) Decoder

Electronic projects that are either related to the firmwares for the 9x, or simply great for radio control applications.
Post Reply
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Arduino SBUS to Servo (PWM) Decoder

Post by jhsa »

Hi, I know that there is another thread with a similar project but I need something a bit different..
I would like to have an arduino pro mini decoding the SBUS signal and driving the 16 servos..
Thanks to Mike, eepskye now sends the 16 channels as SBUS over a USB port, and he also wrote an arduino code to decode the SBUS into 2 PPM streams of 8 channels each.. Thank you so much for that..
However I can also see some advantages in a direct conversion from SBUS to Pwm for driving the servos directly..
I have found this:

http://rc-master.ucoz.ru/publ/19-1-0-87

The page however is in Russian so I used google to translate it.. It uses an arduino Mini to decode the sbus into 16 servo outputs.. It needs an inverter though.
I think Mike managed to invert the signal by coding it on the arduino, so we have a real Sbus signal available.
Attached is the zip file with the code that I downloaded from the Russian site.

EDIT: This attached code compiles.. This is version 2. The one I posted here before didn't compile.. I also found a configurator that we install on the PC. Please have a look at the page.. Again it must be translated :)

http://rc-master.ucoz.ru/publ/19-1-0-105


João
Attachments
SBUS2.zip
(328.43 KiB) Downloaded 1488 times
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

huginen
Posts: 26
Joined: Tue Nov 27, 2012 3:12 pm
Country: Sweden

Re: Arduino SBUS to Servo (PWM) Decoder

Post by huginen »

What error do you get?

Skickat från min SM-G900F via Tapatalk
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Arduino SBUS to Servo (PWM) Decoder

Post by jhsa »

Hi, I just updated the file attached.. I just found a version 2 that compiles ok.. And it comes with a configurator for windows. Please read my first post again as I edited it :)
I just uploaded the code to an arduino pro mini but I am reading the info at the moment.
If you have problems translating the page you might want to install the google translate addon for your browser. I use firefox..

Thanks for your reply.

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
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Arduino SBUS to Servo (PWM) Decoder

Post by jhsa »

No, can't make it work :(
Managed to program the arduino, can't make the config app talk to it, put the scope on the arduino, there is some PWM at 1500 on half of the channels, and PWM at 1000 on the other half. receiving sbus from eepskye, when I hit send sbus the pwm stops..

After a while can't even see the PWM anymore.. :
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
Erni
Posts: 27
Joined: Wed Jun 04, 2014 3:41 pm
Country: -

Re: Arduino SBUS to Servo (PWM) Decoder

Post by Erni »

I tried it on a UNO
It works for me, atleast channels 1-5 and channel 16.
I didn'y use the config tool, just used it as is
I have a Taranis and X6R and use a inverter on the S.Bus line, and tested it with a servo on the mentioned channels.
I don't know how the signal looks, but I could check with a logic analyser

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

Re: Arduino SBUS to Servo (PWM) Decoder

Post by jhsa »

hmmm, I don't have the inverter IC they mention.. could I use a transistor or something? Also the only sbus source I have is the output from eepskye..

couldyou please try the config too to see if it also crashes??
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
Erni
Posts: 27
Joined: Wed Jun 04, 2014 3:41 pm
Country: -

Re: Arduino SBUS to Servo (PWM) Decoder

Post by Erni »

I just used a transistor as inverter like this:

http://www.edutek.ltd.uk/CBricks_Pages/ ... erter.html

I could try the config tool but I am not sure how or what it is supposed to do :)

BTW I made one little change in the SBUS.ino I amended

Mode = GetConfigState();
Mode=1; <---- this one

We cant use serial port for other things as the inverted sbus signal are connected to pin 0 (rx)

And here are the channels shown, first channel 16, and below channel 1,2,3
Attachments
sbus.png
sbus.png (6.51 KiB) Viewed 18399 times
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Arduino SBUS to Servo (PWM) Decoder

Post by jhsa »

Erni wrote: I could try the config tool but I am not sure how or what it is supposed to do :)
Just start the application, select the com port, and try to read the values from the arduino by clicking on the read button.. Mine crashes on both my computers..
BTW I made one little change in the SBUS.ino I amended

Mode = GetConfigState();
Mode=1; <---- this one
What does this change do? ;)
We cant use serial port for other things as the inverted sbus signal are connected to pin 0 (rx)
He has a jumper on the board..

Thanks for helping..

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
Erni
Posts: 27
Joined: Wed Jun 04, 2014 3:41 pm
Country: -

Re: Arduino SBUS to Servo (PWM) Decoder

Post by Erni »

What does this change do?
Oh that was just to ensure that the serial port wasn't used for other purpose (I think)

I tried the config tool and it is very unstable. I was able to do a few read and write but I had to restart several times.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Arduino SBUS to Servo (PWM) Decoder

Post by jhsa »

I can't do any of that.. sometimes the arduino won't even start pulses.. tried with 2 different arduinos..

So I guess I will drop this one :(
Thank you anyway..
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

Post Reply

Return to “General RC Electronic Projects and Discussion”