Skip to content

Commit

Permalink
Revert "added derate factor to case and loadcell"
Browse files Browse the repository at this point in the history
This reverts commit 5d9761b.
  • Loading branch information
CL16gtgh committed May 21, 2024
1 parent 5d9761b commit 760bd8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 1 addition & 3 deletions lib/systems/include/CASESystem.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ DrivetrainCommand_s CASESystem<message_queue>::evaluate(

in.discontinuousBrakesPercentThres = config_.discontinuousBrakesPercentThreshold;

float derateFactor = get_acc_derate_factor();

in.TorqueMode = derateFactor * config_.TorqueMode;
in.TorqueMode = config_.TorqueMode;

in.RegenLimit = config_.RegenLimit;

Expand Down
9 changes: 4 additions & 5 deletions lib/systems/src/TorqueControllers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ void TorqueControllerLoadCellVectoring::tick(
if (ready_)
{
// Calculate total normal force
float derateFactor = get_acc_derate_factor();
float sumNormalForce = 0.0f;
for (int i = 0; i < 4; i++)
{
Expand All @@ -120,10 +119,10 @@ void TorqueControllerLoadCellVectoring::tick(
writeout_.command.speeds_rpm[RL] = AMK_MAX_RPM;
writeout_.command.speeds_rpm[RR] = AMK_MAX_RPM;

writeout_.command.torqueSetpoints[FL] = torquePool * frontTorqueScale_ * loadCellForcesFiltered_[0] / sumNormalForce * derateFactor;
writeout_.command.torqueSetpoints[FR] = torquePool * frontTorqueScale_ * loadCellForcesFiltered_[1] / sumNormalForce * derateFactor;
writeout_.command.torqueSetpoints[RL] = torquePool * rearTorqueScale_ * loadCellForcesFiltered_[2] / sumNormalForce * derateFactor;
writeout_.command.torqueSetpoints[RR] = torquePool * rearTorqueScale_ * loadCellForcesFiltered_[3] / sumNormalForce * derateFactor;
writeout_.command.torqueSetpoints[FL] = torquePool * frontTorqueScale_ * loadCellForcesFiltered_[0] / sumNormalForce;
writeout_.command.torqueSetpoints[FR] = torquePool * frontTorqueScale_ * loadCellForcesFiltered_[1] / sumNormalForce;
writeout_.command.torqueSetpoints[RL] = torquePool * rearTorqueScale_ * loadCellForcesFiltered_[2] / sumNormalForce;
writeout_.command.torqueSetpoints[RR] = torquePool * rearTorqueScale_ * loadCellForcesFiltered_[3] / sumNormalForce;
}
else
{
Expand Down

0 comments on commit 760bd8f

Please sign in to comment.