7
$\begingroup$

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.

$\endgroup$

2 Answers 2

5
$\begingroup$
  • 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.

$\endgroup$
1
  • $\begingroup$ 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. $\endgroup$ Commented Apr 17, 2020 at 16:13
2
$\begingroup$

Using PM07 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 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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.