How to configure Current sensor (hardware)

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
User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

How to configure Current sensor (hardware)

Post by dramida »

I bought a current sensor from RCTimer which integrates also a rezistor divisor for Vbat- battery voltage. I connected Vbat to A0 and current output to A1 (on Crius AIOP with ATMega2560). The voltage works fine on GUI and on OSD.
As minimOSD shows also current compsumption indication, i would like to enjoy this part also.
RCTimer current sensor with voltage rezistive divider
RCTimer current sensor with voltage rezistive divider

How to configure and calibrate the hardware current sensor? I think those lines has the answer but i really don't understand their meaning entierly.

Code: Select all

/********************************************************************/
  /****           powermeter (battery capacity monitoring)         ****/
  /********************************************************************/

    /* enable monitoring of the power consumption from battery (think of mAh)
       allows to set alarm value in GUI or via LCD
      Full description and howto here http://www.multiwii.com/wiki/index.php?title=Powermeter
       Two options:
       1 - hard: - (uses hardware sensor, after configuration gives very good results)
       2 - soft: - (good results +-5% for plush and mystery ESCs @ 2S and 3S, not good with SuperSimple ESC)    */
    //#define POWERMETER_SOFT
    //#define POWERMETER_HARD
    /* PLEVELSCALE is the step size you can use to set alarm */
    #define PLEVELSCALE 50 // if you change this value for other granularity, you must search for comments in code to change accordingly
    /* larger PLEVELDIV will get you smaller value for power (mAh equivalent) */
    #define PLEVELDIV 5000 // (*) default for soft - if you lower PLEVELDIV, beware of overrun in uint32 pMeter
    #define PLEVELDIVSOFT PLEVELDIV // for soft always equal to PLEVELDIV; for hard set to 5000
    #define PSENSORNULL 510 // (*) set to analogRead() value for zero current; for I=0A my sensor gives 1/2 Vss; that is approx 2.49Volt;
    #define PINT2mA 13 // (*) for telemtry display: one integer step on arduino analog translates to mA (example 4.9 / 37 * 100

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

Re: How to configure Current sensor (hardware)

Post by Hamburger »

I do not see what makes this a 'software development' question?
What does rctimer say how to use their hardware?
Which part of the wiki page do you not understand?

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: How to configure Current sensor (hardware)

Post by dramida »

Hamburger wrote:I do not see what makes this a 'software development' question?
What does rctimer say how to use their hardware?
Which part of the wiki page do you not understand?


RCtimer, 3DR, Flytron or any other current sensor, is calibrated the same.

I din't know there is a wiki page about setting / calibrating the current sensor...found it o google as powermetter http://www.multiwii.com/wiki/index.php?title=Powermeter

I'll try set it up again and post the results, hope positive. Anyway the code is a little bit fuzzy about current sensor, too many defines and parameters in the same place, for softwarea and hardware.
I bet there are les than ten users of HW power sensor among tens of thounsand of MW users, also is a cheap sensor and very useful to know when to stop flying (main cause of FPV crashes is loss of power)

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

Re: How to configure Current sensor (hardware)

Post by Hamburger »

the link to the wiki page is in the config.h section - you copy&pasted it yourself in your post. Why do you choose pin A1 for psensor pin?
If you find the description difficult, please enhance it - documentation is a continuous wiki effort.

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: How to configure Current sensor (hardware)

Post by nhadrian »

Hamburger wrote:the link to the wiki page is in the config.h section - you copy&pasted it yourself in your post. Why do you choose pin A1 for psensor pin?
If you find the description difficult, please enhance it - documentation is a continuous wiki effort.


Hi,

I have Crius AIO Pro board.
Till now I only had vbat on A1 with resistor divider.
But now, I wanted to try the pmeter function (I have a flytron 25A sensor, till now I used with a mobidrone osd with 328p onbard, without problem.)
As soon as I uncomment the pmeter hard function, the vbat value become less and noisy, the pmeter value too.
If I comment out pmeter but still let the sensor connected to A2, vbat reading is OK again.
I got the same with issue with RSSI reading.

Do you have any idea?
I read in wiki that maybe RC filter should be used (in mobidrone there isn't, sensor is connected directly to analog input)
Can you describe what values should be used and how to connect?

BR
Adrian

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

Re: How to configure Current sensor (hardware)

Post by Hamburger »

Adrian,
from def.h I take A0 = vbatpin and A2 = psensorpin with mega/CRIUS_AIO_PRO_V1. Why do you use A1?
I have not seen the effect you describe, but have seen the adc values being jumpy. The two lowest bits seemed to contain random value, so be useless.
For vbat I did use RC lowpath filter but have moved to using 3k3 & 5k6 for voltage divider (not 33k & 56k) and that gives better stable value from the adc; for both vbat and psensor we have averaging software filters in MWii code. I have not tried RC filter for psensor yet.
ziss_dm pointed out that the adc values must not be read too frequently - maybe some internal capacitor needs to recharge with the correct output value or whatever. You may try and lower the frequency of sensor reads by increasing PSENSORFREQ.

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: How to configure Current sensor (hardware)

Post by nhadrian »

Hi,

I tried many variations of PSENSORFREQ up to 40 (25Hz) but still the same. If sensor is connected, it jams the vbat reading too. Any suggestions / idea?

BR Adrian

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

Re: How to configure Current sensor (hardware)

Post by Hamburger »

I have not knowingly experienced this drop of voltage readings caused by the analogRead() for psensor. Can you try for that effect with another board?
- maybe change voltage divider for vbat like I described;
- hardware filterering (RC lowpath filter) would be last resort.

vpb
Posts: 231
Joined: Mon Jul 23, 2012 4:09 pm

Re: How to configure Current sensor (hardware)

Post by vpb »

I have one current sensor of frsky, but in order to use it, I cannot use frsky-telemetry with multiwii, and looks like it's hard to integrate Frsky sensor module. So that rc-timer sensors is promising.

@dramida: Have you tried integrating that current&voltage sensor to Multiwii? How about the result?

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

Re: How to configure Current sensor (hardware)

Post by Hamburger »

with latest rev code, the current sensor implementation has changed. Less params to configure, better stability of readings when more than one analog probes attached (like voltage and current). For feature setup read comments in config.h section.

teslahed
Posts: 84
Joined: Wed Jun 27, 2012 2:51 pm

Re: How to configure Current sensor (hardware)

Post by teslahed »

I am currently trying to get my rctimer current and voltage sensor working on the latest dev release of multiwii (MultiWii_dev_2013_04_08_r1391)

I have my code setup as;

Code: Select all

/********************************************************************/
  /****           powermeter (battery capacity monitoring)         ****/
  /********************************************************************/

    //#define POWERMETER_SOFT
    #define POWERMETER_HARD
    /* PLEVELSCALE is the step size you can use to set alarm */
    #define PLEVELSCALE 50 // if you change this value for other granularity, you must search for comments in code to change accordingly
    /* larger PLEVELDIV will get you smaller value for power (mAh equivalent) */
    //#define PLEVELDIV 5000 // default for soft - if you lower PLEVELDIV, beware of overrun in uint32 pMeter
    #define PLEVELDIV 36000 // fixed value for hard - do not tune
    //#define PLEVELDIVSOFT PLEVELDIV // for soft always equal to PLEVELDIV
    #define PLEVELDIVSOFT 5000 // for hard fixed to 5000
    #define PSENSORNULL 0 // set to analogRead() value for zero current; for I=0A my sensor gives 1/2 Vss; that is approx 2.49Volt;
    #define PINT2mA 134 // one integer step on arduino analog translates to mA (example 4.9 / 37 * 1000
   


I have set powermeter_hard because i am using the hardware sensor

I have left #define PLEVELSCALE 50 alone because i don't understand it and don't fancy trying to search for the other comments in the code

I have left //#define PLEVELDIV 5000 commented out because it's for the software current sensor

I have left #define PLEVELDIV 36000 commented in because it tells me it's fixed for the hardware and not to tune it

I have left //#define PLEVELDIVSOFT PLEVELDIV commented out because i'm using the hardware sensor

I have left #define PLEVELDIVSOFT 5000 because it tells me to set it to 5000 for the hardware sensor

I am not sure about #define PSENSORNULL 0 but i get almost no current comsumed when the hexacopter is sitting unarmed so i might have it right?

I calculated #define PINT2mA 134 with 4.9 / 36.6 (from the sensor specs 36.60mV / Amp) * 1000

I have been testing this using my bluetooth phone and the multiwii software app. I can fly over my bed for 1 min, measure the total mAh used, then recharge the battery back to full and see how much is going back in.

A typical 1 min flight uses 220mAh of charge

My phone reports that my hexacopter has consumed a total of '498'

I don't understand why the values are different and i suspect i am missing one or two things in the code because i am not sure i fully understand that either.

If anyone can shed any light on what i am doing wrong i would really appreciate it, thanks! I will admit that both my software and electrical skills are lacking so i have probably made a stupid mistake somewhere.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: How to configure Current sensor (hardware)

Post by haydent »

i have this sensor now too, hoping to get it going well, any one still following this thread ?

felixrising
Posts: 244
Joined: Sat Mar 23, 2013 12:34 am
Location: Australia

Re: How to configure Current sensor (hardware)

Post by felixrising »

Urrrg... this is not a software development thread.. this is a setup thread...

Anyway, yes, I have a RCTimer V&I sensor hooked up to my Crius AIO Pro V1 and V2 boards.. I found the granularity to be way off, ended up changing multipliers in the code to get a reasonably accurate figure.

However I'm on NHA's r23 code (with cherry picked snippets and some mods), so my vbat and psensor computations/config are based on something around r1411 or later.

config.h

Code: Select all

...
       vbat = [0;1023]*16/VBATSCALE  // [b]Felixrising: Using a multiplier of 64 (instead of 16) - by changing (divide/multiply) bitshifts from 4 to 6 in MultiWii.ino in the vbat section.[/b]
       must be associated with #define BUZZER ! */
    #define BATNUM          4 //Number of cells in battery
    #define VBAT              // uncomment this line to activate the vbat code
    //#define VBATSCALE       94 // (*) (**) change this value if readed Battery voltage is different than real voltage
    #define VBATSCALE       82 // (*) (**) change this value if readed Battery voltage is different than real voltage // [b]Felixrising: Using a multiplier of 64 (instead of 16) - see note above[/b]
 
    #define VBATNOMINAL     (42 * BATNUM) // 12,6V full battery nominal voltage - only used for lcd.telemetry
    #define VBATLEVEL_WARN1 (37 * BATNUM) // (*) (**) 10,7V
    #define VBATLEVEL_WARN2 (36 * BATNUM) // (*) (**) 9.9V
    #define VBATLEVEL_CRIT  (35 * BATNUM)
     
    // (*) (**) 9.3V - critical condition: if vbat ever goes below this value, permanent alarm is triggered
    #define NO_VBAT          16  // Avoid beeping without any battery
 .....
    //#define POWERMETER_SOFT
    #define POWERMETER_HARD
    #define PSENSORNULL 4 /* (*) hard only: set to analogRead() value for zero current; for I=0A my sensor gives 1/2 Vss; that is approx 2.49Volt; */
    #define PINT2mA 54     /* (*) hard: one integer step on arduino analog translates to mA (example 4.9 / 37 * 1000) ; */

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: How to configure Current sensor (hardware)

Post by haydent »

i now have good accuracy by locking my cycle time to 4000 to match the wiki and then using the other values shown in the wiki

i had a flight that reported used 2360 and the charger put back in 2460 so only 100mah diff which im sure i could tune closer

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: How to configure Current sensor (hardware)

Post by haydent »

dude, i worked it out so simple, here is haw to show amperage in minimosd from multiwii connected sensor viewtopic.php?f=8&t=3783

User avatar
TTRCmedia
Posts: 4
Joined: Mon May 06, 2013 9:39 pm
Location: Hannover, GER

Re: How to configure Current sensor (hardware)

Post by TTRCmedia »

Hamburger wrote:from def.h I take A0 = vbatpin and A2 = psensorpin with mega/CRIUS_AIO_PRO_V1.

On MultiWii SE 2.0 Board (328p) A0, A1 and A2 are used for camera roll & pitch and trigger. In def.h V_BATPIN = A3 and PSENSORPIN = A2. This FC has A3, A6 and A7 as spare ports - can V_BATPIN easily be changed to A6 or A7?

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

Re: How to configure Current sensor (hardware)

Post by Hamburger »

TTRCmedia wrote:
Hamburger wrote:from def.h I take A0 = vbatpin and A2 = psensorpin with mega/CRIUS_AIO_PRO_V1.

On MultiWii SE 2.0 Board (328p) A0, A1 and A2 are used for camera roll & pitch and trigger. In def.h V_BATPIN = A3 and PSENSORPIN = A2. This FC has A3, A6 and A7 as spare ports - can V_BATPIN easily be changed to A6 or A7?

sure. Search for OVERRIDE_V_BATPIN. It does what you want.

User avatar
TTRCmedia
Posts: 4
Joined: Mon May 06, 2013 9:39 pm
Location: Hannover, GER

Re: How to configure Current sensor (hardware)

Post by TTRCmedia »

Thank you - exactly what I was looking for :-)

scanman
Posts: 74
Joined: Thu Jun 21, 2012 9:26 am
Location: Durban, South Africa
Contact:

Re: How to configure Current sensor (hardware)

Post by scanman »

i couldnt get that rctimer current sensor to work and scrapped it , the granularity is too large (300mv range from idle to full throttle)
it is rated at 90 Amps, i think and we are hovering around 10 amps.

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

Re: How to configure Current sensor (hardware)

Post by Hamburger »

Right.
I have good results with amploc 25A sensors
Plus I find it convenient it has real non-contact between high current line and 5V sensor side

JirkaA
Posts: 11
Joined: Mon Jul 16, 2012 5:41 pm
Location: near Brno, Czech Republic
Contact:

Re: How to configure Current sensor (hardware)

Post by JirkaA »

scanman wrote:i couldnt get that rctimer current sensor to work and scrapped it , the granularity is too large (300mv range from idle to full throttle)
it is rated at 90 Amps, i think and we are hovering around 10 amps.


That is not necessary, look at rctimer for documentation, where is schematic.. Or look at ti.com for datasheet of INA169 which is used in this current sensor. You can simply replace current sensing resistor for higher value, i.e. 1 miliOhm and change value of output resistor for which range you want.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: How to configure Current sensor (hardware)

Post by haydent »

just back on this sensor again, i found my pint2ma calculation was way off (13), giving me a amperage and mah reading too low. my friend alerted me to the possibility after commenting that it didnt seem to be indicating a realistic amperage draw when flying, so a bought a 'watts up' meter (made in usa) from hobbyking (its an excellent meter, best there) any way it confirmed it, and i was able to use it to back calculate what my pint2ma value should be to make it read the right amperage.

with the meter plugged in and the aircraft armed its displayed 3.57A, or 3570ma
then in the MW code i outputted the analog pin's reading to debug(the one connected to the amperage sensor) this was 64

the formula for calculating amperage in MW is the pin reading x pint2ma (reading x pin2ma = mA)

plug in knowns:

64 x pint2ma = 3570

rearrange:

pint2ma = 3570 / 64

pint2ma = 55

i tried this and got pretty much exactly what the watt meter told me in my osd now
Last edited by haydent on Wed Oct 30, 2013 1:15 am, edited 1 time in total.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: How to configure Current sensor (hardware)

Post by haydent »

so im not sure why there's such a difference to the theoretical calculation, whether its my FC or the sensor, but im going to test out the mah now as the meter can tell you that to see if its corrected now too

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: How to configure Current sensor (hardware)

Post by haydent »

well i got the mah correct now after also back calculating that calculation in relation to PLEVELDIV setting and the difference between what my osd said vs the watt meter, i wont go into detail of this as in 2.3 PLEVELDIV is calculated internally

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

Re: How to configure Current sensor (hardware)

