cancel
Showing results for 
Search instead for 
Did you mean: 

Zero crossing detection with STM32G431CB.

Tejashree
Associate III

I want to detect zero crossing.I am able to read back emf with the pins provided on the board.I want to detect zero crossing using the bemf reading.I don't understand how to do it and what is the purpose of GPIO_bemf.0693W00000Kbu2vQAB.png 

1 REPLY 1
minozemstan
Associate II

I'm no expert, but I've read a similar post on this forum. Basically, it pulls the GPIO pin to the ground, when you want to measure the BEMF pin, and it effectively creates a voltage divider from those two resistors. Phase output is the supply, in this case; the GPIO_BEMF is pulled to the ground, and you measure the voltage on the ADC pin. The measured voltage should be Vmeasured = Vd + Vphase*2.2/(10+2.2). No idea how to measure the crossing point, though. Maybe by setting some low threshold (which is reasonably close to zero). This should be, however, solved by motor control libraries.