Giter Site home page Giter Site logo

fair-acc / pulsed-power-ml Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 4.0 36.41 MB

Studie Pulslast-Überwachung & KI-basierte Verbraucher-Klassifikation

License: GNU Lesser General Public License v3.0

Python 22.16% CMake 3.26% Mustache 0.87% CSS 0.11% C++ 18.38% C 0.45% HTML 0.08% Jupyter Notebook 54.69%

pulsed-power-ml's People

Contributors

carolatouchy avatar johannaheuser avatar lgtm-com[bot] avatar sfalamic avatar stefanfoerstel avatar thomaskittler avatar wirew0rm avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

pulsed-power-ml's Issues

[5pt,9pt] REST client with Emscripten

Fetch-API,
JSON deserilization with either IoSerialiser or other library that works with Emscripten

Tasks

  • Implement fetch
  • Set custom header
  • Deserialize json

Findings

  • X_OPENCMW_METHOD header missing for long polling

[8pt,16pt] GNURadio SINK to OpenCMW worker for n (Sinus-)signals

This shall be the final API,
Unit tests are included,
n signals x 5 time sampling factors need to be managed as the client may ask arbitrary combinations of signals.
Mapping between different signals and ring buffers must be implemented. If signals are not compatible or not existent, an intelligent exception must be thrown.

Tasks

  • Implement for n=1 and single sample rate (part 1)
    • gr-time sink providing a callback function called from work
    • opencmw worker
      • RingBuffer stores chunks of data
        • tryPublish called from work callback
          • annotate chunks with current timestamp
        • periodic task calls poller and accumulates all chunks into Acquisition object and calls notify
    • unit tests with libhttp::client tests subscription to a sample source
  • Implement for multiple sinks and multiple sampling rates (part 2)
    • gr-sinks register themselves at singleton registry with the signal name provided to the sink block
    • opencmw worker registers callback functions to all sinks and publishes their data via dedicated ring buffers
    • channel names consist among others of the signal name configured in the sink block and the sample rate, examples here: https://git.gsi.de/acc/specs/generic-daq/-/tree/DAQ_API#filters
    • Replace poller by "multi poller" which only advances all RingBuffers at the same time.

Findings

  • MultiArray compilation error
  • Subscription and query parameters matching
  • httplib

[1pt,6pt] Counter visualization with ImPlot

Tasks

  • Incorporate CMake
  • Fix cast error

Findings

  • Cross-Origin Request Blocked due to missing Acces-Control-Allow-Origin header in opencmw
  • SyntaxError: JSON.parse: nlohman_json expects json to start with { and end with }

[3pt,3pt] First practices with ImPlot

UI loop: data structures are put in a queue. At the beginning of the loop, the data structure of the queue must be transferred to concrete data structures for the visualization.

Tasks

  • Implement queue
  • First plots of self generated data

[2pt] Simple engineering visualization using Grafana

The aim here is to be able to display the signals and read them out. The goal is to show that the data is available in the database.
The goal is not so much to reproduce the look and feel of the other dashboard. The goal of Grafana is to have a unit test for Prometheus - to check that the data is in the database.

[1pt,5pt] Visualize 1 Sinus-signal with 1 subscription in dashboard

Tasks

  • Replace nlohmann deserializer by opencmw deserializer
    • Fetch ranges-v3 library in cmake when using clang
    • Add serialiser include target (cmake)
  • Adapt nlohmann json deserialization to DAQ API
  • Adapt buffer to DAQ API
  • Adapt ImPlot::PlotLine
    • Format time axis to date/time
    • Convert unix timestamp to microseconds

Findings

  • mp-units (required for opencmw build) requires range-v3 if it is compiled with clang < 14 which is the case with emscripten compiler (https://emscripten.org/docs/tools_reference/emcc.html).
  • when using clang, dependency type resolving issues occur (during library includes, e.g. ambiguous symbols)
  • ImPlot::PlotLine only supports homogeneous data types (e.g. int64_t/int64_t or float/float), but int64_t/float is not supported.
  • ImPlot date/time axis formatting supports unix timestamps down to microsecond precision level using double epezent/implot#48 (comment). Timestamps in the time-domain DAQ API are given in nanosecond. For now, we will plot time in microsecond resolution as a max. 50 Hz sample rate results in 20 millisecond time intervals.

[2pt,2pt] Data reduction: Down-sampling (/60, /600)

Is to be executed with on-board means.

The downsampling is to be implemented in the collector.
This should actually only be a configuration of the collector.

Ideas

Create 1st order labeled training data with the infoteam setup

Create a data set for each appliance which contains three phases respectively (off -> on -> off)

Each data set contains the measured voltage and current (and timestamp or index?) (raw data)

Training data should be stored as .h5 files on the infoteam NAS.

[8pt,5pt] Data reduction: Mean, Min, Max

This should be generic enough so that this data reduction also works for non-pulse load signals. In particular, this function should not depend directly on the variable names of the signals but work with "generic variable names".
This should be realized either also in the collector. Or in an adapter/plug-in between the collector and the DB.

Add labels to measurement data

The measurement data will have no labels (i.e. active power per appliance), thus, such labels need to be added "manually".

For a measurement series with only one appliance being switched on and off 100% of the active power will be assigned to the respective appliance.

Once all appliances have been measured, we'll know how much power each appliance consumes, when it is switched of.

With the assumption, that the consumed power of all appliances is constant, it is possible to label measurement data with multiple appliances being switched on and off.

Implement function to split data from measurements (with labels) into training data

The data from measurements will presumably have this format: [t, f_0, ..., f_n], where "t" is an index or a timestamp and f_0 to f_n are features (RMS_I, RMS_U, phase_shift, ...) evaluated at time "t", with one row per measurement.

After the labels have been added to the measurement data (see issue #XX) the format will be: [t, f_0, ..., f_n, p_0, ..., p_m], where p_0 through p_m is the current consumed active power consumed by an appliance at time "t".

The function to split the labeled measurement data will then split the data with a rolling-window of a fixed length "l" of timesteps and a stride of "s". One data point of the training data will consist of all values for all features from t_i to t_i+l (shape=[l, n]) and the respective label consists of the values p_0(t_i+l) to p_m(t_i+l), so the most recent distribution of the active power aver all appliances.
The next training data point will have all feature values and labels shifted in time by "s" steps (t_i -> t_i+s , t_i+l -> t_i+s+l).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.