Skip to content

Commit

Permalink
Startup value fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jsphuebner committed Nov 1, 2022
1 parent 701875d commit 38bbda1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pwmgeneration-foc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void PwmGeneration::Run()
int32_t qlimit = FOC::GetQLimit(ud);

if (frqFiltered < FP_FROMINT(30))
qController.SetMinMaxY(dir <= 0 ? -qlimit : 0, dir => 0 ? qlimit : 0);
qController.SetMinMaxY(dir <= 0 ? -qlimit : 0, dir >= 0 ? qlimit : 0);
else
qController.SetMinMaxY(-qlimit, qlimit);

Expand Down Expand Up @@ -112,7 +112,7 @@ void PwmGeneration::Run()
dController.ResetIntegrator();
qController.ResetIntegrator();
RunOffsetCalibration();
amplitudeErrFiltered = fwOutMax;
amplitudeErrFiltered = fwOutMax << 8;
}
else
{
Expand Down

0 comments on commit 38bbda1

Please sign in to comment.