- 积分
- 178
- 回帖
- 0
- 西莫币
-
- 贡献
-
- 威望
-
- 存款
-
- 阅读权限
- 10
- 最后登录
- 1970-1-1
该用户从未签到
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
在永磁同步电机FOC控制中,计算得到的电压Valfa和Vbeta经过极坐标变换得到|V|和sita,然后在第一扇区(0-60°)里面计算得到VT1和VT2(见计算1),再得到VTA,VTB,VTC(计算2),分配给定时器(决定中占空比)寄存器的比较值。请问下在其他象限中,这个VT1和VT2还需要计算吗?看分配图3中就是根据象限A~F直接分配即可?迷惑中。。。。由于是汇编语言,比较难看。我把汇编程序发上来吧,大家分析下:
CV_SectorA:
djnz guc_sector,CV_SectorB
mov CCU6_CC60RH,r2
mov CCU6_CC60RL,r3 ; CC60CR = V_TB
mov CCU6_CC61RL,a
mov CCU6_CC61RH,r4 ; CC61CR = V_TC
mov CCU6_CC62RH,r0
mov CCU6_CC62RL,r1 ; CC60CR = V_TA
mov CCU6_PAGE,#0x00
mov a,#AD_TRIGGER_CM_L ; A = AD_TRIGGER_CM_L
add a,r7 ; A = AD_TRIGGER_CM_L + T2/2_L
mov CCU6_CC63RL,a
mov a,#AD_TRIGGER_CM_H ; A = AD_TRIGGER_CM_H
addc a,r6 ; A = AD_TRIGGER_CM_H + T2/2_H
mov CCU6_CC63RH,a
mov CCU6_PAGE,#0x01
mov a,#AD_TRIGGER_PM_L ; A = AD_TRIGGER_PM_L
add a,r5 ; A = AD_TRIGGER_PM_L + T1/2_L
mov CCU6_T13PRL,a
mov a,#AD_TRIGGER_PM_H ; A = AD_TRIGGER_PM_H
addc a,b ; A = AD_TRIGGER_PM_H + T1/2_H
mov CCU6_T13PRH,a
ljmp compare_values_end
CV_SectorB:
djnz guc_sector,CV_SectorC
mov CCU6_CC60RL,a
mov CCU6_CC60RH,r4 ; CC60CR = V_TC
mov CCU6_CC61RH,r2
mov CCU6_CC61RL,r3 ; CC61CR = V_TB
mov CCU6_CC62RH,r0
mov CCU6_CC62RL,r1 ; CC60CR = V_TA
mov CCU6_PAGE,#0x00
mov a,#AD_TRIGGER_CM_L ; A = AD_TRIGGER_CM_L
add a,r5 ; A = AD_TRIGGER_CM_L + T1/2_L
mov CCU6_CC63RL,a
mov a,#AD_TRIGGER_CM_H ; A = AD_TRIGGER_CM_H
addc a,b ; A = AD_TRIGGER_CM_H + T1/2_H
mov CCU6_CC63RH,a
mov CCU6_PAGE,#0x01
mov a,#AD_TRIGGER_PM_L ; A = AD_TRIGGER_PM_L
add a,r7 ; A = AD_TRIGGER_PM_L + T2/2_L
mov CCU6_T13PRL,a
mov a,#AD_TRIGGER_PM_H ; A = AD_TRIGGER_PM_H
addc a,r6 ; A = AD_TRIGGER_PM_H + T2/2_H
mov CCU6_T13PRH,a
ljmp compare_values_end
CV_SectorC:
djnz guc_sector,CV_SectorD
mov CCU6_CC60RH,r0
mov CCU6_CC60RL,r1 ; CC60CR = V_TA
mov CCU6_CC61RH,r2
mov CCU6_CC61RL,r3 ; CC60CR = V_TB
mov CCU6_CC62RL,a
mov CCU6_CC62RH,r4 ; CC61CR = V_TC
mov CCU6_PAGE,#0x00
mov a,#AD_TRIGGER_CM_L ; A = AD_TRIGGER_CM_L
add a,r7 ; A = AD_TRIGGER_CM_L + T2/2_L
mov CCU6_CC63RL,a
mov a,#AD_TRIGGER_CM_H ; A = AD_TRIGGER_CM_H
addc a,r6 ; A = AD_TRIGGER_CM_H + T2/2_H
mov CCU6_CC63RH,a
mov CCU6_PAGE,#0x01
mov a,#AD_TRIGGER_PM_L ; A = AD_TRIGGER_PM_L
add a,r5 ; A = AD_TRIGGER_PM_L + T1/2_L
mov CCU6_T13PRL,a
mov a,#AD_TRIGGER_PM_H ; A = AD_TRIGGER_PM_H
addc a,b ; A = AD_TRIGGER_PM_H + T1/2_H
mov CCU6_T13PRH,a
ljmp compare_values_end
CV_SectorD:
djnz guc_sector,CV_SectorE
mov CCU6_CC60RH,r0
mov CCU6_CC60RL,r1 ; CC60CR = V_TA
mov CCU6_CC61RL,a
mov CCU6_CC61RH,r4 ; CC61CR = V_TC
mov CCU6_CC62RH,r2
mov CCU6_CC62RL,r3 ; CC60CR = V_TB
mov CCU6_PAGE,#0x00
mov a,#AD_TRIGGER_CM_L ; A = AD_TRIGGER_CM_L
add a,r5 ; A = AD_TRIGGER_CM_L + T1/2_L
mov CCU6_CC63RL,a
mov a,#AD_TRIGGER_CM_H ; A = AD_TRIGGER_CM_H
addc a,b ; A = AD_TRIGGER_CM_H + T1/2_H
mov CCU6_CC63RH,a
mov CCU6_PAGE,#0x01
mov a,#AD_TRIGGER_PM_L ; A = AD_TRIGGER_PM_L
add a,r7 ; A = AD_TRIGGER_PM_L + T2/2_L
mov CCU6_T13PRL,a
mov a,#AD_TRIGGER_PM_H ; A = AD_TRIGGER_PM_H
addc a,r6 ; A = AD_TRIGGER_PM_H + T2/2_H
mov CCU6_T13PRH,a
ljmp compare_values_end
CV_SectorE:
djnz guc_sector,CV_SectorF
mov CCU6_CC60RL,a
mov CCU6_CC60RH,r4 ; CC61CR = V_TC
mov CCU6_CC61RH,r0
mov CCU6_CC61RL,r1 ; CC60CR = V_TA
mov CCU6_CC62RH,r2
mov CCU6_CC62RL,r3 ; CC60CR = V_TB
mov CCU6_PAGE,#0x00
mov a,#AD_TRIGGER_CM_L ; A = AD_TRIGGER_CM_L
add a,r7 ; A = AD_TRIGGER_CM_L + T2/2_L
mov CCU6_CC63RL,a
mov a,#AD_TRIGGER_CM_H ; A = AD_TRIGGER_CM_H
addc a,r6 ; A = AD_TRIGGER_CM_H + T2/2_H
mov CCU6_CC63RH,a
mov CCU6_PAGE,#0x01
mov a,#AD_TRIGGER_PM_L ; A = AD_TRIGGER_PM_L
add a,r5 ; A = AD_TRIGGER_PM_L + T1/2_L
mov CCU6_T13PRL,a
mov a,#AD_TRIGGER_PM_H ; A = AD_TRIGGER_PM_H
addc a,b ; A = AD_TRIGGER_PM_H + T1/2_H
mov CCU6_T13PRH,a
ljmp compare_values_end
CV_SectorF:
mov CCU6_CC60RH,r2
mov CCU6_CC60RL,r3 ; CC61CR = V_TB
mov CCU6_CC61RH,r0
mov CCU6_CC61RL,r1 ; CC60CR = V_TA
mov CCU6_CC62RL,a
mov CCU6_CC62RH,r4 ; CC60CR = V_TC
mov CCU6_PAGE,#0x00
mov a,#AD_TRIGGER_CM_L ; A = AD_TRIGGER_CM_L
add a,r5 ; A = AD_TRIGGER_CM_L + T1/2_L
mov CCU6_CC63RL,a
mov a,#AD_TRIGGER_CM_H ; A = AD_TRIGGER_CM_H
addc a,b ; A = AD_TRIGGER_CM_H + T1/2_H
mov CCU6_CC63RH,a
mov CCU6_PAGE,#0x01
mov a,#AD_TRIGGER_PM_L ; A = AD_TRIGGER_PM_L
add a,r7 ; A = AD_TRIGGER_PM_L + T2/2_L
mov CCU6_T13PRL,a
mov a,#AD_TRIGGER_PM_H ; A = AD_TRIGGER_PM_H
addc a,r6 ; A = AD_TRIGGER_PM_H + T2/2_H
mov CCU6_T13PRH,a
compare_values_end:
另外,扇区判断怎么在程序里面实现,难道按照simulink仿真里面的方法?请指点。 |
|