Introduction to the openx vario/altimeter

Development & General Chat for the superb openxvario project.

Moderator: rainer

User avatar
Tempo
Posts: 83
Joined: Tue Feb 04, 2014 4:04 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by Tempo »

mstrens wrote:...
3) if arduino works fine with Gy-63, the issue is perhaps on the communication with the X6R; you can try changing the device ID; please note that there is a minor contradiction in the code you downloaded from google:
In the file config.h, you have : #define SENSOR_ID 0xBA
and in the file Aserial.cpp you have : #define SENSOR_ID 0x1B
You can test once with 0xBA in both files and once with 0x1B in both file.

4) You could also make a test with my own (homemade) version which use the same hardware but have several improvements.
I put this version in a post on this forum yesterday but I can repost it here if you want.

Michel
Thank you very much Michel. Testing MS5611 with #define DEBUG works fine. :D
But X6R-telemetry with Taranis is´nt working. Not with SENSOR_ID 0x1B, not with 0xBA :(
Now I have great interest to test it with your running "own homemade version". Please give me your link ;)
In this way it is possible to test correct X6R-telemetrie-operation.( Perhaps there could be a bug in X6R-firmware ?)
( X6R informations http://fpv-community.de/showthread.php? ... E4nger-X6R )

Another Question:
SmartPORT is specified for 3V3. But Arduino gives 5V-signals on Arduino-output-pin-D4. Therefore I added 3 silicium-diods for voltage reduction from 5V to 3,2V. Do you also protect SmartPORT or do you use 5V on SmartPORT ?

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

Re: Introduction to the openx vario/altimeter

Post by Kilrah »

Smart port is bidirectional, so adding diodes would likely prevent communication from working.
User avatar
Tempo
Posts: 83
Joined: Tue Feb 04, 2014 4:04 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by Tempo »

Kilrah wrote:Smart port is bidirectional, so adding diodes would likely prevent communication from working.
This is it ! :shock:
But is SmartPort 5V tolerant ?

Added, see posts below:
Yes, you find in datasheet of used 3V3-microcontroller: " Most I/O-ports are 5V tolerant "
Last edited by Tempo on Thu Feb 06, 2014 9:14 pm, edited 1 time in total.
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Introduction to the openx vario/altimeter

Post by Kilrah »

Yes of course, FrSky's own PC interface cable used for updates is an RS232-type, with +5.6V / -5.6V levels. And everyone else uses the oXs as is.
Archades
Posts: 24
Joined: Sat Jan 04, 2014 3:37 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by Archades »

Not to be a nag, but was curious on the smart port status and has there been any more progress to getting other fields working?
Great work so far though :D

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

Re: Introduction to the openx vario/altimeter

Post by mstrens »

Here what I wrote in another post on this forum.
Please note that :
- the version attached here contains a few additional lines in the .ino file because someone got compiling error when he tried it. The added lines solved his issue.
- I read yesterday on another forum that a developper of a device sending one or two voltages with a X8R had to change his program to let it work with an X6R. I think this oxs version should work with an X6R but I can't test it because I do not have an X6R
- this version allows you to send data in other fields than altitude and vertical speed. I use e.g. Temperature 1, Temperature 2 , VFAS, ...
- to use this version, extract all files from the archive (.rar) in a new directory having exactly the same name as the .ino file (so directory must be "openxsensor_Sport_Volt").

Here original post:
I tried some days ago to implement some enhancements for the OpenXsensor.
You can find in attachment the program that I made.
This program have following characteristics:
- it works only with SPORT protocol ( so with X8R or X6R receivers); it does NOT work with the hub protocol.
- it can send more than Altitude, vertical speed : it transmits up to 6 voltages (e.g. from a lipo) and current and current consumption (if connected to a current sensor). Note : when combined with a vario sensor (MS5611), using a current sensor limits the number of voltages to 5 (this result from a limitation of Arduino).
- it uses different filters to provide a better vario functionality ( more sensitivity and less noise based on the tests I made)
- it is possible to set up some parameters for dynamic filtering of vertical speed; it can provide faster replies when vertical speed is more or less than a value) ; see explanation in config.h tab
- it calculates the vertical speed as fast as possible (50 X / second) allowing good sensitivity even with a lot of filtering even if oxs is used to measure voltages and/or a current
- it send the vertical speed as fast as possible (probably up to 40 X per second if there are no voltage/current to send)
- when powered by a 4.8 battery, it provides more accurate voltage measurements because they are based on the internal 1.1 voltage reference which has less variations than the battery voltage. Take care : this means that you have to connect each voltage to measure (and the current sensor) to a voltage divider (2 resistors) and that the resistors have to be calculated in order to get 1.1 volt at the mid point. See more explanation in the config.h tab.
- it allows you to chose freely which measurement has to be send in which telemetry field (e.g you can send a voltage as Temperature 1, another as VFAS, ...).
- it allows to multiply / divide each measurement by a parameter when transmitting it ; this can be useful because the number of decimals displayed depend on the chossen field.

Please note that this program is based on the official openxsensor but differs on several points.
I do not know if it will be supported by the responsible from Openxsensor forum.
It is not 100% developed and tested.
I tested as much as I could the functions that I use.
I use it myself for the altitude and vertical speed (vario) and it seems OK.
I made tests for the 6 voltages and it was OK.
I did not test the current sensor because I have no current sensor. Normally it should work.
I did not test the ability of changing the sensitivity of the vario on the transmitter. It requires to connect oxs to a channel from the receiver. Normally it should work.
I did not test loading/saving the data in EEPROM. Normally it should work.
I did not test the "push_button" function. Normally it should work.

If you have questions or want some improvements, you can contact me.
Michel
Attachments
openxsensor_Sport_Volt.rar
(26.96 KiB) Downloaded 242 times
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by mstrens »

Archades wrote:Not to be a nag, but was curious on the smart port status and has there been any more progress to getting other fields working?
Great work so far though :D
I just posted (a few minutes ago) a version that can transmit other fields.
Read carefully the comments in the post (e.g. divider resitors must be calculated to provide about 1 volt on the mid point)
User avatar
Tempo
Posts: 83
Joined: Tue Feb 04, 2014 4:04 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by Tempo »

Kilrah wrote:Yes of course, FrSky's own PC interface cable used for updates is an RS232-type, with +5.6V / -5.6V levels. And everyone else uses the oXs as is.
Yes, most digital IO-ports of used STM32F103C8T6 (receiver X6R) are 5V tolerant.
Have a look in datasheet http://www.st.com/web/en/resource/te...CD00161566.pdf :
"...
Clock, reset and supply management
– 2.0 to 3.6 V application supply and I/Os
...
2 x 12-bit, 1 μs A/D converters (up to 16
channels)
– Conversion range: 0 to 3.6 V
...
Up to 80 fast I/O ports
– 26/37/51/80 I/Os, all mappable on 16
external interrupt vectors and almost all
5 V-tolerant
..."
User avatar
Tempo
Posts: 83
Joined: Tue Feb 04, 2014 4:04 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by Tempo »

mstrens wrote:
Archades wrote:Not to be a nag, but was curious on the smart port status and has there been any more progress to getting other fields working?
Great work so far though :D
I just posted (a few minutes ago) a version that can transmit other fields.
Read carefully the comments in the post (e.g. divider resitors must be calculated to provide about 1 volt on the mid point)
@mstrens Thank you very much again ! By now my openxsensor on X6R works. It was my mistake with wrong protecting diods on SmartPort.
In this way I learned a lot of things by doing only one thing wrong :D

I´m very interested in variometer modifications in your "own homemade code". My aim is to develop a "better vario" with features like this http://wstech.de/ . Have a look on "Variometerkunde". You need two optimized components: First component is sensor with optimized differentiation of altitude-signal and second component is an optimized sound-generator for Taranis !
Absence of one component makes no good variometer.

Taranis-variometer-sound is not optimized by now. Taranis is like "high-frequency-beeping". ;)
This is sound of professional variometer:
vario_dv.wav
sound of professional variometer
(211.72 KiB) Downloaded 2882 times
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Introduction to the openx vario/altimeter

Post by MikeB »

mstrens wrote:I read yesterday on another forum that a developper of a device sending one or two voltages with a X8R had to change his program to let it work with an X6R.
That's me!
I had to do that as the device in question needs to sync to the incoming baud rate, and the X6R sent something odd, not SPort protocol, as the first item it output.
I've been heavily tied up with the 9XR-PRO recently, I will get back to the openxsensor when I get a bit of spare time.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Archades
Posts: 24
Joined: Sat Jan 04, 2014 3:37 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by Archades »

Sweet, thanks mstrens. I'll try build my current sensor and test it over the weekend. I have an Allegro ACS758 Series Hall Current Sensor 100A uni directional.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by mstrens »

Tempo wrote:
mstrens wrote:
Archades wrote: Taranis-variometer-sound is not optimized by now. Taranis is like "high-frequency-beeping". ;)
This is sound of professional variometer:
vario_dv.wav
As you probably know, the sound is not produced by the openxsensor but inside the taranis based on the vertical speed values sent by the sensor.
So sound improvement should be programmed on the taranis side. I can't do it in the openxvario.

I imagine it should be quite easyly achieve by the people developping the Tx program.
Still, I do not clearly understand what you expected.
Taranis can currently be set up in order to provide
- a continuous tone when descending, frequency goes down when sensor sinks faster
- a dead band ; no tone when the vertical speed is between 2 values
- a discontinous tone when climbing, frequency goes higher when climbing faster, duration of tone is shorter when climbing faster.

This is to be compared with what the manual found in the link you provided.
This manual explains that the vario can also provide a discontinous tone in the dead. In order to ear the difference between dead zone and climbing, the dead zone uses a duty cycle of 50 % and the climbing uses a duty cycle of 25 %.

Do you ask for:
- using more different frequencies (e.g. lower when rising, higher when climbing, so increasing the gap between the 2 cases)
- generating a (different) tone in the dead zone?
- using another value for the duty cycle when climbing?
Archades
Posts: 24
Joined: Sat Jan 04, 2014 3:37 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by Archades »

Whatever I see the tones are in gliders, they seem diff to the opentx tones for vario. I turned mine off cuz the noise annoyed me...too high pitchy annoying or something haha.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Introduction to the openx vario/altimeter

Post by jhsa »

then you probably never heard the vario tones on the 9x radio.. those are bad. But as far as I'm concerned, better that than nothing. ;) So, I won't complain. :D
For example, on the audio file posted above, the voice audio is really bad. Full of clicks at the beginning of every file. not natural at all.. few times worse than my 9x. But again, better that than nothing :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
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by mstrens »

jhsa wrote:then you probably never heard the vario tones on the 9x radio.. those are bad. But as far as I'm concerned, better that than nothing. ;) So, I won't complain. :D
For example, on the audio file posted above, the voice audio is really bad. Full of clicks at the beginning of every file. not natural at all.. few times worse than my 9x. But again, better that than nothing :mrgreen:

João
I expect that the claims concerns the vario tone.
It should be quite easy for someone to improve the vario tone (be....ep, beep beep...) on the 9x radio if it is just changing some frequencies and duty cycles.
Why not opening an request to the developpers.

Announcing the values (altitude, ...) is more a generic function and depends mainly on the wav files on SD card.

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

Re: Introduction to the openx vario/altimeter

Post by jhsa »

I think the clicks on the beginning of every voice file are because of something else, not the wav itself.. but that is for another thread ;) The vario tones on the 9x are square wave tones.. On taranis are sine wave I think, so they should be smoother..

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
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Introduction to the openx vario/altimeter

Post by MikeB »

