声明:此文章仅作为工作或学习笔记,如有版权问题请及时与作者联系!高手与大牛请绕道。
用PSIM写了一段C代码,用于识别变频器Vd,Vq向Valpha、Vbeta转换。可用于PSIM嵌入C代码仿真。
float Ial, Ibe, theta_e;
float Id, Iq;
Id = in[0];
Iq = in[1];
theta_e = in[2];
Ial = Id*cos(theta_e) - Iq*sin(theta_e);
Ibe = Id*sin(theta_e) + Iq*cos(theta_e);
out[0] =Ial;
out[1] =Ibe;