Post by Hamburger »

You did tune psensornull before tuning pint2ma, right?

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: How to configure Current sensor (hardware)

Post by haydent »

because MW was calculating a value lower than the actual one (according to my watt meter) i didnt worry too much about trying to get the absolute value for psensornull and took it from the datasheet, as anything greater than 0 for psensornull would just make MW's calculated value even lower... i guess to find it out i would disconnect everything but the sensor itself and test it with arduino or mm

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: How to configure Current sensor (hardware)

Post by haydent »

i checked it with nothing plugged in but sensor, it is 0

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: How to configure Current sensor (hardware)

Post by haydent »

ok so i thought id try out the latest 2.3 candidate release and im having trouble with amperage calculation. if i set pint2ma to a value that gives me the right amperage reading my mah reading is way too low ... its like its calculating the mah incorrectly from the ma reading... i imagine something to do with the new internal PLEVELDIV value...

edit. it was a setting in minimosd that is amperage factor value that divides the incoming value by itself, youll find it
Last edited by haydent on Thu Nov 21, 2013 4:33 am, edited 1 time in total.

Adrianm1972
Posts: 7
Joined: Mon Sep 23, 2013 10:24 pm

Re: How to configure Current sensor (hardware)

Post by Adrianm1972 »

I have just about everything working perfectly on my WiteSpy Mega Pro 3Ez running MW2.3, However, I am still not able to get powermeter to work and display amps in my MinimOSD. I have read everything everywhere several times and no matter what I try I always get a displayed 4.0A. I even bought an Amploc 25A sensor to get everything exactly as in the wiki

Is it possble that I made an error that sent too much power to pin A2 and it got fried? Everything else is working perfectly. Can I just got to Def.h and assign powermeter to pin A1 or A3 to see if this is the problem?

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: How to configure Current sensor (hardware)

Post by haydent »

to get minimosd to show amps from multiwii connected amp meter you need to mod minims code to read the value from the multiwii serial protocol (MSP)

amps has only just been added to msp in 2.3 and minim is still to utilise it. here is my link to do that:

see last step (minimosd bit) of this opening post:
viewtopic.php?f=8&t=3783

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: How to configure Current sensor (hardware)

Post by krtek2k »

Hallo , can you tell me please how you have rctimer current sensor configured with CRIUS AIOP V1 or V2? And with V2.3?
If i set vbat scale whatever from 1-200 , i always see 2,6V-2,7V :(

EDIT : Oh , i am doing it from android and i forget to pres "write" button. So now i have my copter ready :)

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: How to configure Current sensor (hardware)

Post by krtek2k »

But not reading current consumption well.
Can you tell me please how you have rctimer current sensor configured with CRIUS AIOP V1 or V2? And with V2.3?
i mean two parameters :
PSENSORNULL
and
PINT2mA

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: How to configure Current sensor (hardware)

Post by haydent »

with that sensor, psensornull = 0 , is it the 90A version ?

have you checked you have the sensor connected to the pins that are chosen in mwc ?

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: How to configure Current sensor (hardware)

Post by krtek2k »

Yes , but i am too lazy to doing many flights before i have real numbers , oki i will set psensornull = 0 , and will find PINT2mA by myself , than i will change minimosd code to see amperage :) And i will be happy with this.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: How to configure Current sensor (hardware)

Post by haydent »

i would recommend a watt meter if you want to really check you have things setup correctly.

My PINT2mA is 53 (i have the 90A version)

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: How to configure Current sensor (hardware)

Post by krtek2k »

thx , i will use 53 as my starting value.

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: How to configure Current sensor (hardware)

Post by krtek2k »

Yes i have 95A version.
what i found:
if i set
VBATSCALE 22 ----- i see 16,2V on 16,4V battery
VBATSCALE 21 ----- i see 17,0V on 16,4V battery
(not happy with the resolution, will 21.7 value work? I think not)
-----------------------------------------------
And if i set
PSENSORNULL 220 ------- i see 0,0-0,1A current
PSENSORNULL 200 ------- i see 0,9A current
PSENSORNULL 100 ------- i see 6,3A current
PSENSORNULL 0 ------- i see 11,8A current

