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 »

thank you.. I will have a look later or tomorrow. I am bit busy at the moment ;)

I will have to build another vario for a glider and a voltage/current sensor for my tricopter. Will try your code. They both will work with ersky9x though, so I guess it will be a good chance to check for compatibility with both firmwares :)

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

Post by MikeB »

I'll do what I can when I get a moment.

Contact Rainer for commit permission.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Maguro
Posts: 17
Joined: Wed Jan 08, 2014 5:17 pm
Country: United States

EagleTree GPS to SPort converter working

Post by Maguro »

I got the EagleTree GPS to SPort converter working. It will actually work with any NMEA compatible GPS. It only took a week or so, and that included learning how to program in C++. Of course I didn't have to figure out how to get the data out of the GPS or into the SPort. That work was done by Lady Ada (at Adafruit) for the GPS and Rolf Blomgren (at DIY Drones) for the SPort. I just had to carve out what I didn't need, add in what I needed, and then make the programs talk to one another .

I can confirm that the GPS ground speed readout on the Taranis is really hosed. Not only is it in no units I can recognize, the data doesn't even convert linearly. Once I got the conversion correct , I noticed when I input units to display 25 on the Tx, 23 would appear. 50 got 49, 100, 101, and 200 got 202. It looks like it crosses over somewhere around 75, but I didn't actually check that far. For now I have the display outputting approximate knots (within 1-2 of what the GPS sends).

The Teensy 3.1 board I used (that's it's actual name) only weighs a few grams. The cables weigh more than the board. There is plenty of capacity in the micro-controller to handle more sensors. The controller is an 32 bit ARM Cortex-M4 running at 72 MHz. The board still has one more serial port and 2 analog converters available, and is 5V tolerant.

Maybe I'll try getting an airspeed sensor working next.

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

Re: OpenXSensor SPORT Interface

Post by mstrens »

jhsa wrote:thank you.. I will have a look later or tomorrow. I am bit busy at the moment ;)

I will have to build another vario for a glider and a voltage/current sensor for my tricopter. Will try your code. They both will work with ersky9x though, so I guess it will be a good chance to check for compatibility with both firmwares :)

João
Jhsa, Mike
please note that I found some bugs based on tests made by Rightrudder. I fixed them but there could be some other.
I do not yet have the rights to publish a version on google.
So, when you want to start your tests (or publish on google), please ask for the latest version.
NeilRogers
Posts: 87
Joined: Sat Jun 22, 2013 2:12 pm
Country: United Kingdom
Location: Wiltshire

Re: OpenXSensor SPORT Interface

Post by NeilRogers »

Hi Michel.

I started testing your new version of Hub/SPort in SPort, very documentation in config.

I'm hoping to do a live test this afternoon if the rain holds off.

I'm using pin 2 as ppm and made only these changes to config

#define PIN_PPM 2
#define PIN_Voltage1 8 all definitions
//#define PIN_CurrentSensor 2 commented
deleted all examples of send definition and set
#define SETUP_DATA_TO_SEND \
ALT_FIRST_ID , ALTIMETER , 1 , 1 ,\
VARIO_FIRST_ID , VERTICAL_SPEED , 1 , 1 ,\
T2_FIRST_ID , SENSITIVITY , 1, 1 ,\
T1_FIRST_ID , ALT_OVER_10_SEC , 1 , 1

#define NUMBEROFCELLS 0
//#define MEASURE_RPM 1

The sensitivity ppm and feedback to T2 looks good.

The only thing I can see with an issue is the new Alt over 10 sec feature, T1 displays 32 all the time, so it looks like T1 is being generated.

I'll let you know things go later

Thanks neil

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

Re: OpenXSensor SPORT Interface

Post by mstrens »

NeilRogers wrote:Hi Michel.

I started testing your new version of Hub/SPort in SPort, very documentation in config.

I'm hoping to do a live test this afternoon if the rain holds off.

I'm using pin 2 as ppm and made only these changes to config

#define PIN_PPM 2
#define PIN_Voltage1 8 all definitions
//#define PIN_CurrentSensor 2 commented
deleted all examples of send definition and set
#define SETUP_DATA_TO_SEND \
ALT_FIRST_ID , ALTIMETER , 1 , 1 ,\
VARIO_FIRST_ID , VERTICAL_SPEED , 1 , 1 ,\
T2_FIRST_ID , SENSITIVITY , 1, 1 ,\
T1_FIRST_ID , ALT_OVER_10_SEC , 1 , 1

#define NUMBEROFCELLS 0
//#define MEASURE_RPM 1

The sensitivity ppm and feedback to T2 looks good.

