matlab_23550/Inu/Src2/VectorControl/dq_to_alphabeta_cos.c
2024-12-27 10:50:32 +03:00

40 lines
1.0 KiB
C

#include "dq_to_alphabeta_cos.h"
#include "IQmathLib.h" // Include header for IQmath library
/////////////////////////////////////////////////
#pragma CODE_SECTION(dq_to_alphabeta_calc,".fast_run2");
void dq_to_alphabeta_calc(DQ_TO_ALPHABETA_handle v)
{
v->Ualpha = _IQmpy(v->Ud, _IQcos(v->Tetta)) + _IQmpy(v->Uq, _IQsin(v->Tetta));
v->Ubeta = -_IQmpy(v->Ud, _IQsin(v->Tetta)) + _IQmpy(v->Uq, _IQcos(v->Tetta));
}
#pragma CODE_SECTION(dq_to_alphabeta_calc2,".fast_run2");
void dq_to_alphabeta_calc2(DQ_TO_ALPHABETA_handle v)
{
v->Ualpha = _IQmpy(v->Ud, _IQsin(v->Tetta)) + _IQmpy(v->Uq, _IQcos(v->Tetta));
v->Ubeta = -_IQmpy(v->Ud, _IQcos(v->Tetta)) + _IQmpy(v->Uq, _IQsin(v->Tetta));
}
#pragma CODE_SECTION(dq_to_alphabeta_calc_cos,".fast_run2");
void dq_to_alphabeta_calc_cos(DQ_TO_ALPHABETA_handle v)
{
v->Ualpha = _IQmpy(v->Ud, _IQcos(v->Tetta)) - _IQmpy(v->Uq, _IQsin(v->Tetta));
v->Ubeta = _IQmpy(v->Ud, _IQsin(v->Tetta)) + _IQmpy(v->Uq, _IQcos(v->Tetta));
}
/////////////////////////////////////////////////