VBAT incorrect value

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
oli
Posts: 21
Joined: Thu Jan 05, 2012 11:19 am

VBAT incorrect value

Post 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

User avatar
fr3d
Posts: 97
Joined: Sun Feb 06, 2011 11:21 am
Location: Cappelle la grande near the ch'ti village
Contact:

Re: VBAT incorrect value

Post by fr3d »

another mw 2.0 bug :(
I have seen it this afternoon

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: VBAT incorrect value

Post 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

oli
Posts: 21
Joined: Thu Jan 05, 2012 11:19 am

Re: VBAT incorrect value

Post by oli »

Thanks Alex, will try it this weekend and will let how know how it works.

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: VBAT incorrect value

Post 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

oli
Posts: 21
Joined: Thu Jan 05, 2012 11:19 am

Re: VBAT incorrect value

Post 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

User avatar
Loosi
Posts: 63
Joined: Sat Aug 20, 2011 8:31 pm
Location: Germany (HSK)
Contact:

Re: VBAT incorrect value

Post 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

User avatar
Hamburger
Posts: 2562
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: VBAT incorrect value

Post by Hamburger »

Can you try with a variable power supply?

User avatar
Loosi
Posts: 63
Joined: Sat Aug 20, 2011 8:31 pm
Location: Germany (HSK)
Contact:

Re: VBAT incorrect value

Post 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 :(

User avatar
djrm
Posts: 40
Joined: Wed Feb 15, 2012 11:32 pm
Location: North Yorkshire, UK

Re: VBAT incorrect value

Post 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.

PatrikE
Posts: 1964
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: VBAT incorrect value

Post 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.

User avatar
Loosi
Posts: 63
Joined: Sat Aug 20, 2011 8:31 pm
Location: Germany (HSK)
Contact:

Re: VBAT incorrect value

Post 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

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: VBAT incorrect value

Post 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...

hexjump
Posts: 39
Joined: Fri May 18, 2012 1:47 pm

Re: VBAT incorrect value

Post 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.

User avatar
Hamburger
Posts: 2562
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: VBAT incorrect value

Post by Hamburger »

Works for me.
Which telemetry do you use? MWii telemetry? Exactly which MWii version?

hexjump
Posts: 39
Joined: Fri May 18, 2012 1:47 pm

Re: VBAT incorrect value

Post 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

User avatar
Hamburger
Posts: 2562
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: VBAT incorrect value

Post by Hamburger »

Can you replace fhe two xbee with serial cable and try again?

hexjump
Posts: 39
Joined: Fri May 18, 2012 1:47 pm

Re: VBAT incorrect value

Post 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.

User avatar
Hamburger
Posts: 2562
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: VBAT incorrect value

Post by Hamburger »

So it is about your xbee setup.
Those connect wit 5v gnd tx rx like your ftdi usb adapter? Same serial?

hexjump
Posts: 39
Joined: Fri May 18, 2012 1:47 pm

Re: VBAT incorrect value

Post 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.

Post Reply