i_park.asm
来自「利用2407编写的PWM整流器控制程序」· 汇编 代码 · 共 56 行
ASM
56 行
;=====================================================================
; Filename : i_park.asm
; Module Name : I_PARK
;
; Description: This transformation projects vectors in orthogonal
; rotating reference frame into two phase orthogonal
; stationary frame.
; ualfa = ud * sin_theta + uq * cos_theta
; ubeta = -ud * cos_theta + uq * sin_theta
; |~~~~~~~~~~~~~~~|
; ud o----> | |----->o ualfa
; uq o----> | I_PARK |
; sin_cos o----> | |----->o ubeta
; |_______________|
;
;
;=====================================================================
;Module definitions for external reference.
.def I_PARK ; function call
.def ipark_alfa,ipark_beta ; Outputs
.def ipark_d,ipark_q,sin_th,cos_th ; Inputs
;=====================================================================
ipark_d .usect "I_park",1 ;Q6
ipark_q .usect "I_park",1 ;Q6
sin_th .usect "I_park",1 ;Q15
cos_th .usect "I_park",1 ;Q15
ipark_alfa .usect "I_park",1
ipark_beta .usect "I_park",1
;=========================
;Calculate the Inverse Park transform
;=========================
I_PARK:
NOP
;ualfa = ud * sin_theta + uq * cos_theta
LDP #ipark_d
LT ipark_d ;Q6,TREG=ud
MPY sin_th ;Q21=Q6*Q15,PREG=ud*sin_theta
LTP ipark_q ;ACC=ud*sin_theta(Q22),TREG=uq
MPY cos_th ;Q21=Q6*Q15,PREG=uq * cos_theta
;ubeta = -ud * cos_theta + uq * sin_theta
MPYA sin_th ;ACC=ud * sin_theta + uq * cos_theta(Q22)
;Q21=Q6*Q15,PREG=uq*sin_theta(Q21)
SACH ipark_alfa ;Q6
LTP ipark_d ;Q6,TREG=ud;ACC=uq*sin_theta(Q22)
MPY cos_th ;PREG=ud*cos_theta(Q21)
SPAC ;ACC=-ud * cos_theta + uq * sin_theta
SACH ipark_beta ;Q6
RET
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?