I come here because I am struggling to understand the signals coming from my 3 phase BLDC motor current. I am using a BLDC motor with a DRV8323RS driver in 1xPWM mode with Hall sensors. I measure the current A, B and C using low sense resistor R_sense of 2mOhm as described in the typical application of the datasheet (cf schematics below).
The gain amplifier G_csa of the DRV8323RS chip is set to 20V/V. The current measurement is set as bidirectional. The voltage of the sense resistor is outputed on SOA, SOB and SOC and routed to the ADCs of my µC. I sample these 3 ADC channels of my µ-controller and I send the current via UART to my computer.
I do the conversion from voltage to current with the following equation with SOx on 16-bits resolution :
Regarding the following pictures I can see several problem :
Picture 1 shows the currents with the motor being moved by hand and no voltage applied. We can see an offset of approximately -2A when there is nothing happening. Then we see the resulting current of the Back EMF which looks OK
Picture 3 shows the currents when the motor has 2V applied with a load by hand to slow down the commutation. Here we see that the shape of the signal looks correct for the green BUT not so much for the blue and red ones. Why the red has a bigger magnitude that the others ? And why the blue signal does not go to negative ? Also, the currents measured seem to not have the correct order of magnitude as I could see on my power supply screen 0.5A. What can be wrong electrically or in my computation ?
- Picture 4 shows the currents with 6V (30% duty cycle) applied and a load by hand. Here the signals are not going negative except some spikes. What is happening ? I thought about aliasing but does not look like.
Update after progression :
I did some improvements on the measurements and partially solved the problem.
I measured with an external tool the static voltage out of the driver when there is no current flowing and I saw that the voltage was fluctuating between 1.61V and 1.65V where it is supposed to be static at 1.65V. This shows fluctuation but it is not big enough to explain a big offset of -2A shown in the original picture. This must come from an offset on the ADC channels. For the moment I compensated it by software.
I did a simple averaging filter for the noise.
The problem of some channels not going negative have been solved by increasing the sampling time of the ADC channels. The following picture shows the improvement on the motor running under 10% PWM. However, when the motor speed increases under 30% of PWM, I cannot get a good measurement even when I tried different ADC sampling times. It looks like the capacitive effect of the ADCs is too big to adapt with the changing voltage of the 3 channels.
My remaining questions are :
- How do you deal with this ADC limitation ? I was thinking about changing the gain of the amplifier to reduce the magnitude but I will loose in resolution.
- I still don't know why one of the channel has a bigger amplitude than the others, any idea ?
- How can I explain the difference between current consumption displayed on my DC power supply and the current measured with my ADCs (0.5A vs 4A) ? It is related with RMS ?
Thank you all for your help :)