<ul>
<li>Is the shunt resistor usually mounted high-side (i.e. at the positive battery terminal), or low-side (at the negative terminal), and why? Does it matter?  </li>
</ul>

<p>There should be no significant difference to the measurement if the shunt resistor is on the high or low side. As the resistor is in series the absolute voltage across, and current through, the resistor remains the same. However, there may be a small advantage to one or the other depending your sensor design - for example, having it on the low side makes the measurement relative to the circuit GND, which may reduce the component count of your amplifier/signal conditioning design.</p>

<ul>
<li>What class of amplifier, in terms of precision, is used for the sensed voltage?  </li>
</ul>

<p>This will depend slightly on your design, and you may find the precision of the ADC to be the limiting factor (e.g. an 8 bit 5V ADC has a resolution of 19.5mV.) That said, the job of the amplifier is to match the range of values from your sensor to the input range of your ADC. While a linear relationship is intuitive and straightforward, it may be more desirable to have a curve to give greater sensitivity around the expected ranges but still report invalid values with slightly reduced precision. You would need to characterise the curve and program it into your flight controller for correct reporting.</p>

<ul>
<li>What range of output voltages does the FC expect?</li>
</ul>

<p>This will depend entirely on the flight controller - but typical ranges for ADCs are 0 to 3.3V or 0 to 5V. Remember that if you want to report a negative reading, you will need to bias your zero value sensor ourput for mid range on the ADC.</p>

<ul>
<li>Is there any smoothing (lowpass filtering) applied to the sensor's output to reduce aliasing from possible high frequency current ripple?</li>
</ul>

<p>Filtering is a good idea to help reduce unwanted values. The response time of the filter needs to be fast enough to capture valid changes while rejecting noise. You can compare the filter response rate to your sample rate - your filter response can be slower if you are checking the voltage every 0.5 seconds instead of every 0.05. Alternatively you may decide to do some filtering in software, sampling several times and averaging, but this takes CPU time away from other tasks.</p>

CC BY-SA 4.0
2020-04-17T16:13:18.857Z
Thank you for the answer! While it is appreciated, it's also mostly theoretical thoughts about the general case, and they mostly mirror my own thoughts (which is nice). The problem with that, and why I'm asking this question in the first place, is that these conclusions, due to being theoretical, may or may not be true. This is why I'm asking _how it's done in commercially available sensors_, as these designs have been tested in practice and engineered using all the knowledge regarding how all of the factors I'm asking about would play out in this particular domain.
FlashCactus
CC BY-SA 4.0
2020-04-17T09:13:05.787Z
2020-04-17T09:13:05.787Z
Kralc
<p>Using <a href="https://docs.px4.io/master/en/power_module/holybro_pm07_pixhawk4_power_module.html" rel="nofollow noreferrer">PM07</a> power management board from Holybro as an example. They use shunt resistor on the high side. Voltage across the shunt resistor is then fed into the Texas Instruments <a href="https://www.ti.com/product/INA169" rel="nofollow noreferrer">INA169</a> current sense amplifier. Gain and BW of the amplifier is set using an external resistor. I was designing my own power management board recently and had exactly the same questions as you do. In the end, rather than inventing my own solution, I used the typical usage example given in INA169 data sheet with the PCB layout adjusted to my needs.</p>

CC BY-SA 4.0
2020-05-02T10:42:41.550Z
2020-05-02T10:42:41.550Z
jpou
<p>Current sensors are a popular feature in both multicopter and fixed wing flight control stacks. </p>

<p>Most of them are analog, i.e. convert the current into a voltage using a small-value shunt resistor (and possibly a voltage amplifier). That voltage is then read by the flight controller via an ADC pin. I've been trying to make my own, and in such cases it is useful to know the best practices in the industry, however my Google-Fu was not strong enough to find those, and reverse-engineering is a rather tedious proposition, since I only have an ESC-integrated one. </p>

<p>The main questions I couldn't find answers to are:</p>

<ul>
<li>Is the shunt resistor usually mounted high-side (i.e. at the positive battery terminal), or low-side (at the negative terminal), and why? Does it matter? </li>
<li>What class of amplifier, in terms of precision, is used for the sensed voltage? </li>
<li>What range of output voltages does the FC expect?</li>
<li>Is there any smoothing (lowpass filtering) applied to the sensor's output to reduce aliasing from possible high frequency current ripple?</li>
<li>If there is any difference between standard sensors used in betaflight FC stacks vs., e.g. APM or PX4 flight controllers, what are they?</li>
</ul>

<p>If someone could provide a circuit schematic of a "typical" current sensor, it would be very much appreciated as well.</p>

<hr>

<p>Clarification on the purpose of this question:</p>

<p>I'm asking because, while I've got my own ideas about each choice, I have no way of verifying whether I've considered everything in the decisions and the relative importance of all the factors involved (without building one first and seeing how things play out). Thus, I'd like to learn from field-tested commercial designs and see how <em>they</em> solved all these questions.</p>

<p>i.e. my thoughts on where to mount the shunt: Low side is simpler, but if done this way, ripple currents from ESCs may induce voltage ripple in the ground, which is worse than voltage ripple at VBAT, since everything in the drone is connected to it directly as a common terminal, while VBAT typically goes through a regulator before hitting sensitive elements. On the other hand, I may be overthinking the significance of this aspect and it might be fine either way; the best way to learn that would be to see how others do it; if they only mount the resistor high-side (or only do it low-side), then it must be significant, if they don't care I shouldn't care either.</p>

