OpenXSensor SPORT Interface

Development & General Chat for the superb openxvario project.

Moderator: rainer

paulj
Posts: 22
Joined: Sun Jun 29, 2014 8:20 am
Country: -

Re: OpenXSensor SPORT Interface

Post by paulj »

paulj wrote:
mstrens wrote:
mstrens wrote: 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!
Finally had the wind on the slope this afternoon. No problems experienced with the modified file - climbed to 130m above launch height without any issues.

Thanks very much!

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

Re: OpenXSensor SPORT Interface

Post by mstrens »

paulj wrote:
Finally had the wind on the slope this afternoon. No problems experienced with the modified file - climbed to 130m above launch height without any issues.

Thanks very much!
Fine,
Thanks for the feedback.
hageha
Posts: 213
Joined: Tue Dec 27, 2011 9:25 pm
Country: -
Location: Hildesheim

Re: OpenXSensor SPORT Interface

Post by hageha »

After I built several openXsensors represents for me the following question:
Is it possible to build a sensor switchable for both systems, eg with a jumper? (XR-DR receiver)
In the future I want to avoid getting to reprogram and use a new heat shrink tubing
I have just the wrong sensor for the new receiver.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens »

hageha wrote:After I built several openXsensors represents for me the following question:
Is it possible to build a sensor switchable for both systems, eg with a jumper? (XR-DR receiver)
In the future I want to avoid getting to reprogram and use a new heat shrink tubing
I have just the wrong sensor for the new receiver.
In principle it is possible.
It was on my todo list.
It is even possible to avoid a jumper and let OXS automatically detect if there is an X serie receiver or not.
If yes, then OXS could activate automatically SPORT protocol otherwise, it could activate the HUB protocol.

Still:
- it is not really easy to do. A lot of the code has to be changed and some have to be duplicated.
- currently, when I activate all options (and some debug function) I reach the limit of the memory of Arduino. So it could be that I have to remove some functionalities that are not often used (probably pushbutton for reset, save to EEPROM).

Currrently I can't work on this because I am implementing an airspeed sensor and a compensated vario.
I have first to finalise this part.
User avatar
kalle123
Posts: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: OpenXSensor SPORT Interface

Post by kalle123 »

It might be a stupid question, but let me (retired mechanical engineer ;) ) put it here.

Yesterday evening did a short bench test with openxsensor. MS5611, arduino uno, D4R-II. See pic. Works!

But there are unused analog ports. So why not monitor the Lipo cell voltages. First cell on A0 (should be OK directly 4.2 V max.)
Second cell with voltage divider (2x 2k) on A1. But what am I doing with that? I am bringing with that divider the SUM of cell 1+2 to a level < 5 volts and monitoring that on A1. Aim was to monitor only cell 2.

Where am I wrong?

br
Attachments
DSCF3530.JPG

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

Re: OpenXSensor SPORT Interface

Post by jhsa »

Then openXsensor subtracts the value of cell1 from the total (1+2), and you get the voltage from cell 2 :)

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
kalle123
Posts: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: OpenXSensor SPORT Interface

Post by kalle123 »

Thanx João.

Simple like that ...

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

Re: OpenXSensor SPORT Interface

Post by mstrens »

kalle123 wrote:It might be a stupid question, but let me (retired mechanical engineer ;) ) put it here.

Yesterday evening did a short bench test with openxsensor. MS5611, arduino uno, D4R-II. See pic. Works!

But there are unused analog ports. So why not monitor the Lipo cell voltages. First cell on A0 (should be OK directly 4.2 V max.)
Second cell with voltage divider (2x 2k) on A1. But what am I doing with that? I am bringing with that divider the SUM of cell 1+2 to a level < 5 volts and monitoring that on A1. Aim was to monitor only cell 2.

Where am I wrong?

br
openxsensor (OXS) can be configured in order to read several voltage (up to 6).
Each of them are measured using the same ground.
So if you use a multicell lipo, OXS can read the first cell( as voltage1), the sum of cell 1 and 2 (as voltage 2), the sum of cell 1 + 2 + 3 (as voltage 3), ...
You know already that it requires some voltage divider in order to bring some voltage down.

