Skip to content

Commit

Permalink
ITM: Avoid small changes in torque loss
Browse files Browse the repository at this point in the history
  • Loading branch information
rnd-ash committed Feb 27, 2023
1 parent 728d70a commit 6a6a9b3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/models/input_torque.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ void InputTorqueModel::update(EgsBaseCan* can_hal, SensorData* measures, bool is
if (is_fwd_gear) {
// Now calculate torque loss (Function of TCC slip)
if (measures->input_rpm > 0 && measures->input_rpm > measures->engine_rpm) {
multi = ((float)measures->input_rpm/(float)measures->engine_rpm);
this->last_tcc_loss = input_torque * multi;
input_torque -= this->last_tcc_loss;
if (measures->input_rpm - measures->engine_rpm > 25) {
multi = ((float)measures->input_rpm/(float)measures->engine_rpm);
this->last_tcc_loss = input_torque * multi;
input_torque -= this->last_tcc_loss;
}
}
egs_can_hal->set_turbine_torque_loss(MIN(0, (float)this->last_tcc_loss));

Expand Down

0 comments on commit 6a6a9b3

Please sign in to comment.