The only thing I can see with an issue is the new Alt over 10 sec feature, T1 displays 32 all the time, so it looks like T1 is being generated.

I'll let you know things go later

Thanks neil
Neil,
The program has already been tested by RightRudder and I found some bugs (that I fixed).
He also asked to be able to display on Tx a bar as fuel gauge showing the current consumption.
I implemented this adding an "offset" parameter in the config file (where you defined how fields are transmitted).

Those changes were done offline (in private messages) the last 2 days.

If you intend to make tests, best would be to use the latest version which has only be distributed to RightRudder.

I put it in attachement here.
Please note that the config file in this attachment contains the parameters for the RigthRudder hardware.
So you have to adapt it for your needs.

I think that the way your defined your config file for the previous version is ok but here at least you have to add the "offset" with a value = 0.


I got the rights to publish my code on google and I am currently trying to upload my code on the google site of openxvario in the branch openxsensor.
Still I face some issues because it is the first time I do so and it takes more time than expected.
I hope that the code will be loaded within 2 hours.
I will first do that and I can analyse other issues (if you have) later on.
Attachments
openxsensor.rar
(47.76 KiB) Downloaded 222 times
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens »

FYI, I just committed all my changes on google.
Link is
https://code.google.com/p/openxvario/so ... penxsensor

If you have questions/issues, I will try to help you.

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

Re: OpenXSensor SPORT Interface

Post by NeilRogers »

Michel
I've quickly loaded the goggle version and setup my parameters flashed the vario in 5 minutes

just off to slope so I've not tested well but sensitivity control looks good, alt 10sec looks the same.

I'll check further once Im back

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

Re: OpenXSensor SPORT Interface

Post by RightRudder »

Thanks Michel

So the offset and negative multiplier is the trick for fuel gauge I see.

I'll test this evening and post back here.

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

Re: OpenXSensor SPORT Interface

Post by NeilRogers »

Conditions were a little extreme today, wind was so strong it was difficult to hear vario beeps, but from what I could here they sounded ok matching with sink and lift.

Your vario was running with the gps for comparison

I've enclosed live data I've had too much time to clean up but I'm getting values on Temp2 for Alt 10sec but strange the tx is reporting 32 so it not the vario.

There a few strange high values on T2, which may be of interest.

Certainly the operation looks ok with no signs of locking.

Thanks neil
Attachments
test-2014-03-21.xls
(3.26 MiB) Downloaded 201 times
RightRudder
Posts: 241
Joined: Tue Jan 15, 2013 9:41 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by RightRudder »

Interesting. I've been getting these altitude glitches too. I set up a custom play function to play the altitude voice message whenever it changes by more than 30m and every so often I'll hear a sick one like 20,000m etc. I got that on my sky9x and if memory serves it happened with taranis too but I was concentrating on another problem at the time and didn't have a chance to investigate it well so that's why I haven't said anything about it till now. It is something quite intermittent but I didn't know if it was originating in the vario or in the tx. I thought it might be my own problem like a loose connection somewhere but now your data has got me wondering about that.

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

Re: OpenXSensor SPORT Interface

Post by mstrens »

Neil and RightRudder,
I had a look at the logfile.
It is clear that there is an issue with the difference of altitude between 10sec.
While the value should be quite stable, it suddenly changes a lot (but always close to the same value).
I checked the code regarding calculation of this field in OXS and I can't found a bug.
This part of the code is quite simple.

There is another tread on this forum explaining issues with telemetry on lipo cells
viewtopic.php?f=92&t=4789

I suspect that the issue is on Tx side (or in the Rx or XJT software).
Could you please say me:
- which Tx are you using (Taranis , ...)
- which release of openTx are you running on TX
- did you make the Frsky upgrade on XJT
- which receiver do you use
- did you make the Frsky upgrade on RX

I will try to explain what we have seen to openTx developpers.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens »

NeilRogers wrote: I'm getting values on Temp2 for Alt 10sec but strange the tx is reporting 32 so it not the vario.

Thanks neil
Neil,
Can you explain more what you mean with Tx is reporting "32".
Michel
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 »

Have you got imperial set? If so, the temp may be Farenheit, so 32 for 0.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
RightRudder
Posts: 241
Joined: Tue Jan 15, 2013 9:41 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by RightRudder »

I can report the following with the latest oxs code you posted here (9 posts back):

The fuel gauge with offset works fine. :)

