cancel
Showing results for 
Search instead for 
Did you mean: 

AC current measurement for bldc motor in STM32

Ss.111
Associate II

I need to know about the AC current measurement for the BLDC motor. I tried to measure phase current for only one phase for two commutation states. I use the STM32F103C8 controller for controlling the BLDC motor. I need some clarification on measuring phase currents for the BLDC motor. I use Timmer 1 to generate PWM and Timmer 4 for changes that occur in the commutation state (ie Step change occurs using XOR operation) and I am using the MOSFET Rdson method to measure the phase current (AC current) and ADC2 injected method for measuring the voltage drop on Rdson.

I tried to measure the phase current for only one phase (phase - B) for two commutation states(state1,state3). since the value, I get from ADC2 is varying So I tried to make an average of that ADC2 reading. I used TIM1 interrupt for PWM generation (15KHz) and for some calculations that include summing up the ADC2 reading, and the average part is done in TIM4. But it does isn't work again there is a variation in the reading. So is there any method for measuring phase current so that it helps me to measure the current.

The MOSFET Rdson method is that when the current is passed through the MOSFET there will be a voltage drop across the source to drain. the voltage drop is amplified by the OP-amp and the output is read in ADC2

Scope Image of the amplified signal

0693W00000aH5YVQA0.png0693W00000aH5YaQAK.png

1 REPLY 1
Javier1
Principal

I dont see any BACK-eMF Slope.

(which in reality is just the magnet passing in front of the non driven coil)

source: @Kenji​ 

0693W00000aH68JQAS.pngYoure not leaving the "measuring" phase floating, there should be always two phases being driven and one floating being measured by the ADC.

https://community.st.com/s/question/0D53W00000j6VDfSAM/bldc-how-to-get-trapezoidal-backemf-waveform?t=1676642036457

we dont need to firmware by ourselves, lets talk