2025-03-20 3:14 AM
Hello everyone,
I am working on a BLDC motor and have implemented Field-Oriented Control (FOC) on an STM32f103c86 microcontroller. For rotor angle estimation, I am using a Luenberger State Observer and calculating the rotor angle using a Lookup Table (LUT).
Has anyone faced a similar issue? Any suggestions on what could be causing the incorrect rotor angle waveform?
Thanks in advance!
Waveform must be same as MotorRun.phase is excepted
int32_t alpha = 0;
int32_t Beta = 0;
int32_t z =0;
int32_t y =0;
int32_t m = 0;
//Calculate Rotor Angle
void CalculateRotorAngle(int32_t ealpha, int32_t ebeta){
alpha =powf(ealpha,2);
Beta = powf(ebeta,2);
z = alpha + Beta;
y = sqrt(z);
m = alpha/y;
Measured.foc.rototAngle = (cos_lut[(unsigned char) (m)]) ;
}