永磁同步电机编码器反馈回来的角度处理
speed_fr->T = 0.00005;
speed_fr->baseFreq = 230;
speed_fr->polePairs = 4;
speed_fr->filterCutoff =(2 * MATH_PI * 100);
speed_fr->K1 =1.0f / (speed_fr->baseFreq * speed_fr->T);
speed_fr->K2 =1.0f / (1.0f + (speed_fr->T * speed_fr->filterCutoff) ) ;
speed_fr->K3 =1.0f - speed_fr->K2 ;
//! \brief Runs the Speed_FR module
//! \param Speed_frHandleThe Speed_FR handle
//! \param ElecTheta The position of the motor
//! \param speed_out The speed of the motor
inline void SPEED_FR_run(SPEED_FR_Handle Speed_frHandle, const float32_t ElecTheta, float32_t* speed_out )
{
SPEED_FR_Obj *speed_fr = (SPEED_FR_Obj *)Speed_frHandle;
if( (ElecTheta < (0.9f)) & (ElecTheta > 0.1f ) )
{
speed_fr->Tmp_fr = speed_fr->K1 * ( ElecTheta - speed_fr->OldElecTheta);
}
else
{
speed_fr->Tmp_fr = speed_fr->Speed;
}
// Low-pass filter
speed_fr->Tmp_fr = (speed_fr->K2 * speed_fr->Speed) + (speed_fr->K3 * speed_fr->Tmp_fr);
speed_fr->Tmp_fr = SPEED_FR_SAT(speed_fr->Tmp_fr, 1.0f, -1.0f);
speed_fr->Speed = speed_fr->Tmp_fr;
speed_fr->OldElecTheta = ElecTheta;
speed_fr->SpeedRpm = ( speed_fr->BaseRpm * speed_fr->Speed);
*speed_out = speed_fr->Speed;
}// end of SPEED_FR_run() function
上面这个函数中ElecTheta是编码器检测到的角度(电角度),为什么要对这个角度值进行处理呢,最后那个*speed_out 输出的是什么值呢?是速度还是角度? 根据编码器的电角度,驱动器好算出电机转子的位置。然后计算d,q轴电流参与电机矢量位置的控制。能否把整个程序流程多截取点看看,有点看不明白 windancerhxw 发表于 2016-8-19 22:50
根据编码器的电角度,驱动器好算出电机转子的位置。然后计算d,q轴电流参与电机矢量位置的控制。能否把整个 ...
这段我理解就是你说的算出电机转子位置,但是 if( (ElecTheta < (0.9f)) & (ElecTheta > 0.1f ) )为啥需要判断在0.1---0.9之间呢?这是所谓的滤波处理吗? 孤独的守望者 发表于 2016-8-22 09:33
这段我理解就是你说的算出电机转子位置,但是 if( (ElecTheta < (0.9f)) & (ElecTheta > 0.1f ) )为啥 ...
稍微查了一下这个函数,发现有注释以及算法详解:
TI详细解释速度算法的原理。
输出:
Speed Computed speed in per-unit GLOBAL_Q 80000000-7FFFFFFF
SpeedRpm Speed in rpm Q0 80000000-7FFFFFFF
至于ElecTherta的处理,我猜是判断运行与上次运行的对比,用于判断 windancerhxw 发表于 2016-8-25 12:25
稍微查了一下这个函数,发现有注释以及算法详解:
TI详细解释速度算法的原理。
那个说明手册在TI官网搜索什么可以下载到?能下载到其他函数的说明手册吗? 观摩学习~!学习学习学习 编程者,很佩服。观看学习成长了
页:
[1]