[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3916)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3916)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4792: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3916)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4793: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3916)
AutoQuad Forum • View topic - Wrong battery cell count and compensation

Wrong battery cell count and compensation

Info and discussion about the original AQ v6 flight controller

Wrong battery cell count and compensation

Postby GoFaster » Tue Sep 11, 2012 10:10 pm

My 4S packs keep getting detected as 3S. Off the charger, the packs measure 16.8V @ 4.2V/cell. This is well above the 12.8V threshold in the code to be detected as 3S. Firmware is v6.6r21.

Also there is nifty compensation in the code to hold hover at midstick as the pack discharges. Is there a documented process to profile a pack discharge curve for the AQ? I can't reverse engineer it from looking at the default CRV values.

Thanks,
- Felix
Vin.png
GoFaster
 
Posts: 355
Joined: Tue Jul 03, 2012 1:20 pm
Location: Connecticut, USA

Re: Wrong battery cell count and compensation

Postby bn999 » Wed Sep 12, 2012 5:33 am

There is a ground program called "batCal.cc" in the repo. It takes a flight log file and estimates the CRV parameters. The logged flight should be a constant hover with little disturbance from a freshly charged battery all the way down to a voltage below the lowest you would want to fly with. Best to do it indoors if there is wind outside.

I don't know why your cell count detection is wrong. If you hook up a SWD debug link, you could check the adcData.vIn variable as it goes through the cell parsing code in adc.c.
bn999
 
Posts: 1559
Joined: Thu Jun 21, 2012 11:40 pm

Re: Wrong battery cell count and compensation

Postby GoFaster » Wed Sep 12, 2012 1:17 pm

GoFaster
 
Posts: 355
Joined: Tue Jul 03, 2012 1:20 pm
Location: Connecticut, USA

Re: Wrong battery cell count and compensation

Postby Kisssys » Wed Sep 12, 2012 1:47 pm

Felix,

Plug in a fresh battery and do a short log.

Plot LOG_VOLTAGE7 and see what you get. Anything above 15 volts shows 3.3 on my board's. Divide the value by .22 and it should be close to your battery voltage.
Steve
Kisssys
Kisssys
 
Posts: 1340
Joined: Sat Jun 23, 2012 9:23 pm

Re: Wrong battery cell count and compensation

Postby GoFaster » Wed Sep 12, 2012 4:14 pm

Hi Steve -

Very odd, I logged 4S, 3S and 2S packs and everything is detected as 3S.
I've verified that the voltage at the AQ power input is indeed pack voltage.

4S pack - initial voltage 16.74V
Initial LOG_VOLTAGE7 approx 2.459
4S Voltage7.png
4S pack - LOG_VOLTAGE7

4S Vin.png
4S pack - LOG_ADC_VIN


3S pack - initial voltage 12.56V
Initial LOG_VOLTAGE7 approx 2.453
3S Voltage7.png
3S pack - LOG_VOLTAGE7

3S Vin.png
3S pack - LOG_ADC_VIN


2S pack - initial voltage 8.35V
Initlal LOG_VOLTAGE7 approx 2.428
2S Voltage7.png
2S pack - LOG_VOLTAGE7

2S Vin.png
2S pack - LOG_ADC_VIN


Can someone with a board from the public beta batch who is running more than 3S please take a look at your LOG_VIN and LOG_VOLTAGE7?

Thanks,
- Felix
GoFaster
 
Posts: 355
Joined: Tue Jul 03, 2012 1:20 pm
Location: Connecticut, USA

Re: Wrong battery cell count and compensation

Postby epyonxero » Wed Sep 12, 2012 6:35 pm

Just took a look at the logs from a flight I did last night. Started with a full 4S 5000mA battery. Anything above 15v always shows about 14.9 v on the GCS but it looks accurate below 14.9
Attachments
V7.png
Voltage 7
VIN.png
VIN Graph
epyonxero
 
Posts: 193
Joined: Thu Aug 30, 2012 4:09 pm

Re: Wrong battery cell count and compensation

Postby GoFaster » Wed Sep 12, 2012 7:16 pm

@epyonxero
Thank you very much for taking the time to look and respond!

@Anyone
Are there any test points or component locations where I can probe to see what the voltages are before and after the divider? Also the pin# on the MCU where Vin is sampled?
GoFaster
 
Posts: 355
Joined: Tue Jul 03, 2012 1:20 pm
Location: Connecticut, USA

Re: Wrong battery cell count and compensation

Postby Kisssys » Wed Sep 12, 2012 7:45 pm

epyonxero

The analog input can't read above 15 volts with the current implementation so what your last post is 100 percent correct with a 4 cell battery. After it got below 15volts it gave a true representation.

The Recom regulators onboard are only good to 18 volts so it has not been an issue. We are aware of it and some changes to make it 5 cell compatible are in the works.

This should not effect detecting of a 4 cell battery.

GoFaster

You have a board problem, it could be the voltage divider for the voltage in made up of R3 R4 or your reference voltage is not 3.3volts.

If your calibration values come out close to what you've seen posted then I would guess it to be the voltage divider. If your not very comfortable pokeing around you might see about a board swap. If you find R3 And R4 next to the I2C connector the picture will show you where to measure. If you read Vin on the Vin marked side of R4 you should get .22 times the value on the LOG_VOLTAGE7 marked side.

Do you have a diode in series with the battery to prevent reverse voltage that could be causing a problem?
Attachments
VoltageDivider.jpg
VoltageDivider.jpg (122.38 KiB) Viewed 12085 times
Steve
Kisssys
Kisssys
 
Posts: 1340
Joined: Sat Jun 23, 2012 9:23 pm

Re: Wrong battery cell count and compensation

Postby GoFaster » Wed Sep 12, 2012 8:34 pm

Steve, you are right. It is a board problem. I'm missing R3, the 1.3K(?) resistor half of the divider.
missingR3.JPG
missingR3.JPG (86.96 KiB) Viewed 12078 times

Measured:
LOG_VOLTAGE7 = 16.52
VIN = 9.37

Do you happen to know (or BillN/Jussi) the Digikey or Mouser part number for this resistor on the public beta boards? I don't know the spec'ed precision and type or even the correct SMD size.
Your pic has R3 as a 138, so R4 on your board would be a 478? My R4 is a 472.

Thanks again for your help Steve.
GoFaster
 
Posts: 355
Joined: Tue Jul 03, 2012 1:20 pm
Location: Connecticut, USA

Re: Wrong battery cell count and compensation

Postby Kisssys » Wed Sep 12, 2012 8:45 pm

Here ya go. Should be a easy fix.

311-1.33KHRCT-ND
Steve
Kisssys
Kisssys
 
Posts: 1340
Joined: Sat Jun 23, 2012 9:23 pm

Next

Return to AutoQuad 6 Flight Controller

Who is online

Users browsing this forum: No registered users and 54 guests