C51 COMPILER V9.52.0.0   PID                                                               03/23/2017 15:15:41 PAGE 1   


C51 COMPILER V9.52.0.0, COMPILATION OF MODULE PID
OBJECT MODULE PLACED IN .\Output\PID.obj
COMPILER INVOKED BY: C:\Keil_v4\C51\BIN\C51.EXE PID.c LARGE OMF2 WARNINGLEVEL(0) BROWSE INCDIR(..\Library\FU68xx_Hardwar
                    -e_Driver\Include;..\User\Include) DEBUG PRINT(.\Listing\PID.lst) TABS(2) OBJECT(.\Output\PID.obj)

line level    source

   1          /**************************** (C) COPYRIGHT 2015 Fortiortech shenzhen *****************************
   2          * File Name          : PID.c
   3          * Author             : Billy Long Fortiortech  Market Dept
   4          * Version            : V1.0
   5          * Date               : 01/07/2015
   6          * Description        : This file contains PI control function used for Motor Control.
   7          ***************************************************************************************************
   8          * All Rights Reserved
   9          **************************************************************************************************/ 
  10          
  11          
  12          /* Includes -------------------------------------------------------------------------------------*/
  13          #include <FU68xx.h>
  14          #include <Myproject.h>
  15          
  16          /* Private variables ----------------------------------------------------------------------------*/
  17          bit FlagStartPI = 0;
  18          
  19          Ramp_TypeDef idata SpeedRamp;
  20          PID_TypeDef idata SpeedPID;
  21          PID_TypeDef idata CurrentPID;
  22          PID_TypeDef idata PowerPID;
  23          
  24          uint16 Delta_Current=0;
  25          uint16 Delta_Speed = 0;
  26          uint16 TargetSpeed = VFTargetSpeed1;
  27          
  28          void SetCurrent(uint16 TargetCurrent)
  29          { 
  30   1          if(ADCData.RCCurrentBUS < TargetCurrent)
  31   1          {
  32   2              Delta_Current = TargetCurrent-ADCData.RCCurrentBUS;
  33   2              if(Delta_Current>CurrentPrecision1)
  34   2              { 
  35   3                if(TargetSpeed< VFTargetSpeed4)
  36   3                {                     
  37   4                    TargetSpeed+=1; 
  38   4                    if(TargetSpeed> VFTargetSpeed4)
  39   4                    {
  40   5                      TargetSpeed = VFTargetSpeed4;
  41   5                    }                   
  42   4                }
  43   3              }
  44   2              else
  45   2              {
  46   3                  MC.SpeedCtl.TargetSpeed = TargetSpeed;
  47   3              }
  48   2          }
  49   1          else
  50   1          {
  51   2            Delta_Current = ADCData.RCCurrentBUS-TargetCurrent;
  52   2            
  53   2            if(Delta_Current>CurrentPrecision1)
  54   2              {
C51 COMPILER V9.52.0.0   PID                                                               03/23/2017 15:15:41 PAGE 2   

  55   3                if(TargetSpeed>VFTargetSpeed1)
  56   3                {
  57   4                  TargetSpeed-=1;
  58   4                  if(TargetSpeed < VFTargetSpeed1)
  59   4                  {
  60   5                    TargetSpeed = VFTargetSpeed1;
  61   5                  }
  62   4                }       
  63   3              }
  64   2            else
  65   2            {
  66   3              MC.SpeedCtl.TargetSpeed = TargetSpeed;
  67   3            }  
  68   2            
  69   2          }
  70   1        MC.SpeedCtl.TargetSpeed = TargetSpeed;  
  71   1      }
  72          
  73          
  74          


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


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