This thread is privately moderated by teralift, who may elect to delete unwanted replies.
Dec 18, 2016, 03:21 AM
AKA jflyper
Thread OP
FAQ

# Understanding Current Meters

There are numerous articles and video clips that tells you how to calibrate your current meter, but very few if not none, tells you the basics behind the current meter. By understanding the elementary DC circuit level basics, you can eliminate all the guess works and bad calibration results.

INA169: The Current Sensor

There are numbers of different type of current sensor around, but we are going to focus on INA169 based ones, which is most likely the type of sensor you will be dealing with.

Figure.1 shows typical application circuit using the INA169.

What it basically does, is to generate a current flowing out of OUT (pin 1) proportional to voltage difference between Vin+ (pin 3) and Vin- (pin 4). The input voltage difference is caused by load current Is, which we actually want to measure, flowing through a shunt resistor Rs. The output current from OUT will then flow through the load resistor RL and form a voltage Vo against ground.

The Vo is then fed to the ADC converter embedded in an MCU.

The INA169 is designed so that Vo is given by
Vo = Is * Rs * RL / 1000 [V] ...(A)
If we are going to connect this output to the CURRENT SENSOR ADC INPUT pin available in many FCs, then Vo should swing between zero and ADC reference voltage for the ADC input pin, which is usually 3.3[V].

At this point, we can study the equation (A). Solving (A) for Is we get
Is = Vo / (Rs * RL / 1000) ...(B)
Since maximum value of Vo is 3.3[V], maximum value of Is (Is(max)), the maximum current we can measure with this circuit is determined by values of Rs and RL.

Example 1: AttoPilot current sensor module

Take AttoPilot current sensor module which uses INA169 for example (Figure 2).

There are several variations of this sensor module, but they all use the same RL, which is 73.2K[ohm]. The 90A part uses 0.50m[ohm] for Rs. So the maximum current this module can measure is
Is(max) = 3.3 / (0.50m * 73.2K / 1000) = 3.3 / (0.50 * 73.2 / 1000) = 90.2[A]
Similarly, the 180A uses 0.25m[ohm] for Rs, so
Is(max) = 3.3 / (0.25m * 73.2K / 1000) = 3.3 / (0.25 * 73.2 / 1000) = 180[A]
Repeating this for 45A part, with Rs = 1.0m[ohm],
Is(max) = 3.3 / (1.0m * 73.2K / 1000) = 3.3 / (1.0 * 73.2 / 1000) = 45.1[A]
We can confirm that given Rs and RL derives maximum rating for the each part.

Example 2: OMNIBUS F3 PRO

Take OMNIBUS F3 PRO as another example. This board has an integrated current sensor. Figure 3 shows the area of current sensor circuit.

I took the DMM to measure the resistance of the resistor labeled RL, and it was 47K[ohm] plus or minus. The marking on the shunt resistor Rs is 0m50, which means 0.5m[ohm]. Then, we can calculate the maximum current Is(max) as
Is(max) = 3.3 / (0.5m * 47K / 1000) = 140[A]
So, this particular OMNIBUS F3 PRO's integrated current sensor can measure the maximum current of 140[A]. It was probably designed for 150[A], which sounds like a nice cut.

Example 3: OMNIBUS F4 PRO

The current sensor circuit for the OMNIBUS F4 PRO is the same as that of F3 PRO, but the RL measured as 110K[ohm], which was a bit of a surprise for the large value. With this value, the Is(max) for the F4 PRO is
Is(max) = 3.3 / (0.5m * 110K / 1000) = 60[A]
Converting Vo to Current Meter Reading

Here we assume we have a current sensor that outputs Vo proportional to the current Is which we want to display as the current meter reading. We further assume that Vo(max) is 3.3V for Is(max). To derive the Is, we use the equation
Is = Vo / scale ...(C)
Solving (C) for scale, we have
scale = Vo/Is ...(D)
The scale can easily be derived by using two known values; Is(max) and Vo(max)=3.3V.
With Is(max) values from previous examples, we get:
AttoPilot 45A: scale = 3.3 / 45 = 0.0733 [V/A]
AttoPilot 90A: scale = 3.3 / 90 = 0.0367 [V/A]
AttoPilot 180A: scale = 3.3 / 180 = 0.0183 [V/A]
OMNIBUS F3 PRO: scale = 3.3 / 150 = 0.0220 [V/A]
OMNIBUS F4 PRO: scale = 3.3 / 60 = 0.0550 [V/A]
These values are in the unit of [V/A], and configurators usually wants 1/10th of [mV/A], we should multiply these values by 10000 (V to mV = 1000, mV to 1/10 mV = 10, 1000 * 10 = 10000).
AttoPilot 45A: scale = 3.3 / 45 * 10000 = 733
AttoPilot 90A: scale = 3.3 / 90 * 10000 = 367
AttoPilot 180A: scale = 3.3 / 180 * 10000 = 183
OMNIBUS F3 PRO: scale = 3.3 / 150 * 10000 = 220
OMNIBUS F4 PRO: scale = 3.3 / 60 * 10000 = 550
Using the theoretically derived scale value

