OpenXSensor SPORT Interface

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
mstrens
Posts: 1367
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens » Sat Jan 18, 2014 6:19 pm

Neil,
Yes, I see that both data are very similar. It is OK.

But it seems that not all data are well received. At some times, the values in the log do not change during more than 20 x 100msec.
This issue occurs e.g at 13:56:35.
At this time, it concerns all types of data (GPS, vario alt, vertical speed).
In general it seems that it occurs less for the vertical speed. This could be explained by the fact that this type of data is send more often than the other type.
Michel


Carbo
Posts: 435
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: OpenXSensor SPORT Interface

Post by Carbo » Sat Jan 18, 2014 9:18 pm

The recording speed with 10 per second may be too high for the taranis in this setup. In the 729 s of flight Neil recorded only 4521 datasets. Reducing the speed to a value where no more losses occur is worth a try?

NeilRogers
Posts: 87
Joined: Sat Jun 22, 2013 2:12 pm
Country: United Kingdom
Location: Wiltshire

Re: OpenXSensor SPORT Interface

Post by NeilRogers » Sat Jan 18, 2014 10:31 pm

With luck the weather will be good tomorrow and I can provide a few more traces of live data.

I would think the taranis will easily record every 100ms I did think about changing to 200ms and any breaks in data will still be seen to reduce the data because hopefully the flying session tomorrow will be longer.

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

Re: OpenXSensor SPORT Interface

Post by Kilrah » Sat Jan 18, 2014 10:38 pm

The Taranis will record at 100ms without issues, but there's no point in doing it as over SPORT values are never updated more than 4-5 times a second anyway. 200ms is enough.

Regarding the gaps, do you have the latest openTx version on the radio?

NeilRogers
Posts: 87
Joined: Sat Jun 22, 2013 2:12 pm
Country: United Kingdom
Location: Wiltshire

Re: OpenXSensor SPORT Interface

Post by NeilRogers » Sun Jan 19, 2014 10:43 am

Thanks for the information Kilrah,
I'm using the latest release r2923, but not a local compiled version with the latest GPS modification.

With regards to VSpd in general I get a log update around 200ms, but I have regularly seen periods where I see updates every of 100ms and in some cases for more than 1 second.

The period of no information could relate to many factors rx signal strength or the rx itself I'm using the X8R receiver with V1 software,

I have a X6R to try when I have a chance, but I'm guessing FRSky will be using the same Rx software.
FRSky have just released a X8R update version V2 for better voltage precision I've updated my X8R yesterday and will test run later today.
This change may effect the dataflow to the tx.

Neil


Haldir
Posts: 2
Joined: Sun Jan 26, 2014 8:15 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by Haldir » Sun Jan 26, 2014 8:21 pm

Hi,
I'd like to congratulate you for successfully reverse engineering the S.PORT protocol.
I'm wondering if it is possible to encode the S.PORT data additionally to the SBUS data over the SBUS connector, as quite a few flight controllers for the different multicopter projects already support SBUS and can directly connect to the SBUS port. So having one connection to supply both sbus and sport data would be kinda nice.

Best Regards,
Haldir

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

Re: OpenXSensor SPORT Interface

Post by Kilrah » Mon Jan 27, 2014 9:25 pm

Sbus and SPORT are completely different. You can't mix that.

VeNoM386
Posts: 1
Joined: Thu Jan 30, 2014 6:59 am
Country: -

Re: OpenXSensor SPORT Interface

Post by VeNoM386 » Thu Jan 30, 2014 7:03 am

Hi all,

Is there a posibility to convert S.PORT sensors data (vario/gps/current/lipo) into MAVLink with the help of a Teensy/Arduino card ? I want to use this signal to feed it into a OSD like MinimOSD.
Basically i want to use FrSky S.PORT sensors on OSD.

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

Re: OpenXSensor SPORT Interface

Post by Kilrah » Thu Jan 30, 2014 11:06 am

It would of course be possible. I don't know of anybody having done it though.

Haldir
Posts: 2
Joined: Sun Jan 26, 2014 8:15 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by Haldir » Sat Feb 01, 2014 6:57 pm

Someone wrote a Mavlink to SPort Converter with the Teensy here: http://www.diydrones.com/forum/topics/a ... -converter
This might help as a start point to do the reverse.

RightRudder
Posts: 241
Joined: Tue Jan 15, 2013 9:41 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by RightRudder » Fri Feb 07, 2014 5:27 am

@NeilRogers

