Page 1 of 1

VBAT incorrect value

Posted: Sun Apr 01, 2012 10:16 pm
by oli
Hello,

today after switching to MultiWii 2.0 I discovered that VBAT readings are not correct anymore, or rather not correct after some flight time. I'm getting the VBAT reported via telemetry and when I start, VBAT says 12,6V which is totally correct after flying around for a couple of minutes it still reports 12,6V and so on. After landing the QuadCopter I unplugged the VBAT connector, replugged it again and VBAT reads 10,8V. So up in the air, couple of minutes later VBAT reads 12,6V, so back to ground, unplug, replug, and here we are 10,4V for VBAT. Up in the sky, couple of minutes later 12,6V on VBAT, and so on and on and on.

With MultiWii 1.9 on a ProMini I haven't had such a failure, problem arose after switching to MultiWii 2.0 on a Mega2560 board.

Thanks for any help

Re: VBAT incorrect value

Posted: Sun Apr 01, 2012 10:52 pm
by fr3d
another mw 2.0 bug :(
I have seen it this afternoon

Re: VBAT incorrect value

Posted: Mon Apr 02, 2012 6:44 am
by Alexinparis
fr3d wrote:another mw 2.0 bug :(
I have seen it this afternoon

Could you try to remove this line ?

Code: Select all

  ADCSRA |= _BV(ADPS2) ; ADCSRA &= ~_BV(ADPS1); ADCSRA &= ~_BV(ADPS0); // this speeds up analogRead without loosing too much resolution: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1208715493/11

Re: VBAT incorrect value

Posted: Mon Apr 02, 2012 11:15 am
by oli
Thanks Alex, will try it this weekend and will let how know how it works.

Re: VBAT incorrect value

Posted: Sun Apr 08, 2012 4:45 pm
by jevermeister
I did my first outside testflights today and took a close look on this issue.

I use a
QuadX
Flyduino v2.1
BMA020,WMP,BMP085.HCM5883L...

I connected a LIPOalarm while flying so I can monitor the lipo and will be noticed if the Voltage drops below 10V.
I configured my Multiwii Lipoalarm to beep the buzzer once every second at 10,5V and twice every second a 10V and three times if below 9.9V.

After 5 minutes of flight the Lipoalarm started to beep and so does the buzzer connected to the flyduino,
everything is working like it should for me.I tested this twice with two 2200mAh Lipos.

--> no problem here
Does anyone have a conclusion what is causing this issue and why some people do no have these problems?

Nils

Re: VBAT incorrect value

Posted: Mon Apr 09, 2012 1:09 pm
by oli
I had the chance to test it yesterday with the solution Alex described, nothing changed so far. I reflashed the Mega2560 board with the original MW2.0 and my telemetry extension and it worked without any problem, so I think that it's not a MW2.0 problem, maybe one of my cables is the problem. I will investigate this problem further.

oli

Re: VBAT incorrect value

Posted: Wed Apr 11, 2012 10:18 pm
by Loosi
Hi!

I´am having problems with VBat too,
can someone verify my calculations please?
some calculations (12.6V in vbatscale must be 12.4V, wrote it wrong but typed it right into the calculator ;) so the values should be ok)
some calculations (12.6V in vbatscale must be 12.4V, wrote it wrong but typed it right into the calculator ;) so the values should be ok)

if they are correct than i have no idea why it isnt working for me :-/ its showing up crazy voltages
wrong voltage :-/ (debug4 is vbat)
wrong voltage :-/ (debug4 is vbat)


I veryfied the voltages 12,4Volt before and 4,95Volt after the voltage divider (directly on Pin A3), so the hardware seems to be ok.
Tried alex´s workaround too, without success

Re: VBAT incorrect value

Posted: Wed Apr 11, 2012 10:30 pm
by Hamburger
Can you try with a variable power supply?

Re: VBAT incorrect value

Posted: Wed Apr 11, 2012 10:40 pm
by Loosi
Hamburger wrote:Can you try with a variable power supply?


