C51 COMPILER V9.52.0.0   MCFIELDWEAKEN                                                     08/29/2018 19:34:23 PAGE 1   


C51 COMPILER V9.52.0.0, COMPILATION OF MODULE MCFIELDWEAKEN
OBJECT MODULE PLACED IN .\Output\mcFieldWeaken.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ..\User\Source\Function\mcFieldWeaken.c LARGE OMF2 WARNINGLEVEL(0) OPTIMIZE
                    -(5,SPEED) BROWSE INCDIR(..\Library\FU68xx_Hardware_Driver\Include;..\User\Include) DEBUG PRINT(.\Listing\mcFieldWeaken.l
                    -st) TABS(2) OBJECT(.\Output\mcFieldWeaken.obj)

line level    source

   1          /**************************** (C) COPYRIGHT 2017 Fortiortech shenzhen *****************************
   2          * File Name          : mcFieldWeaken.c
   3          * Author             : Fortiortech Appliction Team
   4          * Version            : V1.0
   5          * Date               : 2017-12-27
   6          * Description        : This file contains main function used for Motor Control.
   7          ***************************************************************************************************
   8          * All Rights Reserved
   9          **************************************************************************************************/
  10          
  11          /* Includes -------------------------------------------------------------------------------------*/
  12          
  13          
  14          /* Includes -------------------------------------------------------------------------------------*/
  15          #include <FU68xx_2.h>
  16          #include <Myproject.h>
  17          
  18          /* Private variables ---------------------------------------------------------*/
  19          
  20          FIELDWEAKENING  xdata     mcFieldWeaken;      
  21          
  22          /*---------------------------------------------------------------------------*/
  23          /* Name   : void mcFieldWeakenComp(void)
  24          /* Input  : NO
  25          /* Output : NO
  26          /* Description: 弱磁函数控制程序
  27          /*---------------------------------------------------------------------------*/
  28          void mcFieldWeakenComp(void)
  29          {
  30   1          mcFieldWeaken.SpeedErr = mcSpeedRamp.ActualValue - mcFocCtrl.SpeedFlt;      // 计算速度误差
  31   1        
  32   1          if(mcFieldWeaken.CtrlFlag == 0)                                             // 系统初始化为0
  33   1          {
  34   2            if((mcFocCtrl.UqFlt > mcFieldWeaken.OpenFWUQ)&&(mcFieldWeaken.SpeedErr > mcFieldWeaken.SpeedErrTarget))
  35   2            {
  36   3              mcFieldWeaken.CompCnt++;
  37   3              if(mcFieldWeaken.CompCnt > mcFieldWeaken.InFWTime)                      // 连续判断UQ值大于设置门限后，记录速度环
             -输出值
  38   3              {
  39   4                mcFieldWeaken.CtrlFlag = 1;
  40   4              }
  41   3              
  42   3              mcFieldWeaken.SpeedOutFlt = LPFFunction(SpeedPICtrl.ExtOut,mcFieldWeaken.SpeedOutFlt,10);   // 滤波进入
             -弱磁函数时IQ值
  43   3            }
  44   2            else
  45   2            {
  46   3              mcFieldWeaken.CompCnt = 0;
  47   3            }
  48   2          }
  49   1          else                                                                        // 进入弱磁模式
  50   1          {
  51   2            if(mcFocCtrl.UqFlt > mcFieldWeaken.ClosedFWUQ)                            // UQ大于CloseFiledWeak值时才计算
C51 COMPILER V9.52.0.0   MCFIELDWEAKEN                                                     08/29/2018 19:34:23 PAGE 2   

  52   2            {
  53   3              if(SpeedPICtrl.ExtOut > mcFieldWeaken.SpeedOutFlt)
  54   3              {
  55   4                mcFieldWeaken.IDrefCompRef = mcFieldWeaken.SpeedOutFlt - SpeedPICtrl.ExtOut; 
  56   4              }
  57   3              else
  58   3              {
  59   4                mcFieldWeaken.IDrefCompRef = 0;
  60   4              }
  61   3            }
  62   2            else                                                                      // UQ小于CloseFiledWeak值时推出弱磁
  63   2            {
  64   3              mcFieldWeaken.IDrefCompRef = 0;
  65   3              mcFieldWeaken.CtrlFlag = 0;                                             // 退出弱磁
  66   3            }
  67   2            
  68   2            FOC_IDREF = mcFieldWeaken.IDrefCompRef;
  69   2          }
  70   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    280    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =     17    ----
   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)
