Part Number: TMS320F28379D
Hello
In your sample project EQEP_ex2_pos_speed/Eqep_ex2_calculation.c you calculate a mechanical theta. I was expecting this number to be in degrees. It is in fixed point Q15 format. When I convert from Q15 to floating point it gives me very small number.
Can you explain how I can obtain degrees from 0 - 360.
//
// The following lines calculate
//
// p->thetaMech ~= QPOSCNT / mechScaler [current cnt/(total cnt in 1 rev)]
//
// where mechScaler = 4000 cnts/revolution
//
temp = (int32_t)p->thetaRaw * (int32_t)p->mechScaler; // Q0 * Q26 = Q26
temp &= 0x03FFF000;
p->thetaMech = (int16_t)(temp >> 11); // Q26 -> Q15
p->thetaMech &= 0x7FFF;