C51 COMPILER V9.52.0.0   FOCCONTROLFUNCTION                                                10/08/2018 09:40:38 PAGE 1   


C51 COMPILER V9.52.0.0, COMPILATION OF MODULE FOCCONTROLFUNCTION
OBJECT MODULE PLACED IN .\Output\FocControlFunction.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ..\User\Source\Function\FocControlFunction.c LARGE OMF2 WARNINGLEVEL(0) BRO
                    -WSE INCDIR(..\Library\FU68xx_Hardware_Driver\Include;..\User\Include) DEBUG PRINT(.\Listing\FocControlFunction.lst) TABS
                    -(2) OBJECT(.\Output\FocControlFunction.obj)

line level    source

   1          /**************************** (C) COPYRIGHT 2017 Fortiortech shenzhen *****************************
   2          * File Name          : FocControl.c
   3          * Author             : Vina Peng,Fortiortech  Appliction Team
   4          * Version            : V1.0
   5          * Date               : 10-Apr-2017
   6          * Description        : This file contains all the foc control function used for motor control.
   7          ***************************************************************************************************
   8          * All Rights Reserved
   9          **************************************************************************************************/
  10          
  11          
  12          /* Includes -------------------------------------------------------------------------------------*/
  13          #include <FU68xx_2.h>
  14          #include <Myproject.h>
  15          #endif
  16          
  17          /*---------------------------------------------------------------------------*/
  18          /* Name   : void Spwm_Init(void)
  19          /* Input  : NO
  20          /* Output : NO
  21          /* Description: 
  22          /*---------------------------------------------------------------------------*/
  23          void Spwm_Init(void)
  24          {
  25   1        /*使能Spwm*/
  26   1        ClrBit(DRV_CR, FOCEN);
  27   1        SetBit(DRV_CR, FOCEN);
  28   1            
  29   1        /*配置Spwm寄存器*/
  30   1        FOC_CR1       = 0X04;               //FOC_CR1寄存器配置
  31   1        FOC_CR2       = 0X03;               //FOC_CR2寄存器配置
  32   1        
  33   1        FOC_TRGDLY    = 0x00;               //配置电流采样时机
  34   1        FOC_CSO       = 0x00;               //写电流采样基准
  35   1        
  36   1        FOC_RTHEACC   = 0x00;               //爬坡加速度
  37   1        FOC__RTHESTEP = 0x00;               //爬坡速度                              
  38   1        FOC__RTHECNT  = 0x00;               //爬坡次数  
  39   1      
  40   1        /*电流环参数配置*/
  41   1        FOC_DMAX      = DOUTMAX;            //PI环输出UDmax
  42   1        FOC_DMIN      = DOUTMIN;            //PI环输出UDmin
  43   1      
  44   1        FOC_QMAX      = QOUTMAX;            //PI环输出UQmax
  45   1        FOC_QMIN      = QOUTMIN;            //PI环输出UQmax
  46   1        
  47   1        FOC_IDREF     = 0x00;               // 清零 Id
  48   1        FOC_IQREF     = 0x00;               // 清零 Iq
  49   1        
  50   1        FOC_DQKI      = 0x00;               //DQ轴KI系数
  51   1        FOC_DQKP      = 0x00;               //DQ轴KP系数
  52   1            
  53   1        FOC__UD       = 0x00;               //D轴电压
C51 COMPILER V9.52.0.0   FOCCONTROLFUNCTION                                                10/08/2018 09:40:38 PAGE 2   

  54   1        FOC__UQ       = 0x00;               //Q轴电压
  55   1        FOC__THETA    = 0x00;               //角度
  56   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    119    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
   EDATA SIZE       =   ----    ----
   HDATA SIZE       =   ----    ----
   XDATA CONST SIZE =   ----    ----
   FAR CONST SIZE   =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)
