asterics / AsTeRICS

The Assistive Technology Rapid Integration & Construction Set
http://www.asterics.eu
Other
55 stars 27 forks source link

New functionalities for Averager, ComPort, SignalTranslation plugins #291

Closed klues closed 5 years ago

klues commented 5 years ago

For EMG-value processing for evaluations with CB, I needed some new functionalities for the plugins Averager, ComPort and SignalTranslation:

1. Averager

2. ComPort

3. SignalTranslation

Changes (1) and (3) make constructions like this possible:

screenshot_1

A long-term average avg of a raw EMG-signal (out3) is calculated and by two math evaluators a range between avg + noiseoffset and avg + upperbound is calculated. This range is used for min/max of a SignalTranslation instance, scaling the useful signal to a range of e.g. 0-100. The problem of this approach is that the useful, higher signals are also averaged and therefore many/long signals in the useful range will gradually raise avg and therefore will distort the whole calculation. Solution using the new functionalities: as long as the signal is in the useful range, the averager is stopped (see event connections in the screenshot). Therefore only noise and a potential offset will be averaged and avg will stay a solid base for the calculation, even if there are many signals in the useful range.

Change (2) for the ComPort makes it possible to use the COM-port as one of several data sources in a model and prevent the error-message at startup, if the COM-port is not used and not available.

See model https://github.com/asterics/AsTeRICS/blob/klaus/test-add-eventports-averager-signal-translation/bin/ARE/models/useCaseDemos/EEG%26EMG/emg_configurator.acs using change (2) and e.g. model https://github.com/asterics/AsTeRICS/blob/klaus/test-add-eventports-averager-signal-translation/bin/ARE/models/useCaseDemos/mouseControl/crosshairCursorControl_1EMG.acs using changes (1) and (3).

klues commented 5 years ago

@deinhofer @ChrisVeigl @benjaminaigner @sabicalija review/comments on this PR are welcome.

sabicalija commented 5 years ago

I'm not sure if I understand it entirely. You'll have to explain it to me, during a coffee. :wink:

Note: A PID controller (plugin) might be useful in this use case too. But I guess it depends on what you want to achieve.

klues commented 5 years ago

Since I'll also make changes in other plugins, I'll create separate pull request for each change on each plugin to keep PRs smaller and hopefully more understandable. So I'm closing this now.

klues commented 5 years ago

New PRs with separate changes are now:

293 -> AdjustmentCurve

294 -> Averager

295 -> Comport

296 -> StringFormatter

297 -> Myocontroller

298 -> SignalTranslation

@benjaminaigner @ChrisVeigl @deinhofer @sabicalija reviews/comments to these PRs are welcome.