Wrong polarity of PWM Complementary Output

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Wrong polarity of PWM Complementary Output

跳至解决方案
1,637 次查看
engineer_attila
Contributor III

Hi,

I'm using MCSPTR2A5775E 3-phase PMSM Motor Control Kit for learning purpose.

I setup the environement and then flash the default program. Kit worked without any problem , i also watch the variables real time on FreeMASTER

I attached the logic analzer pins related eTPU pins (as a described on AN13038 document page 33)(Phase A HS, Phase A LS, Phase B HS, Phase B LS, Phase C HS, Phase C LS, PWMM Reload, Resolver Excitation Output)

but i didn't see complementary PWM signal pairs , and also resolver excitation signal looks wrong polarity according to AN13038 page 18.

RGHT.png

LFT.png

sayfa18.png

2 pictures taken when the motors right and left spinned and another picture is reference on AN13038.

What is the wrong on my setup?

Regards,
Attila

0 项奖励
1 解答
1,630 次查看
johndiener
Contributor IV

Hello Attila,

With regards to PWM polarity I believe there is a mismatch between the example system timing shown in Figure 17 (which you included above) and what is required for the hardware of this kit.  Figure 17 shows base and complementary active high PWM signals, but I believe the kit hardware (see Figure 5) requires active low on the base channel and active high on the complementary, so your analyzer snapshots look correct to me.  Here is the pertinent configuration code in etpu_gct.c:

struct pwmm_instance_t pwmm_instance =
{
ETPU_PWMM_MASTER_CH, /**< Channel number of the PWMM master channel. */
ETPU_PWMM_PHASEA_BASE_CH, /**< Channel number of the Phase A channel. */
ETPU_PWMM_PHASEB_BASE_CH, /**< Channel number of the Phase B channel. */
ETPU_PWMM_PHASEC_BASE_CH, /**< Channel number of the Phase C channel. */
FS_ETPU_PRIORITY_MIDDLE, /**< Channel priority for all PWMM channels. */
FS_ETPU_PWMM_FM0_COMPLEMENTARY_PAIRS, /**< Type of phases. */
FS_ETPU_PWMM_POLARITY_BASE_ACTIVE_LOW |FS_ETPU_PWMM_POLARITY_COMPL_ACTIVE_HIGH, /**< Base and complementary channel polarity */
(uint24_t)USEC2TCR1(180),
0 /**< Channel parameter base address */
};

With regards to the excitation signal, it runs at 10.016 kHz whereas the PWM is exactly 10 kHz - thus its phase relative to the PWM will drift and just depend upon when you take a snapshot.

John Diener

在原帖中查看解决方案

2 回复数
1,631 次查看
johndiener
Contributor IV

Hello Attila,

With regards to PWM polarity I believe there is a mismatch between the example system timing shown in Figure 17 (which you included above) and what is required for the hardware of this kit.  Figure 17 shows base and complementary active high PWM signals, but I believe the kit hardware (see Figure 5) requires active low on the base channel and active high on the complementary, so your analyzer snapshots look correct to me.  Here is the pertinent configuration code in etpu_gct.c:

struct pwmm_instance_t pwmm_instance =
{
ETPU_PWMM_MASTER_CH, /**< Channel number of the PWMM master channel. */
ETPU_PWMM_PHASEA_BASE_CH, /**< Channel number of the Phase A channel. */
ETPU_PWMM_PHASEB_BASE_CH, /**< Channel number of the Phase B channel. */
ETPU_PWMM_PHASEC_BASE_CH, /**< Channel number of the Phase C channel. */
FS_ETPU_PRIORITY_MIDDLE, /**< Channel priority for all PWMM channels. */
FS_ETPU_PWMM_FM0_COMPLEMENTARY_PAIRS, /**< Type of phases. */
FS_ETPU_PWMM_POLARITY_BASE_ACTIVE_LOW |FS_ETPU_PWMM_POLARITY_COMPL_ACTIVE_HIGH, /**< Base and complementary channel polarity */
(uint24_t)USEC2TCR1(180),
0 /**< Channel parameter base address */
};

With regards to the excitation signal, it runs at 10.016 kHz whereas the PWM is exactly 10 kHz - thus its phase relative to the PWM will drift and just depend upon when you take a snapshot.

John Diener
1,622 次查看
engineer_attila
Contributor III


Hello John,

Thahk you for quick response.

You are right. After i checked the MC33937 datasheet, i noticed base channel is active low logic, complementary channel is active high logic.

PHA.png

Regards,

Attila

0 项奖励