Individual cell voltages.openTx 2.2

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
Chrisbott
Posts: 6
Joined: Sun Aug 06, 2017 3:43 pm
Country: -

Individual cell voltages.openTx 2.2

Post by Chrisbott » Sun Aug 06, 2017 6:53 pm

Hi, new here, hope you don't mind looking at my question?

I have built a few OpenXsensors simply to report Current and VFas. They work superbly.

I'm now trying to measure individual cell volts as well but OpenTx doesn't discover any extra sensors. I'm using OpenTx 2.2 on a Horus.

I can configure so that voltages A3 and A4 are reported but that's not what I want.

Should I be seeing a "Cells" sensor, like the FrSky version?
Any ideas where I'm going wrong?

Thanks.

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

Re: Individual cell voltages.openTx 2.2

Post by mstrens » Mon Aug 07, 2017 6:47 am

Normally you should get "Cells" sensor like the Frsky version.
In order to get individual cells voltage, you have to take care that:
- the line "#define NUMBEROFCELLS " is uncommented and that you assign it a value equal to the number of cells to measure (e.g. 2); when the value is 0, oXs does not calculate/transmit individual cell voltage.
- in line "#define PIN_VOLTAGE " you set as first value the pin connected to first cell and as second the pin connected to the second cell
- you have to connect a 2s lipo (so both pins get simultanously a voltage in the expected range because individual cell voltages are transmitted only if there are more than 0.5 V (and probably less than 5V))

Note : if you use A4 for cell measurement, take care not to activate in your config a sensor that should be connected to the I2C bus (like a baro, an airspeed, an external Adc) because I2C uses A4 and A5.

If this does not help, please put here your config files and report the values that you get for Volt_1 and Volt_2.

PS : not sure but perhaps you have also to configure some calculated fields on TX side when using openTx 2.2.x. Someone else could confirm or infirm.

Chrisbott
Posts: 6
Joined: Sun Aug 06, 2017 3:43 pm
Country: -

Re: Individual cell voltages.openTx 2.2

Post by Chrisbott » Mon Aug 07, 2017 9:35 am

Many thanks. There's plenty of things there to check. From memory I think I had most things right, but will report back after another session on it later today.

Chrisbott
Posts: 6
Joined: Sun Aug 06, 2017 3:43 pm
Country: -

Re: Individual cell voltages.openTx 2.2

Post by Chrisbott » Mon Aug 07, 2017 5:09 pm

Well you certainly cracked it, and saved me some time.

I had all settings correct, but I'd only tried it with a bare Arduino board just to check before I made the resistor ladder and added the current sensor.
I've now made the complete sensor and I get a "Cells" sensor detected now, but only when a lipo is connected to the balance connector. That's actually a pretty neat trick.

In OpenTx 2.2 you then have to add calculated sensors. You can have each cell, and the total, and the lowest, highest and delta. (Or just the ones you want).

Anyway, many thanks for the steer. I have other questions but will save for another post.

Chrisbott
Posts: 6
Joined: Sun Aug 06, 2017 3:43 pm
Country: -

Re: Individual cell voltages.openTx 2.2

Post by Chrisbott » Mon Aug 07, 2017 7:54 pm

OK further questions if that's OK?

1) I've used a 3.3v 8mhz Arduino nano pro so that I have supply headroom from a 5v BEC or 4.8v NiMh. I'm using the on board 3.3v regulator as a V reference and to supply the ACS758 current sensor. Are there any issues with this approach? I see that this limits the max current reading to whatever 3.3v represents, but I'm ok with that.

2) To measure individual lipo volts, I need to set the number of cells at the time of programming. Would it ever be possible for the unit to sense the number of cells attached, and set it's self up accordingly?


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

Re: Individual cell voltages.openTx 2.2

Post by mstrens » Mon Aug 07, 2017 8:10 pm

1) I do not see any issue with your aproach.

2) In the config file, you can use a set up that declare for example 4 voltage pins and you can declare that there are 4 cells. Then if you connect only a 2S lipo (on the first 2 pins), oXs will work and transmit only 2 cell voltages. If you connect a 3S, it will transmit 3 cell voltages...
So you can use the same oXs without changing the programming for different number of cells.

Chrisbott
Posts: 6
Joined: Sun Aug 06, 2017 3:43 pm
Country: -

Re: Individual cell voltages.openTx 2.2

Post by Chrisbott » Mon Aug 07, 2017 8:34 pm

Oh! Excellent. You guys think of everything.

Can't thank you enough. :D :D

Chrisbott
Posts: 6
Joined: Sun Aug 06, 2017 3:43 pm
Country: -

Re: Individual cell voltages.openTx 2.2

Post by Chrisbott » Tue Aug 08, 2017 10:13 pm

Update.
Running the ACS758 at 3.3v means it's output voltage is lower per Amp. So config.h needs a tweak to accommodate that. The good news is that this means the 100A one still measures up to 100A.

One minor downside is that the chips are factory trimmed with a 5v supply. So when using 3.3v, the offset voltage for zero amps is slightly different for every chip. This means each one needs measuring and tweaking in to config.h too.

Otherwise things appear to work a treat.

Post Reply

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

Who is online

Users browsing this forum: No registered users and 4 guests