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.