Once those measurements are done, OXS allows you to select which information have to be sent to the Tx.
You can transmit each voltage but then you do not get the voltage of each cell indivudually.
You can also ask OXS to send the voltage of each cell individually using the foreseen setup.
To do so, you have to :
- specify the max number of cells in the line: #define NUMBEROFCELLS 3 (here 3 is the max number of cells you are measuring using voltage 1, 2 and 3)
- specify that OXS has to calculate and send each cell using those lines:
DEFAULTFIELD , CELLS_1_2 , 1 , 1 ,0 , \
DEFAULTFIELD , CELLS_3_4 , 1 , 1 ,0 , \
DEFAULTFIELD , CELLS_5_6 , 1 , 1 ,0 , \
Note: remove the lines regarding cells in excess (e.g. if you have only 3 cells, remove the line regarding CELLS_5_6)

When Tx will receive the voltage of each cell, it can display all of them on a special telemetry panel (see openTx manual) and it can display on any user configurable display the lowest voltage cell (using CELL) and the total (using CELLS)
User avatar
kalle123
Posts: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: OpenXSensor SPORT Interface

Post by kalle123 »

Hi mstrens.

Think I got a new hobby :D
offers
Posts: 81
Joined: Tue Jan 22, 2013 4:14 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by offers »

Can you point to the "special telemetry panel" for the individual battery view?
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by mstrens »

offers wrote:Can you point to the "special telemetry panel" for the individual battery view?
Here an extract of the taranis manual:

Telemetry view

A LONG press of the PAGE key from any of the main views brings up the telemetry views. The PAGE and +/- keys will then cycle between the power status screen (voltage, current, power or A1/A2 if not set, cell voltages from an FLVS-01 sensor if connected), the min/max and GPS coordinates screen, and if defined from one to three customs screens that can hold up to 12 items each, configured in the telemetry setup menu.
User avatar
kalle123
Posts: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: OpenXSensor SPORT Interface

Post by kalle123 »

offers wrote:Can you point to the "special telemetry panel" for the individual battery view?
Hi offers.

Do you know http://open-txu.org/ ?

http://open-txu.org/taranis-navigation-map-2-0/

Keep a look there ...

br
offers
Posts: 81
Joined: Tue Jan 22, 2013 4:14 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by offers »

Of course i know the open-tx university, but did not find the solution there (nor in the manual)
I will test later the solution above



Offer
offers
Posts: 81
Joined: Tue Jan 22, 2013 4:14 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by offers »

Well i test it, and no screen that show all cells values, can you post a screen shot?

I am using openXsensor that read 6 cell voltage and send them to the Taranis.
Should i configure something to show this screen?.




Offer
offers
Posts: 81
Joined: Tue Jan 22, 2013 4:14 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by offers »

Ha, found it, its in the right side of the first telemetry screen, in small characters, i did not expect it there (now i do [emoji1] )






Offer
offers
Posts: 81
Joined: Tue Jan 22, 2013 4:14 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by offers »

I have another issue,
when i disconnect the battery from the oxs, the values on the Taranis freeze with last value, not showing the 0v
Is it normal? Can i disable it? I like to know that the oXs does not get any value.



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

Re: OpenXSensor SPORT Interface

Post by mstrens »

offers wrote:I have another issue,
when i disconnect the battery from the oxs, the values on the Taranis freeze with last value, not showing the 0v
Is it normal? Can i disable it? I like to know that the oXs does not get any value.



Offer
Which battery do you disconnect? I see 2 possibilities:
1) you power off OXS (so the arduino board)
2) you keep some powersupply on OXS but you disconnect the cable between OXS and the lipo balance connector.

In the first case, OXS does not transmit any data anymore to the Rx and the TX. Currently OpenTx keeps the last known telemetry values.
In the second case, OXS should normally transmit 0 volt for each cells and Tx should display 0.
offers
Posts: 81
Joined: Tue Jan 22, 2013 4:14 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by offers »

I use case #2,
I disconnect the balance plug from the oXs (keeping the voltage to Arduino)
Looking at the debugging info of the Arduino, it looks like it send zero for each cell.