I'm just thinking about the writing to EEPROM every 10 seconds option. The EEPROM has a write cycle life of 100,000. If you write every 10 seconds, you will reach this total after 1,000,000 seconds. This 1,000,000 / 3600 hours = 278 hours or 11.6 days. So if you leave it running for 11.6 days, you will wear the EEPROM out.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Archades
Posts: 24
Joined: Sat Jan 04, 2014 3:37 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by Archades »

@Mstrens
Been a while since I've flown but the vario sounds on this are ok http://www.youtube.com/watch?v=0aFWjv3ymPo
I probably just need to play with the settings for my taranis. What do you recommend for the 4 values for deadband, etc?
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by mstrens »

MikeB wrote:I'm just thinking about the writing to EEPROM every 10 seconds option. The EEPROM has a write cycle life of 100,000. If you write every 10 seconds, you will reach this total after 1,000,000 seconds. This 1,000,000 / 3600 hours = 278 hours or 11.6 days. So if you leave it running for 11.6 days, you will wear the EEPROM out.

Mike.
There are only a few parameters that are recorded.
Most of those parameters are min and max value. It means that they do not change a lot.
If you add a test to write a value only when it is higher (/ lower) the current value in EEPROM you will reduce the number of write a lot and there will be no issue.
Still, there is one value that change always : the consume milliamp.
One option could be to write this value not always on the same adress but each time on a different one (over a kind of buffer of 20 adresses or more).
When the user request a reset, the value in each adresses would be set to 0.
Each second you can write in a different one.
On start up you read all adresses and you keep the one with the highest value.

Anyway, I do not think that many people use this function because a radio like the taranis can do the same I expect job (keeping max, min). I should have to check when does the taranis make a reset of the consumed milliamp.

Currently, in SPORT version, those values except the consumed milliamp does not have sense because they are sent to the TX and the user don't have access to the value in the oxs.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by mstrens »

Archades wrote:@Mstrens
Been a while since I've flown but the vario sounds on this are ok http://www.youtube.com/watch?v=0aFWjv3ymPo
I probably just need to play with the settings for my taranis. What do you recommend for the 4 values for deadband, etc?
Thanks for the video.
In the mean time I had a look to several RC varios and to paraglider vario and I made some proposal to allow each user define his preferences about the vario sounds (frequency at nearly zero lift, variation of frequency in function of vertical speed, frequency of repetition of beep when rising, ..). A developper is currently working on this.

Currently in the taranis you can't really choice the type of sound but you can fix 4 parameters on the telemetry panel.
The 4 parameters refers to the vertical speed.
You have
- a min (in m/sec) (default = -10)
- a center min = lower value of a dead band (default -0.5)
- a center max = high value of the dead band (default +0.5)
- a max (default = + 10)

If the vertical speed is lower than min the vario produces a continous low frequency tone (the same frequency for any value of vertical speed)
If the vertical speed is higher than the min but lower than center min, the vario produces a continous low frequency tone (the frequency varies linearly with vertical speed in the same way as in a glider)
If the vertical speed aproach the center min, the frequecy is 1000 hz. This value seems quite high and some people are curently claiming a little about this.
If the vertical speed is higher than the center min but lower than center max, the vario produces no sound = dead band.
If the vertical speed is higher than the center max but lower than max, the vario produces an intermitent tone (beep beep...) frequency of tone and frequency of repetition vary with vertical speed up to the max. Then the frequenies does not varies anymore.

The default values seems me good as starting point.

In fact it depend a lot of the user and the vario.
If the vario is very noisy(like the current version of Frsky vario - but they are working on a new firmware to upgrade it a lot), you must put a large dead band other wise you get a lot of wrong tones. With the current firmware for the Frsky vario, you have to fix the dead band at about -0.9 +0.9 (in fact 0.6 or 0.9 does not matter because the vario report per step of 0.5 m/sec what is quite bad).
If you use another vario (less noise, more accuracy) you can reduce the dead band or even set center min = center max if you like having always a tone. The values has to been chosen depending of what you would like to know. Do you want to be informed with a rising tone when the vertical speed is > 0, then set the center max value on 0. Do you want to consider that you are already in positive lift when vertical is -0.2 (because normal sinking rate is e.g -0.5) then put it on this value. If you are interested only by big lift, then set the value at 1 or higher.