Hi Neil, just another possibility to consider re your altitude drift. All these pressure sensors are very sensitive to power supply voltage. If you are running low enough that the regulator is dropping out of regulation then your altitude will change in relation to the sag in your battery voltage over time.

Joe

NeilRogers
Posts: 87
Joined: Sat Jun 22, 2013 2:12 pm
Country: United Kingdom
Location: Wiltshire

Re: OpenXSensor SPORT Interface

Post by NeilRogers » Fri Feb 07, 2014 9:10 am

Thanks Joe
The voltage is pretty stable measured internally with Michel's code, I've noticed in my case the altitude is always positive and is linear with time. It's not serious enough to effect VSpd which main function of vario.
For altitude as FRSky GPS is good value at £25.

I'm also testing some beta software for the FrSky HiP Vario, this device in the same environment shows small sine wave altitude drift and its VSpd now look pretty good and I can run dead band of - + 0.2 with no random vario blips
Michel & Kilrah
While using the FrSky new vario software the majority time I was recording different VSpd values every 100ms with worst case of 2 values the same unlike the 10 vaiues with Michel's oxs software.

I've included excel info for the new frsky software,
Neil
Attachments
frsky Hi precision Vario new software.xls
(1.39 MiB) Downloaded 93 times

mstrens
Posts: 1367
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens » Fri Feb 07, 2014 10:20 am

Neil,
I just made a new test to log the data with my latest version oxs.
On 5 minutes recording I got 3 times gaps (about 1 or 2 seconds) in the recording (in fact I got continously the same value for vertical climb rate what is not normal).

Please note that:
- I did it at home with a rx close to the tx
- I upgraded my X8R and XJT (inside the taranis) with the latest firmware (= high precision voltage)
- my taranis has still the original firmware. I got it in november.

Please could you send me the new vario firmware from Frsky to see if I get the same results as you.
I asked for this firmware to Frsky but they did not (yet) react.

Michel

Could you send

NeilRogers
Posts: 87
Joined: Sat Jun 22, 2013 2:12 pm
Country: United Kingdom
Location: Wiltshire

Re: OpenXSensor SPORT Interface

Post by NeilRogers » Fri Feb 07, 2014 11:48 am

Hi Michel
I've modified your volt version of oxs hopefully our latest to transmit on T1 & T2 to allow concurrent operation of your and frsky varios.
I've only run a short test 1 up & down running concurrently I did not see the static values of vspd on either vario yet I'm using the latest taranis v2940. Both varios follow nicely after taking account of my oxs positive drift.

I've include the excel of the test for interest.

I've already reported back to frsky their new software is much better than their current releases, if you email me on [email protected] I've email you the beta software. They all on New Year in China until next week.

There looks to be a break weather so I may be able to run a live test vario comparison today, then weekend all rain.

Cheers neil
Attachments
michelvfrsky.xls
(150.5 KiB) Downloaded 78 times

RightRudder
Posts: 241
Joined: Tue Jan 15, 2013 9:41 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by RightRudder » Fri Feb 07, 2014 2:43 pm

NeilRogers wrote:Thanks Joe
The voltage is pretty stable measured internally with Michel's code, I've noticed in my case the altitude is always positive and is linear with time. It's not serious enough to effect VSpd which main function of vario.
This might be a little misleading if the supply rail to the processor is dropping in the same proportion then you may not measure it properly. I would use a separate volt meter and make time spaced measurements right on the supply to the MS5611. I noticed this sensitivity in my own projects involving these and other pressure sensors that even ground currents can affect the pressure readings unless careful attention is given to the paths these currents flow relative to the current path for the pressure sensor itself. I only noticed this because large servo currents which shared a stupid ground trace caused the pressure reading to fluctuate. Lucky the fact that I could notice the change in relation to servo load and it was a clue that led me to solve the problem and also taught me how picky these sensors are about some things. Drove me nuts for a while. If the trend is always positive then it is not due to local weather related pressure changes. What form of power and regulation are you using?

Joe

mstrens
Posts: 1367
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens » Fri Feb 07, 2014 3:18 pm

RightRudder, Neil,

I some tests I made, I also noticed a drift of the altitude but:
- drift was slower than then values reported by Neil
- drift seems to be sensor temperature related because the rate of deviation seems to reduce when sensor is "warm" after several minutes.

In my version of openxsensor I made some tests sending over the serial interface the pressure, the temperature and the altitude while the sensor remains on the table. Altitude seems me to be temperature related. it looks like calibration parameters where not correct.

This is my experience with MS5611.
Note : I am using a GY-63 board that includes a 3.3 volt regulator taking his power supplier from the regulated 5 volt of the arduino board. So I do not expect a drift in the MS5611 voltage.

RightRudder
Posts: 241
Joined: Tue Jan 15, 2013 9:41 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by RightRudder » Fri Feb 07, 2014 4:40 pm

Double regulation is fine as long as there is enough headroom for both regulators but all regulators have a dropout voltage which can be from hundreds of millivolts to as much as two volts depending on the type of regulator. Just as a random example, suppose your regs have a 1.5v dropout. You need 3v of headroom just to maintain regulation which means you need 6.3v minimum supplying your 5v regulator input. In this example, as soon as your battery voltage drops below 6.3v you are no longer regulating the supply at the 3.3v end. I haven't tested the dropout voltage on the GY-63 and I don't know what Neil is using to supply the 5v side but this could be something to consider.

Joe

NeilRogers
Posts: 87
Joined: Sat Jun 22, 2013 2:12 pm
Country: United Kingdom
Location: Wiltshire

Re: OpenXSensor SPORT Interface

Post by NeilRogers » Fri Feb 07, 2014 7:20 pm

Thanks joe,

I've had a good flying session today running parallel telemetry frsky & oxs I just need to examine all the data.
I went through 3 rx batteries during the session so I'll have a lot of supply voltage variation to investigate.

Thanks neil

RightRudder
Posts: 241
Joined: Tue Jan 15, 2013 9:41 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by RightRudder » Sat Feb 08, 2014 1:05 am

I know there are various makers of GY-63 boards and arduino pro mini clones (I got mine from dealextreme) but just for the record I did some measurements and found that the dropout voltage on my pro-mini is about 420mV and on my GY-63 board about 150mV. This means I expect the MS5611 pressure sensor is going to see a varying supply voltage if I am feeding the battery into the RAW input of the pro-mini and then feeding the VCC from the pro-mini into the vin on the GY-63 whenever the battery gets down to about 3.87v or so. According to the datasheet not only the pressure output but also the temperature output shows a dependency on supply voltage so there is a double whammy. So just for giggles I get out an anyvolt micro regulator set it to 5v and supply the openXsensor RAW input from that and start cranking it down. The taranis is running in the background. As soon as the supply voltage gets below 3.7v the vario starts chirping and the altitude starts going up. If I stop cranking the voltage down the vario quiets but the altitude remains at a fixed positive offset.

So for anyone attempting a 1s setup beware the altimeter and therefore vario will be in error. BTW I was now curious how low the system could tolerate so at this point I tried continuing the downwards track on the supply voltage. It seemed to go unresponsive at about 2.5v although taranis didn't report any telemetry loss so the X8R still seemed to be working.

Depending on the exact boards you have and what regulators they have (and how you wire things up) your mileage may vary with this info. If you really have to run at lower battery voltages I would suggest taking the power for the GY-63 from the RAW input of the pro-mini rather than its regulated output thereby gaining a little headroom. If headroom is no issue then use both regulators and gain some noise immunity for your vario.

Joe

User avatar
zendes
Posts: 2
Joined: Sat Feb 08, 2014 4:54 am
Country: -

Re: OpenXSensor SPORT Interface

Post by zendes » Sat Feb 08, 2014 5:32 am

https://github.com/zendes/SPort_OSD/

This is some code that runs on a MinimOSD. You plug it into the FrSky SPort bus using an inverter cable, and it'll display the values of the sensors on your OSD. Currently it only support the vario & current sensor, because that's all I have. Once the other sensors are in stock again I'll try and add those too. Personally I'm looking forward to playing with the GPS, but unfortunately it won't be available for another few weeks.

NeilRogers
Posts: 87
Joined: Sat Jun 22, 2013 2:12 pm
Country: United Kingdom
Location: Wiltshire

Re: OpenXSensor SPORT Interface

Post by NeilRogers » Sat Feb 08, 2014 2:10 pm

Hi Michel
I've cleaned up my extended live flying comparison yesterday.
In general the sensor map together pretty well, there is a couple of strange events with the oxs using your software.
1. the VSpd goes wild, then set to 0 until the sensor is rebooted, Altitude is ok as all of frsky at 4000, 19000
2. VSpd stops reporting then restarts at 10100 22600

I did see this issue with the previous version before the 6 x voltages, I can retest the older version live again if you think it will be of benefit

Cheers neil
Attachments
PIKE-2014-02-07long.xls
(5.78 MiB) Downloaded 90 times

mstrens
Posts: 1367
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens » Sat Feb 08, 2014 4:57 pm

NeilRogers wrote:Hi Michel
I've cleaned up my extended live flying comparison yesterday.
In general the sensor map together pretty well, there is a couple of strange events with the oxs using your software.
1. the VSpd goes wild, then set to 0 until the sensor is rebooted, Altitude is ok as all of frsky at 4000, 19000
2. VSpd stops reporting then restarts at 10100 22600

I did see this issue with the previous version before the 6 x voltages, I can retest the older version live again if you think it will be of benefit

Cheers neil
Thanks for the report.
I see the 2 issues but I do not understand where is the mistake in the program.
I see that there is also a difference at 10935 (frsky gives negative vertical speed and my version gives positive in contradiction with altitude log)

It is strange because I already used this version on a glider for about 2 hours and I did not got any issue ( based on the sound generated by the vario).

I have a few questions/remarks:
1) I imagine that you changed only the config.h file according to your preferences/needs.
2) Could you send me a copy of your config.h file, so I can try to run the same set up and see if I can reproduce the issues?
3) According this set up, could you communicate me the size of the compiled program (it is given by the IDE at the end of compiling)?
4) Could you also say which tool/release you are using to compile the arduino program.
I am using release 1.0.5 from arduino IDE.
5) Do you have similar issues if you test it at home (e.g. on a table) for a long time?

6) what is the altitude (above see level) where you were flying. It is strange that the values in T1 are so negative?

Based on this I can try to understand or I can make a version that should send more data in order to debug.

Michel

NeilRogers
Posts: 87
Joined: Sat Jun 22, 2013 2:12 pm
Country: United Kingdom
Location: Wiltshire

Re: OpenXSensor SPORT Interface

Post by NeilRogers » Sat Feb 08, 2014 5:40 pm

I did not have a lot of test to test before these live tests, I'll see what I get statically
1 & 2 My changes
#define T1_FIRST_ID 0x0210 // 0x0400
#define T1_LAST_ID 0x021f // 0x040f
#define T2_FIRST_ID 0x0210 //0x0410
#define T2_LAST_ID 0x021f // 0x041f
#define ALT_FIRST_ID 0x0400 // 0x0100
#define ALT_LAST_ID 0x041f // 0x010f
#define VARIO_FIRST_ID 0x0410 // 0x0110
#define VARIO_LAST_ID 0x041f // 0x011f

3. sketch=19468 gvar=908.

4 latest version 1.5.4

5. didn't have these issue with your previous version running live but the test was using alt & vspd fields not transposing to allow frsky in parallel. I will do some static testing. Looks very strange because the altitude continues to report correctly.

6 altitude 224m

I test some more I keep you updated

thanks neil

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

Re: OpenXSensor SPORT Interface

Post by MikeB » Sat Feb 08, 2014 5:48 pm

You've listed T1 and T2 as having the same ID!

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

NeilRogers
Posts: 87
Joined: Sat Jun 22, 2013 2:12 pm
Country: United Kingdom
Location: Wiltshire

Re: OpenXSensor SPORT Interface

Post by NeilRogers » Sat Feb 08, 2014 7:02 pm

Thanks Mike

I don't worry about T1 & T2 generated by the sensor so just changed the definition to id 210 & 21f not to interfere with vario and Alt.

Therefore I changed vario & alt definition to T1 400/40f &T2 410/41f.

I can see the typo T1 41f is incorrect should be 40f

Quick mods before going flying are never good, plus eyesight of course

cheers neil

mstrens
Posts: 1367
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens » Sun Feb 09, 2014 12:15 pm

Neil,
In order to get an easier set up, I had not expected that a user should change the code of the ID as defined by Frsky.

