Skip to content

Commit

Permalink
Smoother shifts
Browse files Browse the repository at this point in the history
  • Loading branch information
rnd-ash committed Sep 30, 2023
1 parent a00301b commit 9bf415c
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/gearbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,18 +578,11 @@ bool Gearbox::elapse_shift(ProfileGearChange req_lookup, AbstractProfile *profil
}

current_working_pressure = wp_current_gear;
float overlap_ending_spc = interpolate_float(
sensor_data.input_torque,
prefill_data.fill_pressure_on_clutch*2,
current_working_pressure + (prefill_data.fill_pressure_on_clutch),
100,
gearboxConfig.max_torque,
InterpType::Linear
);
float overlap_ending_spc = current_working_pressure + (prefill_data.fill_pressure_on_clutch*2);

current_mod_clutch_pressure = interpolate_float(phase_elapsed, prev_mod_clutch_pressure/2, 0, 0, chars.target_shift_time, InterpType::EaseOut);
current_mod_clutch_pressure = interpolate_float(phase_elapsed, prev_mod_clutch_pressure/2, 0, 0, chars.target_shift_time/2, InterpType::EaseOut);
// Max shift clutch pressure increase beyond shift time (Fixes slow 1-2)
current_shift_clutch_pressure = interpolate_float(phase_elapsed, prev_shift_clutch_pressure, overlap_ending_spc, 0, chars.target_shift_time, InterpType::EaseOut);
current_shift_clutch_pressure = interpolate_float(phase_elapsed, prev_shift_clutch_pressure, overlap_ending_spc, 0, chars.target_shift_time*2, InterpType::EaseIn);
} else if (current_stage == ShiftStage::MaxPressure) {
// Ramp time is always 250ms
int wp_new_gear = pressure_manager->find_working_mpc_pressure(this->target_gear);
Expand Down

0 comments on commit 9bf415c

Please sign in to comment.