The persistent storage is broken. With the EEPROM line commented the fuel defaults at power up to 100% as expected. After some seconds it decreases. The push button on the arduino board works to reset the fuel to 100%. When the EEPROM code is compiled the telemetry display for fuel goes to 10182 and always remains at that value. The push button has no effect. :(

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

Re: OpenXSensor SPORT Interface

Post by RightRudder »

I also noticed a glitch with the vario telemetry. I think this is a fault in the tx firmware. When I set my vario thresholds as -3, -0.7, 0.0, 3 then any time the actual vspd field displays 0.00 I hear fast beeps as though the climb rate is very high. if the mid threshold is at any other value, this doesn't happen.
NeilRogers
Posts: 87
Joined: Sat Jun 22, 2013 2:12 pm
Country: United Kingdom
Location: Wiltshire

Re: OpenXSensor SPORT Interface

Post by NeilRogers »

Hi mike

No I'm using metric, I'll investigate further when I get a chance

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

Re: OpenXSensor SPORT Interface

Post by mstrens »

RightRudder wrote:I can report the following with the latest oxs code you posted here (9 posts back):

The fuel gauge with offset works fine. :)

The persistent storage is broken. With the EEPROM line commented the fuel defaults at power up to 100% as expected. After some seconds it decreases. The push button on the arduino board works to reset the fuel to 100%. When the EEPROM code is compiled the telemetry display for fuel goes to 10182 and always remains at that value. The push button has no effect. :(

Joe
RightRudder,
I fixed a bug in the code that load the data from EEPROM.
Still I did not tested (it is not so easy for me because I do not have a version with push button)
I put the new version on Google.
Could you try it?
Thanks
NeilRogers
Posts: 87
Joined: Sat Jun 22, 2013 2:12 pm
Country: United Kingdom
Location: Wiltshire

Re: OpenXSensor SPORT Interface

Post by NeilRogers »

Morning brain fade, I wasn't on metric, T2 is now 0 I confused myself because the speed reports in kph.

I'll setup the new code for next slope session on sunday

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

Re: OpenXSensor SPORT Interface

Post by mstrens »

NeilRogers wrote:Morning brain fade, I wasn't on metric, T2 is now 0 I confused myself because the speed reports in kph.

I'll setup the new code for next slope session on sunday

thanks neil
So , you just look at Temp2 (= alt10sec) when you were not yet flying.
During the flight, the value would have change.
RightRudder
Posts: 241
Joined: Tue Jan 15, 2013 9:41 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by RightRudder »

Tried the EEPROM code. Unfortunately the behaviour is still the same.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens »

RightRudder wrote:Tried the EEPROM code. Unfortunately the behaviour is still the same.
I will look at once more.
I keep you informed
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens »

RightRudder wrote:Tried the EEPROM code. Unfortunately the behaviour is still the same.
I made a test and on my XOS it was OK.

My procedure was:
- I did not test with TX
- I have no physical current sensor (but it should not matter because I declare I have one in config file) .
- I configure OXS in debug mode and let it send the consume milli to my PC
- I start arduino
- the first value I get on my pc is "-1" (which has no sense but is is the value in my EEPROM)
- If I do not press the push button, I continue to get -1 several times per sec.
- I push on push button during about 4 sec. In fact after pressing 1 sec, the green led blink once. I continue to press and I wait up to the led blink twice. Then I release the push button. Led blinking twice is the signal that XOS will reset some values (one of them being the consumed current).
- as soon I release the button, oxs sent "0" to my PC (instead of -1). So the reset function works.

I see wel some strange behaviour; I explain:
If I stop the test at this time and I shutdown OXS and restart it, I get again the initial EEPROM value "-1" .
This means that pressing the pushbutton reset the current consumption in the running xos but not in the EEPROM.
Then looking at the code (normally same as original), I understood that the current consumption is saved automatically in EEPROM but not immediately after a reset (or after some change provided by current sensor).
There are 9 values saved in EEPROM (one of them being current consumption) and XOS save automatically one of the 9 values every 10 seconds. It means that it takes 90 max to save all values.

Once you know it, I think this process is not so bad.
On one side, it avoid to save to often in EEPROM (safe because the number of -guaranted- writes in EEPROM is limited).
On the other side, if you press on the push button per mistake, you get the opportunity to get the previous value back if you shutdown the xos fast enough.
To really reset the EEPROM, you just can let the power on XOS at least 90 sec after pressing the push button.
I tested it, and it works.
RightRudder
Posts: 241
Joined: Tue Jan 15, 2013 9:41 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by RightRudder »

I'm sorry. I am such an idiot. I forgot I am not using my own oxs PCB for these tests but rather a pro-mini clone. I am pressing the reset button, not my own button connected to pin 10. DUH. I only realized this when you said about the double flash.

I am sorry I wasted your time.
Joe
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens »

RightRudder wrote:I also noticed a glitch with the vario telemetry. I think this is a fault in the tx firmware. When I set my vario thresholds as -3, -0.7, 0.0, 3 then any time the actual vspd field displays 0.00 I hear fast beeps as though the climb rate is very high. if the mid threshold is at any other value, this doesn't happen.
RightRudder,
Have you seen my comment on issue 670 (vario sound)

Here what I wrote.

RightRudder,
Due to this request, Bertrand changes the code of openTX (for ARM CPU I think) for the vario tone.
Changes are included in release 2.0.

I presume that you report refers to a test you made with a release 2940 or lower.
It would be good if you could make the same test but with the beta version of release 2.0.
Take care using the beta release 2.0 that:

you MUST save your model on your PC before uploading the new release (because it change the EEPROM); if you do not save, you will lost them when you reload your currrent release.
it is not safe to flight with release 2.0 (it is only in beta test)
there is a bug (at least some days ago) in companion9X 1.99: Normally the telemetry panel should display 3 new fields to set up the vario pitches and duration. Those fields exist on the TX menu panel but not yet on the companion9x screen. If this is unclear, you can contact me.
Maguro
Posts: 17
Joined: Wed Jan 08, 2014 5:17 pm
Country: United States

Re: OpenXSensor SPORT Interface

Post by Maguro »

Bruneaux can I see your code for the airspeed sensor? In particular I like to see the Sport codes you are using.

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

Re: OpenXSensor SPORT Interface

Post by RightRudder »

@mstrens

I made a comment on issue 670. Then I saw the issue is closed so I opened a new issue! I wonder if this problem is related to the false high altitude glitches I mentioned here a few posts back. I have been paying attention with Taranis and oxs and it doesn't seem to be happening. It is unclear if it could be related to tx or oxv. The problem is happening on my 9x with sky board and using the oxv with analog output. Since in that case the vario output is integrated with resistor and capacitor I think it is not possible that the vario can send a very quick high output. This is why I suspected something in the Tx firmware. I see there is a nightly build thread. I'll go over there and get some new code.

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

Re: OpenXSensor SPORT Interface

Post by mstrens »

RightRudder wrote:@mstrens

I made a comment on issue 670. Then I saw the issue is closed so I opened a new issue! I wonder if this problem is related to the false high altitude glitches I mentioned here a few posts back. I have been paying attention with Taranis and oxs and it doesn't seem to be happening. It is unclear if it could be related to tx or oxv. The problem is happening on my 9x with sky board and using the oxv with analog output. Since in that case the vario output is integrated with resistor and capacitor I think it is not possible that the vario can send a very quick high output. This is why I suspected something in the Tx firmware. I see there is a nightly build thread. I'll go over there and get some new code.

Thanks
Joe
I made some tests with the new code written by Bertrand.
As far I remember, I think that there was originally some jumps in the vario pitch when the vertical speed reaches some value defined in the telemetry panel. This is normally fixed with the new version (part of release 2.0) but it is safe if you can also check it.
As far I remember, the change (new vario tones) applies for all Tx with ARM boards.
RightRudder
Posts: 241
Joined: Tue Jan 15, 2013 9:41 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by RightRudder »

I got the build from last night. The audio is worse! haha. It never shuts up now regardless of where I put the thresholds and it is super glitchy sounding. It sounds to me like interrupt driven background code is playing havoc with the audio output. I got the one for the 9x as well but I haven't burned it. It seems like it needs to ripen for a time yet.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens »

RightRudder wrote:I got the build from last night. The audio is worse! haha. It never shuts up now regardless of where I put the thresholds and it is super glitchy sounding. It sounds to me like interrupt driven background code is playing havoc with the audio output. I got the one for the 9x as well but I haven't burned it. It seems like it needs to ripen for a time yet.
Did you had a look at this post.
viewtopic.php?f=86&t=5081

You will see that the some of the 4 parameters in tetelemetry panels are now used in another way.
It was a request from some german people getting the possibility to have 3 types of tone (see the post for more details).
On top of the 3 types of tone, it is still possible to shut up depending on the value of the vertical speed (when lower than X or in a window X-Y).
It is now even possible to change the shup up window during fly using a switch or a pot on Tx. This requires now to set up some custom switch (and to reuse it in a customs function) but this is quite easy.
Please note that you can now adjust the pitch and the frequency of the tone interrupts according your preference.

Some people found this useful but there were not so many reactions. Still I put messages on different forums in order to get some feedback.

Personnally, I had one issue: when the Tx generates a continuous tone (sinking), I hear some pops.
Still those pops seems to be the results of some RF because they stop when I deactivate the RF module.
So, probably, I will have to make some hardware modifications to avoid those RF interferences.

If you have some proposals to make, it is perhaps not to late.
Bertrand was really open to suggestions when he developped this.
Michel

Post Reply

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