Skip to content

Commit

Permalink
Improve handling of crossover trq requests
Browse files Browse the repository at this point in the history
  • Loading branch information
rnd-ash committed Aug 10, 2024
1 parent bf39997 commit db0aa95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/gearbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,12 @@ bool Gearbox::elapse_shift(ProfileGearChange req_lookup, AbstractProfile *profil

ShiftingAlgorithm* algo;
// Check if we exceed the pressure of low filling
if (sensor_data.static_torque > VEHICLE_CONFIG.engine_drag_torque/10.0 && sensor_data.input_rpm > 1500) {
bool is_manual = (profile == manual || profile == race);

if (
(is_manual && sensor_data.static_torque > 50 && sensor_data.input_rpm > 1500) ||
(!is_manual && sensor_data.pedal_pos > 120 && sensor_data.input_rpm > 1500)
) {
algo = new ReleasingShift(&sid);
} else {
algo = new CrossoverShift(&sid);
Expand Down
2 changes: 1 addition & 1 deletion src/shifting_algo/shift_crossover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ uint8_t CrossoverShift::step(
// Limiting engine torque by this much (Computed later with indicated_torque - trq_req_targ = trq request output)
int trq_req_targ = 0;
// We can only request if engine torque is above engines min torque
if (sd->static_torque_wo_request > sd->min_torque && sd->driver_requested_torque && sd->input_rpm > 1200) {
if (sd->static_torque_wo_request > sd->min_torque && sd->driver_requested_torque > sd->min_torque && sd->input_rpm > 1200) {
bool inc = false;
if (phase_id == PHASE_MOMENTUM_RAMP && this->trq_req_start_time != 0) {
trq_req_targ = this->trq_req_ramp_trq;
Expand Down

0 comments on commit db0aa95

Please sign in to comment.