matlab_23550/Inu/Src/VectorControl/dq_to_alphabeta_cos.c

40 lines
1.0 KiB
C
Raw Normal View History

2024-12-27 10:50:32 +03:00
#include "IQmathLib.h" // Include header for IQmath library
#include "dq_to_alphabeta_cos.h"
/////////////////////////////////////////////////
//#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));
}
/////////////////////////////////////////////////