diff --git a/README.md b/README.md index d296906..2da3e6e 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,14 @@
-![PicoQuake](docs/assets/IMG_1788.jpeg) +![PicoQuake](docs/assets/pq_1.jpeg) --- ## Specs -- Accelerometer ranges: +-2 g, +-4 g, +-8 g, +-16 g -- Gyro range: up to +-2000 dps +- Accelerometer ranges: ±2 g, ±4 g, ±8 g, ±16 g +- Gyro range: up to ±2000 dps - Sample rate: 12.5 Hz to 4000 Hz - Configurable low pass (second order) filter: 42 Hz to 3979 Hz - IMU sensor: ICM-42688-P @@ -31,13 +31,13 @@ ## Noise performance -*PicoQuake* can be used to profile vibrations of very low magnitude, due to the low-noise accelerometer used. We evaluated the noise performance of a stationary PicoQuake at room temperature for two configurations: +*PicoQuake* can be used to profile vibrations of very low magnitude, due to the low-noise accelerometer used. -- Low noise configuration: 500 Hz sample rate, 42 Hz filter, +-2 g range +- Low noise configuration: 500 Hz sample rate, 42 Hz filter, ±2 g range - X axis noise: 0.43 mg RMS - Y axis noise: 0.46 mg RMS - Z axis noise: 1.17 mg RMS -- Full performance configuration: 4 kHz sample rate, 2 kHz filter, +-16 g range +- Full performance configuration: 4 kHz sample rate, 2 kHz filter, ±16 g range - X axis noise: 1.88 mg RMS - Y axis noise: 2.21 mg RMS - Z axis noise: 2.57 mg RMS @@ -46,4 +46,4 @@ You can buy *PicoQuake* on [*Tindie*](https://www.tindie.com/products/34749/). -I sell on Tindie +I sell on Tindie diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..92bf677 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +picoquake.plab.si \ No newline at end of file diff --git a/docs/assets/IMG_1788.jpeg b/docs/assets/IMG_1788.jpeg deleted file mode 100644 index eb8aa9b..0000000 Binary files a/docs/assets/IMG_1788.jpeg and /dev/null differ diff --git a/docs/assets/plot_example_fft.png b/docs/assets/plot_example_fft.png index 522fb0f..1efc85d 100644 Binary files a/docs/assets/plot_example_fft.png and b/docs/assets/plot_example_fft.png differ diff --git a/docs/assets/plot_example_psd.jpg b/docs/assets/plot_example_psd.jpg index 7588be7..a84830e 100644 Binary files a/docs/assets/plot_example_psd.jpg and b/docs/assets/plot_example_psd.jpg differ diff --git a/docs/assets/plot_example_ts.jpg b/docs/assets/plot_example_ts.jpg index 45ca651..d4bc708 100644 Binary files a/docs/assets/plot_example_ts.jpg and b/docs/assets/plot_example_ts.jpg differ diff --git a/docs/assets/pq_1.jpeg b/docs/assets/pq_1.jpeg new file mode 100644 index 0000000..94826fd Binary files /dev/null and b/docs/assets/pq_1.jpeg differ diff --git a/docs/assets/IMG_1791.jpeg b/docs/assets/pq_coin.jpeg similarity index 100% rename from docs/assets/IMG_1791.jpeg rename to docs/assets/pq_coin.jpeg diff --git a/docs/assets/IMG_1795.jpeg b/docs/assets/pq_inthebox.jpeg similarity index 100% rename from docs/assets/IMG_1795.jpeg rename to docs/assets/pq_inthebox.jpeg diff --git a/docs/assets/IMG_1800.jpeg b/docs/assets/pq_pole_mnt.jpeg similarity index 100% rename from docs/assets/IMG_1800.jpeg rename to docs/assets/pq_pole_mnt.jpeg diff --git a/docs/assets/IMG_1801.jpeg b/docs/assets/pq_pole_mnt_2.jpeg similarity index 100% rename from docs/assets/IMG_1801.jpeg rename to docs/assets/pq_pole_mnt_2.jpeg diff --git a/docs/assets/signal_diagram.svg b/docs/assets/signal_diagram.svg new file mode 100644 index 0000000..a6488af --- /dev/null +++ b/docs/assets/signal_diagram.svg @@ -0,0 +1,547 @@ + + + + + + + + 2024-11-04T18:05:36.015252 + image/svg+xml + + + Matplotlib v3.6.3, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/assets/terminal_screenshot.png b/docs/assets/terminal_screenshot.png new file mode 100644 index 0000000..67aced1 Binary files /dev/null and b/docs/assets/terminal_screenshot.png differ diff --git a/docs/assets/vscode_screenshot.png b/docs/assets/vscode_screenshot.png new file mode 100644 index 0000000..2ca6848 Binary files /dev/null and b/docs/assets/vscode_screenshot.png differ diff --git a/docs/examples/bldc.md b/docs/examples/bldc.md index f785adf..64acea7 100644 --- a/docs/examples/bldc.md +++ b/docs/examples/bldc.md @@ -4,7 +4,7 @@ Brushless DC motors are a popular choice due to their longevity, efficiency and The two main control algorithms for BLDCs are the basic 6-step trapezoidal BLDC commutation (tldr: turning windings on and off in the correct sequence) and sinusoidal FOC control (tldr: continuous sinusoidal phase currents instead of discrete steps). We wondered how the choice of the control method impacts the vibration produced by the motor. -We carried out a simple comparison test by attaching PicoQuake to a small brushless outrunner motor being controlled by a VESC speed controller. In VESC configuration software, commutation method can be selected. +We carried out a simple comparison test by attaching *PicoQuake* to a small brushless outrunner motor being controlled by a VESC speed controller. In VESC configuration software, commutation method can be selected. ![bldc_vs_foc.png](assets/bldc_vs_foc.png) @@ -12,4 +12,4 @@ A one second recording was captured. Looking at the acceleration plots and RMS v ![bldc_vs_foc_fft.png](assets/bldc_vs_foc_fft.png) -As showcased in this example, PicoQuake can be used in BLDC drive applications to optimize for smooth and low noise operation, which can be particularly important in small electric mobility product such as electric bikes, scooters, etc. +As showcased in this example, *PicoQuake* can be used in BLDC drive applications to optimize for smooth and low noise operation, which can be particularly important in small electric mobility product such as electric bikes, scooters, etc. diff --git a/docs/examples/trackpad.md b/docs/examples/trackpad.md index e98a338..4e40f05 100644 --- a/docs/examples/trackpad.md +++ b/docs/examples/trackpad.md @@ -1,8 +1,8 @@ # Trackpad Click -PicoQuake can be used to evaluate and optimize all the clicky things - such as the click of a trackpad on a laptop. +*PicoQuake* can be used to evaluate and optimize all the clicky things - such as the click of a trackpad on a laptop. -Let’s take a look at how a click of a traditional trackpad looks like. This one has a pivot point at the top and a tactile button under it at the bottom. PicoQuake was simply pressed lightly against the trackpad while clicking it. A recording was taken at the full 4 kHz sample rate. Trackpad’s direction of travel is aligned with the Z axis of PicoQuake. +Let’s take a look at how a click of a traditional trackpad looks like. This one has a pivot point at the top and a tactile button under it at the bottom. *PicoQuake* was simply pressed lightly against the trackpad while clicking it. A recording was taken at the full 4 kHz sample rate. Trackpad’s direction of travel is aligned with the Z axis of *PicoQuake*. ![touchpad_rzr_zoom.png](assets/touchpad_rzr_zoom.png) @@ -14,6 +14,6 @@ More modern trackpads (such as in Apple MacBooks) work very differently however. ![macbook_tp_vs_rzr_tp_annotated.png](assets/macbook_tp_vs_rzr_tp_annotated.png) -Comparing the two with PicoQuake, we can see that the acceleration pattern is very similar regarding amplitude and duration. Which checks out, because the Magic Trackpad’s click feels very much like a physical tactile button click. +Comparing the two with *PicoQuake*, we can see that the acceleration pattern is very similar regarding amplitude and duration. Which checks out, because the Magic Trackpad’s click feels very much like a physical tactile button click. -There is one important difference though - it vibrates in a different axis! Most of the movement is detected in the Y axis (front-back), not Z (up-down). It would appear that human fingers can’t detect the direction of such short bursts of vibration very well, allowing engineers to pick a actuation direction was easiest to implement. This is confirmed by looking inside a MacBook. The magnetic actuator is clearly visible and indeed moves the trackpad in the front-back direction. +There is one important difference though - it vibrates in a different axis! Most of the movement is detected in the Y axis (front-back), not Z (up-down). It would appear that human fingers can’t detect the direction of such short bursts of vibration very well. Therefore engineers picked the actuation direction that was the easiest to implement. This is confirmed by looking inside the MacBook. The magnetic actuator is clearly visible and indeed moves the trackpad in the front-back direction. diff --git a/docs/getting_started.md b/docs/getting_started.md new file mode 100644 index 0000000..c580c6b --- /dev/null +++ b/docs/getting_started.md @@ -0,0 +1,95 @@ +# Getting Started + +## Requirements + +A computer with: + +- *Windows*, *Linux* or *macOS* +- [*Python*](https://www.python.org/downloads/){:target="_blank"} *3.9* or higher +- [*pip*](https://pip.pypa.io/en/stable/installation/){:target="_blank"} + +## Install + +### Basic installation + +Run command: + +```bash +pip install picoquake +``` + +The recommended way to install if you don't need plotting capabilities. Only supports saving CSV data. + +### Plotting capabilities + +Run command: + +```bash +pip install 'picoquake[plot]' +``` + +Enables creating diagrams in time and frequency domain. Additional dependencies will be installed: + +- *NumPy* +- *SciPy* +- *Matplotlib* + +### Test Installation + +Run command: + +```bash +picoquake --version +``` + +The above command should print the installed version of the package. +If you see an error, try the alternative: + +```bash +python -m picoquake --version +``` + +!!! note + `python -m` prefix is needed if the python scripts directory is not in the system PATH. It depends on your OS and the way *Python* was installed. Check the official *Python* documentation for more information. + +## Connect + + Connect *PicoQuake* to your computer. The green LED will light up. + + Run command: + +```bash +picoquake --list +``` + +It will print a list of connected devices: + +``` +PicoQuake C6E3: /dev/cu.usbmodem1101 +... +``` + +!!! info "No devices" + If you don't see any devices, check the connection and try again. You can also try another USB port. + +!!! note "Short ID" + All further commands require a `Short ID` of the device. It's printed on the device label, or can be read by the `--list` command. + +## Test + + + +Run command: + +```bash +picoquake display c6e3 +``` + +Orange LED will light up, and realtime data will be displayed in the terminal. Try to move the device to see the changes. + + +## What's next? + +See [Usage](usage.md) for detailed instructions. + +Run `picoquake --help` to see all available commands. \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 7124da5..c6fb4b6 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,49 +1,4 @@ -# PicoQuake: USB Vibration Sensor - -**Overview:** - -*PicoQuake* is a MEMS accelerometer vibration sensor designed to profile a wide range of vibrations. It can capture everything from very low-frequency movements (tall buildings, bridges), to high-frequency vibrations in the kilohertz range (motors, industrial machinery). - -**Key features:** - -- **Wide frequency range:** Suitable for both low and high-frequency vibration monitoring. -- **Accessible:** A cost-effective alternative to traditional industrial vibration sensors, which often require proprietary hardware and software. -- **Standalone device:** Connects directly to your computer (Linux, Mac, Windows) via USB. -- **Open-source integration:** Interfaced through an open-source Python driver, providing a command line interface (CLI) and an API for easy integration and customization. - -
- -![PicoQuake](assets/IMG_1788.jpeg) - --- - -## Specs - -- Accelerometer ranges: +-2 g, +-4 g, +-8 g, +-16 g -- Gyro range: up to +-2000 dps -- Sample rate: 12.5 Hz to 4000 Hz -- Configurable low pass (second order) filter: 42 Hz to 3979 Hz -- IMU sensor: ICM-42688-P -- Connectivity: USB 2.0 Full Speed 12 Mbps CDC via USB Type-C -- Power requirement: 5 V, 50 mA -- Cable length: 1.8 m -- Dimensions: ⌀30 mm x 13 mm - -## Noise performance - -*PicoQuake* can be used to profile vibrations of very low magnitude, due to the low-noise accelerometer used. We evaluated the noise performance of a stationary PicoQuake at room temperature for two configurations: - -- Low noise configuration: 500 Hz sample rate, 42 Hz filter, +-2 g range - - X axis noise: 0.43 mg RMS - - Y axis noise: 0.46 mg RMS - - Z axis noise: 1.17 mg RMS -- Full performance configuration: 4 kHz sample rate, 2 kHz filter, +-16 g range - - X axis noise: 1.88 mg RMS - - Y axis noise: 2.21 mg RMS - - Z axis noise: 2.57 mg RMS - -## Where to get - -You can buy *PicoQuake* on [*Tindie*](https://www.tindie.com/products/34749/){:target="_blank"}. - -I sell on Tindie +title: +template: home.html +--- diff --git a/docs/installation.md b/docs/installation.md deleted file mode 100644 index 2dafcb0..0000000 --- a/docs/installation.md +++ /dev/null @@ -1,49 +0,0 @@ -# Installation - -## Requirements - -- *Windows*, *Linux* or *macOS* -- [*Python*](https://www.python.org/downloads/){:target="_blank"} *3.9* or higher -- [*pip*](https://pip.pypa.io/en/stable/installation/){:target="_blank"} - -## Basic installation - -Run command: - -```bash -pip install picoquake -``` - -Recommended way to install if you don't need plotting capabilities. Only supports saving CSV data. - -## Plotting capabilities - -Run command: - -```bash -pip install 'picoquake[plot]' -``` - -Enables creating diagrams in time and frequency domain. Additional dependencies will be installed: - -- *NumPy* -- *SciPy* -- *Matplotlib* - -## Test installation - -Run command: - -```bash -picoquake --version -``` - -The above command should print the installed version of the package. -If you see an error, try the alternative: - -```bash -python -m picoquake --version -``` - -!!! note - `python -m` prefix is needed if the python scripts directory is not in the system PATH. It depends on your OS and the way *Python* was installed. Check the official *Python* documentation for more information. diff --git a/docs/overrides/home.html b/docs/overrides/home.html new file mode 100644 index 0000000..77b0eb8 --- /dev/null +++ b/docs/overrides/home.html @@ -0,0 +1,226 @@ +{% extends "main.html" %} +{% block tabs %} +{{ super() }} + + + +
+
+

