📄 imvc07_a.lst
字号:
151 0059 1008- LACC e_id
152 005a 9043- SACL _e_id_1 ; eim1=ei
153
154 005b be42 CLRC OVM ; disable overflow protection mode
155 005c ef00 RET
156
157 ;=============================================================================
158 ; Routine Name: _init_pi_reg_iq
159 ; -----------------------------
160 ; Description: Setup of iq current, PI controller variables
161 ; -----------------------------
162 ; Calling Convention: extern void _init_pi_reg_iq();
163 ;=============================================================================
164 .global _init_pi_reg_iq
165 ;=============================================================================
166 005d _init_pi_reg_iq:
167 005d bc00- LDP #_i_q
168 005e bf80 LACC #0
005f 0000
169 0060 904d- SACL _iq_1
170 0061 904c- SACL _iq_ref_1
171 0062 901b- SACL _i_q
172 0063 9047- SACL _i_q_ref
173 0064 904e- SACL _e_iq_1
174 0065 904f- SACL _I_iq_1_high
175 0066 9050- SACL _I_iq_1_low
176 0067 901d- SACL _u_q_ref
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 5
177 0068 9051- SACL _uq_ref_low
178 0069 904e- SACL _e_iq_1
179 006a 904e- SACL _e_iq_1
180 006b ef00 RET
181
182 ;==============================================================================
183 ; Routine Name: _pi_reg_iq
184 ; ------------------------
185 ; Description: Implements iq current PI controller
186 ;
187 ; OVM=1
188 ; dyi=sat(yi-yim1)
189 ; dyri=sat(yri-yrim1)
190 ; ei=sat(eim1+dyri-dyi)
191 ; dyri=ei-eim1+dyi
192 ; Pi=satsfl(Kps*dyri-Kps*dyi)
193 ; uim1=ui=sat(Pi+Iim1+uim1)
194 ; Iim1=satsfl(Kis*ei)
195 ; yrim1=yrim1+dyri
196 ; yim1=yi
197 ; eim1=ei
198 ; OVM=0
199 ; -------------------------
200 ; Calling Convention: extern void _pi_reg_iq();
201 ;==============================================================================
202 ; +--------------------------------------------------------------------------
203 ; | Input global variables:
204 ; +--------------------------------------------------------------------------+
205 ; | _i_q_ref | reference value of i_q current at step i (yri)
206 ; | _i_q | feedback value of i_q current at step i (yi)
207 ; | _Kps_iq | scaled Kp coeff: Kps = Kp / (2^scalKp) so that
208 ; | | -1 < Kps < +1
209 ; | _sf_P_iq | sf_P_iq = scalKp
210 ; | _Kis_iq | scaled Ki coeff: Kis = Ki / (2^scalKi) so that
211 ; | | -1 < Kis < +1
212 ; | _sf_I_iq | sf_I_iq = scalKi
213 ; | _iq_ref_1 | reference value of i_q current at step i-1 (yrim1)
214 ; | _iq_1 | feedback value of i_q current at step i-1 (yim1) |
215 ; | _e_iq_1 | error at step i-1
216 ; | _I_iq_1_high | integral term at step i-1, (16 MSB) |
217 ; | _I_iq_1_low | integral term at step i-1, (16 LSB)
218 ; +--------------------------------------------------------------------------+
219 ; | Input local variables:
220 ; +--------------------------------------------------------------------------+
221 ; | dif_iq_ref | difference between actual and old reference |
222 ; | dif_iq | difference between actual and old feedback |
223 ; | e_iq | error at step i |
224 ; +--------------------------------------------------------------------------+
225 ; | Output global variables:
226 ; +--------------------------------------------------------------------------+
227 ; | _u_q_ref | output of the regulator (16 MSB)
228 ; | _uq_ref_low | output of the regulator (16 LSB)
229 ; +--------------------------------------------------------------------------+
230 ;------------------------------------------------------------------------------
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 6
231 .global _pi_reg_iq
232 ;==============================================================================
233 006c _pi_reg_iq:
234 006c be47 SETC SXM
235 006d bc00- LDP #_i_q
236 006e be43 SETC OVM ; set overflow protection mode
237
238 006f 6a1b- LACC _i_q,16
239 0070 654d- SUB _iq_1,16
240 0071 980a- SACH dif_iq ; dyi=sat(yi-yim1)
241
242 0072 6a47- LACC _i_q_ref,16
243 0073 654c- SUB _iq_ref_1,16
244 0074 9809- SACH dif_iq_ref ; dyri=sat(yri-yrim1)
245
246 0075 650a- SUB dif_iq,16 ; ACC=dyri-dyi
247 0076 614e- ADD _e_iq_1,16
248 0077 980b- SACH e_iq ; ei=sat(eim1+dyri-dyi)
249
250 0078 654e- SUB _e_iq_1,16
251 0079 610a- ADD dif_iq,16
252 007a 9809- SACH dif_iq_ref ; dyri=ei-eim1+dyi
253
254 007b 7348- LT _Kps_iq
255 007c 5409- MPY dif_iq_ref ; Kps*dyri
256 007d be03 PAC
257 007e 540a- MPY dif_iq ; Kps*dyi
258 007f be05 SPAC ; Kps*dyri-Kps*dyi
259 0080 SATSFL _sf_P_iq ; ACC=Pi=satsfl(Kps*dyri-Kps*dyi) in Q31 format
1 0080 83a0 sar AR3, *+
1 0081 80ab sar AR0, *+,AR3
1 0082 0349- LAR AR3, _sf_P_iq
1 0083 bf08 LAR AR0, #satvals12
0084 0026-
1 0085 8be0 MAR *0+
1 0086 6180 ADD *,16
1 0087 6580 SUB *,16
1 0088 6580 SUB *,16
1 0089 6189 ADD *,16,AR1
1 008a 0b49- RPT _sf_P_iq
1 008b be09 SFL
1 008c 8b90 mar *-
1 008d 0090 lar AR0, *-
1 008e 0380 lar AR3, *
260 008f be46 CLRC SXM
261 0090 2050- ADD _I_iq_1_low
262 0091 2051- ADD _uq_ref_low
263 0092 be47 SETC SXM
264 0093 614f- ADD _I_iq_1_high,16
265 0094 611d- ADD _u_q_ref,16
266
267 0095 sat_reg_out C_SAT_U_Q_REF ; macro that saturates regulator's output
1 0095 bf9f ADD #C_SAT_U_Q_REF,15
0096 3334
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 7
1 0097 bfaf SUB #C_SAT_U_Q_REF,15
0098 3334
1 0099 bfaf SUB #C_SAT_U_Q_REF,15
009a 3334
1 009b bf9f ADD #C_SAT_U_Q_REF,15
009c 3334
268
269 009d 981d- SACH _u_q_ref ; uim1=ui=sat(Pi+Iim1+uim1)
270 009e 9051- SACL _uq_ref_low
271
272 009f 734a- LT _Kis_iq
273 00a0 540b- MPY e_iq
274 00a1 be03 PAC ; Kis*ei
275 00a2 SATSFL _sf_I_iq ; ACC=Iim1=satsfl(Kis*ei)
1 00a2 83a0 sar AR3, *+
1 00a3 80ab sar AR0, *+,AR3
1 00a4 034b- LAR AR3, _sf_I_iq
1 00a5 bf08 LAR AR0, #satvals12
00a6 0026-
1 00a7 8be0 MAR *0+
1 00a8 6180 ADD *,16
1 00a9 6580 SUB *,16
1 00aa 6580 SUB *,16
1 00ab 6189 ADD *,16,AR1
1 00ac 0b4b- RPT _sf_I_iq
1 00ad be09 SFL
1 00ae 8b90 mar *-
1 00af 0090 lar AR0, *-
1 00b0 0380 lar AR3, *
276 00b1 984f- SACH _I_iq_1_high ; Iim1=satsfl(Kis*ei)
277 00b2 9050- SACL _I_iq_1_low
278
279 00b3 6a4c- LACC _iq_ref_1,16
280 00b4 6109- ADD dif_iq_ref,16
281 00b5 984c- SACH _iq_ref_1 ; yrim1=yrim1+dyri
282
283 00b6 101b- LACC _i_q
284 00b7 904d- SACL _iq_1 ; yim1=yi
285
286 00b8 100b- LACC e_iq
287 00b9 904e- SACL _e_iq_1 ; eim1=ei
288
289 00ba be42 CLRC OVM ; disable overflow protection mode
290 00bb ef00 RET
291
292 ;=============================================================================
293 Routine Name: _init_pi_reg_pos
********* INVALID OPCODE
294 ; ------------------------------
295 ; Description: Setup of position, PI controller variables
296 ; ------------------------------
297 ; Calling Convention: extern void _init_pi_reg_pos();
298 ;=============================================================================
299 .global _init_pi_reg_pos
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 8
300 ;=============================================================================
301 00bc _init_pi_reg_pos:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -