(Will translate it to English soon. In the meantime try your luck w/ Google Translator or the built-in one. )
“ImotShunt” is a virtual shunt resistor. It acts on the current reported by the ESC – and, of course, via cumulation over time on the result: mAh.
One should also always keep in mind how “measurement” looks like here:
It is already somewhat different whether I am measuring at the battery end where everything has already calmed down by the low-ESR caps – or in the ESC itself. The current there has a dynamic with a shape which is not DC but also not AC (no sine wave). This is simply “dynamic madness”. If there is a constant reversal of polarity per revolution (commutation) there are x temporal phases in which the insanity is measured.
What is “to accumulate mAh”? The ESC measures at any time. At another time he pushes this value via data line to S32. S32 cumulates the values. In this case S32 can only act as if the current I1 had remained constant from time t1 to the new value I2 at time t2. Of course it was not so. The integrative effect caused by the cumulation is the same as on the battery side but the battery gets to see every value over time, while the ESC does not report every value to cumulate. Therefore, it is actually better if the ESC itself cumulates, if it is really correct measured and frequently enough. This eliminates the temporal “you-let-me-dumb-die” hole between the updates on the data line.
However, it has been shown from purely practical experience in the use of JLog in the past 6 years that time steps of 100ms are perfectly adequate when observing the process, which ends up in the log and in the mAh cumulation. In contrast to other theory, one does not miss anything that can be measured at all. Thus, on above mentioned “time gap”: The update rate of each ESC with data output is currently sufficient for sufficient accuracy in the accumulation of the mAh.
In principle, the following applies: Who measures, measures crap. (German: “Wer misst, misst Mist”) This is not a measuring device – and from measuring instrument to measuring instrument you must always ask who the reference was.
ImotShunt acts basically on Imot even if the ESC accumulates and transmits mAh itself (ImotShunt is then also applied separately to this mAh), – even if the current is measured by S32 itself using the C200 Hall core.
S32 (its developer) of course does not really know how the “measurement” in the respective ESC is designed. Especially by the commutation and by the measuring point one could have done much less well. The current sensor itself is also a factor – is it calibrated, is it temperature-compensated? For example, when you measure in series with the motor lines, the point is how to deal with the fact that the respective phase is only active for a part of the time. Then there is the conversion time of the used ADC which can interfere with PWM duty and frequency. Thus, with the same motor on the same ESC, with the same battery and the same ImotShunt value, the result “mAh” can fluctuate synchronously with the “aggressiveness” of the flight, more precisely, the course of the PWM during the flight.
Additional question: If the ESC measures the motor current but not Ibec, – where does the “peanuts” remain that the BEC in the ESC consumes on the primary side? S32 adds the “peanuts” of the HV²BEC, so used, connected to the databus and in the setup.