USB Vibration Sensor

+

+ Measure any vibration. +

+ PicoQuake + +
+
+
+

Measure Anything

+

+ Measure vibrations of a small fan or a tall building. + Using a low-noise MEMS accelerometer, even the smallest vibrations can be detected. +

+
    +
  • 16 g acceleration range
  • +
  • 4 kHz sample rate
  • +
+

+ Simply hold it to an object, stick it with a double-sided tape or fix it with a cable tie. +

+

+ Specs +

+
+
+ Bridge +
+
+
+
+

Standalone, Accessible, Open Source

+

+ A cost effective alternative to industrial vibration sensors. +

+

+ Connects directly to your computer via USB. + No additional power supply required. + Python driver and command line interface (CLI) with minimal dependencies. + Supports Linux, Mac & Windows. +

+

+ Firmware and Python driver are open-source and available on GitHub. +

+

+ Repository +

+
+
+ FFT Plot +
+
+
+
+

Command Line Interface

+

+ Control PicoQuake using the command line interface (CLI). +

+

+ List available devices, set acquisition parameters and trigger data acquisition. + For advanced acquisitions, a TOML file can be used for configuration. Continuous or interval acquisition is supported. + Data is saved to a CSV file. +

+

+ Supports basic plotting of time series and power spectral density of the acquired data. +