<flight-controller><sensor><current-sensor><electronics><best-practice>
What are the usual engineering considerations for a UAV current sensor?
FlashCactus
# What are the usual engineering considerations for a UAV current sensor?

(Asked by: username_0 on 2020-04-17)

Current sensors are a popular feature in both multicopter and fixed wing flight control stacks.

Most of them are analog, i.e. convert the current into a voltage using a small-value shunt resistor (and possibly a voltage amplifier). That voltage is then read by the flight controller via an ADC pin. I've been trying to make my own, and in such cases it is useful to know the best practices in the industry, however my Google-Fu was not strong enough to find those, and reverse-engineering is a rather tedious proposition, since I only have an ESC-integrated one.

The main questions I couldn't find answers to are:

* Is the shunt resistor usually mounted high-side (i.e. at the positive battery terminal), or low-side (at the negative terminal), and why? Does it matter?
* What class of amplifier, in terms of precision, is used for the sensed voltage?
* What range of output voltages does the FC expect?
* Is there any smoothing (lowpass filtering) applied to the sensor's output to reduce aliasing from possible high frequency current ripple?
* If there is any difference between standard sensors used in betaflight FC stacks vs., e.g. APM or PX4 flight controllers, what are they?

If someone could provide a circuit schematic of a "typical" current sensor, it would be very much appreciated as well.

---

Clarification on the purpose of this question:

I'm asking because, while I've got my own ideas about each choice, I have no way of verifying whether I've considered everything in the decisions and the relative importance of all the factors involved (without building one first and seeing how things play out). Thus, I'd like to learn from field-tested commercial designs and see how *they* solved all these questions.

i.e. my thoughts on where to mount the shunt: Low side is simpler, but if done this way, ripple currents from ESCs may induce voltage ripple in the ground, which is worse than voltage ripple at VBAT, since everything in the drone is connected to it directly as a common terminal, while VBAT typically goes through a regulator before hitting sensitive elements. On the other hand, I may be overthinking the significance of this aspect and it might be fine either way; the best way to learn that would be to see how others do it; if they only mount the resistor high-side (or only do it low-side), then it must be significant, if they don't care I shouldn't care either.

**Tags:** flight-controller, sensor, current-sensor, electronics, best-practice


---

## 2 answers

### Answer by username_1 on 2020-04-17. Score: 5

* Is the shunt resistor usually mounted high-side (i.e. at the positive battery terminal), or low-side (at the negative terminal), and why? Does it matter?

There should be no significant difference to the measurement if the shunt resistor is on the high or low side. As the resistor is in series the absolute voltage across, and current through, the resistor remains the same. However, there may be a small advantage to one or the other depending your sensor design - for example, having it on the low side makes the measurement relative to the circuit GND, which may reduce the component count of your amplifier/signal conditioning design.

* What class of amplifier, in terms of precision, is used for the sensed voltage?

This will depend slightly on your design, and you may find the precision of the ADC to be the limiting factor (e.g. an 8 bit 5V ADC has a resolution of 19.5mV.) That said, the job of the amplifier is to match the range of values from your sensor to the input range of your ADC. While a linear relationship is intuitive and straightforward, it may be more desirable to have a curve to give greater sensitivity around the expected ranges but still report invalid values with slightly reduced precision. You would need to characterise the curve and program it into your flight controller for correct reporting.

* What range of output voltages does the FC expect?

This will depend entirely on the flight controller - but typical ranges for ADCs are 0 to 3.3V or 0 to 5V. Remember that if you want to report a negative reading, you will need to bias your zero value sensor ourput for mid range on the ADC.

* Is there any smoothing (lowpass filtering) applied to the sensor's output to reduce aliasing from possible high frequency current ripple?

Filtering is a good idea to help reduce unwanted values. The response time of the filter needs to be fast enough to capture valid changes while rejecting noise. You can compare the filter response rate to your sample rate - your filter response can be slower if you are checking the voltage every 0.5 seconds instead of every 0.05. Alternatively you may decide to do some filtering in software, sampling several times and averaging, but this takes CPU time away from other tasks.

> **Comments:**
> **username_0**: Thank you for the answer! While it is appreciated, it's also mostly theoretical thoughts about the general case, and they mostly mirror my own thoughts (which is nice). The problem with that, and why I'm asking this question in the first place, is that these conclusions, due to being theoretical, may or may not be true. This is why I'm asking _how it's done in commercially available sensors_, as these designs have been tested in practice and engineered using all the knowledge regarding how all of the factors I'm asking about would play out in this particular domain.  

---

### Answer by username_2 on 2020-05-02. Score: 2

Using [PM07](https://docs.px4.io/master/en/power_module/holybro_pm07_pixhawk4_power_module.html) power management board from Holybro as an example. They use shunt resistor on the high side. Voltage across the shunt resistor is then fed into the Texas Instruments [INA169](https://www.ti.com/product/INA169) current sense amplifier. Gain and BW of the amplifier is set using an external resistor. I was designing my own power management board recently and had exactly the same questions as you do. In the end, rather than inventing my own solution, I used the typical usage example given in INA169 data sheet with the PCB layout adjusted to my needs.


---