What is the logic of the implementation in the openTx side?




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

Re: OpenXSensor SPORT Interface

Post by mstrens »

offers wrote:I use case #2,
I disconnect the balance plug from the oXs (keeping the voltage to Arduino)
Looking at the debugging info of the Arduino, it looks like it send zero for each cell.
It is what I had expected.
offers wrote: What is the logic of the implementation in the openTx side?
Some openTx developper should answer.
Probably that when openTX get 0 , it keeps the previous value.
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: OpenXSensor SPORT Interface

Post by Kilrah »

OpenTX 2.0 (since 2.0.6 or so) ignores values lower than (if I remember well) 0.5V, because a bug in the FrSky LiPo sensor caused it to occasionally send spurious bogus small values, which would mess up the minimum values.
offers
Posts: 81
Joined: Tue Jan 22, 2013 4:14 pm
Country: -

Re: OpenXSensor SPORT Interface

Post by offers »

Thanks for the information.

It will be better if the implementation be one of the two:
1. Ignore low values only for 500mili sec
2. Always show the real values, but do NOT change the minVolt if the values are too low.

In both ways, the presentation will be more accurate, and the alarms will still work.



-- Offer --
User avatar
kalle123
Posts: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: OpenXSensor SPORT Interface

Post by kalle123 »

Needa little help wih voltages

Test equipment here: arduino uno, MS5611, D4-IIR - that works.

Now adding a 2S lipo. Voltage cell #1 on A0 and #2 on A1.

Changed in oxs_config

#define PIN_Voltage1 0 // Pin for measuring Voltage 1 ( Analog In Pin! )
#define PIN_Voltage2 1 // Pin for measuring Voltage 2 ( Analog In Pin! )

#define SETUP_DATA_TO_SEND \
DEFAULTFIELD , ALTIMETER , 1 , 1 , 0 , \
DEFAULTFIELD , VERTICAL_SPEED , 1 , 1 , 0 , \
T1_FIRST_ID , ALT_OVER_10_SEC , 1 , 1, 0 , \
DEFAULTFIELD , CELLS_1_2 , 1 , 1 , 0 , \ <-- added
DEFAULTFIELD , CELLS_3_4 , 1 , 1 , 0 <-- added
// DEFAULTFIELD , CURRENTMA , 10 , 1 , 0, \
// FUEL_FIRST_ID , MILLIAH, -100 , 390 , 100, \
// CELLS_FIRST_ID , CELLS_1_2 , 1, 1 , 0


#define NUMBEROFCELLS 2 // keep this line but set value to 0 (zero) if you do not want to transmit cell voltage.

No I see in telemetry screen right side small values

3.70
0.00

and in next screen

cell and cells 0.00 and 0.0

Was expecting to see both 2 voltages .....
User avatar
KAL
Posts: 552
Joined: Thu Oct 10, 2013 4:36 pm
Country: Germany
Location: somewhere near Rothenburg ob der Tauber

Re: OpenXSensor SPORT Interface

Post by KAL »

Hi Kalle,

AFAIK with 2 cells the line with CELLS_3_4 should be omitted.

Klaus
( TH9X / 9XTreme / FrSky DHT / Spektrum / Multi / RotEnc )
( 9XR PRO / erSKY9x  / FrSky DHT / Spektrum / Multi / RotEnc / P3 as Slider )
User avatar
kalle123
Posts: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: OpenXSensor SPORT Interface

Post by kalle123 »

Dank dir Klaus.

Werde es gleich nochmal probieren ...

LG KH
User avatar
kalle123
Posts: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: OpenXSensor SPORT Interface

Post by kalle123 »

Did the mode, Klaus adviced

DEFAULTFIELD , CELLS_3_4 , 1 , 1 , 0<-- removed!
// DEFAULTFIELD , CURRENTMA , 10 , 1 , 0, \
// FUEL_FIRST_ID , MILLIAH, -100 , 390 , 100, \
// CELLS_FIRST_ID , CELLS_1_2 , 1, 1 , 0


#define NUMBEROFCELLS 2 // keep this line but set value to 0 (zero) if you do not want to transmit cell voltage.

But still see in telemetry screen right side small values

