Hi,
The angle got from fs_etpu_resolver_get_outputs_calculated() is mechanical angle. If resolver is 1xpole pairs, motor is 4x pole pairs, electrical andgel = mechanical*4, here saturation has to be taken into account, regarding the details implement method, you can refer AN12017sw and add bold code.
ptr->Resolver_SW.fltThRotMec = ((tFloat)resolver_outputs_calculated.angle / 0x800000) * FLOAT_PI;
ptr->Resolver_SW.wRotMec.raw = (((tFloat) resolver_outputs_calculated.speed) / 0x800000) * FLOAT_PI *20000; /* rad/s */
// Mechanical rotor position - convert from FLOAT to FIX, <-1,1> range f32ThRotMe = MLIB_ConvertPU_F32FLT(MLIB_Div(ptr->fltThRotMec,FLOAT_PI));
// Electrical rotor offset position - convert from FLOAT to FIX, <-1,1> range f32ThRotElOffset = MLIB_ConvertPU_F32FLT(MLIB_Div(ptr->fltThRotElOffset,FLOAT_PI));
// Electrical rotor position calculation respecting the resolver position offset - fix point arithmetic f32ThRotEl = MLIB_ShL_F32(MLIB_MulSat_F32(f32ThRotMe,ptr->s32motorPPscale),ptr->s16motorPPscaleShift); f32ThRotEl = MLIB_Sub_F32(f32ThRotEl,f32ThRotElOffset);
// Electrical rotor position -> convert from FIX to FlOAT, <-pi, pi> range ptr->fltThRotEl = MLIB_Mul(MLIB_ConvertPU_FLTF32(f32ThRotEl), FLOAT_PI);