📄 field_prof.asm
字号:
;===========================================================================
; File Name: field_prof.asm
;
; Module Name: FLELD_PROFILE
;
; Initialization Routine: FLELD_PROFILE_INIT
;
; Originator: Digital Control Systems Group
; Texas Instruments
;
; Description: This module generates the output command of rotating d-axis
; stator current for a specific input command of speed reference
; This is used for variable speed implementation of the vector
; control of AC induction motor drives.
;
; Note that this field profile has two regions.
; Region 1: Constant id_out at below rated speed.
; Region 2: Inversely proportional decreasing id_out at higher rated speed
; (field weakening operation).
;
; |~~~~~~~~~~~~~~~~~~~~~~~|
; | |
; spd_ref_fp o------>|Q15 FLELD_PROFILE Q15|----->o id_ref_fp
; | |
; |_______________________|
;
; Target dependency: C2xx core only
;
;=====================================================================================
; History:
;-------------------------------------------------------------------------------------
; 11-19-2000 Release Rev 1.0
;===========================================================================
;(To use this Module, copy this section to main system file)
; .ref FLELD_PROFILE, FLELD_PROFILE_INIT ;function call
; .ref spd_ref_fp ;Input
; .ref id_ref_fp ;Output
; .ref spd_1, id_1 ;Parameters
;===========================================================================
;Module definitions for external reference.
.def FLELD_PROFILE, FLELD_PROFILE_INIT ;function call
.def spd_ref_fp ;Input
.def id_ref_fp ;Output
.def spd_1, id_1 ;Parameters
;===========================================================================
.include x24x_app.h
;---------------------------------------------------------------------------
;User configurable default parameter values
;ID_1_ .set 2500h ; 1HP Maximum value of d-axis stator current (Q15)
ID_1_ .set 1500h ; 1/4HP Maximum value of d-axis stator current (Q15)
SPD_1_ .set 4000h ; High (rated) speed point on profile (Q15)
;---------------------------------------------------------------------------------
spd_ref_fp .usect "field",1
id_ref_fp .usect "field",1
spd_abs .usect "field",1
spd_1 .usect "field",1
id_1 .usect "field",1
field_tmp1 .usect "field",1
;----------------------------------------------------------------------
FLELD_PROFILE_INIT:
;----------------------------------------------------------------------
LDP #spd_1
SPLK #SPD_1_, spd_1
SPLK #ID_1_, id_1
RET
;----------------------------------------------------------------------
FLELD_PROFILE:
;----------------------------------------------------------------------
SPM 0 ; Reset product mode
SETC SXM ; Set sign extension mode
SETC OVM ; Set overflow mode
LDP #spd_ref_fp
LACC spd_ref_fp ; ACC = spd_ref (Q15)
ABS ; ACC = |spd_ref| (Q15)
SACL spd_abs ; spd_abs = |spd_ref| (Q15)
; Check |spd_ref| is in between 0 and spd_1 ?
SUB spd_1 ; ACC = |spd_ref| - spd_1 (Q15)
BCND FIELD_PROF1,LT ; Branch to FILED_PROF1 if |spd_ref| < spd_1
B FIELD_PROF2 ; Branch to FILED_PROF2 if |spd_ref| >= spd_1
FIELD_PROF1
LACC id_1 ; ACC = id_1 (Q15)
SACL id_ref_fp ; id_ref = id_1 (Q15)
B FIELD_END
FIELD_PROF2
LT id_1 ; TREG = id_1 (Q15)
MPY spd_1 ; PREG = id_1*spd_1 (Q30)
PAC ; ACC = id_1*spd_1 (Q30)
SACH field_tmp1,1 ; field_tmp1 = id_1*spd_1 (Q15)
LACC field_tmp1,15 ; ACC = id_1*spd_1 left shifted by 15 (id_ref_fp=Q15)
RPT #15 ; Repeat SUBC 16 times
SUBC spd_abs ; Dividing (id_1*spd_1)/|spd_ref|
SACL id_ref_fp ; id_ref_fp = (id_1*spd_1)/|spd_ref| (Q15)
FIELD_END
RET
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -