openXsensor and the new telemetry in OpenTX 2.1

Development & General Chat for the superb openxvario project.

Moderator: rainer

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

openXsensor and the new telemetry in OpenTX 2.1

Post by Carbo »

Yesterday i flew a new sailplane with openXsensor with vario and airspeed (vario compensated with airspeed). Worked perfect as usual, but when viewing the logfile, the airspeed was surprisingly low. Normally i would check that with GPS, but RX and oXs are in the vertical fin, so there is no room for a GPS.

When i remember right, oXs transmits knots and previous openTX did the calculation for km/h. In 2.1 i have to use the ratio 1.852 to get the real speed in km/h?
THERMIK_XL-2015-08-20.csv
(386.39 KiB) Downloaded 282 times

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

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by mstrens »

It is right that oXS transmit the airspeed in knots because it was the unit expected by openTx 2.0.
I presume that openTx 2.1 allows you to select the units to display.

if you select km/h in openTx 2.1, I would expect that openTx would perform the conversion knots > km/h (for the display and for the log).
If it is not the case, I presume it is an error.
Kilrah or Bertrand should confirm how it is expected to work.
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by Kilrah »

Airspeed was expected in knots because when that functionality was added there was no official spec for transmitting airspeed in the protocol, and as the GPS used knots the same was chosen pretty arbitrarily.
Now that FrSky have released airspeed sensors using the same ID and chose to spec the unit as km/h in their protocol this is now how it is expected in OpenTX 2.1, so oXs would need to be adjusted accordingly.
Carbo
Posts: 467
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by Carbo »

To be compatible with old and new telemetry, a switch in oxsconfig.h to choose the unit to transmit would do it.

@mstrens: another change in 2.1 is the possible "auto offset" for the sensors. Airspeed can be resetted in oXs with ppm, now there is another way to do it. Is this equivalent, or is it better for the accuracy of airspeed and energycompensation to reset in oXs?
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by jhsa »

So why can't openTX have a choice to select both?
After all despite of what the sensor sends some people might want one unit or the other, and not everybody uses the oXs. So they are stuck with knots? Even if they select the metric system?

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
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by Kilrah »

The user can choose what unit to display, what's hardcoded to spec is what we expect the sensor to send. If it doesn't send in the right unit the conversions will obviously be wrong.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by jhsa »

Ahh ok.. understood.. I thought the sensor sent some raw digital data..

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
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by mstrens »

@kilrah,

Ok, I will change oXS in order to be able to send airspeed in km/h.
Just one more question:
In oXs, Airspeed is currently sent in 1/10 of knots (12.3 knots is sent as "123").
If I send km/h, may I add some decimals and if yes how many (e.g. 35.64 km/h being sent as "356" if I one decimal is applied)
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by mstrens »

@ carbo,

To provide a new version of oXs, I am waiting an answer from Kilrah about the number of decimals to be sent.

In the meantime you can easily fix the issue if you modify your config.h file.
You should currently have a line like (in the section that defines the data to be sent):
DEFAULTFIELD , AIR_SPEED , 1 , 1 ,0

You could replace it by:
DEFAULTFIELD , AIR_SPEED , 1852 , 1000 ,0
This means that the data being sent will be multiplied by 1852 and divided 1000.
This assume that openTx expect the data to be in 1/10 of km/h.
If the value you get on tx is 10 X to big, then you could replace 1000 by 10000 (it means that the data has to be in km/h (and not in 1/10 of km/h).

About the reset option on oXs and openTx:
- I think that the reset option on oXs has no impact on dTE (because in the way it is implemented the formula are linear and it is only the variation - in fact speed of variation - that has an impact on dTE).
- for the airspeed, I think that it does not make sense to use the auto offset option on Tx side because the conversion from pressure to airspeed is not linear. So the reset option via ppm on oXs side is the only option if you want to recalibrate the sensor without powering off.
Carbo
Posts: 467
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by Carbo »

Due to the mountingposition of my oXs i will use the ratio option in OpenTX2.1 for the next flights. I will wait for your new version. IMO one decimal is still fine, as you can see in my logfile.

By the way, i think it is very important, to maintain a non commercial sensor family, even if there is not that much response by users. This will keep the quality of the commercial sensors high and the prices low.
User avatar
kalle123
Posts: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by kalle123 »

Carbo wrote: .... even if there is not that much response by users.
I still can not understand it!! Keep on the excellent work.

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

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by jhsa »

I would have thought that there are loads of people using it.. If not, you know what they say ;) THEIR LOSS!! :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
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Re : openXsensor and the new telemetry in OpenTX 2.1

Post by Kilrah »

mstrens wrote:@kilrah,

Ok, I will change oXS in order to be able to send airspeed in km/h.
Just one more question:
In oXs, Airspeed is currently sent in 1/10 of knots (12.3 knots is sent as "123").
If I send km/h, may I add some decimals and if yes how many (e.g. 35.64 km/h being sent as "356" if I one decimal is applied)
Just checked and it is still one decimal indeed, so 356 for 35.6 km/h.

Envoyé de mon SM-G920F en utilisant Tapatalk
Carbo
Posts: 467
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by Carbo »

The use of the ratio parameter was not so inuitive, as i hoped. Here is another discussion about the unit conversion:
https://github.com/opentx/opentx/issues/2305

Thereafter he formula for ratio is: value = (custom.ratio * value + 122) / 255. The resulting ratio for knots --> km/h is 47.1, indeed i can not comprehend this. Any hints? Did i overlook a description of the ratio parameter?
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by Kilrah »

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

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by mstrens »

I do not understand the formula from this issue too but I think the value 47.1 is (nearly) the rigth ratio.
I calculated it in folowing way.
I found in another post ( search.php?keywords=ratio&t=6887&sf=msgonly ) that
"Displayed value" = "telemetry value" / 255 * "ratio"
So "ratio" = "Displayed value" / "telemetry value" * 255.
Now, imagine that "telemetry value" = 10 (= 1 knot) ; so the expected displayed value is 1.852 km/h.
And replacing you get : ratio = 1.852 / 10 * 255 = 47.2

About publishing a new version of oXS, I would propose to wait a little in order to avoid adding a new parameter in the config file (and in the configurator too). There are already so many parameters.
The users using 2.1 can easily fix the issue using this ratio.
If I would now always send airspeed as 1/10 of km/h, then the users using prior openTx version would have the issue and would have to use multiplier/divider parameter.

In the future (when openTx 2.0.x would expect 1/10 of km/h too), I would change oXs in order to send always in 1/10 of km/h (like the Frsky sensor).
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by Kilrah »

mstrens wrote:In the future (when openTx 2.0.x would expect 1/10 of km/h too)
That won't happen, 2.0 only supports knots as input, it doesn't even define km/h or mph units. That's actually probably one of the reasons why airspeed was sent as knots, to avoid changes that would have had to wait for a major revision.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by mstrens »

@Kilrah,
So, if I understand right, it means that openTx 2.0 would not support the Frsky airspeed sensor (because Frsky sensor sent 1/10 of km/h while openTx 2.0 expect 1/10 of knot and openTx 2.0 can't apply a "ratio" to convert).
This would force the user to migrate to openTx 2.1 (if they want to use a Frsky airspeed sensor).
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by jhsa »

I can't understand why is not possible to support both?

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
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by Kilrah »

Correct, the FrSky airspeed sensor would require 2.1. I've never seen one sold yet though...

2.0 doesn't have a definition for speed units other than knots, so speed conversions can only be done from knots to something else. Can't be added without major changes not to break other things. That's precisely why we redid the telemetry from scratch for 2.1.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by mstrens »

jhsa wrote:I can't understand why is not possible to support both?

João
The current version of oXs can already support both.

If you use openTx 2.0 (or earlier version), just let multiplier and divider set to "1" (the default value) in oXs_config.
oXs will transmit in 1/10 of knots but opentTx converts it automatically into km/h (if set on metric - at least, I think it is so- ).
If you use openTx 2.1, you can currently perform the conversion :
- or on oXs side : using a multiplier = 1852 and a divider = 1000 will let oXs send in 1/10 of km/h and you do not need a "ratio" on tx side)
- or on openTx side : let oXs default value and oXs sent in 1/10 of knot. Then set a ratio = 47.2 on Tx in order to perform the conversion.

