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

New InputFilter class #590

Merged
merged 37 commits into from
May 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
749ab5a
new InputFilter Class for Divert & Shaper
KipK Apr 1, 2023
b70fedf
changed divert_sim config to new divert props
KipK Apr 29, 2023
38baa79
fix divert_sim compile
KipK Apr 29, 2023
4b84127
use divert_decay_smoothing_time instead of divert_decay_smoothing_factor
KipK Apr 29, 2023
1068e78
add ENABLE_DEBUG_INPUT_FILTER
KipK Apr 29, 2023
b06d3e8
change default divert_min_charge_time to 600 sec
KipK May 2, 2023
4f75e25
shaper indent
KipK May 3, 2023
44fa69a
Merge remote-tracking branch 'origin/master' into shaper
KipK May 4, 2023
2482d43
add presettings to divert_sim
KipK May 4, 2023
978602b
change default divert settings to mimic previous ones
KipK May 4, 2023
d0d8b7d
updated snapshots for divert unit test
KipK May 4, 2023
13d8740
divert_sim test_config.json
KipK May 5, 2023
6d3e207
Merge branch 'master' into shaper
KipK May 9, 2023
050c161
changed tested value
KipK May 9, 2023
c60f4c6
typo
KipK May 9, 2023
075869a
Merge branch 'master' into shaper
KipK May 9, 2023
79895b6
fix test
KipK May 9, 2023
ee29469
correct property to divert_decay_smoothing_time
KipK May 9, 2023
0389ae9
Merge remote-tracking branch 'origin/master' into shaper
KipK May 10, 2023
0cb0907
Merge remote-tracking branch 'origin/master' into shaper
KipK May 13, 2023
18ab7af
Warning fixes
jeremypoulter May 13, 2023
32c1713
Run the tests with the defaults, no waste and no import profiles.
jeremypoulter May 13, 2023
616a89c
Added the master graphs to the report.
jeremypoulter May 16, 2023
90d61bc
Merge remote-tracking branch 'origin/master' into shaper
KipK May 17, 2023
4e21826
Merge branch 'shaper' of https://github.com/KipK/ESP32_WiFi_V4.x into…
KipK May 17, 2023
0ded855
fix hysteresis dead spot
KipK May 17, 2023
583494d
changed default divert_decay_smoothing_time to 600
KipK May 17, 2023
2a1d32f
Added an interactive mode to allow you to run the simulation with dif…
jeremypoulter May 17, 2023
2455b86
Merge branch 'shaper' of https://github.com/KipK/ESP32_WiFi_V4.x into…
KipK May 17, 2023
89b4b43
bump gui
KipK May 18, 2023
c89936f
updated divert_sim test configs
KipK May 18, 2023
29b5cce
Made the Grid I/E graphs taller again
jeremypoulter May 18, 2023
4d62c75
Run the simulation python server for `make server`
jeremypoulter May 20, 2023
fae2d8f
update divert_sim test.http
KipK May 21, 2023
fa98f5c
update test_divert values
KipK May 21, 2023
95678ca
cleanup statics
KipK May 21, 2023
56185d4
updated static files
KipK May 21, 2023
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
6 changes: 3 additions & 3 deletions api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ paths:
Configure Solar divert:
value:
divert_enabled: true
divert_attack_smoothing_factor: 0.4
divert_decay_smoothing_factor: 0.05
divert_min_charge_time: 60
divert_attack_smoothing_time: 8
divert_decay_smoothing_time: 300
divert_min_charge_time: 20
Set normal charging mode:
value:
charge_mode: fast
Expand Down
5 changes: 4 additions & 1 deletion divert_sim/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,7 @@ $RECYCLE.BIN/

*.o
divert_sim
output

*.csv
test_results.xml
!*_master.csv
4 changes: 3 additions & 1 deletion divert_sim/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ CPPFLAGS := \
# \
# -D ENABLE_DEBUG \
# -D ENABLE_DEBUG_DIVERT \
# -D ENABLE_DEBUG_INPUT_FILTER \
# -D ENABLE_DEBUG_EVSE_MAN \
# -D ENABLE_DEBUG_EVSE_MONITOR
LDFLAGS := -pthread
Expand Down Expand Up @@ -65,6 +66,7 @@ STREAM_SPY_OBJ := \
StreamSpy.o \

