cancel
Showing results for 
Search instead for 
Did you mean: 

FOC SVPWM code,why are hCntPhA/B/C the TIM_CCR value?

Lzhiy.1
Associate II

Take the 1st sector as an example,Tim1 is configured in center-aligned mode,in function PWMC_SetPhaseVoltage Ta,Tb,Tc is figured out,then TIM_CCR1~3 are set to Ta,Tb,Tc.But in my opinion,TIM_CCR1~3 should be set as below.What do I get wrong?0693W00000FCnlyQAD.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
rpip.1
Associate III

The V-shaped triangle means TIMER count from ARR to 0, 0 to ARR. so Ta,b,c is applied. If TIMER is counting as 0 to ARR, ARR to 0, then your opinions is right.

View solution in original post

2 REPLIES 2
rpip.1
Associate III

The V-shaped triangle means TIMER count from ARR to 0, 0 to ARR. so Ta,b,c is applied. If TIMER is counting as 0 to ARR, ARR to 0, then your opinions is right.

cedric H
ST Employee

Hello @Lzhiy.1​ ,

I am not sure I fully understand your concern, but please note that the Timer is configured in PWM mode 1.

PWM mode 1 - In upcounting, channel [1-3] are active as long as TIMx_CNT<TIMx_CCR[1-3]

else inactive. In downcounting, channel [1-3] are inactive as long as TIMx_CNT>TIMx_CCR[1-3] else active.

Regards

Cedric