版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、說明:下面程序取自IFX 16位機(jī)無傳感器PMSM電機(jī)矢量控制程序。程序架構(gòu)是C語言嵌套匯編。其中坐標(biāo)系變換是匯編編寫。有插圖說明,便于更好的理解。 其中包括坐標(biāo)系變換,磁鏈角估算,PI速度環(huán)電流環(huán)調(diào)節(jié)。(單片機(jī)XC2236N,Tasking 編譯器Cavin整理坐標(biāo)系變換說明:雙電阻采樣得到兩相電流(ia, ib,由abc120靜止坐標(biāo)系Clarke 變換到直角坐標(biāo)系(ia,也由(ia,甲靜止直角坐標(biāo)系Park變換到直角旋轉(zhuǎn)坐標(biāo)系(iq, id。直流id不變,通過PI速度環(huán)電流環(huán)得到期望直流iq,進(jìn)行限幅控制。由旋轉(zhuǎn)坐標(biāo) 系(vq, vd經(jīng)過Park逆變換到靜止坐標(biāo)系(va, v,然后再經(jīng)過
2、矢量調(diào)制成PWM控制 電機(jī)。無傳感器角度估算:由Clarke變換得到(ia,甲和由Park逆變換得到的(va,邛,經(jīng) 過低通濾波器PT1,再由直角坐標(biāo)系變極坐標(biāo)系得到磁鏈估算角無傳感器開環(huán)啟動(dòng) 策略:在定子中加入幅值及頻率都受控的電流,若PLL收斂,切換到FOC閉環(huán)控制。/ 二、上、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上/力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、
3、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、上、卜、卜、卜、卜、上、上個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)小、上、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)
4、個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)小*/ 二、上、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上/力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力
5、、力、力、力、力、力、力、力、力、力、上、卜、上個(gè)個(gè)個(gè)個(gè)小、上、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)小、上、卜、卜、卜、卜、上、卜 / 力、力、力、力、力、力、力、力、/ /、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、
6、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上/ /力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、* / Function int clarke_trans(int Phase_s, int Phase_t, int *ia;/ Desc
7、ription ia=/ Description ia=is/ ib = 1/sqrt(3*( (2 * it + is/ Returnvalue (ib * 16 , (ia * 16/ Parameters/ Date09.01.2005/ Condition optimization off / one* inline int clarke_trans(int Phase_s, int Phase_t, int *ia(int retvalue;_asm(mov r12,MCW nmov MCW,#0200h ; set saturation nshl %2,#1 ; ( 2*Phase
8、_t nadd %2,%1 ; + Phase_s nmov r13,#37837 nCoMULsu %2,r13 ;* 1/sqrt(3 nCoSHL #4 ; default 2 * 4 nCoSTORE %0,MAS ; ib = result nshl %1,#2 nmov %3,%1 ; ia = Phase_s * 4 nmov MCW,r12 n:=&w(retvalue /* output registers */:w(Phase_s,w(Phase_t,w(ia /* input registers */:r13,r12/*scratch registers */;retur
9、n retvalue;、上、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)小、上、卜、卜、卜、卜、上、卜 / 力、力、力、力、力、力、力、力、/ /、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、
10、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上/ /力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、* / Function int park_trans(int e_a,int e_b,int phi,int *a_b/ Descriptionpark transforma
11、tion/ ReturnvalueId_comp , Iq_comp/ Parameters/ Date/ Date/09.01.2005/ Condition optimization off / oneinline int park_trans(int i_a,int i_b,int phi,int *o_q(int retvalue;asm( nmov r13,MCW nmov MCW,#0600h nshr %3,#6 nshl %3,#1 nEXTS #SEG (_sincostab,#2 nmov r11,%3 + #SOF(_sincostab+512 nmov r12,%3 +
12、 #SOF(_sincostab nCoMUL %2,r12 nCoMAC %1,r11 nCoSTORE %0,MAS nCoMUL %2,r11 nCoMAC- %1,r12 nCoSTORE %4,MAS nmov MCW,r13 nn:=&w(retvalue /* output registers */:w(i_a,w(i_b,w(phi,w(o_q /* input registers */:r13,r12,r11/*scratch registers */return retvalue;小小小小小小小小小A反PaA反Pak變換應(yīng)用于定子電壓:vqs/vds:、上、卜、卜、卜、卜、
13、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)小、上、卜、卜、卜、卜、上、卜 / 力、力、力、力、力、力、力、力、/ /、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、
14、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上/ /力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、* / Function int inv_park_trans(int e_a,int e_b,int phi,int *a_b/ Descriptioninverse park tran
15、sformation/ ReturnvalueI_alpha , I_beta/ Parameters/ Date09.01.2005/ Condition optimization off / one* inline int inv_park_trans(int i_d,int i_q,int phi,int *o_bint retvalue;asm( nmov r13,MCW nmov MCW,#0600h nshr %3,#6 nshl %3,#1 nEXTS #SEG (_sincostab,#2 nmov r12,%3 + #SOF(_sincostab+512 nmov r11,%
16、3 + #SOF(_sincostab nCoMUL %1,r12 nCoMAC- %2,r11 nCoASHR #2 nCoSTORE %0,MAS nCoMAC %2,r12 nCoASHR #2 nCoSTORE %4,MAS nmov MCW,r13 nn:=&w(retvalue /* output registers */:w(i_d,w(i_q,w(phi,w(o_b /* input registers */ : r13,r12,r11/*scratch registers */;return retvalue;Now, the voltage space vectorQ,尸口
17、) is transformed into a polar representation (中V|).The transformation is calculated in the CORDIC:CORDIC configuration Circular vectoring mode K 壽 1,64676A finalMPS因=面%向=0Zfinal = 7 十抗甲二ex= %1場Z = 0Now, the voltage space vector is transformed into a polar representation (中 The transformation is calc
18、ulated in the CORDIC:CORDIC configuration Circular vectoring mode K 之 1,64676=匕汗_/A final#ps因二七面rfinal = 0同=7十濟(jì)壯(9中二x=??赯 = 0NACU Ij小Uii/ Cj*J/ /、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上/ /力、力、力、力、力、力、力、力、力、力、力、
19、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、* / Function int cart_polar_conv(int x,int y, int *angle;/ Description/ Returnvalue/ Parameters/ Date09.01.2005/ Condition optimization off / one* unsigned int cart_polar_conv(int x,int y, i
20、nt *angleunsigned int retvalue;asm( nmov MCW,#0200h ; enable saturation to +/-0 x7fff nmov r13,%1 ; r13 = x njmpr cc_nn,kpw1co ; if (x = 0 goto kpw1co nneg r13 ; else r13 = -r13 nkpw1co: ; r13 = Ixl nmov r12,%2 ; r12 = y njmpr cc_nn,kpw2co ; if (y = 0 goto kpw2co nneg r12 ; r12 = -r12 nkpw2co: ; r12
21、 = |y| nmov r9,#1024 ncmp r13,r12 njmpr cc_c,kpw3co ; if( x signed nCoSTORE %0,MAS ; %0 = CoACC n nEXTS #SEG (_phitab,#1 nmov r10,r9+#SOF(_phitab ; r10 = arctan( y/x n cmp %1,#0 ; njmpr cc_n,kpw4co ; if ( x 0 goto kpw4co n cmp %2,#0 njmpr cc_n,kpw5co ; if ( y 0 and y 0 nneg r10 nmov %3,r10 ; angle =
22、 -arctan( y/x n”jmpr cc_uc, endco nnkpw4co: ; x 0 ncmp %2,#0 ; njmpr cc_n,kpw6co ; if ( y 0 goto kpw6co n mov r9,#8000h nsub r9,r10 nmov %3,r9 ; angle = 180 arctan( y/x n jmpr cc_uc, endco nnkpw6co: ; x 0 and y 0 nadd r10,#8000h n”mov %3,r10 ; angle = -180+ arctan( y/x n jmpr cc_uc, endco nnkpw3co:
23、; Ixl signed nCoSTORE %0,MAS ; %0 = CoACC n”nEXTS #SEG (_phitab,#1 n”mov r10,r9+#SOF(_phitab ; r10 = arctan( y/x ncmp %1,#0 n”jmpr cc_n,kpw7co ; if ( x 0 goto kpw7co n”cmp %2,#0 n”jmpr cc_n,kpw8co ; if ( y 0 and y 0 n add r10,#0C000h nmov %3,r10 ; angle = -90+ arctan( x/y = -(90 arccot( y/x = -arcta
24、n( y/x njmpr cc_uc, endco n n kpw7co: n cmp %2,#0 ; x 0 n jmpr cc_n,kpw9co ; if ( y 0 goto kpw9co n add r10,#4000h nmov %3,r10 ; angle = 90+ arctan( x/y = 180 (90 arccot( y/x = 180 arctan( y/x n jmpr cc_uc, endco nkpw9co: ; x 0 and y 0,Indicates software trigger/ (Conversion starts once this functio
25、n is executed/ Returnvalue None/ Parameters ubExtTrg:/ External Trigger : defines external trigger./ Parameters ubEnIntr:/ Enable Source Interrupt : defines source interrupt/ Parameters ubRFill:/ Refill : defines the refill/ Parameters ubChannelNum:/ Channel number : Name of the Request Channel Numb
26、er (0 -/ 15- see macros defined in the header file/ Date 14.05.2010/小小小小小小小小小小void ADC0_vStartSeq0ReqChNum(ubyte ubExtTrg, ubyte ubEnIntr, ubyte ubRFill, ubyte ubChannelNum uword uwVal = 0;if (ubExtTrg = 1uwVal = 0 x0080;)if (ubEnIntr = 1uwVal = uwVal + 0 x0040;)if (ubRFill = 1uwVal = uwVal + 0 x002
27、0;uwVal = uwVal + (ubChannelNum & 0 x001f;ADC0_QINR0 = uwVal; / requested channel / End of function ADC0_vStartSeq0ReqChNum* / Function void ADC0_viSRN0(void/ DescriptionThis is the interrupt service routine for the Service/ Request Node 0 of the ADC0 module./ ReturnvalueNone/ ParametersNone/ Date14
28、.05.2010/* / user CODE BEGIN (ADC0_viSRN0,0/ USER CODE END _interrupt(ADC0_SRN0INT void ADC0_viSRN0(void (if(ADC0_EVINFR & 0 x0100 = 0 x0100 /Result0 event interrupt(ADC0_EVINCR = 0 x0100; / Clear Result0 event interrupt/ USER CODE BEGIN (ADC0_viSRN0,20if( CCU60_TCTR0 & 0 x0040 / check count directi
29、on of T12.ADC0_CHCTR8 |= 0 x1000; / 1: T12 counts down - assign ADC-CH8 toRESREG1 elseADC0_CHCTR8 &= 0 xefff; / 0: T12 counts up - assign ADC-CH8 to RESREG0if( !(svm0.Sector & 0 x0001CCU60_T13PR = svm0.T2Store/2 + svm0.ADCDELAY; / set T13 Period value elseCCU60_T13PR = svm0.T1Store/2 + svm0.ADCDELAY
30、; / set T13 Period valueCCU60_vEnableShadowTransfer(CCU60_TIMER_13; / enable shadow transfer/ USER CODE END) / End of function ADC0_viSRN0It is rotating in space 鐘 in the speed ;It is rotating in space 鐘 in the speed ;Sampling Period Ta:L= L + tjTqVolt-Sg。W Bdluncinu Reference VectorThe rerence sect
31、or represents the resulting magnetic stator field (flux), it is defined by the fol lowing equationC3)Figure-10 PWNI Pttrn of a Sevgn Sagment Switching Sequ國nC3)Figure-10 PWNI Pttrn of a Sevgn Sagment Switching Sequ國n匕已itis notating in space with the speed a;w = 2?c t(12The reference vector can be ap
32、proximated by bvo active sectors (e.g. V1 and V2) and one zero vector (VO). The plane Is dissected Into six sectors and ttie angle 0足 airrent 口 1KMiJ dcnnq one PWMi period (Trawj Ttie third phase ourrenl rsn be cakulaled by 見 + & + /=2皿話edundartl for Ihe carMml-l9ur4 11 FIum tunriE MtjurmnE wlitiiin
33、i cte PWM Pintmin urdM lo realize thE metrod. tie ADU tngficf 口unis must Ee odiusted occording to the KVMi panern. Iwo ifleefi1 cumemi can fee meawied M PWM time T1 and 12 Depending on 1he actual iwtar he rwaured currents have a diPerent mesrunq. The foUowurK table shows these combw的時(shí)邑 而日 ihe cilaui
34、LailKin for phate current & and %5KT4FA.BcDEF工iiVVWWrN.Wuu.V.Vu代)(WI-VJ - wu&WJ .uVV(U)鉀 V)IV*/ /、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上/ /力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、
35、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、* / Function void ADC0_viSRN1(void/ DescriptionThis is the interrupt service routine for the Service/ Request Node 1 of the ADC0 module./ ReturnvalueNone/ Parameters None/ Date 14.05.2010/小小小小小小小小小小/ USER CODE BEGIN (ADC0_viSRN1,0/ USER C
36、ODE END_interrupt(ADC0_SRN1INT void ADC0_viSRN1(void (if(ADC0_EVINFR & 0 x0200 = 0 x0200 /Result1 event interrupt (ADC0_EVINCR = 0 x0200; / Clear Result1 event interrupt/ USER CODE BEGIN (ADC0_viSRN1,21ADC0_CHCTR8 &= 0 xefff; / assign ADC-CH8 to RESREG0 if( !(svm0.Sector & 0 x0001CCU60_T13PR = svm0.
37、T1Store/2 + svm0.ADCDELAY; / set T13 Period value elseCCU60_T13PR = svm0.T2Store/2 + svm0.ADCDELAY; / set T13 Period valueCCU60_vEnableShadowTransfer(CCU60_TIMER_13; / enable shadow transfer/ calculate Ialpha and Ibeta from single shunt measurementswitch( svm0.SectorStorecase 0:svm0.IphaseA = (ADC0_
38、RESR0 & 0 x0fff - svm0.ADCOFFSET;svm0.IphaseB = (ADC0_RESR1 & 0 x0fff - (ADC0_RESR0 & 0 x0fff;break;svm0.IphaseA = (ADC0_RESR1 & 0 x0fff - (ADC0_RESR0 & 0 x0fff;svm0.IphaseB = (ADC0_RESR0 & 0 x0fff - svm0.ADCOFFSET;break;svm0.IphaseA = -(ADC0_RESR1 & 0 x0fff + svm0.ADCOFFSET;svm0.IphaseB = (ADC0_RES
39、R0 & 0 x0fff - svm0.ADCOFFSET;break;svm0.IphaseA = -(ADC0_RESR1 & 0 x0fff + svm0.ADCOFFSET;svm0.IphaseB = (ADC0_RESR1 & 0 x0fff - (ADC0_RESR0 & 0 x0fff;break; svm0.IphaseA = (ADC0_RESR1 & 0 x0fff - (ADC0_RESR0 & 0 x0fff;svm0.IphaseB = -(ADC0_RESR1 & 0 x0fff + svm0.ADCOFFSET;break; svm0.IphaseA = (AD
40、C0_RESR0 & 0 x0fff - svm0.ADCOFFSET;svm0.IphaseB = -(ADC0_RESR1 & 0 x0fff + svm0.ADCOFFSET;break;default: break;/ Calculate currents Id and Iq foc0.Id = park_trans( foc0.Ialpha, foc0.Ibeta, foc0.AngleStore, &foc0.Iq ;/ USER CODE END / End of function ADC0_viSRN1的把上述的馬達(dá)方程變換到與轉(zhuǎn)子同步的dq坐標(biāo)系中.壯使d軸定位在轉(zhuǎn)子磁鏈軸上
41、,可得到:T, = ia 九匕)二土 十*L - LJ 1右 個(gè) r、翥 $ q $qt ; /7 H f /工下nt qf.s qs當(dāng)iqq=】 ;叫 當(dāng)iqq=】 ;叫 轉(zhuǎn)矩達(dá)到最大值2AAList of EquationsTne mecriamcai and electncai equations of the DC motor are valid for the Permanent Magnet Synchronous Motoi PMSM) as well. In the following, a set of equations is listed, which will tens
42、ed later in ths application riote.Voltage Equation:(5:L .日 - R(5:dInduced Voltage:vbciiif = K j 甲,(0Mechanical Friction:inFriclion 1 Fiidkai 一 他Mechanical Equation:T加_J . 而 一 1nm - mLwid _ 1UFricliQii2.14 List of EquationsThe mechanical and electncal aquations of the DC motor arc valid (or the Perma
43、nent Magnet Synchronous Motoi (PMSM) as well. In the fallowing, a set of equations is listed, which will tensed later in ttiis application riote.Vohage Equation:L R i = v-vhelnf阻242 Sensorless FOCThe costs for an encoder or other position sensor can bs saved, when the exact position of the rotor is
44、not required. The motors back EMF is utilized in order to calculate the rotatian angle and rotor position. Tlie back EMF is calculated in the flux estimator which is based on tiie voltage model of the system in the two phaseeferncE frame. A single shunt is enough to reconstruct the phase currents.Pl
45、-con InsllertrnntirrnPi-CDnkciilrCt-orfce bfi力加rmcjlcLialonspeed Pl-cflntrlerPartIransrDfnirfereriM speed-w:S-PVJJ-Unrtw煙Pl-con InsllertrnntirrnPi-CDnkciilrCt-orfce bfi力加rmcjlcLialonspeed Pl-cflntrlerPartIransrDfnirfereriM speed-w:S-PVJJ-Unrtw煙53intguru de?KJ1nie eo-nirolTwaIctcH vauge Source invrri
46、tTCurrentC日忙5日時(shí)2.4.2Sensorless FOGThe costs for an encoder oroiherposiilon $ensor can t)e saved, when the exact position of the rotor Is not requiredThe rnotor-s back EMF i與 utlizd in order to calcuilale the rotation anglB and rater p口弓中on Thf back EMF i$ Calculsted in Ihe flux estimator which is ba
47、sed on ttie voltage model of the system in the two phase retenerKa frame. A single shunt 序 enough to reeonstruci trie phase eurwiis.Figure 16 5hO?ra the block diagram oFthe 古白n部rl總總& FOC dgorilhm. The flux 白tim己匕rW npul signals are taken (ram Ihe Grtiiogonal tvo phase staler system with (he index u
48、and fi. The outpul signal represents the rotor angle. The mtoi 切g(shù)rills in Ihe tvo phase stator 拿yst3mstern) are squuvalent lo the three ph氧導(dǎo)片與/以em. As Aresult. an id&al M phase motor can be assumed in tn& ?45-syste insertion OT Equation (29) in Equation 25 and Equation (30) in Equation (26J.干叩=J(vta
49、-R - ita)dr- La%中=W耶 - L Lp = j(vsp - R i5pdt- L - is(3(32CCUcmlFigure 11 Flow Chart 1112 Period Match Interrupt/ /、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上/ /力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、
50、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、* / Function void CCU60_viNodeI0(void/ DescriptionThis is the interrupt service routine for the CCU60 node/ I0. If the content of the corresponding compare timer/ (configurable equals the content of the capture/compare/
51、register or if a capture event occurs at the associated/ port pin, the interrupt request flag is set and an/ interrupt is triggered (only if enabled./ Please note that you have to add application specific code/ to this function./ ReturnvalueNone/ ParametersNone/ Date14.05.2010/* / USER CODE BEGIN (N
52、odeI0,1/ USER CODE END_interrupt(CCU60_NodeI0_INT void CCU60_viNodeI0(void (/ USER CODE BEGIN (NodeI0,2/ USER CODE ENDif(CCU60_IS & 0 x0040 / if CCU60_IS_T12OM(/ Timer T12 one match detection/ USER CODE BEGIN (NodeI0,20CCU60_vEnableShadowTransfer(CCU60_TIMER_12;/ USER CODE ENDCCU60_ISR |= 0 x0040; /
53、 clear flag CCU60_IS_T12OM )if(CCU60_IS & 0 x0080 / if CCU60_IS_T12PM(/ Timer T12 period match detection/ USER CODE BEGIN (NodeI0,19CCU60_TCTR2 = t13_triggersvm0.Sector;svm0.SectorStore = svm0.Sector;svm0.T1Store = svm0.T1;svm0.T2Store = svm0.T2;foc0.AngleStore = foc0.Angle;/ Flux Estimator/ /、卜、卜、卜
54、、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上/ /力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、上、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上個(gè)個(gè)
55、個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)小DSP_MAC(foc0.Ialpha, foc0.STATOR_R, foc0.Valpha;DSP_MAC(foc0.Ibeta, foc0.STATOR_R, foc0.Vbeta;foc0.FluxAmplitude = cart_polar_conv(foc0.Fluxalpha, foc0.Fluxbeta, &foc0.FluxAngle;/ /、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、
56、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上/ /力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、力、上、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、卜、上、上個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)個(gè)小if( status0.control = 0(foc0.Vd = 0;if( foc0.AngleSpeed 0 foc0.Vq = vf_co
57、ntrol(foc0.Vf_offset, foc0.Vf_slew, foc0.AngleSpeed;else foc0.Vq = vf_control(-foc0.Vf_offset, foc0.Vf_slew, foc0.AngleSpeed;elsecontrol0.ReferenceIq = pi_controller32(&control0.Speed, control0.ReferenceSpeed, control0.ActualSpeed;foc0.Vd = pi_controller32(&control0.Id, control0.ReferenceId, foc0.Id
58、;foc0.Vq = pi_controller32(&control0.Iq, control0.ReferenceIq, foc0.Iq;) foc0.Valpha = inv_park_trans( foc0.Vd, foc0.Vq, foc0.Angle, &foc0.Vbeta ;/ Modulator svm( &svm0 ;/ USER CODE ENDCCU60_ISR 1= 0 x0080; / clear flag CCU60_IS_T12PM ) / End of function CCU60_viNodeI02-2 Space Vector ModulationIn t
59、his section, the / End of function CCU60_viNodeI02-2 Space Vector ModulationIn this section, the modulation ofa three leg voltage source inverter Is described. This type of Inverter contains sb MOSFETs or IGBTs which act as switches. The switches connected to the positive supply rail are called high
60、 side swiiches (h$andthe switch 的 tonrtected to the negative rail of I he power supply are called twside switches 口的In tue following figure, a block diagram of a three leg voltage source Inverter can be seen:Figure 6 Three Leg Voltage Source InverterRy switching tbie high side arid low side switches
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 技能經(jīng)驗(yàn)入股合同范例
- 土地拆遷管理公司合同范例
- 差價(jià)合同范例
- 托盤采購談判合同范例
- 展覽運(yùn)營合同模板
- 工地臨時(shí)房轉(zhuǎn)讓合同范例
- 承包酒店合同范例
- 買房欠款合同模板
- 兼職廣告 推廣合同范例
- 承包廢品拆解合同范例
- 冷庫工程特點(diǎn)施工難點(diǎn)分析及對策
- Python-Django開發(fā)實(shí)戰(zhàn)
- 小學(xué)道法小學(xué)道法1我們的好朋友--第一課時(shí)ppt課件
- 路由和波長分配PPT課件
- 光伏組件開路電壓測試記錄
- 配電箱安裝規(guī)范
- AP1000反應(yīng)堆結(jié)構(gòu)設(shè)計(jì)
- 中英文商務(wù)派遣函樣板
- 幼兒園大班主題教案《超市》含反思
- 彎臂車床夾具設(shè)計(jì)說明書
- 企業(yè)員工健康管理存在的問題與解決途徑探討
評論
0/150
提交評論