already done, same result :-( waiting for some parts from reichelt that should arrive tomorrow, than i will try some other stuff, but currently i´am out of ideas what i´am doing wrong :(

Re: VBAT incorrect value

Posted: Wed Apr 11, 2012 10:46 pm
by djrm
I think you will find that the 5v power supply to the processor is used as reference voltage for the ADC conversion, if you supply the FC with anything other than exactly 5 volts then the ADC measurement will be inaccurate by a proportional amount. So check the supply voltage. hth David.

Re: VBAT incorrect value

Posted: Wed Apr 11, 2012 10:58 pm
by PatrikE
You can test the Vbatscale tool in my Online configurator.
http://panoramaic.se/configurator/

Meassure battery over U1 & U2
Meassure value over R2
Fill the values in the Popupboxes.

Re: VBAT incorrect value

Posted: Thu Apr 12, 2012 4:55 pm
by Loosi
djrm wrote:I think you will find that the 5v power supply to the processor is used as reference voltage for the ADC conversion, if you supply the FC with anything other than exactly 5 volts then the ADC measurement will be inaccurate by a proportional amount. So check the supply voltage. hth David.


YES, your the man ;) that was it, it was only 4.6Volt (dont understand why, cause the vcc is 5Volt), now i´am using a external LM7805 to supply Aref. Now after some try and error i have found the correct vbatscale ;)
calculating is a nice thing, but caused by the tolerances and wires the calculated vbatscale will never be the right, so i figured out :twisted:
would be great if the vbatscale would be stored to the eeprom so we can change it in the gui, i think that will make this much easyer and you dont have to re-compile and upload it for changing only this 3 digit value ;)

thank you very much

daniel

Re: VBAT incorrect value

Posted: Thu Apr 12, 2012 6:33 pm
by jevermeister
Loosi wrote:
djrm wrote:would be great if the vbatscale would be stored to the eeprom so we can change it in the gui, i think that will make this much easyer and you dont have to re-compile and upload it for changing only this 3 digit value


Alex is working on a new serial protocoll - wait and see...

Re: VBAT incorrect value

Posted: Sat May 19, 2012 8:37 pm
by hexjump
oli wrote:Hello,

today after switching to MultiWii 2.0 I discovered that VBAT readings are not correct anymore, or rather not correct after some flight time. I'm getting the VBAT reported via telemetry and when I start, VBAT says 12,6V which is totally correct after flying around for a couple of minutes it still reports 12,6V and so on. After landing the QuadCopter I unplugged the VBAT connector, replugged it again and VBAT reads 10,8V. So up in the air, couple of minutes later VBAT reads 12,6V, so back to ground, unplug, replug, and here we are 10,4V for VBAT. Up in the sky, couple of minutes later 12,6V on VBAT, and so on and on and on.

With MultiWii 1.9 on a ProMini I haven't had such a failure, problem arose after switching to MultiWii 2.0 on a Mega2560 board.

Thanks for any help


I got the same problem. If I use a telemetry to read the VBAT value, it will be always the same value. But it works correctly with a usb cable.
I'm confused.

Re: VBAT incorrect value

Posted: Sat May 19, 2012 10:50 pm
by Hamburger
Works for me.
Which telemetry do you use? MWii telemetry? Exactly which MWii version?

Re: VBAT incorrect value

Posted: Sat May 19, 2012 11:14 pm
by hexjump
Hamburger wrote:Works for me.
Which telemetry do you use? MWii telemetry? Exactly which MWii version?

Hi, I'm using the newest development version. Everything works good via USB cable in GUI. After connecting via XBEE, I can't get the right VBAT value. And this value doesn't change. It remains at 12.20 V

Re: VBAT incorrect value

Posted: Sat May 19, 2012 11:20 pm
by Hamburger
Can you replace fhe two xbee with serial cable and try again?

Re: VBAT incorrect value

Posted: Sat May 19, 2012 11:26 pm
by hexjump
Hamburger wrote:Can you replace fhe two xbee with serial cable and try again?

It worked with the serial cable. I got the right VBAT value in GUI and the value changed by consuming the battery.

Re: VBAT incorrect value

Posted: Sun May 20, 2012 12:51 pm
by Hamburger
So it is about your xbee setup.
Those connect wit 5v gnd tx rx like your ftdi usb adapter? Same serial?

Re: VBAT incorrect value

Posted: Mon May 21, 2012 9:27 pm
by hexjump
Hamburger wrote:So it is about your xbee setup.
Those connect wit 5v gnd tx rx like your ftdi usb adapter? Same serial?

I got why ! It's about my self made mega board. It takes the Vcc of the FTDI as reference to calculate the lipo's voltage. That's why it worked with USB cable but not the ESC's 5V input. It works pretty well since I connected the Vcc FTDI to the other 5V pins on the mega board. Thanks for your reply.