+

+ CLI Documentation +

+
+
+ Terminal CLI +
+
+
+
+

Python API

+

+ Integrate PicoQuake into your project using the Python API. +

+

+ Read values directly, trigger acquisition based on a threshold, or stream buffered data. +

+

+ API Documentation +

+
+
+ VSCode Screenshot +
+
+
+ +{% endblock %} + +{% block footer %} +{{ super() }} +{% endblock %} \ No newline at end of file diff --git a/docs/overrides/main.html b/docs/overrides/main.html new file mode 100644 index 0000000..f652498 --- /dev/null +++ b/docs/overrides/main.html @@ -0,0 +1,12 @@ + + + + + + +{% extends "base.html" %} + +{% block extrahead %} + + +{% endblock %} diff --git a/docs/python_api/examples.md b/docs/python_api/examples.md index f6d4d05..f9cfb3b 100644 --- a/docs/python_api/examples.md +++ b/docs/python_api/examples.md @@ -10,7 +10,7 @@ import picoquake if __name__ == "__main__": # Create a PicoQuake device - device = picoquake.PicoQuake("d4e9") + device = picoquake.PicoQuake("c6e3") # Configure acquisition device.configure( @@ -58,7 +58,7 @@ import picoquake if __name__ == "__main__": # Create a PicoQuake device - device = picoquake.PicoQuake("d4e9") + device = picoquake.PicoQuake("c6e3") # Configure acquisition device.configure( diff --git a/docs/specs.md b/docs/specs.md new file mode 100644 index 0000000..95373b2 --- /dev/null +++ b/docs/specs.md @@ -0,0 +1,25 @@ +## Sensor + +- Accelerometer ranges: ±2 g, ±4 g, ±8 g, ±16 g +- Gyro range: up to ±2000 dps +- Sample rate: 12.5 Hz to 4000 Hz +- Configurable low pass (second order) filter: 42 Hz to 3979 Hz +- IMU sensor: ICM-42688-P + +## General + +- Connectivity: USB 2.0 Full Speed 12 Mbps CDC via USB Type-C +- Power requirement: 5 V, 50 mA +- Cable length: 2.0 m +- Dimensions: ⌀30 mm x 13 mm + +## Noise performance + +- Low noise configuration (500 Hz sample rate, 42 Hz filter, ±2 g range) + - X axis noise: < 0.5 mg RMS + - Y axis noise: < 0.5 mg RMS + - Z axis noise: < 1.2 mg RMS +- Fastest sample rate, highest range (4 kHz sample rate, 2 kHz filter, ±16 g range) + - X axis noise: < 2.0 mg RMS + - Y axis noise: < 2.5 mg RMS + - Z axis noise: < 3.0 mg RMS diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css new file mode 100644 index 0000000..1740148 --- /dev/null +++ b/docs/stylesheets/extra.css @@ -0,0 +1,24 @@ + +.md-header__title { + font-family: "Roboto Mono", monospace; + font-size: 1.4rem; +} + +.md-typeset a { + color: #0969da; + text-decoration: underline; +} + +:root { + --md-primary-fg-color: #393939; + --md-primary-fg-color--light: #6a6a6a; + --md-primary-fg-color--dark: #000000; + --md-primary-bg-color: #ffffff; + --md-primary-bg-color--light: #ffffffbd; + + --md-accent-fg-color: #8400ff; + --md-accent-fg-color--transparent:#8400ff35; + --md-accent-bg-color: #ffffff; + --md-accent-bg-color--light: #ffffff; +} + diff --git a/docs/usage.md b/docs/usage.md index 11d2e67..0d7f492 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -64,14 +64,14 @@ For the description of the CSV file, see [Acquisition CSV File](acquisition_data Acquire data for 10 seconds at 100 Hz sample rate. Filter set to 42 Hz. Save it to `data.csv`. ```bash -picoquake acquire D4E9 data.csv -s 10 -r 100 -f 42 +picoquake acquire c6e3 data.csv -s 10 -r 100 -f 42 ``` Acquire data for 2 seconds at 4000 Hz sample rate. Filter set to 1000 Hz. Accelerometer range set to +-16 g, gyro range set to +-2000 dps. Save it to `data.csv`. ```bash -picoquake acquire D4E9 data.csv -s 2 -r 4000 -f 1000 -ar 16 -gr 2000 +picoquake acquire c6e3 data.csv -s 2 -r 4000 -f 1000 -ar 16 -gr 2000 ``` !!! warning @@ -97,7 +97,7 @@ picoquake trigger [options] Trigger data acquisition when the RMS value of the acceleration in the X-axis exceeds 1 g. Save it to `data.csv`. Record for 1 second before and 5 seconds after the trigger. ```bash -picoquake trigger D4E9 data.csv -r 1000 -f 303 --rms_threshold 1.0 --axis x --pre_seconds 1 --post_seconds 5 +picoquake trigger c6e3 data.csv -r 1000 -f 303 --rms_threshold 1.0 --axis x --pre_seconds 1 --post_seconds 5 ``` ## Run diff --git a/mkdocs.yml b/mkdocs.yml index 263d1b3..4d61404 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,30 +5,36 @@ repo_name: PLab-SI/PicoQuake nav: - Home: index.md - - Example Use Cases: + - Specs: specs.md + - Use Cases: - examples/trackpad.md - examples/bldc.md - - installation.md - - usage.md - - plotting.md - - acquisition_data.md - - fw_update.md - - cli.md - - Python API: - - Examples: python_api/examples.md - - Reference: - - python_api/interface.md - - python_api/data.md - - python_api/exceptions.md + - Getting Started: getting_started.md + - Documentation: + - usage.md + - plotting.md + - acquisition_data.md + - fw_update.md + - cli.md + - Python API: + - Examples: python_api/examples.md + - Reference: + - python_api/interface.md + - python_api/data.md + - python_api/exceptions.md theme: name: material palette: - - scheme: default - primary: blue grey - accent: orange + primary: custom + accent: custom logo: assets/axes_symbol_round.svg favicon: assets/axes_symbol_round.svg + custom_dir: docs/overrides + features: + - navigation.tabs + - navigation.tabs.sticky + - navigation.instant plugins: - search @@ -54,4 +60,12 @@ markdown_extensions: - toc: permalink: true -copyright: Copyright © 2024 PLab \ No newline at end of file +extra: + social: + - icon: fontawesome/regular/envelope + link: mailto:info@plab.si + +extra_css: + - stylesheets/extra.css + +copyright: Copyright © 2024 PLab \ No newline at end of file