• 回复
  • 收藏
  • 点赞
  • 分享
  • 发新帖

saber里面怎么实现park clark变换啊 求教 在线等

初学saber,觉得用起来高端又复杂。abc/dq0坐标变换貌似没有现成的模块,但是自己又不知道怎么搭,希望高手不吝赐教!
全部回复(2)
正序查看
倒序查看
youngtao
LV.1
2
2013-08-23 20:52
element template abc2dqo  a b c theta d q o
input nu a,b,c,theta
output nu d, q, o

{
number pi = 3.1415926


d = (cos(theta)*a+cos(theta-2*pi/3)*b+cos(theta+2*pi/3)*c)*(2/3)
q = (sin(theta)*a+sin(theta-2*pi/3)*b+sin(theta+2*pi/3)*c)*(-2/3)
o=  (a+b+c)*(1/3)

}


enjoy

0
回复
xxf88xxf
LV.3
3
2013-08-24 21:08
@youngtao
elementtemplateabc2dqo abcthetadqoinputnua,b,c,thetaoutputnud,q,o{numberpi=3.1415926d=(cos(theta)*a+cos(theta-2*pi/3)*b+cos(theta+2*pi/3)*c)*(2/3)q=(sin(theta)*a+sin(theta-2*pi/3)*b+sin(theta+2*pi/3)*c)*(-2/3)o= (a+b+c)*(1/3)}enjoy
saber自带example里面的变换
element template abc_dq a b c d q thetarm = p
var nu d, q
ref nu a, b, c
ref nu thetarm
number p=1

{

  val nu thetare, dd, qq
  number ang
  number xp,p2
  number remains      # check for an even pole number input


  standard..sp sp_thar[*],ns_thar[*]


  parameters {
        xp = argbp("gte_w","undef_w","inf_w",p,"p",2,2)

        # check for an even pole number input
        remains= xp-2*int(xp/2)
        if (remains == 1) {
                saber_message("TMPL_W_NPOLES_EQ_ODD",instance())
        }

        p2 = xp/2
        ang = 2*math_pi/3
        sp_thar = [(-500meg,10),(-1meg,1),(-10k,100u*math_pi/xp),\
                   (-1k,10u*math_pi/xp),(0,1u*math_pi/xp),\
                   (1k,10u*math_pi/xp),(10k,100u),(1meg,1),(500meg,0)]
        ns_thar = [(-1meg,math_pi/xp),(1meg,0)]
  }

  values {

      if (p == 1) {
 thetare = thetarm
      }
      else {
 thetare = thetarm*p/2
      }
      dd = (a*sin(thetare) + b*sin(thetare -ang) + c*sin(thetare +ang))*2/3.0
      qq = (a*cos(thetare) + b*cos(thetare -ang) + c*cos(thetare +ang))*2/3.0
  }

  control_section {
      pl_set( (dd,qq) , (a,b,c,thetarm) )
      sample_points(thetarm,sp_thar)
  }

  equations {
      d: d = dd
      q: q = qq
  }
}

0
回复