Problems with theta calculation in PMSM Vector Control function

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problems with theta calculation in PMSM Vector Control function

ソリューションへジャンプ
2,144件の閲覧回数
peterdufault
Contributor III

I'm still working with something based on AN3206.  I'm trying to figure out what's wrong with my commutation, and I started reading back the theta from the eTPU.  It doesn't make any sense to me.

I have a 4000 count encoder and a motor with two pole pairs.  According to the function description theta = (2 * encoder)/4000, so theta should advance twice for each cycle.  However, it isn't even synchronized with the zero position of the encoder.  See the attached plot.

In etpu_pmsmvc.c scale is set to scale = motor_pole_pairs * 0x1000000 / qd_pc_per_rev; .

Since there was not a "get theta" function I added one like this:

fract24_t fs_etpu_pmsmvc_get_theta(uint8_t channel)

{

    uint32_t *pba;

    pba = fs_etpu_data_ram(channel) + (0x4000 >> 2);

    return (fract24_t)(*(pba + ((FS_ETPU_PMSMVC_THETA_OFFSET) >> 2)));

}

Any ideas?

0 件の賞賛
返信
1 解決策
1,896件の閲覧回数
peterdufault
Contributor III

Never mind.  I had used the PMWmaster channel instead of the PMSMVC_channel and happened to get back that thing that went from -1 to 1.  Now that I've fixed it I get what I expect.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,896件の閲覧回数
peterdufault
Contributor III

Well, whatever I'm getting back with that fs_etpu_pmsmvc_get_theta() function it isn't theta.  Even if I stop the motor rotation I get the same -1 to 1 ramp.  I've asked Freescale for the eTPU code that is being generated by the eTPU function selector so I can figure out what's going on.

0 件の賞賛
返信
1,897件の閲覧回数
peterdufault
Contributor III

Never mind.  I had used the PMWmaster channel instead of the PMSMVC_channel and happened to get back that thing that went from -1 to 1.  Now that I've fixed it I get what I expect.

0 件の賞賛
返信