OpenXSensor SPORT Interface

Development & General Chat for the superb openxvario project.

Moderator: rainer

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

Re: OpenXSensor SPORT Interface

Post by jhsa »

I found a bit confusing as well, because he did the same in many posts ;) I thought there were different projects :)
It's clarified now. Thank you..

João

Sent from my GT-I9195 using Tapatalk
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 SPORT Interface

Post by mstrens »

RightRudder wrote:I thought XOS was the version which was re-written by Michel for the SPORT and oXs was the version Rainer wrote to do vario plus current.
As far I know, openXvario is the original code written by Rainer. It works only for Hub protocol.
Michael Blandford (I think) creates openXsensor based on the code of Rainer but structuring it a lot more.
Still it did not support all fields from openXvario and did not support an analog output for the vertical speed.

OpenXsensor has then been completed (perhaps by Michael Blandford and Bertrand) in order to transmit too part of the fields (vertical speed and Altitude I think) on the Sport protocol (X serie receiver).
Michael Blandford changes the communication between OpenXsensor and Rx in order to avoid some bugs from Arduino librairy and he add a RPM calculation.

On my side, I continued to add functionalities to openXsensor in order to:
- improve the way vertical speed is calculated (better filtering, bug, ...)
- calculate more fields (e.g. more voltages allowing more sensors)
- transmit all fields as well on HUB as on SPORT protocol
- generate an analog signal corresponding to Vertical speed (like openXvario did)
- allow some offset, multiplier and divider factors for most of fields being transmitted
- provide a more structured documentation about all the options (in the config.cpp file).

Some versions of my code were published in some treads on openrcforums (problably this tread).

Afterwards I get the autorisation to put my code on google in order to replace the previous openXsensor code.
My code (which is greatly based on the code made by Michael) is currently the latest code present on google in the branch openXsensor at this link:
https://code.google.com/p/openxvario/so ... penxsensor

I hope it is clear so.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: OpenXSensor SPORT Interface

Post by MikeB »

Rainer did create the openXsensor from openXvario, I only added the Sport protocol and RPM.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
hageha
Posts: 213
Joined: Tue Dec 27, 2011 9:25 pm
Country: -
Location: Hildesheim

Re: OpenXSensor SPORT Interface

Post by hageha »

I try a 4 cell lipo on S port to measure.
Can I do this without individual cells over 4 voltage divider to measure?
If so, what settings do I have to put where?
Alti / Vario and a single cell works.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens »

hageha wrote:I try a 4 cell lipo on S port to measure.
Can I do this without individual cells over 4 voltage divider to measure?
If so, what settings do I have to put where?
Alti / Vario and a single cell works.
I am not 100% sure I understand the question.
I presume you want to measure only the total voltage of the 4 cell lipo.
I so, you have to:
1) declare that you want to measure one voltage e.g. with this config (if voltage will be measured on pin 3, but you can select another analog pin if you want):
#define PIN_Voltage1 3
#define PIN_Voltage2 8
#define PIN_Voltage3 8
#define PIN_Voltage4 8
#define PIN_Voltage5 8
#define PIN_Voltage6 8

2) declare which fields are transmitted; for SPORT and alti + VerticalSpeed + 1 voltage (Voltage 1 being transmitted as VFAS with a multiplier factor of 10) you can use this set up
#define SETUP_DATA_TO_SEND \
DEFAULTFIELD , ALTIMETER , 1 , 1 , 0 ,\
DEFAULTFIELD , VERTICAL_SPEED , 1 , 1 ,0 , \
VFAS_FIRST_ID , VOLT1 , 10 , 1 , 0

3) declare if you are using internal voltage reference (about 1.1 volt) as reference to measure the voltage from your lipo. To do so, put this command in the config.
#define USE_INTERNAL_REFERENCE

Note: you can also measure the lipo regarding Vcc (about 5 volt) if you have a stable Vcc; see explanation in the config file.

4) calibrate the voltage measurement based on the dividers resistors you are using (see explanation in config file);
If you are using the internal voltage reference, then you could use
R1 = 10k
R2 = 150k
Note that the value "0" and "4.89" have to be adapted based on your calibration.

#define offset_1 0
#define mVoltPerStep_1 4.89

5) You do not have to transmit the lipo cell voltage (because you measure only the total); so use this in config.
#define NUMBEROFCELLS 0


I hope this help.
If it is not clear or do not answer your question, don't hesitate to ask more.

