Open XVario lipo monitor
Moderator: rainer
Open XVario lipo monitor
I have spent hours on this forum, but can't find a definitive answer. Is it possible to get the voltage from a 3 cell lipo, and send it to a Taranis. I notice that OpenXsensor Configurator says "not allowed".
I have ordered 2 30A sensors, which appear to be straightforward to add.
I have ordered 2 30A sensors, which appear to be straightforward to add.
Re: Open XVario lipo monitor
AFAIK total voltage yes, individual cell voltage no.
Re: Open XVario lipo monitor
Thanks Kilrah, that's what I feared.
Re: Open XVario lipo monitor
OXS can for sure measure a 3 (up to 6) lipo cells and send to the Taranis the voltages of each of the 3 cells. Taranis can then display each of them , the lowest voltage and the total.aduncan wrote:I have spent hours on this forum, but can't find a definitive answer. Is it possible to get the voltage from a 3 cell lipo, and send it to a Taranis. I notice that OpenXsensor Configurator says "not allowed".
I have ordered 2 30A sensors, which appear to be straightforward to add.
I do not know why the configurator says "not allowed". Probably you forgot another set up (otherwise it is a bug in the configurator I would have to check)
Please note that in order to let OXS calculates and transmit the voltages of each lipo cells, you have:
- to specify a (analog) pin to measure VOLT1
- to specify a '(analog) pin to measure VOLT2
- to specify a '(analog) pin to measure VOLT3
- to specify if the different voltages are measured based on Vcc (probably about 5 volt) or based on Internal reference (about 1.1 volt)
- to specify the number of lipo being used (here 3)
- to calibrate VOLT1, VOLT2 and VOLT3 (so that VOLT1 reports the voltage of cell 1, VOLT2 in order to let this report the voltage of cell 1 + 2, VOLT3 in order to let this report the sum of the 3 cells)
- to specify that Cell measurements have to be transmitted to Tx
Important note: the voltages provided by the lipo cell are to high to be measured directly by Arduino. So you have to reduce the voltages applied on Arduino pin using some voltages dividers.
Each voltage divider is composed of 2 resistors.
The values of the resistors depends on the base (Vcc/internal ref) being use.
Please look at the explanations inside config_descriptions.h.
let me know if something is unclear and I will try to explain.
Re: Open XVario lipo monitor
OpenXsensor as far as I know can do that since a looooong time..
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
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
Re: Open XVario lipo monitor
My settings VARIO and 3S Lipoaduncan wrote:I have spent hours on this forum, but can't find a definitive answer. Is it possible to get the voltage from a 3 cell lipo, and send it to a Taranis.
Worked last year and should work now.
br
Re: Open XVario lipo monitor
@mstrens. I forgot about the explanation file. It makes everything MUCH clearer, including how to calculate everything. Time to get the soldering iron on!
@kalle123. Thank you for sharing. That will be a good guide for me.
@kalle123. Thank you for sharing. That will be a good guide for me.
Re: Open XVario lipo monitor
That should probably go to the configurator google code page as an example??
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
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
Re: Open XVario lipo monitor
I have spent some time printing out and studying oXs_config_description.h. An excellent guide, thank you for taking the time to write it. As a newcomer, I confess to being spoiled by the Configurator program, I have not been brave enough yet to edit config.h manually.
Anyway, the soldering iron has been applied, and it works! Now I'm a bit confused with the calibration. I have used the 10K, 33K, 68K, and 120K resistors as suggested in config_description. I have defined Volt1, 2, 3 as A0,A1 and A2. Data sent I used AccX, Y and Z.I copied kalle123's setting from his post as a starting point, then did the voltmeter/telemetry calculations.
The result is not far off, but I have questions.
1. AccX, Y and Z. Should they show, the voltage of the 1st cell, the combined voltage of the first 2 cells, and then the total battery voltage?
2.The Cell and Cells fields. I assume that Cells id total battery voltage, and should be the same as Volt3.
Is the Cell field the cell with the lowest voltage?
3.How do I calculate the divider factor on the voltage screen in Configurator?
To be honest, I don't really need the individual cell voltages, the battery voltage and the lowest cell are the important values. I wanted to see them to check that the lowest cell voltage (cell?) agreed with the lowest cell voltage shown.
Sorry for all the questions, but I've really got my teeth into this now!!!
Anyway, the soldering iron has been applied, and it works! Now I'm a bit confused with the calibration. I have used the 10K, 33K, 68K, and 120K resistors as suggested in config_description. I have defined Volt1, 2, 3 as A0,A1 and A2. Data sent I used AccX, Y and Z.I copied kalle123's setting from his post as a starting point, then did the voltmeter/telemetry calculations.
The result is not far off, but I have questions.
1. AccX, Y and Z. Should they show, the voltage of the 1st cell, the combined voltage of the first 2 cells, and then the total battery voltage?
2.The Cell and Cells fields. I assume that Cells id total battery voltage, and should be the same as Volt3.
Is the Cell field the cell with the lowest voltage?
3.How do I calculate the divider factor on the voltage screen in Configurator?
To be honest, I don't really need the individual cell voltages, the battery voltage and the lowest cell are the important values. I wanted to see them to check that the lowest cell voltage (cell?) agreed with the lowest cell voltage shown.
Sorry for all the questions, but I've really got my teeth into this now!!!
Re: Open XVario lipo monitor
That is the result. A 3S Lipo in storage condition.
From oXs_config_description.h
* If this seems too complex, just use 2 voltages as different as possible (but in the range of the normal values you want to measure)
* and apply calculation based on following example: .
* I expect voltage to be normally between 4 volt and 6 volt, so I apply 2 voltages close to those values to End point
* - for first voltage, voltmeter gives 3510 millivolt and telemetry gives 533
* - for second voltage, voltmeter gives 5900 millivolt and telemetry gives 904
* So MVOLT_PER_STEP = (5900-3510) / (904-533) = 6.4420
* So OFFSET = 3510 - (533 * 6.4420 ) = 76
How do I calculate the divider factor on the voltage screen in Configurator?From oXs_config_description.h
* If this seems too complex, just use 2 voltages as different as possible (but in the range of the normal values you want to measure)
* and apply calculation based on following example: .
* I expect voltage to be normally between 4 volt and 6 volt, so I apply 2 voltages close to those values to End point
* - for first voltage, voltmeter gives 3510 millivolt and telemetry gives 533
* - for second voltage, voltmeter gives 5900 millivolt and telemetry gives 904
* So MVOLT_PER_STEP = (5900-3510) / (904-533) = 6.4420
* So OFFSET = 3510 - (533 * 6.4420 ) = 76
Re: Open XVario lipo monitor
1. Yes : AccX, Y and Z should show, the voltage of the 1st cell, the combined voltage of the first 2 cells, and then the total battery voltageaduncan wrote:I have spent some time printing out and studying oXs_config_description.h. An excellent guide, thank you for taking the time to write it. As a newcomer, I confess to being spoiled by the Configurator program, I have not been brave enough yet to edit config.h manually.
Anyway, the soldering iron has been applied, and it works! Now I'm a bit confused with the calibration. I have used the 10K, 33K, 68K, and 120K resistors as suggested in config_description. I have defined Volt1, 2, 3 as A0,A1 and A2. Data sent I used AccX, Y and Z.I copied kalle123's setting from his post as a starting point, then did the voltmeter/telemetry calculations.
The result is not far off, but I have questions.
1. AccX, Y and Z. Should they show, the voltage of the 1st cell, the combined voltage of the first 2 cells, and then the total battery voltage?
2.The Cell and Cells fields. I assume that Cells id total battery voltage, and should be the same as Volt3.
Is the Cell field the cell with the lowest voltage?
3.How do I calculate the divider factor on the voltage screen in Configurator?
To be honest, I don't really need the individual cell voltages, the battery voltage and the lowest cell are the important values. I wanted to see them to check that the lowest cell voltage (cell?) agreed with the lowest cell voltage shown.
Sorry for all the questions, but I've really got my teeth into this now!!!
2. Cells is the total battery and should be the same as Volt3, Cell is the voltage of the lowest cell.
3. I think that the divider voltage in Configurator can be calculated as (R1+R2) / R1; so for VOLT1, it should be (33+10) / 10 = 4.3; for Volt2 it should be (68 + 10)/10 = 7.8 etc.
Please note that if you apply those values, you will probably not get exactly 100% the right voltages in AccX, AccY, ... because there are some tolerances on the resistors, on the internal voltage reference and on the Arduino Analog to Digital Converter.
You can fine tune those values if you follow the intructions in config_description but then you have to edit manually the config file.
Re: Open XVario lipo monitor
Ah, I guessed wrongly. Ok, out with the ohmmeter!! Thank you. This will stand me in good when my current sensors arrive!! Thank you.
Re: Open XVario lipo monitor
Hi,
Bye.
I'm planning to do a complete guide on setting voltage measurements but I need time...jhsa wrote:That should probably go to the configurator google code page as an example??
You should not need to edit oXs_config file directly, the Configurator allows you to set all the parameters, but the oXs_config_description is a good documentationaduncan wrote:I have spent some time printing out and studying oXs_config_description.h. An excellent guide, thank you for taking the time to write it. As a newcomer, I confess to being spoiled by the Configurator program, I have not been brave enough yet to edit config.h manually.
Bye.
Re: Open XVario lipo monitor
Success!! Measured the resistance of all 6 resistors and did the calculation. Put them in the divider factor box and set the offsets to zero. Redid the comparative voltage tests and was very happy. For example if the telemetry screen showed 12.41 volts, the voltmeter gave 12.43. Also the Cell figure did show the lowest cell as measured by the voltmeter.
Now I need to buy some more 3 cell balance sockets and redo the complete wiring neatly. Can't wait for my current sensors to arrive now.
Thanks to everyone who has made this project possible. I have got enormous satisfaction from it. Not only has it worked out a bit cheaper than buying ready made parts, but it is a much neater solution.
Now I need to buy some more 3 cell balance sockets and redo the complete wiring neatly. Can't wait for my current sensors to arrive now.
Thanks to everyone who has made this project possible. I have got enormous satisfaction from it. Not only has it worked out a bit cheaper than buying ready made parts, but it is a much neater solution.
Re: Open XVario lipo monitor
great that you are happy.aduncan wrote:Success!! Measured the resistance of all 6 resistors and did the calculation. Put them in the divider factor box and set the offsets to zero. Redid the comparative voltage tests and was very happy. For example if the telemetry screen showed 12.41 volts, the voltmeter gave 12.43. Also the Cell figure did show the lowest cell as measured by the voltmeter.
Now I need to buy some more 3 cell balance sockets and redo the complete wiring neatly. Can't wait for my current sensors to arrive now.
Thanks to everyone who has made this project possible. I have got enormous satisfaction from it. Not only has it worked out a bit cheaper than buying ready made parts, but it is a much neater solution.
If you play a little with the divider and/or the offset, you could probably even reduce the difference between 12.41 and 12.43 but this has to be validated over the normal range (e.g. from 9.5 Volt up to 12.5 Volt)
Re: Open XVario lipo monitor
Hi,
Can someone please share an example of oXs configuration for LiPo cell monitoring and transmitting individual cell voltage data via S.Port? I'm about to do some tests on 6S LiPo monitoring capabilities of the OxS, but I got confused on the step where I need to define which data needs to be transmitted to the TX.
I use er9x and (if I understand it correctly) it has fields to display cell voltages (V1 ... V6). But so far I couldn't figure out how oXs needs to be configured in order to transmit the data in the "right" fields...
Can someone please share an example of oXs configuration for LiPo cell monitoring and transmitting individual cell voltage data via S.Port? I'm about to do some tests on 6S LiPo monitoring capabilities of the OxS, but I got confused on the step where I need to define which data needs to be transmitted to the TX.
I use er9x and (if I understand it correctly) it has fields to display cell voltages (V1 ... V6). But so far I couldn't figure out how oXs needs to be configured in order to transmit the data in the "right" fields...
Re: Open XVario lipo monitor
In order to provide you a config file, I would like to know :
- the analog pins you are using
- the values of the resistors you are using for the dividers.
- if you are using the internal voltage reference or not.
If you send the values I can send you back a file.
Here already a draft of config file (without vario)
On the Tx side, on openTx there is a screen where tx displays the voltage of each cell and the total.
It is also possible to display the lowest cell and the total voltage on a customs screen if you select the telemetry field "Cell" (for the lowest cell) and "Cells" for the total.
I presume that something similar exists for your Tx.
- the analog pins you are using
- the values of the resistors you are using for the dividers.
- if you are using the internal voltage reference or not.
If you send the values I can send you back a file.
Here already a draft of config file (without vario)
On the Tx side, on openTx there is a screen where tx displays the voltage of each cell and the total.
It is also possible to display the lowest cell and the total voltage on a customs screen if you select the telemetry field "Cell" (for the lowest cell) and "Cells" for the total.
I presume that something similar exists for your Tx.
Code: Select all
#ifndef OXS_CONFIG_h
#define OXS_CONFIG_h
#define SENSOR_ID 0x1B //0x1B
#define PIN_SERIALTX 4 // The pin which transmits the serial data to the FrSky telemetry receiver
// --------- 6 - Voltages & Current sensor settings ---------
// ***** 6.1 - Voltage Reference selection (VCC or 1.1V internal) *****
#define USE_INTERNAL_REFERENCE
// ***** 6.2 - Voltages Analog Pins *****
#define PIN_VOLTAGE_1 0
#define PIN_VOLTAGE_2 1
#define PIN_VOLTAGE_3 2
#define PIN_VOLTAGE_4 3
#define PIN_VOLTAGE_5 4
#define PIN_VOLTAGE_6 5
// ***** 6.3 - Voltage measurements calibration parameters *****
#define OFFSET_1 0
#define MVOLT_PER_STEP_1 4.89
#define OFFSET_2 0
#define MVOLT_PER_STEP_2 10.1
#define OFFSET_3 0
#define MVOLT_PER_STEP_3 15.1
#define OFFSET_4 0
#define MVOLT_PER_STEP_4 20
#define OFFSET_5 0
#define MVOLT_PER_STEP_5 25
#define OFFSET_6 0
#define MVOLT_PER_STEP_6 30
// ***** 6.4 - Number of Lipo cells to measure (and transmit to Tx) *****
#define NUMBEROFCELLS 6 // keep this line but set value to 0 (zero) if you do not want to transmit cell voltage.
// --------- 9 - Data to transmit ---------
// ***** 9.1 - Frsky data *****
#define SETUP_FRSKY_DATA_TO_SEND \
DEFAULTFIELD , CELLS_1_2 , 1 , 1 , 0 ,\
DEFAULTFIELD , CELLS_3_4 , 1 , 1 , 0 ,\
DEFAULTFIELD , CELLS_5_6 , 1 , 1 , 0
#endif// End define OXS_CONFIG_h
Re: Open XVario lipo monitor
Sent you a PM in order not to spam this thread with wrong config examples...
Re: Open XVario lipo monitor
Don't you think andrewju, others could learn from your requests? Don't find it fair to send PMs, so others can not answer!andrewju wrote:Sent you a PM in order not to spam this thread with wrong config examples...
br KH, who "spams" her from time to time
Re: Open XVario lipo monitor
who else? MEEEEEE... of course
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
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
Re: Open XVario lipo monitor
Na João. That are only our small conversations
KH
KH
Re: Open XVario lipo monitor
Relax Gents, I'll share my findings ASAP!
For now there's no solution - but that's mainly because I have just burned my X8R and it's already too late here to go to the garage to get another one...
For now there's no solution - but that's mainly because I have just burned my X8R and it's already too late here to go to the garage to get another one...
Re: Open XVario lipo monitor
Update:
The issue was tracked down to a stupid wiring mistake... The S.Port data cable was connected to Port 5 of the Arduino instead of Port 4. No wonder I had no telemetry data displayed in er9x...
The oXs settings were just like in mstrens' example, and once the wiring was fixed - they worked great, indeed!
The issue was tracked down to a stupid wiring mistake... The S.Port data cable was connected to Port 5 of the Arduino instead of Port 4. No wonder I had no telemetry data displayed in er9x...
The oXs settings were just like in mstrens' example, and once the wiring was fixed - they worked great, indeed!
Re: Open XVario lipo monitor
That happens to me all the time.. great that you found the problem..
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
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
Re: Open XVario lipo monitor
Hi, hopefully someone has an idea!
I have the problem that on my Taranis I see only the first of 3 cells displayed
My guess is that the problem could be my uncommon order of the pins: A6,A7,A0 ?
I'm using the 4.0 from github from today. Taranis OpenTX 2.0.17 with X8R SPort.
This is my config:
Interesting, I've enabled DEBUGNEWVALUE and I get for every of the 3 cells the right value!
But when I enable DEBUGCELLCALCULATION I see only for First Cell an number for calculation, but for Second Cell is 0 and so on! So Cell 2 and Cell 3 are not calculated!
Why can that be? I assume this is the reason why I see only one cell in Taranis or?
I have the problem that on my Taranis I see only the first of 3 cells displayed
My guess is that the problem could be my uncommon order of the pins: A6,A7,A0 ?
I'm using the 4.0 from github from today. Taranis OpenTX 2.0.17 with X8R SPort.
This is my config:
Code: Select all
// ***** 6.1 - Voltage Reference selection (VCC or 1.1V internal) *****
//#define USE_INTERNAL_REFERENCE
// ***** 6.2 - Voltages Analog Pins *****
#define PIN_VOLTAGE_1 6
#define PIN_VOLTAGE_2 7
#define PIN_VOLTAGE_3 0
// ***** 6.3 - Voltage measurements calibration parameters *****
#define OFFSET_1 0
#define MVOLT_PER_STEP_1 4.898
#define OFFSET_2 0
#define MVOLT_PER_STEP_2 4.896
#define OFFSET_3 0
#define MVOLT_PER_STEP_3 4.912
// ***** 6.4 - Number of Lipo cells to measure (and transmit to Tx) *****
#define NUMBEROFCELLS 3 // keep this line but set value to 0 (zero) if you do not want to transmit cell voltage.
#define SETUP_FRSKY_DATA_TO_SEND \
DEFAULTFIELD , ALTIMETER , 1 , 1 , 0 , \
DEFAULTFIELD , VERTICAL_SPEED , 1 , 1 , 0 , \
DEFAULTFIELD , CELLS_1_2 , 1 , 1 , 0 , \
DEFAULTFIELD , CELLS_3_4 , 1 , 1 , 0 , \
T1 , ALT_OVER_10_SEC , 1 , 1 , 0 , \
T2 , SENSITIVITY , 1 , 1 , 0
But when I enable DEBUGCELLCALCULATION I see only for First Cell an number for calculation, but for Second Cell is 0 and so on! So Cell 2 and Cell 3 are not calculated!
Why can that be? I assume this is the reason why I see only one cell in Taranis or?
Re: Open XVario lipo monitor
The uncommon order of the pins should not matter.
Your config seems ok. Still it seems that you use the same resistors for your 3 voltage dividers because the parameters MVOLTx_PER_STEP are nearly the same.
This is not optimal in order to get the best accuracy.
You could expect a better accurary if (for each voltage measurement) you use a voltage divider that provide a max voltage on arduino analog pin just below Vcc.
Anyway, this does not explain why you get a voltage only for the first cell.
Could you send me the 3 values (voltages) that you get when you enabled DEBUGNEWVALUE.
Please note that OXS calculates the voltage of each cell by difference between 2 voltages (e.g. cell 2 is the difference between volt2 and volt1).
When oXS perform this calculation, it makes some checks: e.g. volt2 must be bigger than volt1 by more than 0.5 volt. If check is not OK, cell voltage is forced to 0.
If you want you could change the function calculateCell in order to get more data
Current code:
Code in order to get more data when DEBUGCELLCALCULATIONis activated
Your config seems ok. Still it seems that you use the same resistors for your 3 voltage dividers because the parameters MVOLTx_PER_STEP are nearly the same.
This is not optimal in order to get the best accuracy.
You could expect a better accurary if (for each voltage measurement) you use a voltage divider that provide a max voltage on arduino analog pin just below Vcc.
Anyway, this does not explain why you get a voltage only for the first cell.
Could you send me the 3 values (voltages) that you get when you enabled DEBUGNEWVALUE.
Please note that OXS calculates the voltage of each cell by difference between 2 voltages (e.g. cell 2 is the difference between volt2 and volt1).
When oXS perform this calculation, it makes some checks: e.g. volt2 must be bigger than volt1 by more than 0.5 volt. If check is not OK, cell voltage is forced to 0.
If you want you could change the function calculateCell in order to get more data
Current code:
Code: Select all
uint32_t OXS_VOLTAGE::calculateCell(int32_t V0 , int32_t V1 , int32_t V2 , int cellId) {
int32_t cell_1 ;
int32_t cell_2 ;
if (V0 < 500) V0 = 0 ;
if (V1 < 500) V1 = 0 ;
if (V2 < 500) V2 = 0 ;
cell_1= V1 - V0 ;
cell_2= V2 - V1 ;
if (cell_1 < 500) cell_1 = 0 ;
if (cell_2 < 500) cell_2 = 0 ;
cell_1 = (cell_1 >> 1) & 0xFFF ; //Frsky expects that the value are divided by 2
cell_2 = (cell_2 >> 1) & 0xFFF ; //Frsky expects that the value are divided by 2
#ifdef DEBUGCELLCALCULATION
printer->print("Cell calculation for cellId ");
printer->print(cellId) ;
printer->print(" Frist Cell = ");
printer->print(cell_1) ;
printer->print(" Second Cell = ");
printer->print(cell_2) ;
printer->print(" Frsky value = ");
printer->println( (cell_2 << 20) | (cell_1 << 8) | ( ( (int32_t) NUMBEROFCELLS)<<4 ) | (int32_t) cellId , HEX );
#endif
return (cell_2 << 20) | (cell_1 << 8) | ( ( (int32_t) NUMBEROFCELLS)<<4 ) | (int32_t) cellId ;
}
Code in order to get more data when DEBUGCELLCALCULATIONis activated
Code: Select all
uint32_t OXS_VOLTAGE::calculateCell(int32_t V0 , int32_t V1 , int32_t V2 , int cellId) {
int32_t cell_1 ;
int32_t cell_2 ;
if (V0 < 500) V0 = 0 ;
if (V1 < 500) V1 = 0 ;
if (V2 < 500) V2 = 0 ;
cell_1= V1 - V0 ;
cell_2= V2 - V1 ;
if (cell_1 < 500) cell_1 = 0 ;
if (cell_2 < 500) cell_2 = 0 ;
cell_1 = (cell_1 >> 1) & 0xFFF ; //Frsky expects that the value are divided by 2
cell_2 = (cell_2 >> 1) & 0xFFF ; //Frsky expects that the value are divided by 2
#ifdef DEBUGCELLCALCULATION
printer->print("Cell calculation for cellId ");
printer->print(cellId) ;
printer->print(" V0= ");
printer->print(V0) ;
printer->print(" V1= ");
printer->print(V1) ;
printer->print(" V2= ");
printer->print(V2) ;
printer->print(" Frist Cell = ");
printer->print(cell_1) ;
printer->print(" Second Cell = ");
printer->print(cell_2) ;
printer->print(" Frsky value = ");
printer->println( (cell_2 << 20) | (cell_1 << 8) | ( ( (int32_t) NUMBEROFCELLS)<<4 ) | (int32_t) cellId , HEX );
#endif
return (cell_2 << 20) | (cell_1 << 8) | ( ( (int32_t) NUMBEROFCELLS)<<4 ) | (int32_t) cellId ;
}
Re: Open XVario lipo monitor
Thank you very much for your help!
your excellent explanation made aware of the mistake I have done.
Somehow I have understood that the calculation is done before the mvolt_per_step multiplier...
My voltage divider are:
Cell 1 direct
Cell 2 = 10k/10k
Cell 3 = 20k/10k
So one more thanks for explanation!
Just as an idea, it would be valuable to habe a how to for voltage reading because it's hard to find good examples.
your excellent explanation made aware of the mistake I have done.
Somehow I have understood that the calculation is done before the mvolt_per_step multiplier...
My voltage divider are:
Cell 1 direct
Cell 2 = 10k/10k
Cell 3 = 20k/10k
with my wrong assumption it reads the same voltage thus skipping because of this check.volt2 must be bigger than volt1 by more than 0.5 volt. If check is not OK, cell voltage is forced to 0.
So one more thanks for explanation!
Just as an idea, it would be valuable to habe a how to for voltage reading because it's hard to find good examples.
Re: Open XVario lipo monitor
I have a similar problem to aduncan for which I have struggled unsuccessfully to find a solution. When sending voltages from a 3 cell lipo to my Taranis I am only able to send 2 of the 3 cell voltages, the third is always a zero voltage. I can change the zero cell by changing the voltage input pins but one voltage is always zero. If I configure openxsensor to sense a fourth cell then it sends cell 4 as zero and one other cell as zero.
I have attached my config file in the hope that someone more skilled than myself can find what I am doing wrong.
Current situation
OpenXsensor v2.5 Configurator v2.1 D8R 11 (both plus and not plus) Taranis (OpenTx V 2.0.9.2 )
3 cell lipo; internal reference voltage; voltage dividers 10k/32k, 10k/68k, 10k/120k
I have attached my config file in the hope that someone more skilled than myself can find what I am doing wrong.
Current situation
OpenXsensor v2.5 Configurator v2.1 D8R 11 (both plus and not plus) Taranis (OpenTx V 2.0.9.2 )
3 cell lipo; internal reference voltage; voltage dividers 10k/32k, 10k/68k, 10k/120k
- Attachments
-
- oXs_config.zip
- (2 KiB) Downloaded 208 times
Re: Open XVario lipo monitor
I posted yesterday but haven't as yet been released by moderator. My problem was that i could only receive 2 of the 3 battery voltages sent regardless of my pin configurations. I am pleased (well extremely pleased actually) to report that using v4 of openxsensor my problem was solved
My congratulations to the developers of this initiative. I have been using the variometer for a few weeks now and continue to be amazed with its effectiveness. Thanks again
My congratulations to the developers of this initiative. I have been using the variometer for a few weeks now and continue to be amazed with its effectiveness. Thanks again
-
- Posts: 241
- Joined: Tue Jan 15, 2013 9:41 pm
- Country: -
Re: Open XVario lipo monitor
Greetings to all, I have been away for a couple of years! Life gets in the way of hobbies sometimes. However I am getting caught up here and it's good to be back. I upgraded my Taranis FW to v2.1.7 and I see there is a configurator app now for oXs. Wow things have come a long way indeed and my thanks to all who have been working so hard and sharing so generously. Yes I have again donated. So I have been following along and set up last night pretty much as described here. I am awaiting current sensors to connect to A3, I have configured oXs to output V1,2,3 as Acc X,Y,Z and I don't have any dividers yet but was just jumping the A0,1,2 pins to vcc and saw the telem values change on Taranis. However has anyone messed with this on the telemetry in v.2.1.7? It is a little different. I created calculated sensor variables for C1,C2,C3 select cels1 as source for C1 and C2 and in the drop down box selected cell1 and cell2 respectively. For C3 I used cels2 for source and on the drop down box clicked cell3. I see values on the Taranis so I assume this works once I get proper dividers and calibration going, but reading the above I'm confused about the comments regarding Cell and cells. I read that Cells is the total pack voltage and should be the same as V3 and cell should report the lowest cell. Does that still apply in v2.1.7? I can't seem to access those variables. Current input on A3 also responds but I am a bit confused with regard to consumption. oXs can calculate it and I have tried to configure that and send as fuel but again 2.1.7 also can calculate consumption. I have redefined fuel as mAH and I see that it integrates as I jump A3 to vcc. I have configured a calculated sensor variable I call Csp and set it for consumption using he discovered current sensor sent by oXs under the default setting and that also seems to integrate although the numbers are all meaningless at this point without any scaling and cal. Which is the best way to go here?
Joe
Joe