Skip to content

Commit

Permalink
Removed experimental current limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
jsphuebner committed Aug 24, 2019
1 parent 213fa2f commit b18eeac
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 27 deletions.
2 changes: 1 addition & 1 deletion include/project/param_prj.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
#define POTMODE_DUALCHANNEL 1
#define POTMODE_CAN 2

#define VER 4.51.R
#define VER 4.52.R
#define VERSTR STRINGIFY(4=VER)

enum _modes
Expand Down
2 changes: 0 additions & 2 deletions include/project/throttle.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class Throttle
static void BmsLimitCommand(int& finalSpnt, bool dinbms);
static void UdcLimitCommand(int& finalSpnt, s32fp udc);
static void IdcLimitCommand(int& finalSpnt, s32fp idc);
static void IacLimitCommand(int& finalSpnt, s32fp iac);
static int potmin[2];
static int potmax[2];
static int brknom;
Expand All @@ -58,7 +57,6 @@ class Throttle
static s32fp udcmax;
static s32fp idcmin;
static s32fp idcmax;
static s32fp iacmax;

private:
static int speedFiltered;
Expand Down
3 changes: 0 additions & 3 deletions src/project/stm32_sine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,6 @@ static void ProcessThrottle()
throtSpnt = GetUserThrottleCommand();
GetCruiseCreepCommand(finalSpnt, throtSpnt);

Throttle::iacmax = (Param::Get(Param::iacmax) * finalSpnt) / 100;
Throttle::IacLimitCommand(finalSpnt, Param::Get(Param::ilmax));

if (hwRev != HW_TESLA)
Throttle::BmsLimitCommand(finalSpnt, Param::GetBool(Param::din_bms));

Expand Down
21 changes: 0 additions & 21 deletions src/project/throttle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ s32fp Throttle::udcmin;
s32fp Throttle::udcmax;
s32fp Throttle::idcmin;
s32fp Throttle::idcmax;
s32fp Throttle::iacmax;

bool Throttle::CheckAndLimitRange(int* potval, int potIdx)
{
Expand Down Expand Up @@ -214,23 +213,3 @@ void Throttle::IdcLimitCommand(int& finalSpnt, s32fp idc)
finalSpnt = MAX(res, finalSpnt);
}
}

void Throttle::IacLimitCommand(int& finalSpnt, s32fp iac)
{
if (finalSpnt >= 0)
{
s32fp iacerr = iacmax - iac;
int res = FP_TOINT(iacerr * 10);

res = MAX(0, res);
finalSpnt = MIN(res, finalSpnt);
}
else
{
s32fp iacerr = iacmax - iac;
int res = FP_TOINT(iacerr * 10);

res = MIN(0, res);
finalSpnt = MAX(res, finalSpnt);
}
}

0 comments on commit b18eeac

Please sign in to comment.