hageha
Posts: 213
Joined: Tue Dec 27, 2011 9:25 pm
Country: -
Location: Hildesheim

Re: OpenXSensor SPORT Interface

Post by hageha »

mstrens, thank you for your quick response.
I'll get to work and report the results.
Hans

Everything works very well - thank you -
bgbrik
Posts: 20
Joined: Wed Jan 22, 2014 8:53 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by bgbrik »

Hi, I have made a few SPORT Varios (openXsensor) for myself and fellow club members and we are all very pleased with the performance. I thought I might make a few to sell on forums or eBay but before I do I would like to know other peoples opinion on the legal and moral ethics of making a few pence from other peoples designs. Also would there be a market?
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by bertrand35 »

Interesting! I will be very happy if the openXsensor can be found on eBay. I am tired of making them for the club mates at about nothing compared to the time needed to build them!
hageha
Posts: 213
Joined: Tue Dec 27, 2011 9:25 pm
Country: -
Location: Hildesheim

Re: OpenXSensor SPORT Interface

Post by hageha »

@ mstrens,
after many attempts, I ask again.
I have built the same device again and this time I want to run it with a D8R-II plus receiver.
Vario and altimeter is o.k. but I get no voltage output.
Maybe you can help me again.

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

Re: OpenXSensor SPORT Interface

Post by mstrens »

hageha wrote:@ mstrens,
after many attempts, I ask again.
I have built the same device again and this time I want to run it with a D8R-II plus receiver.
Vario and altimeter is o.k. but I get no voltage output.
Maybe you can help me again.

Hans
I presume you are using the latest version of OXS available on google.
The oxs_config.h file is quite complex to set up because many options are available.
Could you send me the oxs_config.h file.
I hope this could help fixing the issue.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: OpenXSensor SPORT Interface

Post by jhsa »

I think a GUI, or a configuration wizard would be a good thing now that it has so many options ;)

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
davx
Posts: 210
Joined: Sun Sep 15, 2013 7:01 am
Country: -

Re: OpenXSensor SPORT Interface

Post by davx »

jhsa wrote:I think a GUI, or a configuration wizard would be a good thing now that it has so many options ;)

João
It could probably be done with processing, like the MultiwiiConf...
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: OpenXSensor SPORT Interface

Post by jhsa »

Anyone know how to do it? I wish I had the knowledge. . :(
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 SPORT Interface

Post by mstrens »

jhsa wrote:I think a GUI, or a configuration wizard would be a good thing now that it has so many options ;)

João
I just made a configuration wizard.
I am currently starting with some tests.

It has been developped using Microsoft visual basic 2010 express on a pc running windows 7.

If you want to test it, i add the executable in attachment.
I install this uncompressed file in a folder c:\oXs
It is supposed to create a oxs_config.h file in a c:\oXs folder when you fill the 5 screens.


Please note that this is the first program I wrote in this language.
I am not sure if the executable package is well done.
As far I can see, the program would check if all microsoft drivers/files are available on your pc. If some are missing it should normally get them automatically from the web.
Attachments
setup.rar
(160.42 KiB) Downloaded 263 times
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: OpenXSensor SPORT Interface

Post by jhsa »

Hey, that was fast. Will check in a while. 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
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: OpenXSensor SPORT Interface

Post by jhsa »

It doesn't work for me. I put it in c:\oXs but i get the following error:

"Cannot download the application. The application is missing required files. Contact application vendor for assistance"

I have win7 64 bit

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 SPORT Interface

Post by mstrens »

jhsa wrote:It doesn't work for me. I put it in c:\oXs but i get the following error:

"Cannot download the application. The application is missing required files. Contact application vendor for assistance"

I have win7 64 bit

João
Perhaps I have to provide additional files too.
When I generate the application, visual basic generates several files. I thought that the "setup.exe" was enough but probably the other are needed too.

In attachement, I put a new archive which contain all files being generated in folder c:\oXs
Attachments
oXs.rar
(208.72 KiB) Downloaded 208 times
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: OpenXSensor SPORT Interface

Post by jhsa »

wow. it looks good.. in some screens some letters and numbers are on top of others, but i thing this is only cosmetics and could be fixed easily??..
The other problem I have is that it gives an error when trying to create the config.h file.. maybe because I didn't install it in C:\oXs?
I have it in:

C:\Program Files (x86)\oXs
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: OpenXSensor SPORT Interface

