This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TMS320F28069M:占空比值错误

Guru**** 2536010 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/941173/tms320f28069m-error-in-duty-cycle-values

器件型号:TMS320F28069M

尊敬的先生/女士:

代码:

#define PI 3.1415926

#define M 0.4  

双 θ= 0;

Theta-= 100 * PI *(PERIOD_COUNT / 10000.0);

//********* sector1********* //
if (theta>=0 && theta<(PI/6)||theta>=(11*PI/6)&& theta<=(2*PI))

D1 = 1/3+(2/PI)*M * cos (theta);
D3 = 1/3+(2/PI)*M * cos (theta+(2*PI/3));
D5 = 1/3+(2/PI)*M * cos (theta-(2*PI/3));

对于上述代码行、我的预期输出为  

当 θ 为0至30度时、D1值从0.587降至0.553、而当 θ 为330至360 度时、D1值从0.553降至0.587

当 θ 为0至30度时、D3的值在0.2060至0.1128之间变化、而当 θ 为330至360 度时、D3的值在0.333至0.206之间变化

当 θ 为0至30度时、D5值在0.206至0.3333之间变化 、而当 θ 为330至360 度时、D5值在0.333至0.206之间变化

但我在观察窗口中得到以下值

D1在0.2546至0.2231之间变化(θ 为0至30度)

D3在-0.1273至-0.2178之间变化 (θ 为0至30度)

D5在 -0.1273至-0.0053之间变化 (θ 为0至30度)

请帮助我解决此问题

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    ADDAGUDURU、

    您是否尝试过实时调试 D1、D3和 D5值?

    暂停 CPU、打开表达式窗口、并观察变量。 我建议使用计算器验证计算结果。 如果一切正常、打开 Register veiwer、并确保您的 CMPx 和 TBPRD 寄存器正确。


    此致、
    Cody  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    感谢您的回复。