I am reading volts and amps through minimOSD at googles with connected battery.
I have current consumption same value at minimOSD and EZ-GUI
I have voltage same value at minimOSD and EZ-GUI

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: How to configure Current sensor (hardware)

Post by haydent »

ok i had that problem with vbatscale too, and what you need to do is this mod:
viewtopic.php?f=8&t=3792
with this i use a vbatscale of 120 and get accurate reading.

with psensornull, maybe your sensor is different to mine, to check, you should hook a DMM up to your amperage signal wire and see what is there when there is no amperage draw. can you also link me your sensor ?

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: How to configure Current sensor (hardware)

Post by krtek2k »

Thank You haydent , i will try your mod. I have regular rctimer sensor from rctimer directly , but their website is not running now. And i dont know what is dmm, i will try functionality with my founded values , and if it will work fine , i will not looking for another problems :)

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: How to configure Current sensor (hardware)

Post by haydent »

dmm = digital multimeter

Nerox
Posts: 17
Joined: Thu Jul 17, 2014 9:23 pm

Re: How to configure Current sensor (hardware)

Post by Nerox »

Hi,

coming back to this:

I am running the current & voltage sensor on A0 & A1 and changed this accordingly in def.h

I am struggling to get this thing up and running. There are literally a BILLION posts to this thing (RC Timer 90A voltage & current sensor) on the internet and people trying to get it working with Multi Wii. I have not found a single person who is saying, yes, this thing works and is actually showing appropriate values. I have re-flashed my board approximately 20 times right now (and I am now at that point were I'm one step before discarding the whole "sensor" into the garbage can) due to this sensor and here is what I got:

-First I tried VBat Scale 21, which is exactly the value that is all over the internet for this sensor. With a fully charged flightpack, that had 12.50 Volts when everything was up and running, the GUI was fluctuating between 12.0 and 12.1 Volts. Changing VBat Scale made it worse, no matter in which direction. People on the internet claimed the resolution of this thing wasn't suitable for 9-12 Volts, which makes sense.
-After my Quad lied in a field for 5 days and I was able to recover it, I now get exactly the 12.5 Volts with a VBat Scale of 18. I have NO idea wha changed, I didn't even re-flash the software after I recovered it... MAybe something was oxidation, I don't know, and the resistance changed.
However. the voltage drop is not way too big. When starting the engines, the voltages goes down to approx. 11 Volts instantly and drops to 10 Volts after 3 Minutes. Checking with a Multimeter, initial voltage is 11.5V with full throttle, so there is a difference of approximately 0.5 Volts. Although the initial voltage is now correct, the rest is crap and the Sensor doesn't help me to evaluate when to go back home, as it shows an "mepty" fligt pack on my MinimOSD way to soon.

-Power Sensor, no words. Tried different values for PINT2mA, which was 13, 132 and now 55. 13 gave me a constant increase in "Power Sum" in the GUI (very slowly), no matter at which throttle level. After a 10 minutes flight, Power sum was 300, charger showed 4500 mah consumed.
132 lead to a constant consumption of 16A, at least thats what the MinimOSD showed. I tried the MinimOSD mod in this thread:
viewtopic.php?f=8&t=3783
This leads to "0A and 0mAh consumed" in the GUI.

Is there ANYBODY who has got this thing to work properly? MinimOSD is useless if the Power Sensor generates values that are totally out of range. I could live with 0.2Volts too much or too less, but the Sensor is sometimes flugtuating between 11.1 and 9.8 Volts within 1 second.

Thanks!
Malte

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: How to configure Current sensor (hardware)

Post by haydent »

I got it working fine. It might help for you to work through your system bit by bit. So start with a multimeter on your signal wires and check you are getting a voltage that fluctuates as it should in correlation to voltage and amperage. Then check the fc is reading the values by using debug[0] = value in the code to show in the gui the value read on the pins is working and also fluctuates appropriately. Then you can work up from there with some math knowing what value is being read by the analog pin for a known voltage or amperage to determine the unknown parameters you need.

Post Reply