Post by jhsa »

Ok, installed it in c:\oXs and now it generates the config.h file but it crashes if I try to insert some values on the voltages menu..
As I understand we insert the max voltage and the value for R1, and the program computes R2??
Or we insert the resistor values and the program calculates the max voltage that it can read? I think the latest is better.. Ah, also, could we insert the resistor values in ohms? ex 10000 ohm? because we can measure the resistor and insert a more accurate value. that is how is done in oXs, right? Resistors have some tolerances as you know.. :)

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 SPORT Interface

Post by mstrens »

jhsa wrote:Ok, installed it in c:\oXs and now it generates the config.h file but it crashes if I try to insert some values on the voltages menu..
As I understand we insert the max voltage and the value for R1, and the program computes R2??
Or we insert the resistor values and the program calculates the max voltage that it can read? I think the latest is better.. Ah, also, could we insert the resistor values in ohms? ex 10000 ohm? because we can measure the resistor and insert a more accurate value. that is how is done in oXs, right? Resistors have some tolerances as you know.. :)

João
Here a version that should fix the issue in the voltages menu.

Normally you know the max voltage that you want to measure. Your enter this value. The default value for R1 is 10k.
When both values are known (and based on the Vref), R2 is calculated and displayed.
It is the minimum value of R2 that you have to put in order to avoid to exceed Vref.
If you put a much higher value for R2, it will work but you will loose in precision.

Note that in Vmax and R1 you can enter decimal values (using a dot).

The value you enter for R1 and R2 are not used to set up the 2 calibration values because it is better to set up those parameters based on real measurement in order to take care of ADC , Vref, R1, R2 errors and so to get a maximum precision. It only requires a voltmeter and some calculations to found them. Principle is explained in the config file.
Attachments
oXs_v2.rar
(209.19 KiB) Downloaded 197 times
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: OpenXSensor SPORT Interface

Post by jhsa »

ok, I will try later.. But I still think that entering the exact measured resistor values would be better. Both resistors because we might not find the resistors that the program gives us, and aproximate is not an option. So better we enter the values of what we got, and then the application calculates the max voltage of the divider.. the max voltage is not so critical and can vary a bit, as long as you don't put too much voltage in ot of course.. If you need more voltage, just try another resistor combination to bring the max value higher.. I think it should work like this.. It is how it was done in previous versions of the oXs and it worked very accurate..

João

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
paulj
Posts: 22
Joined: Sun Jun 29, 2014 8:20 am
Country: -

Re: OpenXSensor SPORT Interface

Post by paulj »

Good evening everyone,

I have been through the whole thread - I am very impressed by the work you have all done to get to this stage. I have had my Taranis for a week - how glad I am to have open source on my transmitter as well as on my computers!

I have a couple of really simple questions:
  • I assume the hardware build for the SPORT version is identical to the build on the wiki for OpenXVario?
  • Would I be right in assuming I don't need the receiver RX pin connection, but will simply connect the receiver plug into the sPORT?
I have downloaded and compiled the code, and uploaded it to the ProMini already - I am now ready to attack it with a soldering iron!

Thanks again for all the hard work :)

EDIT: I worked it out while the post was waiting for approval :)

For others who may be working through the thread - Connection to the SPORT is signal - 4, +5v to raw, and 0v to gnd. The connection to pin 2 will be necessary if you want to adjust sensitivity using a spare channel on the receiver. For configuration, read through osx_config.h carefully and select the options you require. In my case, doing nothing led to a non functioning vario. The last tip - the sounds need to be enabled on a switch on the transmitter.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens »

paulj wrote:Good evening everyone,


I have a couple of really simple questions:
  • I assume the hardware build for the SPORT version is identical to the build on the wiki for OpenXVario?
  • Would I be right in assuming I don't need the receiver RX pin connection, but will simply connect the receiver plug into the sPORT?
OpenXSensor is just a new name for openXvario because it can handle more sensors than a vario.
So the hardware is exactly the same. All the pictures you can see about openxvario applies for openxsensor.

As you already find it I think, you can build a RC connector using the arduino pin 4 (signal), raw and ground. This connector is plug into the SPORT from a X serie receiver. Note when using a D serie receiver, there is no SPORT and you have to plug to another connector.
You are right that you can also add a connection (from arduino pin2 by default) to a rx channel but this is only an option in order to adjust the vario sensitivity from Tx.
paulj
Posts: 22
Joined: Sun Jun 29, 2014 8:20 am
Country: -