3.70
0.00

and in next screen

cell and cells 0.00 and 0.0

Was expecting to see both 2 voltages .....

Have on A0 an on A1 3.7x Volt
User avatar
KAL
Posts: 552
Joined: Thu Oct 10, 2013 4:36 pm
Country: Germany
Location: somewhere near Rothenburg ob der Tauber

Re: OpenXSensor SPORT Interface

Post by KAL »

And what about the calibration parameters

Code: Select all

#define offset_1             ?.??   
#define mVoltPerStep_1       ?.??     
#define offset_2             ?.??   
#define mVoltPerStep_2       ?.?? 
especially for cell 2

and the values of your divider resistors?

(Meine Kristallkugel ist gerade in Reparatur :mrgreen: )

Klaus
( TH9X / 9XTreme / FrSky DHT / Spektrum / Multi / RotEnc )
( 9XR PRO / erSKY9x  / FrSky DHT / Spektrum / Multi / RotEnc / P3 as Slider )
User avatar
kalle123
Posts: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: OpenXSensor SPORT Interface

Post by kalle123 »

Hi Klaus. A crystal ball wont help. :)

Therefore some pics and my oxs_config.
Test setup. Voltage divider 2 x 2 k right upper corner.
Test setup. Voltage divider 2 x 2 k right upper corner.
Vario works!
Vario works!
Cell and cells - NADA!
Cell and cells - NADA!
3.7 and 0.0 just in right corner
3.7 and 0.0 just in right corner
and the oxs_config (without calibration :? )
oxs_config.h.zip
My oxs_config. Possibilities might be too much for me ...
(12.29 KiB) Downloaded 184 times
Ok. I have seen , that there is "something" with calibration in oxs_config. But mstrens didn't mention that ...

I think, I need a hand with that. Lipo first cell -> directly A0, second cell (divider 2 x 2 k) -> A1.

br KH
User avatar
KAL
Posts: 552
Joined: Thu Oct 10, 2013 4:36 pm
Country: Germany
Location: somewhere near Rothenburg ob der Tauber

Re: OpenXSensor SPORT Interface

Post by KAL »

You have to calibrate both analog inputs separately.

The main procedure to calibrate is explained in section 5.3 of oxs_config.h

Set numberofcells to 0, so that no cell calculation is made.
I would send VOLT1 to the TX and calibrate this input (A0) for 1 cell (about 3,7V).
Also send VOLT2 (A1) to the TX and calibrate A1 to the whole voltage of cell 1 + cell 2 (about 7,4V).

If this 2 values are transmitted correctly, then set numberofcells to 2 and send cells_1_2
VOLT1 and VOLT2 you can then omit.

I hope this helps a bit (I'm not very deep into this stuff, just a beginner with OXS).

(If I'm on the wrong path with this, someone may please correct me!)

Btw: Have you seen the OpenXSensor configurator (here under downloads)?

Klaus
( TH9X / 9XTreme / FrSky DHT / Spektrum / Multi / RotEnc )
( 9XR PRO / erSKY9x  / FrSky DHT / Spektrum / Multi / RotEnc / P3 as Slider )
User avatar
kalle123
Posts: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: OpenXSensor SPORT Interface

Post by kalle123 »

Thanx Klaus. Will give it a try this evening.

Come back with the result later ...

cu KH
User avatar
kalle123
Posts: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: OpenXSensor SPORT Interface

Post by kalle123 »

Looks better now.

"Set numberofcells to 0, so that no cell calculation is made." did not help at all. Don't see any voltages on Tanaris.

Had to put a value here

#define offset_1 0
#define mVoltPerStep_1 4.89 // = 5000 / 1023 (if Vcc =5 volt)
#define offset_2 0
#define mVoltPerStep_2 9.78 <-- !!

As the lipo is balanced, I just doubled the define mVoltPerStep_1 value.

(Would not call it a "calibration" ;) )

Whole project looks very interesting, but at the moment a little too much for me.

OpenXSensor configurator also in linux !! But I am missing some simple documentation (for people like me ;) )

br KH
DSCF3550.JPG
DSCF3551.JPG

Post Reply

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