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

📄 i_park.asm

📁 利用2407编写的PWM整流器控制程序
💻 ASM
字号:
;=====================================================================
; 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -