diff --git a/include/param_prj.h b/include/param_prj.h index e640260..fed0a67 100644 --- a/include/param_prj.h +++ b/include/param_prj.h @@ -53,11 +53,10 @@ PARAM_ENTRY(CAT_MOTOR, curkp, "", 0, 20000, 32, 107 ) \ PARAM_ENTRY(CAT_MOTOR, curki, "", 0, 100000, 20000, 108 ) \ PARAM_ENTRY(CAT_MOTOR, curkifrqgain,"dig/Hz", 0, 1000, 50, 120 ) \ - PARAM_ENTRY(CAT_MOTOR, fwkp, "", 0, 1000, 1, 142 ) \ - PARAM_ENTRY(CAT_MOTOR, fwki, "", 0, 1000, 1, 143 ) \ - PARAM_ENTRY(CAT_MOTOR, fwmargin, "dig", 0, 10000, 2000, 141 ) \ + PARAM_ENTRY(CAT_MOTOR, fwkp, "", 0, 1000, 5, 142 ) \ + PARAM_ENTRY(CAT_MOTOR, fwki, "", 0, 1000, 300, 143 ) \ + PARAM_ENTRY(CAT_MOTOR, fwmargin, "dig", 0, 10000, 2500, 141 ) \ PARAM_ENTRY(CAT_MOTOR, syncofs, "dig", 0, 65535, 0, 70 ) \ - PARAM_ENTRY(CAT_MOTOR, syncadv, "dig/Hz", 0, 65535, 10, 133 ) \ PARAM_ENTRY(CAT_MOTOR, lqminusld, "mH", 0, 1000, 0, 139 ) \ PARAM_ENTRY(CAT_MOTOR, fluxlinkage, "mWeber", 0, 1000, 90, 140 ) diff --git a/src/pwmgeneration-foc.cpp b/src/pwmgeneration-foc.cpp index 1b87c88..67d8c2d 100644 --- a/src/pwmgeneration-foc.cpp +++ b/src/pwmgeneration-foc.cpp @@ -224,11 +224,6 @@ void PwmGeneration::CalcNextAngleSync(int dir) { uint16_t syncOfs = Param::GetInt(Param::syncofs); uint16_t rotorAngle = Encoder::GetRotorAngle(); - s32fp syncadv = FP_MUL(frqFiltered, Param::GetInt(Param::syncadv)); - syncadv = MAX(0, syncadv); - - //Compensate rotor movement that happened between sampling and processing - syncOfs += FP_TOINT(dir * syncadv); angle = polePairRatio * rotorAngle + syncOfs; frq = polePairRatio * Encoder::GetRotorFrequency();