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

📄 imvc07_a.lst

📁 2407的交流电机控制程序
💻 LST
📖 第 1 页 / 共 5 页
字号:
     605 0183 9024-         SACL    _position              ;store position 
     606 0184 ef00          RET
     607            
     608            ;=============================================================================
     609            ; Routine Name: _tabcdq 
     610            ; ---------------------
     611            ;       Description: Transforms coordinates from abc to dq frame 
     612            ;       input of the transformation routine are current from phase A and B 
     613            ;       and position of the rotor flux(theta)and output are transformed currents
     614            ;       from the synchronous reference frame.  
     615            ; ---------------------
     616            ; Calling Convention: extern void tabcdq();
     617            ;=============================================================================
     618 0185 254d  Cas1            .word   9549            ; Constant Ca=1/sqrt(3) scaled by *2^-1
     619 0186 49e7  Cbs1            .word   18919           ; Constant Cb=2/sqrt(3) scaled by *2^-1
     620 0187 c064  Cnalpha .word   -16284          ; Constant Calpha=-0.5, negative
     621 0188 6ed5  Cbeta           .word   28373           ; Constant Cbeta=sqrt(3)/2
     622            ;=============================================================================
     623                    .global _tabcdq
     624            ;=============================================================================
     625 0189       _tabcdq:
     626 0189 bc00-         LDP     #_theta
     627                                              ; call sine to obtain sin_theta
     628 018a 1025-         LACC    _theta                  ; argument
     629 018b 90a0          SACL    *+                      ; push argument on the stack
     630 018c 7a80          CALL    _sine                   ; call function
         018d 026a' 
     631 018e 8b90          MAR     *-                      ; restore SP
     632 018f bc00-         LDP     #_theta
     633 0190 9022-         SACL    _sin_theta              ; store sin_theta
     634                                              ; cosine(theta) = sine(theta + PI/2)
     635 0191 1025-         LACC    _theta
     636 0192 bf90          ADD     #C_PI_2         ; obtain augument
         0193 4000  
     637 0194 90a0          SACL    *+                      ; push augument on the stack
     638 0195 7a80          CALL    _sine                   ; call function
         0196 026a' 
     639 0197 8b90          MAR     *-                      ; restore SP
     640 0198 bc00-         LDP     #_theta
     641 0199 9023-         SACL    _cos_theta              ; store cos_theta
     642                                              ; transform abc2alphabeta
     643 019a be43          SETC    OVM                     ; OPERATIONS WIIL BE MADE UNDER OVM = 1
     644                                              ; _i_alpha = _i_a
     645 019b 1016-         LACC    _i_a
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00  Mon May 28 09:55:02 2007
Copyright (c) 1987-1999  Texas Instruments Incorporated 
D:\Imvc\IMVC07_a.asm                                                 PAGE   16

     646 019c 9018-         SACL    _i_alpha
     647                                              ; _i_beta  = (Cas1*_i_a + Cbs1*_i_b)*2
     648 019d a217-         MAC     Cbs1,_i_b
         019e 0186' 
     649 019f b900          LACL    #0
     650 01a0 a216-         MAC     Cas1,_i_a
         01a1 0185' 
     651 01a2 be04          APAC
     652 01a3               sat2
1        01a3 bc00-         LDP     #satvals12
1        01a4 6127-         ADD     satvals12+1,16
1        01a5 6527-         SUB     satvals12+1,16
1        01a6 6527-         SUB     satvals12+1,16
1        01a7 6127-         ADD     satvals12+1,16
     653 01a8 9a19-         SACH    _i_beta, 2
     654                                               ; transform alphabeta2dq
     655                                               ; _i_d = _i_alpha*_cos_theta + _i_beta*_sin_theta
     656 01a9 5423-         MPY     _cos_theta               ; P still loaded with _i_a(lpha) 
     657 01aa 7119-         LTP     _i_beta
     658 01ab 5422-         MPY     _sin_theta
     659 01ac be04          APAC
     660 01ad               sat1
1        01ad bc00-         LDP     #satvals12
1        01ae 6126-         ADD     satvals12,16
1        01af 6526-         SUB     satvals12,16
1        01b0 6526-         SUB     satvals12,16
1        01b1 6126-         ADD     satvals12,16
     661 01b2 991a-         SACH    _i_d, 1
     662                                               ; i_q = -_i_alpha*_sin_theta + _i_beta*_cos_theta
     663 01b3 5423-         MPY     _cos_theta              ; P still loaded with _i_beta
     664 01b4 7118-         LTP     _i_alpha
     665 01b5 5422-         MPY     _sin_theta
     666 01b6 be05          SPAC 
     667 01b7               sat1
1        01b7 bc00-         LDP     #satvals12
1        01b8 6126-         ADD     satvals12,16
1        01b9 6526-         SUB     satvals12,16
1        01ba 6526-         SUB     satvals12,16
1        01bb 6126-         ADD     satvals12,16
     668 01bc 991b-         SACH    _i_q, 1
     669 01bd be42          CLRC    OVM                     ; OPERATIONS WERE MADE UNDER OVM = 1
     670 01be ef00          RET
     671            
     672            ;=============================================================================
     673            ; Routine Name: _tdqabc 
     674            ; ---------------------
     675            ;       Description: Transforms coordinates from dq to abc frame 
     676            ;       Input of the routine are dq reference voltages (output of the dq axis 
     677            ;       current controllers and the rotation angle of the rotor flux(theta)
     678            ;       and output are the reference voltages in the natural frame of the motor 
     679            ; ---------------------
     680            ; Calling Convention: extern void tdqabc();
     681            ;=============================================================================
     682                    .global _tdqabc
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00  Mon May 28 09:55:02 2007
Copyright (c) 1987-1999  Texas Instruments Incorporated 
D:\Imvc\IMVC07_a.asm                                                 PAGE   17

     683            ;=============================================================================
     684 01bf       _tdqabc:
     685 01bf bc00-         LDP     #_theta
     686                                                     ; transform dq2alphabeta
     687 01c0 be43          SETC    OVM                             ; OPERATIONS WIIL BE MADE UNDER OVM = 1
     688                                                     ; _u_beta  = _u_d*_sin_theta + _u_q*_cos_theta;
     689 01c1 731d-         LT      _u_q_ref        
     690 01c2 5423-         MPY     _cos_theta 
     691 01c3 711c-         LTP     _u_d_ref
     692 01c4 5422-         MPY     _sin_theta
     693 01c5 be04          APAC
     694 01c6               sat1
1        01c6 bc00-         LDP     #satvals12
1        01c7 6126-         ADD     satvals12,16
1        01c8 6526-         SUB     satvals12,16
1        01c9 6526-         SUB     satvals12,16
1        01ca 6126-         ADD     satvals12,16
     695 01cb 991f-         SACH    _u_beta_ref, 1
     696                                                      ; _u_alpha = _u_d*_cos_theta - _u_q*_sin_theta;
     697 01cc 5423-         MPY     _cos_theta                      ; P still loaded with _u_d
     698 01cd 711d-         LTP     _u_q_ref 
     699 01ce 5422-         MPY     _sin_theta
     700 01cf be05          SPAC
     701 01d0               sat1
1        01d0 bc00-         LDP     #satvals12
1        01d1 6126-         ADD     satvals12,16
1        01d2 6526-         SUB     satvals12,16
1        01d3 6526-         SUB     satvals12,16
1        01d4 6126-         ADD     satvals12,16
     702 01d5 991e-         SACH    _u_alpha_ref, 1
     703                                                      ; transform alphabeta2abc
     704                                                      ; _u_a = _u_alpha;
     705 01d6 9933-         SACH    _u_a_ref, 1
     706                                                      ; _u_b = Cnalpha*_u_alpha + Cbeta*_u_beta;
     707 01d7 a21e-         MAC     Cnalpha,_u_alpha_ref
         01d8 0187' 
     708 01d9 b900          LACL    #0
     709 01da a21f-         MAC     Cbeta,_u_beta_ref
         01db 0188' 
     710 01dc be04          APAC
     711 01dd               sat1
1        01dd bc00-         LDP     #satvals12
1        01de 6126-         ADD     satvals12,16
1        01df 6526-         SUB     satvals12,16
1        01e0 6526-         SUB     satvals12,16
1        01e1 6126-         ADD     satvals12,16
     712 01e2 9934-         SACH    _u_b_ref, 1
     713                                                      ; _u_c = Cnalpha*_u_alpha - Cbeta*_u_beta;
     714 01e3 a21e-         MAC     Cnalpha,_u_alpha_ref
         01e4 0187' 
     715 01e5 b900          LACL    #0
     716 01e6 a21f-         MAC     Cbeta,_u_beta_ref
         01e7 0188' 
     717 01e8 be05          SPAC
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00  Mon May 28 09:55:02 2007
Copyright (c) 1987-1999  Texas Instruments Incorporated 
D:\Imvc\IMVC07_a.asm                                                 PAGE   18

     718 01e9               sat1
1        01e9 bc00-         LDP     #satvals12
1        01ea 6126-         ADD     satvals12,16
1        01eb 6526-         SUB     satvals12,16
1        01ec 6526-         SUB     satvals12,16
1        01ed 6126-         ADD     satvals12,16
     719 01ee 9935-         SACH    _u_c_ref, 1
     720 01ef be42          CLRC    OVM                             ; OPERATIONS WERE MADE UNDER OVM = 1
     721 01f0 ef00          RET
     722            
     723            ;=============================================================================
     724            ;       Routine Name: _update_pwm       
     725            ;       -------------------------
     726            ;       Description: update the compare registers with ON time value for the power stage   
     727            ;       -------------------------
     728            ; Calling Convention: extern void update_pwm  ();
     729            ;=============================================================================
     730                    .global _update_pwm
     731            ;=============================================================================
     732 01f1       _update_pwm:
     733 01f1 be47          SETC    SXM
     734 01f2 bc00-         LDP     #_pwm_period
     735 01f3 7336-         LT              _pwm_period
     736            
     737 01f4 5433-         MPY     _u_a_ref
     738 01f5 be03          PAC
     739 01f6 2f36-         ADD     _pwm_period, 15                ; += period/2
     740 01f7 bce8          LDP     #DP_EV                          ; Event Manager Data Page Pointer
     741 01f8 9817          SACH    CMPR1                           ; CMPR1 = (period * (1 + u_a_ref)) /2
     742            
     743 01f9 bc00-         LDP     #_pwm_period
     744 01fa 5434-         MPY     _u_b_ref
     745 01fb be03          PAC
     746 01fc 2f36-         ADD     _pwm_period, 15                ; += period/2
     747 01fd bce8          LDP     #DP_EV                          ; Event Manager Data Page Pointer
     748 01fe 9818          SACH    CMPR2                           ; CMPR2 = (period * (1 + u_b_ref)) /2
     749            
     750 01ff bc00-         LDP      #_pwm_period
     751 0200 5435-         MPY     _u_c_ref
     752 0201 be

⌨️ 快捷键说明

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