Skip to content

Commit

Permalink
Removed syncadv, turned out in all tests it was disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jsphuebner committed Sep 10, 2022
1 parent 63fbfb1 commit b80fbe2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
7 changes: 3 additions & 4 deletions include/param_prj.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 )

Expand Down
5 changes: 0 additions & 5 deletions src/pwmgeneration-foc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit b80fbe2

Please sign in to comment.