shepherd-core 2024.8.1__tar.gz → 2024.9.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/PKG-INFO +8 -7
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/README.md +6 -6
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/examples/eenv_generator.py +1 -1
- shepherd_core-2024.9.1/examples/simulate_vharvester.py +74 -0
- shepherd_core-2024.9.1/examples/simulate_vsource.py +72 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/pyproject.toml +2 -1
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/content/energy_environment.py +3 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/content/virtual_harvester.py +8 -3
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/content/virtual_harvester_fixture.yaml +27 -16
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/content/virtual_source.py +22 -2
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/content/virtual_source_fixture.yaml +16 -3
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/task/emulation.py +2 -1
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/reader.py +3 -3
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/version.py +1 -1
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/vsource/__init__.py +10 -0
- shepherd_core-2024.9.1/shepherd_core/vsource/target_model.py +140 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/vsource/virtual_converter_model.py +35 -30
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/vsource/virtual_harvester_model.py +34 -3
- shepherd_core-2024.9.1/shepherd_core/vsource/virtual_harvester_simulation.py +71 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/vsource/virtual_source_model.py +7 -1
- shepherd_core-2024.9.1/shepherd_core/vsource/virtual_source_simulation.py +144 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core.egg-info/PKG-INFO +8 -7
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core.egg-info/SOURCES.txt +6 -3
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/conftest.py +1 -1
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/test_content_fixtures.py +13 -4
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/test_content_models.py +16 -16
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/decoder_waveform/test_decoder.py +1 -1
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/fw_tools/test_converter.py +12 -12
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/fw_tools/test_patcher.py +5 -5
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/fw_tools/test_validation.py +8 -8
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/test_examples.py +6 -5
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/test_writer.py +2 -2
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/vsource/conftest.py +5 -5
- shepherd_core-2024.8.1/examples/vharvester_simulation.py +0 -96
- shepherd_core-2024.8.1/examples/vsource_emulation.py +0 -86
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/examples/experiment_from_yaml.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/examples/experiment_generic_var1.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/examples/experiment_generic_var2.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/examples/experiment_models.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/examples/firmware_model.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/examples/firmware_modification.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/examples/inventory.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/examples/uart_decode_waveform.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/examples/uart_raw2.csv +0 -0
- /shepherd_core-2024.8.1/examples/vsource_simulation.py → /shepherd_core-2024.9.1/examples/vsource_debug_sim.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/setup.cfg +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/calibration_hw_def.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/commons.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/base/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/base/cal_measurement.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/base/calibration.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/base/content.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/base/shepherd.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/base/timezone.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/base/wrapper.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/content/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/content/_external_fixtures.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/content/energy_environment_fixture.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/content/firmware.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/content/firmware_datatype.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/experiment/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/experiment/experiment.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/experiment/observer_features.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/experiment/target_config.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/readme.md +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/task/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/task/firmware_mod.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/task/harvest.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/task/observer_tasks.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/task/programming.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/task/testbed_tasks.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/testbed/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/testbed/cape.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/testbed/cape_fixture.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/testbed/gpio.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/testbed/gpio_fixture.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/testbed/mcu.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/testbed/mcu_fixture.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/testbed/observer.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/testbed/observer_fixture.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/testbed/target.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/testbed/target_fixture.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/testbed/testbed.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/testbed/testbed_fixture.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/virtual_source_doc.txt +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/decoder_waveform/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/decoder_waveform/uart.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/fw_tools/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/fw_tools/converter.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/fw_tools/converter_elf.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/fw_tools/patcher.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/fw_tools/validation.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/inventory/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/inventory/python.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/inventory/system.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/inventory/target.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/logger.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/testbed_client/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/testbed_client/cache_path.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/testbed_client/client_abc_fix.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/testbed_client/client_web.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/testbed_client/fixtures.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/testbed_client/user_model.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/writer.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core.egg-info/dependency_links.txt +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core.egg-info/requires.txt +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core.egg-info/top_level.txt +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core.egg-info/zip-safe +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/conftest.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/example_cal_data.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/example_cal_data_faulty.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/example_cal_meas.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/example_cal_meas_faulty1.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/example_cal_meas_faulty2.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/example_config_emulator.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/example_config_experiment.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/example_config_experiment_alternative.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/example_config_harvester.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/example_config_testbed.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/example_config_virtsource.yaml +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/test_base_models.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/test_examples.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/test_experiment_models.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/test_task_generation.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/test_task_models.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/test_testbed_fixtures.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/data_models/test_testbed_models.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/decoder_waveform/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/fw_tools/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/fw_tools/build_msp.elf +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/fw_tools/build_nrf.elf +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/fw_tools/conftest.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/inventory/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/inventory/test_inventory.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/test_cal_hw.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/test_logger.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/test_reader.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/testbed_client/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/vsource/__init__.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/vsource/test_converter.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/vsource/test_harvester.py +0 -0
- {shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/tests/vsource/test_z.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: shepherd_core
|
|
3
|
-
Version: 2024.
|
|
3
|
+
Version: 2024.9.1
|
|
4
4
|
Summary: Programming- and CLI-Interface for the h5-dataformat of the Shepherd-Testbed
|
|
5
5
|
Author-email: Ingmar Splitt <ingmar.splitt@tu-dresden.de>
|
|
6
6
|
Maintainer-email: Ingmar Splitt <ingmar.splitt@tu-dresden.de>
|
|
@@ -23,6 +23,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
23
23
|
Classifier: Programming Language :: Python :: 3.10
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.11
|
|
25
25
|
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
27
|
Classifier: License :: OSI Approved :: MIT License
|
|
27
28
|
Classifier: Operating System :: OS Independent
|
|
28
29
|
Classifier: Natural Language :: English
|
|
@@ -119,11 +120,11 @@ These pydantic data-models are used throughout all shepherd interfaces. Users ca
|
|
|
119
120
|
|
|
120
121
|
## Compatibility
|
|
121
122
|
|
|
122
|
-
| OS |
|
|
123
|
-
|
|
124
|
-
| Ubuntu | 3.8 - 3.
|
|
125
|
-
| Windows | 3.8 - 3.
|
|
126
|
-
| MacOS | 3.8 - 3.
|
|
123
|
+
| OS | PyVersion | Comment |
|
|
124
|
+
|---------|------------|--------------------------------------------|
|
|
125
|
+
| Ubuntu | 3.8 - 3.13 | |
|
|
126
|
+
| Windows | 3.8 - 3.13 | no support for elf and hex-conversions yet |
|
|
127
|
+
| MacOS | 3.8 - 3.13 | hex-conversion missing |
|
|
127
128
|
|
|
128
129
|
Notes:
|
|
129
130
|
- hex-conversion needs a working and accessible objcopy
|
|
@@ -147,7 +148,7 @@ For bleeding-edge-features or dev-work it is possible to install directly from G
|
|
|
147
148
|
```Shell
|
|
148
149
|
pip install git+https://github.com/orgua/shepherd-datalib.git@dev#subdirectory=shepherd_core -U
|
|
149
150
|
# and on sheep with newer debian
|
|
150
|
-
pip install git+https://github.com/orgua/shepherd-datalib.git@dev#subdirectory=shepherd_core -U --break-system-packages
|
|
151
|
+
sudo pip install git+https://github.com/orgua/shepherd-datalib.git@dev#subdirectory=shepherd_core -U --break-system-packages
|
|
151
152
|
```
|
|
152
153
|
|
|
153
154
|
If you are working with ``.elf``-files (embedding into experiments) you make "objcopy" accessible to python. In Ubuntu, you can either install ``build-essential`` or ``binutils-$ARCH`` with arch being ``msp430`` or ``arm-none-eabi`` for the nRF52.
|
|
@@ -63,11 +63,11 @@ These pydantic data-models are used throughout all shepherd interfaces. Users ca
|
|
|
63
63
|
|
|
64
64
|
## Compatibility
|
|
65
65
|
|
|
66
|
-
| OS |
|
|
67
|
-
|
|
68
|
-
| Ubuntu | 3.8 - 3.
|
|
69
|
-
| Windows | 3.8 - 3.
|
|
70
|
-
| MacOS | 3.8 - 3.
|
|
66
|
+
| OS | PyVersion | Comment |
|
|
67
|
+
|---------|------------|--------------------------------------------|
|
|
68
|
+
| Ubuntu | 3.8 - 3.13 | |
|
|
69
|
+
| Windows | 3.8 - 3.13 | no support for elf and hex-conversions yet |
|
|
70
|
+
| MacOS | 3.8 - 3.13 | hex-conversion missing |
|
|
71
71
|
|
|
72
72
|
Notes:
|
|
73
73
|
- hex-conversion needs a working and accessible objcopy
|
|
@@ -91,7 +91,7 @@ For bleeding-edge-features or dev-work it is possible to install directly from G
|
|
|
91
91
|
```Shell
|
|
92
92
|
pip install git+https://github.com/orgua/shepherd-datalib.git@dev#subdirectory=shepherd_core -U
|
|
93
93
|
# and on sheep with newer debian
|
|
94
|
-
pip install git+https://github.com/orgua/shepherd-datalib.git@dev#subdirectory=shepherd_core -U --break-system-packages
|
|
94
|
+
sudo pip install git+https://github.com/orgua/shepherd-datalib.git@dev#subdirectory=shepherd_core -U --break-system-packages
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
If you are working with ``.elf``-files (embedding into experiments) you make "objcopy" accessible to python. In Ubuntu, you can either install ``build-essential`` or ``binutils-$ARCH`` with arch being ``msp430`` or ``arm-none-eabi`` for the nRF52.
|
|
@@ -35,7 +35,7 @@ for _v, _c in product(voltages_V, currents_A):
|
|
|
35
35
|
voltage_vector = np.linspace(_v, _v, int(file.samplerate_sps * duration_s))
|
|
36
36
|
current_vector = np.linspace(_c, _c, int(file.samplerate_sps * duration_s))
|
|
37
37
|
|
|
38
|
-
for idx in trange(repetitions, desc="generate"):
|
|
38
|
+
for idx in trange(repetitions, desc="generate", leave=False):
|
|
39
39
|
timestamps = idx * duration_s + timestamp_vector
|
|
40
40
|
file.append_iv_data_si(timestamps, voltage_vector, current_vector)
|
|
41
41
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""Demonstrate behavior of Virtual Harvester Algorithms.
|
|
2
|
+
|
|
3
|
+
- simulation is based on ivsamples derived from a solar-isc-voc-recording during a jogging-trip
|
|
4
|
+
- harvesting is done by various algorithms and preconfigured virtual harvesters
|
|
5
|
+
- results are printed on console (harvested energy)
|
|
6
|
+
|
|
7
|
+
Output:
|
|
8
|
+
E_out = 0.000 mWs -> cv20
|
|
9
|
+
E_out = 17.165 mWs -> cv10
|
|
10
|
+
E_out = 17.427 mWs -> mppt_voc
|
|
11
|
+
E_out = 17.242 mWs -> mppt_bq_solar
|
|
12
|
+
E_out = 13.998 mWs -> mppt_bq_thermoelectric
|
|
13
|
+
E_out = 15.202 mWs -> mppt_po
|
|
14
|
+
E_out = 17.811 mWs -> mppt_opt
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
|
|
19
|
+
from shepherd_core import Reader
|
|
20
|
+
from shepherd_core.data_models import VirtualHarvesterConfig
|
|
21
|
+
from shepherd_core.vsource import simulate_harvester
|
|
22
|
+
from shepherd_data import ivonne
|
|
23
|
+
|
|
24
|
+
# config simulation
|
|
25
|
+
sim_duration = 32
|
|
26
|
+
file_ivonne = Path(__file__).parent.parent.parent / "shepherd_data/examples/jogging_10m.iv"
|
|
27
|
+
file_ivcurve = Path(__file__).parent / "jogging_ivcurve.h5"
|
|
28
|
+
|
|
29
|
+
hrv_list = [
|
|
30
|
+
"cv20",
|
|
31
|
+
# ⤷ fails due to lower solar voltage
|
|
32
|
+
"cv10",
|
|
33
|
+
"mppt_voc",
|
|
34
|
+
"mppt_bq_solar",
|
|
35
|
+
# ⤷ bq needs 16 s to start -> bad performance for this demo
|
|
36
|
+
"mppt_bq_thermoelectric",
|
|
37
|
+
# ⤷ thermoelectric setpoint -> bad performance for solar
|
|
38
|
+
"mppt_po",
|
|
39
|
+
"mppt_opt",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
save_files: bool = False
|
|
43
|
+
|
|
44
|
+
# convert IVonne to IVCurve
|
|
45
|
+
if not file_ivcurve.exists():
|
|
46
|
+
with ivonne.Reader(file_ivonne) as db:
|
|
47
|
+
db.convert_2_ivcurves(file_ivcurve, duration_s=sim_duration)
|
|
48
|
+
|
|
49
|
+
# Input Statistics
|
|
50
|
+
with Reader(file_ivcurve, verbose=False) as file:
|
|
51
|
+
window_size = file.get_window_samples()
|
|
52
|
+
I_in_max = 0.0
|
|
53
|
+
for _t, _v, _i in file.read_buffers():
|
|
54
|
+
I_in_max = max(I_in_max, _i.max())
|
|
55
|
+
print(
|
|
56
|
+
f"Input-file: \n"
|
|
57
|
+
f"\tE_in = {file.energy() * 1e3:.3f} mWs (not representative)\n"
|
|
58
|
+
f"\tI_in_max = {I_in_max * 1e3:.3f} mA\n"
|
|
59
|
+
f"\twindow_size = {window_size} n\n",
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
# Simulation
|
|
63
|
+
for hrv_name in hrv_list:
|
|
64
|
+
file_output = (
|
|
65
|
+
file_ivcurve.with_name(file_ivcurve.stem + "_" + hrv_name + file_ivcurve.suffix)
|
|
66
|
+
if save_files
|
|
67
|
+
else None
|
|
68
|
+
)
|
|
69
|
+
E_out_Ws = simulate_harvester(
|
|
70
|
+
config=VirtualHarvesterConfig(name=hrv_name),
|
|
71
|
+
path_input=file_ivcurve,
|
|
72
|
+
path_output=file_output,
|
|
73
|
+
)
|
|
74
|
+
print(f"E_out = {E_out_Ws * 1e3:.3f} mWs -> {hrv_name}")
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""Demonstrate behavior of Virtual Source Algorithms.
|
|
2
|
+
|
|
3
|
+
The emulation recreates an observer-cape, the virtual Source and a virtual target
|
|
4
|
+
- input = hdf5-file with a harvest-recording
|
|
5
|
+
- output = hdf5-file
|
|
6
|
+
- config is currently hardcoded, but it could be an emulation-task
|
|
7
|
+
- target is currently a simple resistor
|
|
8
|
+
|
|
9
|
+
The output file can be analyzed and plotted with shepherds tool suite.
|
|
10
|
+
|
|
11
|
+
Output:
|
|
12
|
+
E_out = 220.001 mWs -> direct (no current-limit)
|
|
13
|
+
E_out = 13.142 mWs -> diode+capacitor
|
|
14
|
+
E_out = 13.066 mWs -> diode+resistor+capacitor
|
|
15
|
+
E_out = 15.045 mWs -> BQ25504
|
|
16
|
+
E_out = 14.962 mWs -> BQ25504s
|
|
17
|
+
E_out = 14.397 mWs -> BQ25570
|
|
18
|
+
E_out = 14.232 mWs -> BQ25570s
|
|
19
|
+
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
|
|
24
|
+
from shepherd_core.data_models import VirtualSourceConfig
|
|
25
|
+
from shepherd_core.vsource import ResistiveTarget
|
|
26
|
+
from shepherd_core.vsource import simulate_source
|
|
27
|
+
from shepherd_data import Reader
|
|
28
|
+
|
|
29
|
+
# config simulation
|
|
30
|
+
file_input = Path(__file__).parent / "jogging_ivcurve.h5"
|
|
31
|
+
|
|
32
|
+
src_list = [
|
|
33
|
+
"direct",
|
|
34
|
+
"diode+capacitor",
|
|
35
|
+
"diode+resistor+capacitor",
|
|
36
|
+
"BQ25504",
|
|
37
|
+
"BQ25504s",
|
|
38
|
+
"BQ25570",
|
|
39
|
+
"BQ25570s",
|
|
40
|
+
]
|
|
41
|
+
tgt = ResistiveTarget(R_Ohm=1_000, controlled=True)
|
|
42
|
+
save_files = True
|
|
43
|
+
|
|
44
|
+
for src_name in src_list:
|
|
45
|
+
file_output = (
|
|
46
|
+
file_input.with_name(file_input.stem + "_emu_" + src_name + file_input.suffix)
|
|
47
|
+
if save_files
|
|
48
|
+
else None
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
e_out_Ws = simulate_source(
|
|
52
|
+
config=VirtualSourceConfig(
|
|
53
|
+
name=src_name,
|
|
54
|
+
C_output_uF=0,
|
|
55
|
+
V_intermediate_enable_threshold_mV=1,
|
|
56
|
+
V_intermediate_disable_threshold_mV=0,
|
|
57
|
+
# jogging-dataset has max VOC of ~1.6 V -> lower set-point for non-boost
|
|
58
|
+
C_intermediate_uF=100 if "direct" not in src_name else 0,
|
|
59
|
+
V_pwr_good_enable_threshold_mV=1300 if "dio" in src_name else 2800,
|
|
60
|
+
V_pwr_good_disable_threshold_mV=1000 if "dio" in src_name else 2400,
|
|
61
|
+
V_input_drop_mV=150 if "dio" in src_name else 0,
|
|
62
|
+
),
|
|
63
|
+
target=tgt,
|
|
64
|
+
path_input=file_input,
|
|
65
|
+
path_output=file_output,
|
|
66
|
+
monitor_internals=True,
|
|
67
|
+
)
|
|
68
|
+
print(f"E_out = {e_out_Ws * 1e3:.3f} mWs -> {src_name}")
|
|
69
|
+
|
|
70
|
+
with Reader(file_output, verbose=False) as reader:
|
|
71
|
+
reader.plot_to_file()
|
|
72
|
+
reader.plot_to_file(start_s=1, end_s=1.1)
|
|
@@ -19,6 +19,7 @@ classifiers = [
|
|
|
19
19
|
"Programming Language :: Python :: 3.10",
|
|
20
20
|
"Programming Language :: Python :: 3.11",
|
|
21
21
|
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
22
23
|
"License :: OSI Approved :: MIT License",
|
|
23
24
|
"Operating System :: OS Independent",
|
|
24
25
|
"Natural Language :: English",
|
|
@@ -30,7 +31,7 @@ dependencies = [
|
|
|
30
31
|
"numpy",
|
|
31
32
|
"pyYAML",
|
|
32
33
|
"chromalog",
|
|
33
|
-
"pydantic[email]>2.0.0",
|
|
34
|
+
"pydantic[email]>2.0.0", # not compatible with prior versions
|
|
34
35
|
"tqdm",
|
|
35
36
|
"intelhex",
|
|
36
37
|
"requests",
|
|
@@ -34,6 +34,9 @@ class EnergyEnvironment(ContentModel):
|
|
|
34
34
|
valid: bool = False
|
|
35
35
|
|
|
36
36
|
# TODO: scale up/down voltage/current
|
|
37
|
+
# TODO: multiple files for one env
|
|
38
|
+
# TODO: mean power as energy/duration
|
|
39
|
+
# TODO: harvester, transducer
|
|
37
40
|
|
|
38
41
|
# additional descriptive metadata, TODO: these are very solar-centered -> generalize
|
|
39
42
|
light_source: Optional[str] = None
|
|
@@ -21,6 +21,7 @@ from .energy_environment import EnergyDType
|
|
|
21
21
|
class AlgorithmDType(str, Enum):
|
|
22
22
|
"""Options for choosing a harvesting algorithm."""
|
|
23
23
|
|
|
24
|
+
direct = disable = neutral = "neutral"
|
|
24
25
|
isc_voc = "isc_voc"
|
|
25
26
|
ivcurve = ivcurves = ("ivcurve",)
|
|
26
27
|
constant = cv = "cv"
|
|
@@ -62,6 +63,9 @@ class VirtualHarvesterConfig(ContentModel, title="Config for the Harvester"):
|
|
|
62
63
|
# ⤷ of (open voltage) measurement
|
|
63
64
|
rising: bool = True
|
|
64
65
|
# ⤷ direction of sawtooth
|
|
66
|
+
enable_linear_extrapolation: bool = True
|
|
67
|
+
# ⤷ improves slow cv-algo that is base of most ivcurve-harvesters
|
|
68
|
+
# (update-freq dependent on window-size)
|
|
65
69
|
|
|
66
70
|
# Underlying recorder
|
|
67
71
|
wait_cycles: Annotated[int, Field(ge=0, le=100)] = 1
|
|
@@ -107,7 +111,7 @@ class VirtualHarvesterConfig(ContentModel, title="Config for the Harvester"):
|
|
|
107
111
|
return self
|
|
108
112
|
|
|
109
113
|
def calc_hrv_mode(self, *, for_emu: bool) -> int:
|
|
110
|
-
return 1 * int(for_emu) + 2 * self.rising
|
|
114
|
+
return 1 * int(for_emu) + 2 * self.rising + 4 * self.enable_linear_extrapolation
|
|
111
115
|
|
|
112
116
|
def calc_algorithm_num(self, *, for_emu: bool) -> int:
|
|
113
117
|
num = algo_to_num.get(self.algorithm)
|
|
@@ -117,7 +121,7 @@ class VirtualHarvesterConfig(ContentModel, title="Config for the Harvester"):
|
|
|
117
121
|
f"current usage = {self.algorithm}"
|
|
118
122
|
)
|
|
119
123
|
raise ValueError(msg)
|
|
120
|
-
if num < algo_to_num["isc_voc"]:
|
|
124
|
+
if not for_emu and num < algo_to_num["isc_voc"]:
|
|
121
125
|
msg = (
|
|
122
126
|
f"[{self.name}] Select valid harvest-algorithm for harvester, "
|
|
123
127
|
f"current usage = {self.algorithm}"
|
|
@@ -177,7 +181,7 @@ u32 = Annotated[int, Field(ge=0, lt=2**32)]
|
|
|
177
181
|
|
|
178
182
|
# Currently implemented harvesters
|
|
179
183
|
# NOTE: numbers have meaning and will be tested ->
|
|
180
|
-
# - harvesting on "neutral" is not possible
|
|
184
|
+
# - harvesting on "neutral" is not possible - direct pass-through
|
|
181
185
|
# - emulation with "ivcurve" or lower is also resulting in Error
|
|
182
186
|
# - "_opt" has its own algo for emulation, but is only a fast mppt_po for harvesting
|
|
183
187
|
algo_to_num = {
|
|
@@ -192,6 +196,7 @@ algo_to_num = {
|
|
|
192
196
|
}
|
|
193
197
|
|
|
194
198
|
algo_to_dtype = {
|
|
199
|
+
"neutral": EnergyDType.ivsample,
|
|
195
200
|
"isc_voc": EnergyDType.isc_voc,
|
|
196
201
|
"ivcurve": EnergyDType.ivcurve,
|
|
197
202
|
"cv": EnergyDType.ivsample,
|
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
# - look into the implementation to see which parameters are used
|
|
4
4
|
# - base for neutral fallback values if provided yml is sparse
|
|
5
5
|
# - -> it is encouraged to omit redundant parameters in your own implementation
|
|
6
|
+
# - general rule: 0<id<2000 harvest from transducers, 2000<=id harvest from ivcurve
|
|
7
|
+
|
|
6
8
|
- datatype: VirtualHarvesterConfig
|
|
7
9
|
parameters:
|
|
8
10
|
id: 1000
|
|
9
11
|
name: neutral
|
|
12
|
+
enable_linear_extrapolation: true
|
|
10
13
|
owner: Ingmar
|
|
11
14
|
group: NES Lab
|
|
12
15
|
visible2group: true
|
|
@@ -16,7 +19,7 @@
|
|
|
16
19
|
|
|
17
20
|
- datatype: VirtualHarvesterConfig
|
|
18
21
|
parameters:
|
|
19
|
-
id:
|
|
22
|
+
id: 1100
|
|
20
23
|
name: ivcurve
|
|
21
24
|
description: Postpone harvesting by sampling ivcurves (voltage stepped as sawtooth-wave)
|
|
22
25
|
comment: ~110 Hz, Between 50 & 60 Hz line-frequency to avoid standing waves
|
|
@@ -32,19 +35,19 @@
|
|
|
32
35
|
|
|
33
36
|
- datatype: VirtualHarvesterConfig
|
|
34
37
|
parameters:
|
|
35
|
-
id:
|
|
38
|
+
id: 1101
|
|
36
39
|
name: ivcurves # synonym
|
|
37
40
|
inherit_from: ivcurve
|
|
38
41
|
|
|
39
42
|
- datatype: VirtualHarvesterConfig
|
|
40
43
|
parameters:
|
|
41
|
-
id:
|
|
44
|
+
id: 1103
|
|
42
45
|
name: iv110 # synonym
|
|
43
46
|
inherit_from: ivcurve
|
|
44
47
|
|
|
45
48
|
- datatype: VirtualHarvesterConfig
|
|
46
49
|
parameters:
|
|
47
|
-
id:
|
|
50
|
+
id: 1102
|
|
48
51
|
name: iv1000
|
|
49
52
|
comment: Name relates to curves per second
|
|
50
53
|
inherit_from: ivcurve
|
|
@@ -53,7 +56,7 @@
|
|
|
53
56
|
|
|
54
57
|
- datatype: VirtualHarvesterConfig
|
|
55
58
|
parameters:
|
|
56
|
-
id:
|
|
59
|
+
id: 1200
|
|
57
60
|
name: isc_voc
|
|
58
61
|
description: Postpone harvesting by sampling short circuit current & open circuit voltage
|
|
59
62
|
inherit_from: neutral
|
|
@@ -62,7 +65,7 @@
|
|
|
62
65
|
|
|
63
66
|
- datatype: VirtualHarvesterConfig
|
|
64
67
|
parameters:
|
|
65
|
-
id:
|
|
68
|
+
id: 2100
|
|
66
69
|
name: cv20
|
|
67
70
|
description: Harvesting with constant Voltage
|
|
68
71
|
inherit_from: neutral
|
|
@@ -71,28 +74,28 @@
|
|
|
71
74
|
|
|
72
75
|
- datatype: VirtualHarvesterConfig
|
|
73
76
|
parameters:
|
|
74
|
-
id:
|
|
77
|
+
id: 2101
|
|
75
78
|
name: cv24
|
|
76
79
|
inherit_from: cv20
|
|
77
80
|
voltage_mV: 2400
|
|
78
81
|
|
|
79
82
|
- datatype: VirtualHarvesterConfig
|
|
80
83
|
parameters:
|
|
81
|
-
id:
|
|
84
|
+
id: 2102
|
|
82
85
|
name: cv33
|
|
83
86
|
inherit_from: cv20
|
|
84
87
|
voltage_mV: 3300
|
|
85
88
|
|
|
86
89
|
- datatype: VirtualHarvesterConfig
|
|
87
90
|
parameters:
|
|
88
|
-
id:
|
|
91
|
+
id: 2102
|
|
89
92
|
name: cv10
|
|
90
93
|
inherit_from: cv20
|
|
91
94
|
voltage_mV: 1000
|
|
92
95
|
|
|
93
96
|
- datatype: VirtualHarvesterConfig
|
|
94
97
|
parameters:
|
|
95
|
-
id:
|
|
98
|
+
id: 2200
|
|
96
99
|
name: mppt_voc
|
|
97
100
|
description: MPPT based on open circuit voltage for solar
|
|
98
101
|
inherit_from: neutral
|
|
@@ -104,7 +107,7 @@
|
|
|
104
107
|
|
|
105
108
|
- datatype: VirtualHarvesterConfig
|
|
106
109
|
parameters:
|
|
107
|
-
id:
|
|
110
|
+
id: 2201
|
|
108
111
|
name: mppt_bq
|
|
109
112
|
description: MPPT of TI BQ-Converters for solar
|
|
110
113
|
inherit_from: mppt_voc
|
|
@@ -114,7 +117,7 @@
|
|
|
114
117
|
|
|
115
118
|
- datatype: VirtualHarvesterConfig
|
|
116
119
|
parameters:
|
|
117
|
-
id:
|
|
120
|
+
id: 2202
|
|
118
121
|
name: mppt_bqt
|
|
119
122
|
description: MPPT of TI BQ-Converters for thermoelectric
|
|
120
123
|
inherit_from: mppt_voc
|
|
@@ -124,19 +127,19 @@
|
|
|
124
127
|
|
|
125
128
|
- datatype: VirtualHarvesterConfig
|
|
126
129
|
parameters:
|
|
127
|
-
id:
|
|
130
|
+
id: 2203
|
|
128
131
|
name: mppt_bq_solar # explicit naming
|
|
129
132
|
inherit_from: mppt_bq
|
|
130
133
|
|
|
131
134
|
- datatype: VirtualHarvesterConfig
|
|
132
135
|
parameters:
|
|
133
|
-
id:
|
|
136
|
+
id: 2204
|
|
134
137
|
name: mppt_bq_thermoelectric # explicit naming
|
|
135
138
|
inherit_from: mppt_bqt
|
|
136
139
|
|
|
137
140
|
- datatype: VirtualHarvesterConfig
|
|
138
141
|
parameters:
|
|
139
|
-
id:
|
|
142
|
+
id: 2205
|
|
140
143
|
name: mppt_po
|
|
141
144
|
description: MPPT based on perturb & observe algorithm
|
|
142
145
|
inherit_from: neutral
|
|
@@ -148,10 +151,18 @@
|
|
|
148
151
|
|
|
149
152
|
- datatype: VirtualHarvesterConfig
|
|
150
153
|
parameters:
|
|
151
|
-
id:
|
|
154
|
+
id: 2206
|
|
152
155
|
name: mppt_opt
|
|
153
156
|
description: Power-Optimum with very fast PO-Variant (harvesting) or special max-pwr-picker (emulator / ivcurve)
|
|
154
157
|
inherit_from: mppt_po
|
|
155
158
|
algorithm: mppt_opt
|
|
156
159
|
voltage_step_mV: 1
|
|
157
160
|
interval_ms: 0.01
|
|
161
|
+
|
|
162
|
+
- datatype: VirtualHarvesterConfig
|
|
163
|
+
parameters:
|
|
164
|
+
id: 3000
|
|
165
|
+
name: direct
|
|
166
|
+
description: Disables harvesting, even for ivcurve-input
|
|
167
|
+
inherit_from: neutral
|
|
168
|
+
algorithm: neutral
|
|
@@ -12,6 +12,7 @@ from ...logger import logger
|
|
|
12
12
|
from ...testbed_client import tb_client
|
|
13
13
|
from ..base.content import ContentModel
|
|
14
14
|
from ..base.shepherd import ShpModel
|
|
15
|
+
from .energy_environment import EnergyDType
|
|
15
16
|
from .virtual_harvester import HarvesterPRUConfig
|
|
16
17
|
from .virtual_harvester import VirtualHarvesterConfig
|
|
17
18
|
|
|
@@ -42,6 +43,8 @@ class VirtualSourceConfig(ContentModel, title="Config for the virtual Source"):
|
|
|
42
43
|
# ⤷ if false -> v_intermediate = v_input, output-switch-hysteresis is still usable
|
|
43
44
|
enable_buck: bool = False
|
|
44
45
|
# ⤷ if false -> v_output = v_intermediate
|
|
46
|
+
enable_feedback_to_hrv: bool = False
|
|
47
|
+
# src can control a cv-harvester for ivcurve
|
|
45
48
|
|
|
46
49
|
interval_startup_delay_drain_ms: Annotated[float, Field(ge=0, le=10_000)] = 0
|
|
47
50
|
|
|
@@ -200,7 +203,7 @@ class VirtualSourceConfig(ContentModel, title="Config for the virtual Source"):
|
|
|
200
203
|
values["V_disable_output_threshold_mV"] = self.V_intermediate_disable_threshold_mV
|
|
201
204
|
return values
|
|
202
205
|
|
|
203
|
-
def calc_converter_mode(self, *, log_intermediate_node: bool) -> int:
|
|
206
|
+
def calc_converter_mode(self, dtype_in: EnergyDType, *, log_intermediate_node: bool) -> int:
|
|
204
207
|
"""Assembles bitmask from discrete values.
|
|
205
208
|
|
|
206
209
|
log_intermediate_node: record / log virtual intermediate (cap-)voltage and
|
|
@@ -208,11 +211,25 @@ class VirtualSourceConfig(ContentModel, title="Config for the virtual Source"):
|
|
|
208
211
|
"""
|
|
209
212
|
enable_storage = self.C_intermediate_uF > 0
|
|
210
213
|
enable_boost = self.enable_boost and enable_storage
|
|
214
|
+
if enable_boost != self.enable_boost:
|
|
215
|
+
logger.warning("VSrc - boost was disabled due to missing storage capacitor!")
|
|
216
|
+
enable_feedback = (
|
|
217
|
+
self.enable_feedback_to_hrv
|
|
218
|
+
and enable_storage
|
|
219
|
+
and not enable_boost
|
|
220
|
+
and dtype_in == EnergyDType.ivcurve
|
|
221
|
+
)
|
|
222
|
+
if enable_feedback != self.enable_feedback_to_hrv:
|
|
223
|
+
reason = "enabled boost, " if enable_boost else ""
|
|
224
|
+
reason += "" if dtype_in == EnergyDType.ivcurve else "input not ivcurve, "
|
|
225
|
+
reason += "" if enable_storage else "no storage capacitor"
|
|
226
|
+
logger.warning("VSRC - feedback to harvester was disabled! Reasons: %s", reason)
|
|
211
227
|
return (
|
|
212
228
|
1 * int(enable_storage)
|
|
213
229
|
+ 2 * int(enable_boost)
|
|
214
230
|
+ 4 * int(self.enable_buck)
|
|
215
231
|
+ 8 * int(log_intermediate_node)
|
|
232
|
+
+ 16 * int(enable_feedback)
|
|
216
233
|
)
|
|
217
234
|
|
|
218
235
|
def calc_cap_constant_us_per_nF_n28(self) -> int:
|
|
@@ -285,13 +302,16 @@ class ConverterPRUConfig(ShpModel):
|
|
|
285
302
|
def from_vsrc(
|
|
286
303
|
cls,
|
|
287
304
|
data: VirtualSourceConfig,
|
|
305
|
+
dtype_in: EnergyDType = EnergyDType.ivsample,
|
|
288
306
|
*,
|
|
289
307
|
log_intermediate_node: bool = False,
|
|
290
308
|
) -> Self:
|
|
291
309
|
states = data.calc_internal_states()
|
|
292
310
|
return cls(
|
|
293
311
|
# General
|
|
294
|
-
converter_mode=data.calc_converter_mode(
|
|
312
|
+
converter_mode=data.calc_converter_mode(
|
|
313
|
+
dtype_in, log_intermediate_node=log_intermediate_node
|
|
314
|
+
),
|
|
295
315
|
interval_startup_delay_drain_n=round(
|
|
296
316
|
data.interval_startup_delay_drain_ms * samplerate_sps_default * 1e-3
|
|
297
317
|
),
|
|
@@ -11,11 +11,12 @@
|
|
|
11
11
|
# General Config
|
|
12
12
|
enable_boost: false # if false -> v_intermediate = v_input, output-switch-hysteresis is still usable
|
|
13
13
|
enable_buck: false # if false -> v_output = v_intermediate
|
|
14
|
+
enable_feedback_to_hrv: false # src can control a cv-harvester for ivcurve
|
|
14
15
|
|
|
15
16
|
interval_startup_delay_drain_ms: 0
|
|
16
17
|
|
|
17
18
|
harvester:
|
|
18
|
-
name: mppt_opt # harvester only active if input is "
|
|
19
|
+
name: mppt_opt # harvester only active if input is "ivcurve"
|
|
19
20
|
|
|
20
21
|
V_input_max_mV: 10000
|
|
21
22
|
I_input_max_mA: 4200
|
|
@@ -26,18 +27,21 @@
|
|
|
26
27
|
V_intermediate_init_mV: 3000 # allow a proper / fast startup
|
|
27
28
|
I_intermediate_leak_nA: 0.0
|
|
28
29
|
|
|
30
|
+
# Output-Switch with comparator and hysteresis
|
|
29
31
|
V_intermediate_enable_threshold_mV: 1 # -> target gets connected (hysteresis-combo with next value)
|
|
30
32
|
V_intermediate_disable_threshold_mV: 0 # -> target gets disconnected
|
|
31
33
|
interval_check_thresholds_ms: 0.0 # some BQs check every 64 ms if output should be disconnected
|
|
32
34
|
|
|
35
|
+
# Power-Good signal from comparator and hysteresis
|
|
33
36
|
V_pwr_good_enable_threshold_mV: 2800 # target is informed by pwr-good on output-pin (hysteresis) -> for intermediate voltage
|
|
34
37
|
V_pwr_good_disable_threshold_mV: 2200
|
|
35
38
|
immediate_pwr_good_signal: true # 1: activate instant schmitt-trigger, 0: stay in interval for checking thresholds
|
|
36
39
|
|
|
37
|
-
C_output_uF: 1.0 # final (always last) stage to compensate
|
|
40
|
+
C_output_uF: 1.0 # final (always last) stage to compensate transient current spikes when enabling power for target
|
|
38
41
|
|
|
39
42
|
# Extra
|
|
40
43
|
V_output_log_gpio_threshold_mV: 1400 # min voltage needed to enable recording changes in gpio-bank
|
|
44
|
+
# TODO: actually disable gpio below that
|
|
41
45
|
|
|
42
46
|
# Boost Converter
|
|
43
47
|
V_input_boost_threshold_mV: 0.0 # min input-voltage for the boost converter to work
|
|
@@ -81,6 +85,8 @@
|
|
|
81
85
|
id: 1010
|
|
82
86
|
name: direct
|
|
83
87
|
inherit_from: neutral
|
|
88
|
+
harvester:
|
|
89
|
+
name: direct # even disables harvesting of ivcurve
|
|
84
90
|
# Note: current input has no influence
|
|
85
91
|
|
|
86
92
|
- datatype: VirtualSourceConfig
|
|
@@ -90,7 +96,12 @@
|
|
|
90
96
|
description: Simple Converter based on diode and buffer capacitor
|
|
91
97
|
inherit_from: neutral
|
|
92
98
|
V_input_drop_mV: 300 # simulate input-diode
|
|
93
|
-
C_intermediate_uF:
|
|
99
|
+
C_intermediate_uF: 47 # primary storage-Cap
|
|
100
|
+
harvester:
|
|
101
|
+
name: cv20
|
|
102
|
+
enable_feedback_to_hrv: true # src can control a cv-harvester for ivcurve
|
|
103
|
+
V_intermediate_enable_threshold_mV: 2000
|
|
104
|
+
V_intermediate_disable_threshold_mV: 1800 # nRF draw ~0.5 mA below that point
|
|
94
105
|
|
|
95
106
|
- datatype: VirtualSourceConfig
|
|
96
107
|
parameters:
|
|
@@ -230,3 +241,5 @@
|
|
|
230
241
|
id: 1033
|
|
231
242
|
name: default
|
|
232
243
|
inherit_from: BQ25570s
|
|
244
|
+
|
|
245
|
+
# TODO: add some generic boost-converters with mppt_po, _voc and more
|
{shepherd_core-2024.8.1 → shepherd_core-2024.9.1}/shepherd_core/data_models/task/emulation.py
RENAMED
|
@@ -33,7 +33,8 @@ class Compression(str, Enum):
|
|
|
33
33
|
lzf = default = "lzf" # not native hdf5
|
|
34
34
|
gzip1 = gzip = 1 # higher compr & load
|
|
35
35
|
null = None
|
|
36
|
-
# NOTE:
|
|
36
|
+
# NOTE: lzf & external file-compression (xz or zstd) work better than gzip
|
|
37
|
+
# -> even with additional compression
|
|
37
38
|
|
|
38
39
|
|
|
39
40
|
compressions_allowed: list = [None, "lzf", 1]
|
|
@@ -76,7 +76,7 @@ class Reader:
|
|
|
76
76
|
|
|
77
77
|
if not hasattr(self, "samplerate_sps"):
|
|
78
78
|
self.samplerate_sps: int = samplerate_sps_default
|
|
79
|
-
self.sample_interval_ns: int =
|
|
79
|
+
self.sample_interval_ns: int = round(10**9 // self.samplerate_sps)
|
|
80
80
|
self.sample_interval_s: float = 1 / self.samplerate_sps
|
|
81
81
|
|
|
82
82
|
self.max_elements: int = 40 * self.samplerate_sps
|
|
@@ -177,8 +177,8 @@ class Reader:
|
|
|
177
177
|
# this assumes iso-chronous sampling
|
|
178
178
|
duration_s = self._cal.time.raw_to_si(duration_raw)
|
|
179
179
|
self.sample_interval_s = duration_s / sample_count
|
|
180
|
-
self.sample_interval_ns =
|
|
181
|
-
self.samplerate_sps = max(
|
|
180
|
+
self.sample_interval_ns = round(10**9 * self.sample_interval_s)
|
|
181
|
+
self.samplerate_sps = max(round((sample_count - 1) / duration_s), 1)
|
|
182
182
|
self.runtime_s = round(self.ds_voltage.shape[0] / self.samplerate_sps, 1)
|
|
183
183
|
self.buffers_n = int(self.ds_voltage.shape[0] // self.samples_per_buffer)
|
|
184
184
|
if isinstance(self.file_path, Path):
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
"""Simulation model of the virtual source."""
|
|
2
2
|
|
|
3
|
+
from .target_model import ConstantCurrentTarget
|
|
4
|
+
from .target_model import ConstantPowerTarget
|
|
5
|
+
from .target_model import ResistiveTarget
|
|
3
6
|
from .virtual_converter_model import PruCalibration
|
|
4
7
|
from .virtual_converter_model import VirtualConverterModel
|
|
5
8
|
from .virtual_harvester_model import VirtualHarvesterModel
|
|
9
|
+
from .virtual_harvester_simulation import simulate_harvester
|
|
6
10
|
from .virtual_source_model import VirtualSourceModel
|
|
11
|
+
from .virtual_source_simulation import simulate_source
|
|
7
12
|
|
|
8
13
|
__all__ = [
|
|
9
14
|
"PruCalibration",
|
|
10
15
|
"VirtualConverterModel",
|
|
11
16
|
"VirtualHarvesterModel",
|
|
12
17
|
"VirtualSourceModel",
|
|
18
|
+
"simulate_harvester",
|
|
19
|
+
"simulate_source",
|
|
20
|
+
"ResistiveTarget",
|
|
21
|
+
"ConstantCurrentTarget",
|
|
22
|
+
"ConstantPowerTarget",
|
|
13
23
|
]
|