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

Use Gyroscope in BallChallange #17

Open
5 tasks
DavidFederl opened this issue Sep 13, 2024 · 2 comments
Open
5 tasks

Use Gyroscope in BallChallange #17

DavidFederl opened this issue Sep 13, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@DavidFederl
Copy link
Contributor

DavidFederl commented Sep 13, 2024

Add Gyroscope measurement with 1.6kHz and publish to different topic.

ToDo

  • Rename topic from g-value to acceleration
  • Implement Gyroscope Usage read with 400Hz
    • Implement read from gyroscope and Publish Data to topic .../gyroscope
    • Make CSV Service store publish to gyroscope
  • Implement Gyroscope Usage read with 1600Hz
    • Update read data implementation
    • Make CSV Service store publish to gyroscope

Remarks

Caution

When reading with 1600Hz the internal RAM of the RP2040 (260KB) is to small to store all data!
Amounts to around (only one topic):

$$\#_{\text{Bytes per sample}} \cdot \omega_{\text{measurements}} \cdot \Delta_{\text{recording}} = 14 \cdot 1600Hz \cdot 5s = 112000B \approx 110KiB$$

Solutions:

  • Intermediately store data on Flash Chip (512B per page / 256KiB)
  • Publish data in chunks (~1000 samples)
@DavidFederl DavidFederl self-assigned this Sep 13, 2024
@DavidFederl DavidFederl added the enhancement New feature or request label Sep 13, 2024
@DavidFederl
Copy link
Contributor Author

waiting for es-ude/elastic-ai.runtime.enV5#282 (comment) to be merged

@DavidFederl
Copy link
Contributor Author

To overcome memory shortage on the ESP32 side we will split up the measurement into groups of around 800 samples. With a measurement frequency of about 1.6kHz this would lead to 6 published batches for one cycle of 3 seconds.

This can be accomplished by providing a ID for the measurement request under which the data will be published.

sequenceDiagram
    participant S as CSV-Service 
    participant E as enV5
    Note over E: sub[.../DO/measurement]
    S ->> E: pub[.../DO/measurement , <ID>]
    Note over S: sub[.../DATA/gyroscope/<ID>]
    Note over S: sub[.../DATA/accelerometer/<ID>]
    Note over S: sub[.../DONE/measurement]
    Note over S,E: show countdown
    loop for 3 seconds
        par gyroscope
            Note over E: measure with 1600Hz
            E ->> S: pub[.../DATA/gyroscope/<ID> , batch (~800 samples)]
        and accelerometer
            Note over E: measure with 800Hz
            E ->> S: pub[.../DATA/accelerometer/<ID> , batch (~800 sampkes)]
        end
    end
    E ->> S: pub[.../DONE/measurement , <ID>]
    Note over S: unsub[.../DATA/gyroscope/<ID>]
    Note over S: unsub[.../DATA/accelerometer/<ID>]
    Note over S: unsub[.../DONE/measurement]
Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant