14 float i_alpha, i_beta;
20 i_alpha = 2*(current.
a - (current.
b - current.
c))/3.0;
27 if(motor_electrical_angle)
28 sign = (i_beta *
_cos(motor_electrical_angle) - i_alpha*
_sin(motor_electrical_angle)) > 0 ? 1 : -1;
30 return sign*
_sqrt(i_alpha*i_alpha + i_beta*i_beta);
42 float i_alpha, i_beta;
48 i_alpha = 0.6666667*(current.
a - (current.
b - current.
c));
53 float ct =
_cos(angle_el);
54 float st =
_sin(angle_el);
56 return_current.
d = i_alpha * ct + i_beta * st;
57 return_current.
q = i_beta * ct - i_alpha * st;
58 return return_current;