Skip to content

Commit

Permalink
Fix division error
Browse files Browse the repository at this point in the history
  • Loading branch information
dalathegreat committed Nov 20, 2023
1 parent 1e91bd6 commit 2f6d6cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Software/src/battery/TESLA-MODEL-3-BATTERY.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ void update_values_tesla_model_3_battery() { //This function maps all the value
if (SOC == 10000) {
max_target_charge_power = 0; // When battery is 100% full, set allowed charge W to 0
} else if (SOC > 9500) { // When battery is between 95-99.99%, ramp the value between Max<->0
max_target_charge_power = MAXCHARGEPOWERALLOWED * (1 - (SOC - 9500) / 500);
max_target_charge_power = MAXCHARGEPOWERALLOWED * (1 - (SOC - 9500) / 500.0);
} else { // Outside the specified SOC range, set the charge power to the maximum
max_target_charge_power = MAXCHARGEPOWERALLOWED;
}
Expand Down

1 comment on commit 2f6d6cf

@Newevg
Copy link
Collaborator

@Newevg Newevg commented on 2f6d6cf Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works correctly

Please sign in to comment.