⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smopos.lst

📁 TI的digital motor control lib的源代码。了解TI的编程规范
💻 LST
📖 第 1 页 / 共 5 页
字号:
C:\TIC2XX\C2000\CGTOOLS\BIN\DSPA.EXE -q -v2xx -gs smopos.asm -o ..\obj\smopos.obj -l ..\temp\smopos.lst 

TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00  Tue May  6 12:41:27 2003
Copyright (c) 1987-1999  Texas Instruments Incorporated 
smopos.asm                                                           PAGE    1

       1            ;=====================================================================================
       2            ; File name:        SMOPOS.ASM                     
       3            ;                    
       4            ; Originator:   Digital Control Systems Group
       5            ;                       Texas Instruments
       6            ;
       7            ; Description:  Implementating a sliding mode current observer and estimating
       8            ;               the back EMF and rotor position for sensorless permanent-
       9            ;               magnet synchronous motor control 
      10            ;
      11            ; Note that thetae = (0,7FFFh) => (0,360 degree)
      12            ; 
      13            ;=====================================================================================
      14            ; History:
      15            ;-------------------------------------------------------------------------------------
      16            ; 03-01-2001    Release Rev 1.0
      17            ;================================================================================
      18            ; Applicability: F240,F241,C242,F243,F24xx.  (Peripheral Independent).
      19            ;================================================================================
      20            ; Routine Name: smopos_calc                                                                         Type: C Call
      21            ;  
      22            ;  C prototype : void smopos_calc(struct SMOPOS *p);
      23            ;
      24            ;        The struct object is defined in the header file "smopos.h" as follows:
      25            ;
      26            ; typedef struct {  int  vsalfa;         /* Input: Stationary alfa-axis stator voltage (Q15) */
      27            ;                   int  esalfa;         /* Variable: Stationary alfa-axis back EMF (Q15) */
      28            ;                   int  zalfa;      /* Output: Stationary alfa-axis sliding control (Q15) */
      29            ;                   int  gsmopos;    /* Parameter: Motor dependent control gain (Q15) */
      30            ;                   int  isalfae;    /* Variable: Estimated stationary alfa-axis stator current (Q15) */
      31            ;                   int  fsmopos;    /* Parameter: Motor dependent plant matrix (Q15) */
      32            ;                   int  vsbeta;         /* Input: Stationary beta-axis stator voltage (Q15) */
      33            ;                   int  esbeta;         /* Variable: Stationary beta-axis back EMF (Q15) */
      34            ;                   int  zbeta;      /* Output: Stationary beta-axis sliding control (Q15) */
      35            ;                   int  isbetae;    /* Variable: Estimated stationary beta-axis stator current (Q15) */
      36            ;                   int  isalfa;         /* Input: Stationary alfa-axis stator current (Q15) */
      37            ;                   int  isalfaerr;  /* Variable: Stationary alfa-axis current error (Q15) */                
      38            ;                   int  kslide;     /* Parameter: Sliding control gain (Q15) */
      39            ;                   int  isbeta;         /* Input: Stationary beta-axis stator current (Q15) */
      40            ;                   int  isbetaerr;  /* Variable: Stationary beta-axis current error (Q15) */                
      41            ;                   int  esalfalo;   /* Variable: Stationary alfa-axis back EMF - low word */                   
      42            ;                   int  kslf;       /* Parameter: Sliding control filter gain (Q15) */
      43            ;                   int  esbetalo;   /* Variable: Stationary beta-axis back EMF - low word */                   
      44            ;                   int  thetau;     /* Varialbe: Estimated rotor angle (Q15) */
      45            ;                   int  thetae;     /* Output: Compensated rotor angle (Q15) */
      46            ;                                       int  comp_ang_flg; /* Input: Compensated rotor angle flag, 1=comp., 0=no
      47            ;                   int  speedref;   /* Input: Reference speed (Q15) */
      48            ;                   int  (*calc)();      /* Pointer to calculation function */ 
      49            ;                                } SMOPOS;                  
      50            ;                        
      51            ;        Frame Usage Details:
      52            ;     step   |      a      |      b       |      c       |     d        |      e
      53            ;____________|_____________|______________|______________|_____________ |___________
      54            ;     AR0        | smoptemp(1) |  eserrlo(3)  |  ptr_smo(4)      |  smoptemp(5) |  delta(5) 
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00  Tue May  6 12:41:27 2003
Copyright (c) 1987-1999  Texas Instruments Incorporated 
smopos.asm                                                           PAGE    2

      55            ;     AR1        |  eserrhi(3) |   es_dq(4)   |                          |                              |       
      56            ;     AR2        | smoptemp(3) | esbeta_p(4)  |              |              |
      57            ;     AR3        | esalfa_p(4) |              |              |              |
      58            ;
      59            ;================================================================================
      60                            .def        _smopos_calc
      61            ;================================================================================
      62                                            .ref            ATANTAB_45  ; ArcTan look-up table (256 entries)        
      63            ;================================================================================
      64            ; Include rotor angle compensation table
      65            ;----------------------------------------------------------------------------------
      66                                            .include        cmptable.tab   ; Rotor position compensation table
      67            ;================================================================================
      68      0004  __smopos_calc_framesize .set 0004h
      69            ;================================================================================
      70 0100       _smopos_calc:
      71                                                                                                                    ; Assume
      72 0100 8aa0          POPD    *+                                                                      ; Keep return address
      73 0101 80a0          SAR     AR0,*+                                                          ; Keep old frame pointer (FP)
      74 0102 8180          SAR     AR1,*                                                           ; Keep old stack pointer (SP)
      75 0103 b004          LARK    AR0,__smopos_calc_framesize             ; Load AR0 with frame size      
      76 0104 00e8          LAR     AR0,*0+,AR0                                                     ; AR0->FP0 (new FP), ARP=AR0
      77            
      78            ;================================================================================
      79 0105 7c03                  SBRK    #3              ; ARP=AR0, AR0->FR0-3 (1st argument)            
      80            ;----------------------------------------------------------------------------------
      81 0106 0280                  LAR             AR2,*   ; ARP=AR0, AR0->vsalfa, AR2->vsalfa
      82            ;----------------------------------------------------------------------------------
      83 0107 7803                  ADRK    #3              ; ARP=AR0, AR0->FR0, AR2->vsalfa
      84            ;----------------------------------------------------------------------------------
      85 0108 8b8a                  MAR             *,AR2   ; ARP=AR2, AR0->FR0, AR2->vsalfa
      86            ;----------------------------------------------------------------------------------
      87 0109 be47                  SETC    SXM             ; Turn sign extension mode on
      88                                                            ; ARP=AR2, AR0->FR0, AR2->vsalfa
      89            ;----------------------------------------------------------------------------------
      90 010a be42                  CLRC    OVM             ; Set overflow mode off
      91                                                            ; ARP=AR2, AR0->FR0, AR2->vsalfa
      92            ;----------------------------------------------------------------------------------
      93 010b bf01                  SPM     1       ; Set product mode left shifted 1 bit
      94                                                    ; ARP=AR2, AR0->FR0, AR2->vsalfa
      95            ;----------------------------------------------------------------------------------
      96            ; (1) Sliding mode current observer
      97            ;     isalfae = fsmopos*isalfae + gsmopos*(vsalfa-esalfa-zalfa)
      98            ;     isbetae = fsmopos*isbetae + gsmopos*(vsbeta-esbeta-zbeta)
      99            ;----------------------------------------------------------------------------------
     100 010c       SMOI                    ; ARP=AR2, AR0->FR0, AR2->vsalfa
     101            ;----------------------------------------------------------------------------------
     102 010c 10a0          LACC    *+              ; ACC = vsalfa  (Q15)
     103                                                    ; ARP=AR2, AR0->FR0, AR2->esalfa
     104            ;----------------------------------------------------------------------------------
     105 010d 30a0          SUB             *+              ; ACC = vsalfa - esalfa (Q15)
     106                                                    ; ARP=AR2, AR0->FR0, AR2->zalfa
     107            ;----------------------------------------------------------------------------------
     108 010e 30a8          SUB             *+,AR0  ; ACC = vsalfa - esalfa - zalfa (Q15)
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00  Tue May  6 12:41:27 2003
Copyright (c) 1987-1999  Texas Instruments Incorporated 
smopos.asm                                                           PAGE    3

     109                                                    ; ARP=AR2, AR0->FR0, AR2->gsmoppos, ARP=AR0
     110            ;----------------------------------------------------------------------------------
     111 010f 9080                  SACL    *               ; FR0 = smoptemp = vsalfa - esalfa - zalfa (Q15)
     112                                                            ; ARP=AR0, AR0->FR0, AR2->gsmoppos
     113            ;----------------------------------------------------------------------------------
     114 0110 738a          LT              *,AR2   ; TREG = smoptemp = vsalfa - esalfa - zalfa (Q15)
     115                                                            ; ARP=AR0, AR0->FR0, AR2->gsmoppos, ARP=AR2
     116            ;----------------------------------------------------------------------------------
     117 0111 54a0                  MPY             *+              ; PREG = gsmopos*(vsalfa-esalfa-zalfa) (Q30)
     118                                                            ; ARP=AR2, AR0->FR0, AR2->isalfae 
     119            ;----------------------------------------------------------------------------------
     120 0112 be03                  PAC                             ; ACC = gsmopos*(vsalfa-esalfa-zalfa) (Q31)
     121                                                            ; ARP=AR2, AR0->FR0, AR2->isalfae 
     122            ;----------------------------------------------------------------------------------
     123 0113 73a0                  LT              *+              ; TREG = isalfae  (Q15)
     124                                                            ; ARP=AR2, AR0->FR0, AR2->fsmopos 
     125            ;----------------------------------------------------------------------------------
     126 0114 5490                  MPY             *-      ; PREG = isalfae*fsmopos  (Q30)
     127                                                            ; ARP=AR2, AR0->FR0, AR2->isalfae
     128            ;----------------------------------------------------------------------------------
     129 0115 be04                  APAC                    ; ACC = isalfae*fsmopos+gsmopos*(vsalfa-esalfa-zalfa) (Q31)
     130                                                            ; ARP=AR2, AR0->FR0, AR2->isalfae                       
     131            ;----------------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -