typedef struct { _iq As; // Input: phase-a stator variable
_iq Bs; // Input: phase-b stator variable _iq Alpha; // Output: stationary d-axis stator variable _iq Beta; // Output: stationary q-axis stator variable
void (*calc)(); // Pointer to calculation function
} CLARKE; #define CLARKE_DEFAULTS {0,0,0,0,(void (*)(Uint32))clarke_calc}
void clarke_calc(CLARKE *v)
{ v->Alpha = v->As;
v->Beta = (v->As + 2*v->Bs)*0.57735026918963; // 1/sqrt(3) = 0.57735026918963
}
问题:上的Clarke变换中,v->Beta是Q格式还是浮点数啊?后面 *0.57735026918963这个不是浮点数嘛?
Eric Ma:
问题:上的Clarke变换中,v->Beta是Q格式还是浮点数啊?后面 *0.57735026918963这个不是浮点数嘛?
Eric:
Q格式是定点还是浮点,要看IQMATHLIB.h这个头文件里面的宏定义。
ERIC