I ported my FOC PMSM motor control project from LVMultiAxis+PfcKit platform to DRV8312EVM platform, however, I have not used the on-chip InstaSpin feature yet. My motor spins well, my question is about the sample timing of the three phase current.
I use ePWM1 SOCA for ADC SOC, the ePWM1 is configured up-down counting mode, AQCTLA is set to 0x0060 (i.e., CAU = 10b, CAD = 01b).
At first, I set ePWM1 SOCASEL = TBPRD because I thought that's the mid-point of PWM positive pulses. However, the phase samp data are incorrect, merely glitches.
Then I set ePWM1 SOCASEL = ZERO, the phase current data are all correct, and the plot waveforms show smooth sine waves.
So why the sample timing has to be set when the PWM counter is zero, where it is the mid-point of negative PWM pulses? Is the half H-bridge positively or negatively activated? When is the best sample timing of phase currents?
Thank you in advance for your support.