Changeset 1316
- Timestamp:
- 03/28/11 09:37:44 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/pmsm/pmsm_ctrl.h
r1302 r1316 296 296 icond(3) = the; 297 297 icond(4) = Ww; 298 icond(5) = 1;298 icond(5) = 0; 299 299 vec tmp = L*icond; 300 300 … … 465 465 icondpd(5) = u_old(0); 466 466 icondpd(6) = u_old(1); 467 icondpd(7) = 1;467 icondpd(7) = 0; 468 468 469 469 tmp = L*icondpd; … … 471 471 udq = tmp(0,1); 472 472 473 uab = udq; //set size473 //uab = udq; //set size 474 474 uab(0) = udq(0)*cos(the) - udq(1)*sin(the); 475 475 uab(1) = udq(1)*cos(the) + udq(0)*sin(the); … … 490 490 //else{ //(MAXuflag == 0) //no cut off } 491 491 492 u_old = u ab;492 u_old = udq; 493 493 494 494 return uab; … … 655 655 656 656 for(i = 0; i < rec_hor-1; i++){ 657 p_isd(i+1) = a*p_isd(i) + p_isq(i)*p_ome(i)*Dt + c*udq(0);658 p_isq(i+1) = -p_isd(i)*p_ome(i)*Dt + a*p_isq(i) - b*p_ome(i) + c*udq(1);657 p_isd(i+1) = a*p_isd(i) + p_isq(i)*p_ome(i)*Dt; + c*0.5*(udq(0)+u_old(0)); 658 p_isq(i+1) = -p_isd(i)*p_ome(i)*Dt + a*p_isq(i) - b*p_ome(i); + c*0.5*(udq(1)+u_old(1)); 659 659 p_ome(i+1) = d*p_ome(i) + e*p_isq(i); 660 660 p_the(i+1) = p_the(i) + Dt*p_ome(i); … … 677 677 678 678 L = lq.getL(); 679 679 680 680 icondpd(0) = isa*cos(the) + isb*sin(the); 681 681 icondpd(1) = isb*cos(the) - isa*sin(the); … … 685 685 icondpd(5) = u_old(0); 686 686 icondpd(6) = u_old(1); 687 icondpd(7) = 1;687 icondpd(7) = 0; 688 688 689 689 tmp = L*icondpd; … … 691 691 udq = tmp(0,1); 692 692 693 uab = udq; //set size693 //uab = udq; //set size 694 694 uab(0) = udq(0)*cos(the) - udq(1)*sin(the); 695 695 uab(1) = udq(1)*cos(the) + udq(0)*sin(the); … … 710 710 //else{ //(MAXuflag == 0) //no cut off } 711 711 712 u_old = u ab;713 712 u_old = udq; 713 714 714 return uab; 715 715 }