Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DC Power supply: perform mode switch only when it is on #952

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions modules/EvseManager/EvseManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ bool EvseManager::powersupply_DC_set(double _voltage, double _current) {

if (((config.hack_allow_bpt_with_iso2 or config.sae_j2847_2_bpt_enabled) and current_demand_active) and
is_actually_exporting_to_grid) {
if (not last_is_actually_exporting_to_grid) {
if (not last_is_actually_exporting_to_grid and powersupply_dc_is_on) {
// switching from import from grid to export to grid
session_log.evse(false, "DC power supply: switch ON in import mode");
r_powersupply_DC[0]->call_setMode(types::power_supply_DC::Mode::Import, power_supply_DC_charging_phase);
Expand Down Expand Up @@ -1616,9 +1616,10 @@ bool EvseManager::powersupply_DC_set(double _voltage, double _current) {
return false;

} else {
if (charging_phase_changed or (((config.hack_allow_bpt_with_iso2 or config.sae_j2847_2_bpt_enabled) and
last_is_actually_exporting_to_grid) and
current_demand_active)) {
if (powersupply_dc_is_on and
(charging_phase_changed or (((config.hack_allow_bpt_with_iso2 or config.sae_j2847_2_bpt_enabled) and
last_is_actually_exporting_to_grid) and
current_demand_active))) {
// switching from export to grid to import from grid
session_log.evse(false, "DC power supply: switch ON in export mode");
r_powersupply_DC[0]->call_setMode(types::power_supply_DC::Mode::Export, power_supply_DC_charging_phase);
Expand Down
Loading