The values of scale, as you can see, is easily computed from the maximum current the sensor was designed to measure, and can be used as a starting point for the calibration. The calibration is necessary because values of resistors have errors, and INA169 also has amplification errors.

The theoretical value can also be used to evaluate the value derived by some other methods; if you get a value that differs extremely from the theoretical one, you have to start looking for explanations.

What is the offset?

The offset is the voltage that the current sensor outputs when Is is zero. For INA169 based sensors, the offset is very small, if not zero. An example of the sensor with non-zero offset is Allegro System's hall effect current sensor ACS770-Uxxx which outputs 0.5V when Is is zero.
Last edited by teralift; Dec 24, 2016 at 11:16 PM.
 Sign up now to remove ads between posts
 Dec 18, 2016, 04:52 AM My quadcopter is not a drone! Great post! Very useful. You mean "Hall effect current sensor" though...
Dec 18, 2016, 07:49 PM
Registered User
Quote:
 Originally Posted by teralift Example 3: OMNIBUS F4 PRO The current sensor circuit for the OMNIBUS F4 PRO is the same as that of F3 PRO, but the RL measured as 110K[ohm], which was a bit of a surprise for the large value. With this value, the Is(max) for the F4 PRO is Is(max) = 3.3 / (0.5m * 110K / 1000) = 60[A]
These are bad news for me. I just ordered one of them and thought the current sensor is rated like the one on the F3 Pro with at least 100A.

Is it posible to change the resistor RL and all is fine after that?
 Dec 18, 2016, 10:27 PM Registered User I re-calibrated my F3 Pro yesterday and got a scale value of 734. Way off the above value of 236. I think I'll try it again but this time without the USB connected, as it may be impacting readings. I'll tell you what: it's freaking scary having a quad spinning its props and drawing over 20A while it's centimeters away from your legs! Can't really use a bucket as a shield as I need to be able to see the clamp meter.
 Dec 19, 2016, 07:25 PM n00b Really good explanation. Been searching the net for how the current sensing works but couldn't find anything. Thanks Teralift!
 Dec 20, 2016, 02:15 AM Registered User does the OF4 pro v2 have a same (only 60A) readout as a maximum? If true, then this makes the current sensor useless. This is a big fail from the manufacturer. If my multimeter is correct, then mine measures about 110Kohm too. The current sensor was the reason why i paid more and got the pro. Now to find out that its a useless feature because its only capable of 60A? Last edited by RadMulRot; Dec 20, 2016 at 02:26 AM.
 Jan 02, 2017, 07:24 AM Quad Enthusiast Awesome post. I have been wondering if some part of my omnibus f3 pro has been damaged because my osd is only displaying 45a at max, but the current used (mAh) seems to be correct at the end of my flight. Could something be screwed up?
Jan 02, 2017, 09:19 AM
AKA jflyper
Thread OP
Quote:
 Originally Posted by Moosivaras does the OF4 pro v2 have a same (only 60A) readout as a maximum? If true, then this makes the current sensor useless. This is a big fail from the manufacturer. If my multimeter is correct, then mine measures about 110Kohm too. The current sensor was the reason why i paid more and got the pro. Now to find out that its a useless feature because its only capable of 60A?
It's designed that way...

Deciding current meter rating is a design decision. Some want huge max scale, others want moderate, yet remaining want precision instead of large rating (Max scale and precision are tradeoffs.)

Having said that, I think 60A was too small; it should have been 90A at least.

I'm planning to do a RL replacement to change the max scale, which will require a moderate micro soldering. If this goes well, I might propose myairbot.com to include a pair of moderate sized pads so users can easily alter the max scale.
Jan 02, 2017, 09:21 AM
AKA jflyper
Thread OP
Quote:
 Originally Posted by Adamtfc Awesome post. I have been wondering if some part of my omnibus f3 pro has been damaged because my osd is only displaying 45a at max, but the current used (mAh) seems to be correct at the end of my flight. Could something be screwed up?