For the max value, if you want to be able the ear a difference between 9 and 10 m/sec then you must set the value on 10 but the change is frequency between 1 and 2 m/s will not be so big. If you reduce the max value to e.g 5, you will ear much better a difference between 1 and 2 but not anymore between 5 and 6.

You see, it is not easy to answer. It depend a lot on the quality of the vario and on what you expect.
Archades
Posts: 24
Joined: Sat Jan 04, 2014 3:37 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by Archades »

Thanks for the help. Currently drugged with valium to fix a back spasm so any testing I'll be doing is probably another week away as life is a bit of a blur at the moment:P. Next on my plan is to setup the current sensor with your code and hopefully my back fixes itself by the weekend to start testing.

I bought some FLVSS sensors and they work nicely although they're a bit pricey. Would be great to get a smaller version without the OLED (maybe half the size of the FLVSS? A balance plug connector + 10-20mm), something in the $10-15 mark would be awesome via S.Port or even just something that can swing data back over to an OXS. Would I2C be the best protocol to use for the least amount of wires?
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by bertrand35 »

Here are some work in progress on the vario topic inside OpenTX. Thanks Michel for the tests!

1) I allowed low frequency sounds, 150Hz is the limit instead of 440Hz (but 150Hz is not very very nice)

2) I added some more maths in tone generation to keep the same energy in high and low tones, low tones sounded really low compared to high tones

3) I added a 2nd and a 3rd harmonic to the sine wave to have softer tones. Completely experimental. Harmonic amplitudes = (60000, 4096, 1024). The sine wave also has now 1024 points instead of 100.

4) I added configurable global parameters for a "zero frequency", "max frequency", and "zero repeat period" for the vario

5) I worked on the vario function to use these parameters. Also the ratio beep / silence is 50% around 0m/s and 25% above, linear progression between both points.

The isssue is tracked here:
https://github.com/opentx/opentx/issues/670

Feel free to comment!
User avatar
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: Introduction to the openx vario/altimeter

Post by Flaps 30 »

Looks good Bertrand. :)

Will this be implemented for the 9X and the M128 transmitters, bearing in mind that many are fitted with Megasound cards where the buzzer output is fed to the speaker via the LM386 amplifier?
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Introduction to the openx vario/altimeter

Post by jhsa »

Flaps.. unfortunately I don't think that the m128 can generate a sine wave?? :(
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
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by bertrand35 »

No it will be only available on ARM boards.
User avatar
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: Introduction to the openx vario/altimeter

Post by Flaps 30 »

Pity :( ... Time to keep an eye open for a Sky board.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Introduction to the openx vario/altimeter

Post by MikeB »

It's called a 9XR-PRO!

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Archades
Posts: 24
Joined: Sat Jan 04, 2014 3:37 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by Archades »

Are there and ID fields available in the FRSKY telemetry to know it's orientation in 3d space? Basically wondering if it's possible to do a 3axis magnetometer and gyro or whatever and have a HUD for it's orientation with google glass or something. Basically how Phoenix RC has a lil model view to see it when it's far away.

http://www.rcgroups.com/forums/showthre ... st27574639
This was my basic crazy idea. Could be of use to the folks that like to fly realllly high and maybe have an onscreen visual on the Taranis one day of it.
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Introduction to the openx vario/altimeter

Post by Kilrah »

Nope there are none at this point, would need to be added.
Archades
Posts: 24
Joined: Sat Jan 04, 2014 3:37 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by Archades »

Hopefully it could be added one day.

Seeing as I don't want to pull off the nice wrapping of my FLVSS, does anyone know what the main chip is used to do the measurements? Are they just using a single MCU with 6 voltage dividers or something? Not interested in the OLED screen side of things for some modes, would love a smaller n lighter variant. There's a schematic on their site but I believe that's only viewable by approved developers.

Post Reply

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