akiyoshi oguro
/
Vector_SVPWM_drive_F302R8
Vector SVPWM Drive SPMSM
Diff: main.cpp
- Revision:
- 2:0058dae8606d
- Parent:
- 1:74d7a989b741
- Child:
- 3:cb3ad5a26986
diff -r 74d7a989b741 -r 0058dae8606d main.cpp --- a/main.cpp Sat Jun 01 03:13:36 2019 +0000 +++ b/main.cpp Sat Jun 08 03:52:20 2019 +0000 @@ -213,21 +213,21 @@ if(r==1){ if((Speed > 1000)&&(Speed <=1500)){ iso=-0.3; - Vqp=0.2*Vq; //0.8 + Vqp=0.3*Vq; //0.2 Vdlink=0.4; Edw=3500; z=0.7; } if((Speed > 1500)&&(Speed <=2000)){ iso=0.7; - Vqp=0.2*Vq; //0.7 + Vqp=0.3*Vq; //0.2 Vdlink=0.45; Edw=3600; z=0.7; } if((Speed > 2000)&&(Speed <=3000)){ iso=0.8; - Vqp=0.2*Vq; //0.3 + Vqp=0.3*Vq; //0.2 Vdlink=0.5; Edw=3700; z=0.7; @@ -268,7 +268,7 @@ z=0.8; //0.8 } // th=(Wz*et*1.9E-4)+iso; //1.99E-4 - th=(W*et*1.9E-4)+iso; + th=(W*et*1.9E-4)+iso; //1.9E-4 // th=Wo*wi*1.85E-4; } @@ -361,7 +361,7 @@ // Vq=(idq[1]);//tmp vdq /*****PID Id *****/ - Idin=(-0.25)-idq[0]; // -0.2 + Idin=(-0.25)-idq[0]; // -0.25 float adi,bdi,cdi,workdi[2]; float kpdi=1.0,kidi=0.5,kddi=0.0; //p51 0.5 1.2 0.0 float dtdi=1.0E-6;//1E-6 @@ -459,10 +459,10 @@ } /*****PID ω *****/ - Xin=5500*(1.05-Vr_adc)-vst; // 5500 + Xin=5000*(1.05-Vr_adc)-vst; // 5500 float a,b,c,work[2]; - float kp=2.0,ki=0.5,kd=0.0; // 1.2 0.7 - float dt=10.0E-6;//1E-6 + float kp=2.0,ki=0.5,kd=0.0; // 2.0 0.5 + float dt=10.0E-6;//10E-6 a=Xin; b=work[1]+(Xin+work[0])/2.0*dt; c=(Xin-work[0])/dt; @@ -491,7 +491,7 @@ }*/ /****Filter********/ float vstfo=vstf; - float dttt=100.0E-6;//100E-6 + float dttt=10.0E-6;//100E-6 float k11,k22,k33,k44,tau1=0.1;//0.01 k11=dttt*(vsti-vstfo)/tau1; k22=dttt*(vsti-(vstfo+k11/2.0))/tau1;