It should be possible to add a parameter to the oXs_config.h file (and the configurator tool) in order to select the unit of the airspeed being transmitted : e.g. #define AIRSPEED_UNIT (with a value KNOT or KMH).
Still this seems me adding a (minor) unnecessary complexity because there are already alternatives (and there are not many users using an airspeed sensor).

In the future (if sending 1/10 of km/h would become "the" standard) , then I propose to change oXs in order to send always in 1/10 of km/h. It will make it a little easier for most of the users.
Users with still a Tx firmware expecting knots, could still use oXs but they would have to apply a multipler (1000) and a divider (1852) to get finnalyt he same result as now.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by jhsa »

Thanks for the explanation.. I use er9x/ersky9x. Never used speed though. Not sure whether it has knots, Km/h, or both ;) :)

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
Carbo
Posts: 467
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by Carbo »

I have enlarged the openXsensor praising memorial (foreground). Unfortunately the material for the OpenTX praising memorial (background) ran out with 2.1.1. But the trucks shall arrive soon.
Memorial.jpg
User avatar
kalle123
Posts: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by kalle123 »

What is in front of the persons face? A new trend, I don't know.? Can he take it off?

Duck and hide :mrgreen:
Carbo
Posts: 467
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by Carbo »

Dont you know widescreen uhd fpv? But in reality - i do not want to frighten anybody.
tedbmoss
Posts: 121
Joined: Sun Jul 15, 2012 10:42 pm
Country: -
Location: Peoria, AZ

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by tedbmoss »

I have been using it since it first came out, probably others are to, just not saying anything. For me, it is hard to keep up with all the new stuff. Is there any mention of crystals like 16 MHz or 27 MHz for the Arduino?
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by mstrens »

tedbmoss wrote:I have been using it since it first came out, probably others are to, just not saying anything. For me, it is hard to keep up with all the new stuff. Is there any mention of crystals like 16 MHz or 27 MHz for the Arduino?
I think that most people use an Arduino pro mini running under 5Volt at 16Mhz.
Even if tis is not foreseen by the datasheet of AVR328p (MCU of this arduino), I think that some people use it with a lower voltage in order to use 1S lipo.

Normally oXs could also run on an Arduino pro mini running at 3.3Volt at 8 mHz. The datasheet foresees that AVR328P can run at 8 Mhz when voltage is 3.3 Volt.

When frequency is reduced to 8 Mhz, oXs will perform less voltages/current conversions per 0.5 ms and the values will probably be a little less accurate.

Note: I never heard about a frequency of 27 mhz for a AVR328P; max based on the spec is 20mhz as far I know.
Carbo
Posts: 467
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by Carbo »

It seems, that with 2.1.7 we have knots again instead of km/h.

https://github.com/opentx/opentx/issues/3043
kcaldwel
Posts: 40
Joined: Wed Mar 12, 2014 7:49 pm
Country: Canada

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by kcaldwel »

I just did some test runs with an OXS GPS, and a N2 Industries airspeed sensor on my car. It seems both are reporting near 2x the actual speeds in kph, as verified by the calibrated car speedometer and another GPS, using OpenTx 2.1.7. Both the Taranis telemetry display and the log file show the speed about 2x too high.

I have the 47.1 ratio factor in the telemetry setting for the N2 airspeed sensor.

I should have tried setting both to knots, to see if it made any difference - now it is raining. The log files has kmh in the headings for the data.

I had done some testing like this previously, using some 2.1+ OpentTx version with a FrSky GPS, and had only the airspeed incorrectly because I didn't have the 47.1 ratio entered.

My Taranis is set for metric units. The altitude (m) from OXS seems fine.

Any ideas what is wrong?

Thanks,

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

Re: openXsensor and the new telemetry in OpenTX 2.1

Post by mstrens »

Did you configure oXs in order to send in knots?
I think that all Frsky sensors (GPS and airspeed) send their value in knots (in fact 1/10 of knots).
I presume that It is what openTX expects and that openTx converts it in the units you set up on the Tx.
So even if oXs allows to select between knots and km, I think it should not be used for Frsky protocols.

Post Reply

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