From 760bd8f0acf3683092601822cb4682c4eb286568 Mon Sep 17 00:00:00 2001 From: CL16gtgh Date: Tue, 21 May 2024 18:04:56 -0400 Subject: [PATCH] Revert "added derate factor to case and loadcell" This reverts commit 5d9761b97bdf00b7dc1c1b5c5e89d01f0a533253. --- lib/systems/include/CASESystem.tpp | 4 +--- lib/systems/src/TorqueControllers.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/systems/include/CASESystem.tpp b/lib/systems/include/CASESystem.tpp index 48293bb96..38f914700 100644 --- a/lib/systems/include/CASESystem.tpp +++ b/lib/systems/include/CASESystem.tpp @@ -113,9 +113,7 @@ DrivetrainCommand_s CASESystem::evaluate( in.discontinuousBrakesPercentThres = config_.discontinuousBrakesPercentThreshold; - float derateFactor = get_acc_derate_factor(); - - in.TorqueMode = derateFactor * config_.TorqueMode; + in.TorqueMode = config_.TorqueMode; in.RegenLimit = config_.RegenLimit; diff --git a/lib/systems/src/TorqueControllers.cpp b/lib/systems/src/TorqueControllers.cpp index 043871282..4351c4dc8 100644 --- a/lib/systems/src/TorqueControllers.cpp +++ b/lib/systems/src/TorqueControllers.cpp @@ -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++) { @@ -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 {