Hello Martin,
I have built your decoder and will use it as a SBUS display to check receiver output.
I works very well and was very easy to build (SH1106/Arduino Pro Mini/file:"sbusdecode4")
My display shows that all values that are slightly off (-4%).
Is it possible to tweak the values in the code to match those I see in my Taranis?
/Pete
SBUS decoder, display, and wireless buddy box project
-
- Posts: 2
- Joined: 27 Jun 2021, 20:10
-
- Posts: 750
- Joined: 16 Feb 2018, 14:11
- Location: Warwickshire
Re: SBUS decoder, display, and wireless buddy box project
Hi Pete,
Yes it's pretty easy - up near the top of the main sbusDecode4.ino file, you'll see two lines, one for scaling the SBUS numbers to microseconds, and one for scaling the SBUS numbers to percentages. The lines are line number 21 and 24. In the Arduino IDE, you can select Preferences from the File menu, and there's a check box to toggle on/off the display of line numbers.
The scaling is done by fitting a straight line through two points - the default values for microsecond scaling (at line 21) reads:
Which means that a raw SBUS value of 150 gets converted to 1000 microseconds, and a raw value of 1901 gets converted to 2000 microseconds. You don't have to use 150 and 1901 as the two SBUS values - probably best to set the decoder to display SBUS values, and see what range your Taranis gives out. Then adjust the scaling numbers, recompile and re-upload.
Similarly, for percentages, the default percent scaling (at line 24) reads:
Depending on the units your Taranis displays, you can adjust either or both of the scaling lines.
After one or two adjust/compile/upload/test cycles, you should be able to tweak the numbers to get perfect agreement with your Taranis.
Yes it's pretty easy - up near the top of the main sbusDecode4.ino file, you'll see two lines, one for scaling the SBUS numbers to microseconds, and one for scaling the SBUS numbers to percentages. The lines are line number 21 and 24. In the Arduino IDE, you can select Preferences from the File menu, and there's a check box to toggle on/off the display of line numbers.
The scaling is done by fitting a straight line through two points - the default values for microsecond scaling (at line 21) reads:
Code: Select all
#define MICROSECOND_SCALING 150, 1901, 1000, 2000
Similarly, for percentages, the default percent scaling (at line 24) reads:
Code: Select all
#define PERCENT_SCALING 150, 1901, -100, 100
After one or two adjust/compile/upload/test cycles, you should be able to tweak the numbers to get perfect agreement with your Taranis.
-
- Posts: 2
- Joined: 27 Jun 2021, 20:10
Re: SBUS decoder, display, and wireless buddy box project
Hi,
Thanks. I will try this as soon as possible.
/Pete
Thanks. I will try this as soon as possible.
/Pete
-
- Posts: 1
- Joined: 25 Jul 2021, 21:19
Re: SBUS decoder, display, and wireless buddy box project
Hallo Martin
I have used your sketch for a FrSky XM receiver. It is built in a battle tank with dual path drive. The settings for the XM receiver are:
#define MICROSECOND_SCALING 172, 1811, 1000, 2000 // FrSky receivers will output a range of 172 - 1811
https://www.modelltruck.net/showthread. ... svagn-m-41
Best regards
Bert
I have used your sketch for a FrSky XM receiver. It is built in a battle tank with dual path drive. The settings for the XM receiver are:
#define MICROSECOND_SCALING 172, 1811, 1000, 2000 // FrSky receivers will output a range of 172 - 1811
https://www.modelltruck.net/showthread. ... svagn-m-41
Best regards
Bert
-
- Posts: 19
- Joined: 03 Mar 2019, 17:15
- Location: Surrey
Re: SBUS decoder, display, and wireless buddy box project
For anyone who might be interested, there's an SBUS decoder project at https://dronebotworkshop.com/radio-control-arduino-car/
It uses the IbusBM library
It uses the IbusBM library
-
- Posts: 750
- Joined: 16 Feb 2018, 14:11
- Location: Warwickshire
Re: SBUS decoder, display, and wireless buddy box project
Minor update to allow more than 8 PPM channels to be output. See sbusDecode6.zip file attached to opening post. Defaults to 12 channels, but you can set any number up to 18 by editing the value NUM_PPM_CHANNELS in the config.h file.
The PPM update rate slows when more than 8 channels are selected. Each frame is NUM_PPM_CHANNELS * 2.2 + 4 milliseconds long.
The PPM update rate slows when more than 8 channels are selected. Each frame is NUM_PPM_CHANNELS * 2.2 + 4 milliseconds long.