I had foressen that the user would fill a table.
Here the comments I wrote in config.h; perhaps is it not clear enough.
//*********************General set up to define wich measurements are transmitted *****************************************************
// You must specify here under ONE ROW for EACH FIELD to tranmit.
// Each row must contains:
// - 1 : the code of a field to transmit (e.g. "T1_FIRST_ID" )
// - 2 : a comma
// - 3 : the code of a measurement to transmit in this field (e.g. "VOLT1")
// - 4 : a comma
// - 5 : a multiplier factor to apply on the value to transmitted (set "1" to keep the original measurement, 10 to multiply by 10 , ...)
// - 6 : a comma
// - 7 : a divider factor to apply on the value to transmitted (set "1" to keep the original measurement, 10 to divide by 10 , ...)
// - 8 : a comma and "\" if there is least one next more (don't fill on the last row); take care that "\" must be the last caracter on the row (no space after)
// Notes : multiplier and divider must be integer (no decimal)
// The code of a measurement (e.g. VOLT1) may not appear on several rows
// The code of a field to transmit (e.g. "T1_FIRST_ID" ) may not appear on several rows
// Sequence of rows does not matter.
// Here an example of set up in order to transmit
// as altitude the altitude measurement,
// as vertical speed the vertical speed measurement
// as Temperature T1 the VOLT6 measurement divided by 100
// #define SETUP_DATA_TO_SEND \
// ALT_FIRST_ID , ALTIMETER , 1 , 1 ,\
// VARIO_FIRST_ID , VOLT4 , 1 , 1 ,\
// T1_FIRST_ID , VOLT6, 1 , 100
// *********************************************************************



So, for my test with OXS in parallel with Frsky vario, I used this set up (and I did not modified the other "#define" lines with the ID
#define SETUP_DATA_TO_SEND \
T1_FIRST_ID , ALTIMETER , 1 , 1 ,\
T2_FIRST_ID , VERTICAL_SPEED , 1 , 1

NeilRogers
Posts: 87
Joined: Sat Jun 22, 2013 2:12 pm
Country: United Kingdom
Location: Wiltshire

Re: OpenXSensor SPORT Interface

Post by NeilRogers » Sun Feb 09, 2014 1:05 pm

Thanks Michel

Nice feature in true hacker style I just modified where I knew it would work, I've correct my typo which could have caused the strange operation.
I left on all evening with no sign of the issue.
With luck I may get a change try it live today, but there's rain and an f3f comp on the hill so it may be later

cheers neil

mstrens
Posts: 1367
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens » Sun Feb 09, 2014 9:03 pm

NeilRogers wrote:
3. sketch=19468 gvar=908.
When I compile with the config.h I used for my parallel test, I get a size of 16.606 bytes.
I do not activate the PPM, the EEPROM and the current sensor. I do not measure voltages with this config.

If you make new tests, please use the version in attachment which contains the setting I used and minor cosmetics changes.
Perhaps, there is a bug using some functions that I did not activate in my config e.g. about using PPM signal to configure sensitivity. I did not tested those functions (except measuring some voltages) because I did not used them (yet)

Question : do you adjust the sensitivity from the Tx (using the PPM)? I can check this code and change my hardware in order to better investigate.

Perhaps can you also log the sensitivity.
I expect that getting wrong vertical speed can only result from a wrong sensitivity.
Therefore you just have to add (in the config file) this line
VFAS_FIRST_ID , SENSITIVITY , 1, 1 ,\
between the line for T1 and the line for T2
NeilRogers wrote: 6 altitude 224m
I do not understand why the values for XOS altitude in you report are negative.
Could it be that it results from some manipulations you did on the log file.
Otherwise, I think it could be the result of wrong calibration in your MS5611 (what could perhaps explain the drift that you have).
Attachments
openxsensor_Sport_Volt_09feb2013.rar
(26.98 KiB) Downloaded 91 times

NeilRogers
Posts: 87
Joined: Sat Jun 22, 2013 2:12 pm
Country: United Kingdom
Location: Wiltshire

Re: OpenXSensor SPORT Interface

Post by NeilRogers » Sun Feb 09, 2014 9:35 pm

Hi Michel
I didn't get a chance to test today the wind was a bit extreme on the slope and prefer to bring back the glider back in one piece

I've not hooked up the sensitivity ppm, I thought your filtering bypassed it so it has been disconnected.

I made no change to any of the configs other the hack above.

I will setup the oxs with your latest software unmodified for next live test probably Thursday or Friday weather permitting

The negative T1 value is report in the log and on the realtime telemetry taranis display
Thanks neil

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

Re: OpenXSensor SPORT Interface

Post by MikeB » Sun Feb 09, 2014 11:46 pm

I'm just finding a bit of time to look at this again, although I have been reading along!
I have got some new code running that does millis() and micros() WITHOUT using interrupts, just reading timer1. It works fine as long as you call either millis() or micros() at least once every 4 mS.
What I would now like to do is convert the I2C from using interrupts to using polling, I have the code referred to earlier in this thread for that.
This would mean we have full control of all interrupts in use.

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


Post Reply

Return to “OpenXVario - an open source vario supported by the open source firmwares!!”