I'm not sure what I should be asking for because some of the terminology is confusing to me, but what I'm trying to do is use the two motor timers (TIM1 and TIM8) on the STM32F405 to sample BEMF on a sensorless BLDC driver.
On a previous version of this hardware, I was using an F411 and only driving one motor, so what I was doing was the following:
- Set up the hardware timer PWM outputs of TIM1 to drive the gate driver (CH1, CH1N, CH2, CH2N, CH3 CH3N)
- Set up the timer to run at 20kHz and change the duty cycle using a PI controller. PWM is driven using Center Aligned Mode 3.
- Set up CH4 of TIM1 to count to 1. Use this event to trigger an ADC injected conversion of the 3 BEMF resistors.
This works OK, albeit rather hackey....I know that's not right, but it was working.
However, now that I'm trying to drive two motors with two different motor timers, I can't lean on this same method because I'm not allowed to sample more than 4 injected conversions at a time....What is the right way to use two motor timers to drive two independent BLDC motors and grab the required 6 BEMF signals at the top of the center aligned PWM signal?