6S with Temperature

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
mattuk
Posts: 2
Joined: Thu Jul 16, 2020 8:55 am
Country: -

6S with Temperature

Post by mattuk »

2 parts to this question really...

1) My Arduino has 8 analogue inputs (A0-A7). If I use 6 of them for my 6S cell monitoring and another 1 for current monitoring, this leaves me with 1 more that I'd like to use for temperature monitoring. Is it possible to do this in a nice way as it seems the configuration files are only setup to read 6 voltages?

2) My (nasty) solution so far has been to hack the analogue reading of a thermistor into the RPM section of the main openXsensor.ino as RPM seems quite an easy section to modify:

Code: Select all

#ifdef MEASURE_RPM
  if (millis() > ( lastRpmMillis + 200) ){  // allow transmission of RPM only once every 200 msec
        if (RpmSet == true) {               // rpm is set 
            RpmSet = false ;
        } else {
            RpmValue = 0 ;
        }
        //sport_rpm.value = RpmValue ; //------------------------Comment this out so RPM isn't populated with actual RPM!
        sport_rpm.value = 25 ;   //------------------------Add thermistor code here (value of 25 now reported on the tx as a test, which seems to work...)
        sport_rpm.available = true ;    
        lastRpmMillis = millis() ;
However with this method my Taranis is reporting the temperature as RPM and although I can charge this on the Taranis I'd like to change it in the code really. I've tried changing this line in the advanced configuration files but the Taranis still seems to see the temperature as RPM:

Code: Select all

#define         DATA_ID_RPM    0xE4
Does anyone know what I'd have to change to get this 'RPM' to show up as a temperature by default?

Thanks

Matt

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

Re: 6S with Temperature

Post by mstrens »

Please note that the voltages of the 6th cell will perhaps not be very accurate because it will be calculated substracting total 5 cells voltage from total 6 cells voltage. A small error on total 5 cells voltage and on 6 cells voltage will have a much greater impact on the difference.

In order to get the temperature on the Tx, you can copy the value (temperature) you calculated into a field named "test1.value" and set "test1.available" to true. Then in the oXs_config_basic.h file, you can uncomment the line "#define T1_SOURCE TEST_1"
mattuk
Posts: 2
Joined: Thu Jul 16, 2020 8:55 am
Country: -

Re: 6S with Temperature

Post by mattuk »

Thank you, that did it! I can now monitor all lipo voltages, current draw from the lipo and the temperature of the lipo :D :D
Hopefully cell 6 will be close enough, I'll see how I get on.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RE: Re: 6S with Temperature

Post by jhsa »


mstrens wrote:Please note that the voltages of the 6th cell will perhaps not be very accurate because it will be calculated substracting total 5 cells voltage from total 6 cells voltage. A small error on total 5 cells voltage and on 6 cells voltage will have a much greater impact on the difference.
Hi Michel, I have been away from RC electronic projects for a little while :) and forgot how do we get a more accurate voltage reading? Some special ADC chip? If so, which one?
Sorry about the question, but I cannot check the oXs code at the moment, as I don't have access to my PC.
Thanks

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: 6S with Temperature

Post by mstrens »

Measuring the total voltage of a 6S should not be an issue at all.
Measuring the voltage of each cell will probably be less accurate on the last cells because the cell voltage is calculated based on the difference of e.g. 5th and 6th cells. So a small error on a value can give a bigger error (in %) on the difference.

oXs supports an external cheap ADC (the ADS1115) which is more accurate than the internal ADC. Still it measures only 4 channels if I remember well.

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

Re: 6S with Temperature

Post by jhsa »

Thanks.. what about two ADC chips? Could they read up to 8 cells? Are they i2c?

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: 6S with Temperature

Post by mstrens »

They are I2C so in theory it could but it is currently not supported by oXs ( and there is no real interest).
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: 6S with Temperature

Post by jhsa »

Well, I think there would be interest for models running on 6s as it is much more accurate. Also multiple sensors would be good for models with more than 1 battery. At the moment I am building a model that will probably have a battery powering each of the 2 motors.. So, two batteries. I still didn't think how I am going to diaplay both battery voltages, but 2 sensors would be nice as I would like to detect the lowest cell on both batteries. And I think I could probably configure that in ErskyTX..

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

Post Reply

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