Re: OpenXSensor SPORT Interface

Post by paulj »

Just been out for a flight with the vario fitted. Everything seems to work fine, but I am getting an interesting issue at about 58m above launch - the vario suddenly changes to (about) -380m. Once I come down below the 58m point, it resets back to the correct altitude. Seems to be an overflow of some sort. Has anyone else seen anything like this?
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens »

paulj wrote:Just been out for a flight with the vario fitted. Everything seems to work fine, but I am getting an interesting issue at about 58m above launch - the vario suddenly changes to (about) -380m. Once I come down below the 58m point, it resets back to the correct altitude. Seems to be an overflow of some sort. Has anyone else seen anything like this?
I was not aware of this issue but yesterday I just found a bug in the way altitude is calculated.
When XOS had to convert a pressure into altitude that would give an altitude above 500m, it calculates 50 m instead of 500.
This can easily be fixed.

Could it be that your are flying at a field that is more or less 440 meter above see?
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens »

mstrens wrote:
paulj wrote:Just been out for a flight with the vario fitted. Everything seems to work fine, but I am getting an interesting issue at about 58m above launch - the vario suddenly changes to (about) -380m. Once I come down below the 58m point, it resets back to the correct altitude. Seems to be an overflow of some sort. Has anyone else seen anything like this?
I was not aware of this issue but yesterday I just found a bug in the way altitude is calculated.
When XOS had to convert a pressure into altitude that would give an altitude above 500m, it calculates 50 m instead of 500.
This can easily be fixed.

Could it be that your are flying at a field that is more or less 440 meter above see?
I put a new version of the file oxs_MS5611.cpp on google in order to fix the issue about the 500m above sea.
I hope it solve your issue. Please let me know.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: OpenXSensor SPORT Interface

Post by jhsa »

mstrens wrote: Here a version that should fix the issue in the voltages menu.

Normally you know the max voltage that you want to measure. Your enter this value. The default value for R1 is 10k.
When both values are known (and based on the Vref), R2 is calculated and displayed.
It is the minimum value of R2 that you have to put in order to avoid to exceed Vref.
If you put a much higher value for R2, it will work but you will loose in precision.


Hi, regarding your GUI, it doesn't compile with the generated Config.h
Did you say something about 2 lines missing? can't find your post. If that is the case, which lines are missing?

Thanks,
It's a very nice app anyway.. well, it will be even better when it is working ;) :D
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
paulj
Posts: 22
Joined: Sun Jun 29, 2014 8:20 am
Country: -

Re: OpenXSensor SPORT Interface

Post by paulj »

mstrens wrote:
mstrens wrote:
paulj wrote:Just been out for a flight with the vario fitted. Everything seems to work fine, but I am getting an interesting issue at about 58m above launch - the vario suddenly changes to (about) -380m. Once I come down below the 58m point, it resets back to the correct altitude. Seems to be an overflow of some sort. Has anyone else seen anything like this?
I was not aware of this issue but yesterday I just found a bug in the way altitude is calculated.
When XOS had to convert a pressure into altitude that would give an altitude above 500m, it calculates 50 m instead of 500.
This can easily be fixed.

Could it be that your are flying at a field that is more or less 440 meter above see?
I put a new version of the file oxs_MS5611.cpp on google in order to fix the issue about the 500m above sea.
I hope it solve your issue. Please let me know.

I'll give it a go and let you know. The hill is probably 450m above sea level!
paulj
Posts: 22
Joined: Sun Jun 29, 2014 8:20 am
Country: -

Re: OpenXSensor SPORT Interface

Post by paulj »

I have compiled oxs with the new version of oxs_MS5611 and loaded it up - I may not get a chance to test it until next weekend. I'll feed back as soon as I can.

One other small requests, probably relating to ther fact I am using Linux. In oxs_out_frsky.cpp, the header inclusion is capitalised oxs_out_FRSKY.h. The file is not capitalised, so it is not found during compilation. Could you change the #include statement to match the file?

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

Re: OpenXSensor SPORT Interface

Post by mstrens »

paulj wrote:
One other small requests, probably relating to ther fact I am using Linux. In oxs_out_frsky.cpp, the header inclusion is capitalised oxs_out_FRSKY.h. The file is not capitalised, so it is not found during compilation. Could you change the #include statement to match the file?
It is changed on google

Post Reply

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