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

Config option: Limit to 10A in simplified mode #742

Merged
merged 2 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions modules/EvseManager/EvseManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ void EvseManager::init() {

void EvseManager::ready() {
bsp = std::unique_ptr<IECStateMachine>(new IECStateMachine(r_bsp));

if (config.hack_simplified_mode_limit_10A) {
bsp->set_ev_simplified_mode_evse_limit(true);
}

error_handling =
std::unique_ptr<ErrorHandling>(new ErrorHandling(r_bsp, r_hlc, r_connector_lock, r_ac_rcd, p_evse));

Expand Down
1 change: 1 addition & 0 deletions modules/EvseManager/EvseManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ struct Conf {
int hack_present_current_offset;
bool hack_pause_imd_during_precharge;
bool hack_allow_bpt_with_iso2;
bool hack_simplified_mode_limit_10A;
bool autocharge_use_slac_instead_of_hlc;
bool enable_autocharge;
std::string logfile_suffix;
Expand Down
6 changes: 6 additions & 0 deletions modules/EvseManager/IECStateMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,12 @@ void IECStateMachine::set_pwm(double value) {
}
}

if (ev_simplified_mode_evse_limit and ev_simplified_mode and value > ev_simplified_mode_evse_limit_pwm) {
EVLOG_warning
<< "Simplified mode: Limiting output PWM to 10A due to config option \"hack_simplified_mode_limit_10A\"";
value = ev_simplified_mode_evse_limit_pwm;
}

r_bsp->call_pwm_on(value * 100);

feed_state_machine();
Expand Down
7 changes: 7 additions & 0 deletions modules/EvseManager/IECStateMachine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@

void connector_force_unlock();

void set_ev_simplified_mode_evse_limit(bool l) {
ev_simplified_mode_evse_limit = l;
}

// Signal for internal events type
sigslot::signal<CPEvent> signal_event;
sigslot::signal<> signal_lock;
Expand All @@ -103,6 +107,9 @@
bool pwm_running{false};
bool last_pwm_running{false};

static constexpr float ev_simplified_mode_evse_limit_pwm{10 / 0.6 / 100.}; // Fixed 10A limit

Check notice on line 110 in modules/EvseManager/IECStateMachine.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/EvseManager/IECStateMachine.hpp#L110

class member 'IECStateMachine::ev_simplified_mode_evse_limit_pwm' is never used.
// If set to true, EVSE will limit to 10A in case of simplified charging
bool ev_simplified_mode_evse_limit{false};
bool ev_simplified_mode{false};
bool has_ventilation{false};
bool power_on_allowed{false};
Expand Down
7 changes: 7 additions & 0 deletions modules/EvseManager/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ config:
always be positive but power supply may actually discharge the car.
type: boolean
default: false
hack_simplified_mode_limit_10A:
description:
Limit PWM to 10A if EV uses simplified charging mode. Set to false to be compliant with IEC61851-1:2019 section A.2.3.
It is the responsibility of the EV to limit to 10A according to the norm. Enable this option to deviate from the norm
and limit from the EVSE side.
type: boolean
default: false
autocharge_use_slac_instead_of_hlc:
description: Use slac ev mac address for autocharge instead of EVCCID from HLC
type: boolean
Expand Down
Loading