B-G431B-ESC1 Current Control

Your calculation was very helpful, it would have taken me forever to figure that out. There is one small error, the shunt resistor value is 0.003 ohms instead of 0.03.

I performed some measurements using a shunt resistor value of 0.003 and gain of 64/7, in simpleFOC torque/voltage mode with a stalled motor. I averaged many measurements together using a low pass filter and compared the measurements to those obtained with a cheap multimeter. All measured values are within 0.03 amps, average error 0.014 amps. We can conclude that these parameters result in low bias.

ChgsgKS

Here is a trace of successive measurements with the motor rotating at a very slow speed:

The error appears to be approximately normally distributed, with a standard deviation about 0.04 amps. The measurement error does not appear to increase when driving more current. This means the percentage error becomes lower as currents become larger.

We can use oversampling to reduce the measurement error. We would have to implement this in software, with ADC_TRIGGEREDMODE_SINGLE_TRIGGER (multiple samples per trigger) the chip is only fast enough for 2x oversampling. ADC_TRIGGEREDMODE_MULTI_TRIGGER doesn’t work for our use case.

I tried modifying the dma interrupt to not trigger during the off duty cycle, but didn’t get anywhere.

2 Likes