打印

LKS08x_FOC_SensorLessV4.27.1程序问题咨询

[复制链接]
1182|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
hfwangzc|  楼主 | 2022-11-21 13:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
各位大神,你好!如下AdcSampleCal函数中CurrentPerUnitGAIN参数,初始化赋值的地方,一直没有找到,还请各位帮忙,回复下,谢谢。。。
*******************************************************************************
函数名称:    void AdcSampleCal(stru_FOC_CtrProcDef *this)
功能描述:    电流采样
输入参数:    stru_FOC_CtrProcDef *this 结构体指针
输出参数:    无
返 回 值:    无
其它说明:    1.电流采样,采集AB两相电流
修改日期      版本号          修改人            修改内容
-----------------------------------------------------------------------------
2020/8/5      V1.0            Wencai.Zhao Howlet Li          创建
*******************************************************************************/
void AdcSampleCal(stru_FOC_CurrLoopDef *this)
{
    stru_CurrPhaseUVW t_StatCurrUV;

#if (CURRENT_SAMPLE_TYPE == CURRENT_SAMPLE_1SHUNT)
    t_StatCurrUV = SVPWM_1ShuntGetPhaseCurrent(this); /* 读取ADC采样到的相电流值 */
#else

#if (CURRENT_SAMPLE_TYPE == CURRENT_SAMPLE_2SHUNT)
    t_StatCurrUV = SVPWM_2ShuntGetPhaseCurrent(this); /* 读取ADC采样到的相电流值 */
#else
#if ((CURRENT_SAMPLE_TYPE == CURRENT_SAMPLE_3SHUNT)||(CURRENT_SAMPLE_TYPE == CURRENT_SAMPLE_MOSFET))
    t_StatCurrUV = SVPWM_3ShuntGetPhaseCurrent(this); /* 读取ADC采样到的相电流值 */
#endif
#endif
#endif

    /* 电流标幺化处理 */
                        this->mStatCurrUVW.nPhaseU = _IQ15mpy(t_StatCurrUV.nPhaseU, struFluxOB_Param.CurrentPerUnitGAIN);
                        this->mStatCurrUVW.nPhaseV = _IQ15mpy(t_StatCurrUV.nPhaseV, struFluxOB_Param.CurrentPerUnitGAIN);
                        this->mStatCurrUVW.nPhaseW = -(this->mStatCurrUVW.nPhaseU + this->mStatCurrUVW.nPhaseV);
    /* clark变换 */
          if(struFOC_CtrProc.bMotorDirtionCtrlPhase == CW)
                {
       this->mStatCurrAlfaBeta.nBeta = _IQ15mpy(18919, (this->mStatCurrUVW.nPhaseV - this->mStatCurrUVW.nPhaseW));
    }else{
                         this->mStatCurrAlfaBeta.nBeta = _IQ15mpy(18919, (this->mStatCurrUVW.nPhaseW - this->mStatCurrUVW.nPhaseV));
                }
                this->mStatCurrAlfaBeta.nAlph = this->mStatCurrUVW.nPhaseU;

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

1

帖子

0

粉丝