If your mAh draw is not too far off, then your current and voltage are both correct. You are not drawing as much amps as you thought you were.
Jan 02, 2017, 02:27 PM
Quad Enthusiast
Quote:
 Originally Posted by teralift If your mAh draw is not too far off, then your current and voltage are both correct. You are not drawing as much amps as you thought you were.
I know for a fact I'm pulling over 45a running tornado t2 2300kv with hq 5x4x3 with a 5s lipo. Exact same setup with an RROSD instead for the OSD displays its maximum 99a. Has to be a defect with the board?

Also my scale is all the way to 715 to get accurate amp draw. Maybe having the scale high like that limits what's displayed? My offset is at 0
Last edited by Adamtfc; Jan 02, 2017 at 06:41 PM.
Jan 03, 2017, 12:33 AM
AKA jflyper
Thread OP
Quote:
 Originally Posted by Adamtfc I know for a fact I'm pulling over 45a running tornado t2 2300kv with hq 5x4x3 with a 5s lipo. Exact same setup with an RROSD instead for the OSD displays its maximum 99a. Has to be a defect with the board? Also my scale is all the way to 715 to get accurate amp draw. Maybe having the scale high like that limits what's displayed? My offset is at 0
(1) Just to be sure, what is your FC?

(2) Scale is used to divide the current sensor output voltage. So, if scale is set to a larger value, amps displayed will be smaller. But in any case, 715 sounds like overkill...
Jan 05, 2017, 04:06 PM
Registered User
Quote:
 Originally Posted by teralift It's designed that way... Deciding current meter rating is a design decision. Some want huge max scale, others want moderate, yet remaining want precision instead of large rating (Max scale and precision are tradeoffs.) Having said that, I think 60A was too small; it should have been 90A at least. I'm planning to do a RL replacement to change the max scale, which will require a moderate micro soldering. If this goes well, I might propose myairbot.com to include a pair of moderate sized pads so users can easily alter the max scale.
I think it`s even less then 60A because the datasheet of the INA139 says that

Voutmax = V+ - 0.7V - (Vin+ - Vin-)

If the sensor is geting V+ = 3.3V it gives roughly 2.6V wich means the max amp-rating is about 47A.

I thought it's maybe possible to solder a second 110k resistor on top of the existing one to double the rating but I feel a bit uncomfortable to solder on these small parts. I will stay tuned to see if your replacement works like expected.

BTW: Thank you for your great work explaining nearly everything on the OMNIBUS FC I ever wanted to know. You saved me so many times from an headache
Jan 06, 2017, 02:44 AM
AKA jflyper
Thread OP
Quote:
 Originally Posted by skela I think it`s even less then 60A because the datasheet of the INA139 says that Voutmax = V+ - 0.7V - (Vin+ - Vin-) If the sensor is geting V+ = 3.3V it gives roughly 2.6V wich means the max amp-rating is about 47A.
V+ in this case refers to pin 5 input voltage, and is usually Vin-.

Quote:
 I thought it's maybe possible to solder a second 110k resistor on top of the existing one to double the rating but I feel a bit uncomfortable to solder on these small parts. I will stay tuned to see if your replacement works like expected.
I believe it would be much easier to remove it and solder another one.
 Jan 06, 2017, 07:16 AM Registered User Ok I think I got it now I'm not familiar with this STM32 stuff so I thought that the maximum ADC input voltage should be Vcc. But after I read the datasheet (should do this more often rather than thinking ) the inputs are 5V tolerant (wich means about 8V tolerant). This makes it possible to use the much higher voltage from Vin+ without damaging anything on the processor if the current is higher. Only some of my thoughts because I want to understand such things correct. So hopefully I do not bother this thread to much Thank you again
Jan 06, 2017, 07:39 AM
AKA jflyper
Thread OP
Quote:
 Originally Posted by skela Ok I think I got it now I'm not familiar with this STM32 stuff so I thought that the maximum ADC input voltage should be Vcc. But after I read the datasheet (should do this more often rather than thinking ) the inputs are 5V tolerant (wich means about 8V tolerant). This makes it possible to use the much higher voltage from Vin+ without damaging anything on the processor if the current is higher. Thank you again
Some ADC input pins are 5V tolerant, some are not.

However, V+ for INA169 should be 5V for most of flight controller designs which makes the design safer against unexpected large current flowing through the shunt. I believe designs that use Vin- for V+ are direct derivatives of AttoPilot type simple standalone current sensor unit in which 5V is not available.

Quote:
 Only some of my thoughts because I want to understand such things correct. So hopefully I do not bother this thread to much
You are my type

 Quick Reply Message:
 Thread Tools