25 lines
485 B
C
25 lines
485 B
C
#include "IQmathLib.h" // Include header for IQmath library
|
|
|
|
#include "alphabeta_to_dq.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////
|
|
|
|
|
|
#pragma CODE_SECTION(alphabeta_to_dq_calc,".fast_run");
|
|
void alphabeta_to_dq_calc(ALPHABETA_TO_DQ *v)
|
|
{
|
|
|
|
v->Ud = _IQmpy(v->Ualpha, _IQcos(v->Tetta)) + _IQmpy(v->Ubeta, _IQsin(v->Tetta));
|
|
v->Uq = -_IQmpy(v->Ualpha, _IQsin(v->Tetta)) + _IQmpy(v->Ubeta, _IQcos(v->Tetta));
|
|
|
|
}
|
|
/////////////////////////////////////////////////
|