【翌创ET6001测评】FOC电流环算力
<div class='showpostmsg'><p>测试目的:</p><p > 评估在200M主频下的执行FOC电流环的算力</p>
<p >测试结果:</p>
<p > 如下图所示,ADC完成采样中断时,置IO为高电平,读ADC,计算FOC电流环,设置PWM输出,置IO为低电平。测试得到单次FOC电流环时间为1.72uS。</p>
<p > </p>
<p >说明:</p>
<p > 由于我开发环境,暂无法DEBUG,无法单次调试抓内存数据,只能通过GPIO测定FOC电流环执行时间;</p>
<p >开发板是只有IO的最小系统,没有BLDC电控需要的MOS驱动以及ADC配合PGA的真实采样环路,所以测试的仅为算力测试。一般在100M的M4F上测试,最快常规是5us,本次在ET6001上测到1.72比预期好很多,但由于没有真实的硬件回路,一些过调制case无法执行到。</p>
<p > </p>
<p>入口代码</p>
<pre>
<code>void AdcIrq(void)
{
System_Obj *pS = &SystemObj;
pS->Ia = ADC1->SARC_RESULT.RESULT&0xFFFF;//u
pS->Ib = ADC1->SARC_RESULT.RESULT&0xFFFF;//v
pS->UdcAdc = ADC1->SARC_RESULT.RESULT&0xFFFF;//vbus
pS->SpeedR = ADC1->SARC_RESULT.RESULT&0xFFFF;//spped r
//电流环计算
MotorCurrentLoop(&SystemObj);
}
#define POLS (2)
#define LD (0.000925f)
#define LQ (LD)
#define RS (0.358000f)
#define FI (0.01374f)
void VarInit(System_Obj *pSysObj)
{
extern uint32_t SystemCoreClockFrequency;
pSysObj->MainFreq = SystemCoreClockFrequency;
pSysObj->PwmFreq = 10000;
pSysObj->CtrlFreq = 2000;
pSysObj->HalfDuty = MyDiv16(SystemObj.MainFreq , SystemObj.PwmFreq,0,0)>>2;
pSysObj->VolSampBase = 105;
pSysObj->CurSampBase = 10;
MotorSetParam(RS,LD,LQ,FI);
MotorContrlPamIni();
}
</code></pre>
<p> </p>
</div><script> var loginstr = '<div class="locked">查看本帖全部内容,请<a href="javascript:;" style="color:#e60000" class="loginf">登录</a>或者<a href="https://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php&action=wechat" style="color:#e60000" target="_blank">注册</a></div>';
if(parseInt(discuz_uid)==0){
(function($){
var postHeight = getTextHeight(400);
$(".showpostmsg").html($(".showpostmsg").html());
$(".showpostmsg").after(loginstr);
$(".showpostmsg").css({height:postHeight,overflow:"hidden"});
})(jQuery);
} </script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script> <p><span style="color:#1abc9c;"><img height="48" src="https://bbs.eeworld.com.cn/static/editor/plugins/hkemoji/sticker/facebook/congra.gif" width="48" /></span></p>
页:
[1]