matlab_23550/Inu/Src/VectorControl/teta_calc.h

37 lines
732 B
C
Raw Normal View History

2024-12-27 10:50:32 +03:00
#ifndef TETA_CALC
#define TETA_CALC
#include "IQmathLib.h"
#include "pid_reg3.h"
void calc_teta_Id(_iq Frot, _iq Id, _iq Iq, _iq *tetta_out, _iq *theta_to_slave, _iq *Fsl_out, _iq *Fstator_out,
unsigned int master, int reset);
void init_teta_calc_struct(void);
// k_r = Ts / Tr_cm
// Tr_cm = Lr / Rr
// Lr - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// Rr - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//
// k_t = 1 / (Tr_cm * 2 * Pi * f_b)
// <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> f_b = NORMA_FROT
// K = Ts * f_b
// f_b - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (12 <20><>)
// Ts - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (840 <20><>)
typedef struct {
_iq Imds;
_iq theta;
_iq hz_to_angle;
_iq k_r;
_iq k_t;
} TETTA_CALC;
#define TETTA_CALC_DEF {0,0,0,0,0}
extern TETTA_CALC tetta_calc;
#endif //TETA_CALC