cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G4 Window Comparator Alternatives

BPaik
Senior

I am designing a motor controller PCB that uses an STM32G4 MCU (since the CORDIC accelerator and FPU will be useful in my application). One of the required features for this project is cycle-by-cycle current limiting for a BLDC motor. I have two phase current sensors for phases A and B which I am reading through inputs that have an ADC and comparator. In the documentation I read how the comparators can be used to implement cycle-by-cycle current limiting. However, I need to be able to apply current limiting to positive and negative currents (i.e. the current magnitudes) of each phase. It looks like comparator window mode is meant to solve this exact problem. However, it appears that the STM32G4 series comparators do not have window mode. Is there a recommended alternative to window mode that would allow me to cycle-by-cycle current limit on both positive and negative current peaks?

3 REPLIES 3

The break circuitry for timers in 'G4 is impressively complex, can't that be used to merge inputs from two comparators, effectively providing the needed window?

JW

Is your suggestion that I physically route the current signal to another pin for the complementary comparator? In other words, each current signal would be physically connected to two pins - one for each comparator? I considered this approach, but it seemed a somewhat cumbersome solution. Since the STM32G4 is the most advanced MCU in the "mainstream MCU" line, I was surprised that it did not appear to support window mode while the lower end STM32F3 did. Thus, I wanted to see if there was a way to effectively accomplish the same thing though some kind of internal multiplexing. Or perhaps is the STM32F3 the only one intended for BLDC motor control and not the STM32G4?

*Some* 'F3 have comparators with adjustable hysteresis and speed/consumption, the 'G4 don't. The 'G4 ADC appear to be picky. Throwing a million transistors at the problem may result in something impressive yet it won't get "universally better". In some ways, 'G4 (nor 'F3) does not surpass an NE555...

JW