• 大小: 2.60M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-04-13
  • 语言: C/C++
  • 标签: 例程  电机  控制  

资源简介

电机控制例程

资源截图

代码片段和文件信息

#include “Park.h“
#include “Svgen.h“

//#define Sq3OV2 0.866  //
#define Sq3OV2 887 //0.866*1024
//#define Sq3OV2 0x6ED9  //sqrt(3)/2 in 1.15 format
/***********************************************************************
                                                             
Filename:       CalcRef.s                                
Date:           10/01/08                                     
                                               
CalcRefVec

Description:        
Calculate the scaled reference vector (Vr1Vr2Vr3) from qValphaqVbeta.
The method is an modified inverse Clarke transform where Valpha & Vbeta 
are swapped compared to the normal Inverse Clarke.

Vr1 = Vbeta
Vr2 = (-Vbeta/2 + sqrt(3)/2 * Valpha)
Vr3 = (-Vbeta/2 - sqrt(3/2) * Valpha)

Functional prototype:
void CalcRefVec(tParkParm *pParkparm)
**********************************************************************/
// extern u32 MeasCompCalculateClarkeDoConSinInvCalcRefCalcSVG;

void CalcRefVec(tParkParm *pParkparmtSVGenParm *pSVGenParm)
{
s32 valtemp1; 
s16 ValphaW = pParkparm->qValpha;
s16 VbetaW = pParkparm->qVbeta;

pSVGenParm->qVr1 = VbetaW ;//Q15
valtemp1 = Sq3OV2 * ValphaW;
pSVGenParm->qVr2 = RIGHSHIFT10(valtemp1) - RIGHSHIFT1(VbetaW); //pSVGenParm->qVr2 = ((Sq3OV2 * ValphaW)/1024) - (VbetaW /2);     //pSVGenParm->qVr2 = ((Sq3OV2 * ValphaW)>>10) - (VbetaW>>1);//  //Q15
valtemp1 = -Sq3OV2 * ValphaW;
pSVGenParm->qVr3 = RIGHSHIFT10(valtemp1) - RIGHSHIFT1(VbetaW); //pSVGenParm->qVr3 = ((0-Sq3OV2 * ValphaW)/1024)  - (VbetaW /2);  //pSVGenParm->qVr3 = ((0-Sq3OV2 * ValphaW)>>10)  - (VbetaW>>1);//  //Q15
}


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-03-17 05:55  SW1800_MotorFOCDriver-master\
     目录           0  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\
     文件        1645  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\CalcRef.c
     文件        1447  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\ClrkPark.c
     文件         326  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\Control.h
     文件        2454  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\FdWeak.c
     文件         572  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\FdWeak.h
     文件        2210  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\General.h
     文件        1136  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\InitMcu.c
     文件         912  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\InvPark.c
     文件         961  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\MeasCurr.c
     文件         634  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\MeasCurr.h
     文件       36353  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\PMSM.c
     文件        1127  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\Park.h
     文件         169  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\Parms.h
     文件        1676  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\Pi.c
     文件         651  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\Pi.h
     文件         372  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\ReadADC.h
     文件         987  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\SVGen.h
     文件       16740  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\Smc.c
     文件        5825  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\Smc.h
     文件       15029  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\Svgen.c
     文件        6363  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\Trig.c
     文件       11547  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\UserParms.h
     文件       20695  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\faultprotect.c
     文件        6074  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\faultprotect.h
     文件       23966  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\swm1500_uart.c
     文件        3381  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\swm1500_uart.h
     文件         300  2017-03-17 05:55  SW1800_MotorFOCDriver-master\APP\typedef.h
     目录           0  2017-03-17 05:55  SW1800_MotorFOCDriver-master\CSL\
     目录           0  2017-03-17 05:55  SW1800_MotorFOCDriver-master\CSL\CMSIS\
............此处省略192个文件信息

评论

共有 条评论