OPENEVSE_WIFI_OBJ := \
input_filter.o \
divert.o \
current_shaper.o \
evse_man.o \
Expand Down Expand Up @@ -135,7 +137,7 @@ clean:
rm -f $(TARGETS) $(OBJ)

server:
python3 -m http.server
python3 server.py

$(OBJ): %.o : %.cpp $(DEPS)
$(CPP) -c -o $@ $< $(CPPFLAGS)
Expand Down
6 changes: 6 additions & 0 deletions divert_sim/data/config-default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"divert_PV_ratio": 1.1,
"divert_attack_smoothing_time": 20,
"divert_decay_smoothing_time": 600,
"divert_min_charge_time": 600
}
6 changes: 6 additions & 0 deletions divert_sim/data/config-inputfilter-noimport.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"divert_PV_ratio": 1.1,
"divert_attack_smoothing_time": 300,
"divert_decay_smoothing_time": 20,
"divert_min_charge_time": 600
}
6 changes: 6 additions & 0 deletions divert_sim/data/config-inputfilter-nowaste.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"divert_PV_ratio": 0.5,
"divert_attack_smoothing_time": 20,
"divert_decay_smoothing_time": 600,
"divert_min_charge_time": 600
}
6 changes: 3 additions & 3 deletions divert_sim/data/test_config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"divert_PV_ratio": 0.5,
"divert_attack_smoothing_factor": 0.4,
"divert_decay_smoothing_factor": 0.05,
"divert_PV_ratio": 1.1,
"divert_attack_smoothing_time": 20,
"divert_decay_smoothing_time": 600,
"divert_min_charge_time": 600
}
73 changes: 73 additions & 0 deletions divert_sim/interactive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<!DOCTYPE html>
<html>

<head>
<title>OpenEVSE Solar Divert Simulations</title>
<script type="text/javascript" src="https://canvasjs.com/assets/script/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
<script type="text/javascript" src="simulations.js"></script>
<script type="text/javascript">
var profiles = [
"master",
"interactive"
];

function run_simulation() {
$.post("simulation", JSON.stringify({
"divert_PV_ratio": parseFloat($("#divert_PV_ratio").val()),
"divert_attack_smoothing_time": parseInt($("#divert_attack_smoothing_time").val()),
"divert_decay_smoothing_time": parseInt($("#divert_decay_smoothing_time").val()),
"divert_min_charge_time": parseInt($("#divert_min_charge_time").val())
}), () => {
init_summary(profiles);
loadSummary("output/summary_master.csv", () => {
loadSummary("output/summary_interactive.csv", () => {
generate_summary_table(profiles);
for (const dataset of datasets) {
var id = dataset.id + "_interactive";
loadChart(id, "output/"+ id + ".csv", dataset.title + " (interactive)", dataset.class);
}
}, "interactive");
});
});
}
</script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<link rel="stylesheet" href="simulations.css" />
</head>

<body>
<h1>OpenEVSE Solar Divert Simulations</h1>

<a href="view.html">Test Results</a><br/>

<label for="divert_PV_ratio">divert_PV_ratio</label>
<input type="text" id="divert_PV_ratio" value="1.1"><br/>
<label for="divert_attack_smoothing_time">divert_attack_smoothing_time</label>
<input type="text" id="divert_attack_smoothing_time" value="20"><br/>
<label for="divert_decay_smoothing_time">divert_decay_smoothing_time</label>
<input type="text" id="divert_decay_smoothing_time" value="200"><br/>
<label for="divert_min_charge_time">divert_min_charge_time</label>
<input type="text" id="divert_min_charge_time" value="600"><br/>

<button onclick="run_simulation()">Run Simulation</button>

<h2>Summary</h2>
<div id="summary_table">
</div>

<script type="text/javascript">

for (const dataset of datasets) {
var id = generate_chart(dataset, "master");;
loadChart(id, "output/"+ id + ".csv", dataset.title + " (master)", dataset.class);
generate_chart(dataset, "interactive");
}
//<div id="day1_default" style="width:100%; height:300px;" class="solar" csv="output/day1_default.csv" title="Day 1"></div>

</script>

</body>

</html>
Loading