-
Notifications
You must be signed in to change notification settings - Fork 24
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
Feat: dynamic frequency #211
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
krautech
reviewed
Dec 21, 2024
Jomik
reviewed
Dec 21, 2024
sbtoonz
commented
Dec 21, 2024
Jomik
reviewed
Dec 21, 2024
sbtoonz
force-pushed
the
feat-dynamicfreq
branch
from
December 21, 2024 21:22
4fc5ede
to
f85f135
Compare
Sliding Window Implementation: Utilizes a fixed-size buffer (deque) to maintain the most recent frequency readings, enabling real-time calculation of the rolling average and standard deviation. Dynamic Threshold Calculation: Sets the threshold at the rolling average plus three standard deviations (μ + 3σ), allowing the system to adapt to normal operational fluctuations without manual parameter tuning. Minimum Threshold Establishment: Introduces a baseline threshold set to 20% above the initial frequency reading to ensure stability during initialization and prevent premature anomaly detection. Enhanced Logging: Adds detailed debug logs to track frequency statistics and threshold values, facilitating easier monitoring and troubleshooting.
sbtoonz
force-pushed
the
feat-dynamicfreq
branch
from
December 21, 2024 21:26
c2a5f38
to
12ef502
Compare
krautech
approved these changes
Dec 24, 2024
I would move the initialization of the variables to the init function
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Title: Implement Dynamic Thresholding for Coil Frequency Monitoring
This update enhances the
_check_hardware
function by introducing a self-adjusting threshold mechanism for monitoring coil frequencies. The previous static multiplier method has been replaced with a data-driven approach that adapts to real-time frequency variations, improving anomaly detection accuracy.Key Changes:
Sliding Window Implementation: Utilizes a fixed-size buffer (
deque
) to maintain the most recent frequency readings, enabling real-time calculation of the rolling average and standard deviation.Dynamic Threshold Calculation: Sets the threshold at the rolling average plus three standard deviations (μ + 3σ), allowing the system to adapt to normal operational fluctuations without manual parameter tuning.
Minimum Threshold Establishment: Introduces a baseline threshold set to 20% above the initial frequency reading to ensure stability during initialization and prevent premature anomaly detection.
Enhanced Logging: Adds detailed debug logs to track frequency statistics and threshold values, facilitating easier monitoring and troubleshooting.
Benefits:
Improved Accuracy: The self-adjusting threshold reduces false positives by accounting for natural variations in frequency readings.
Robustness to Noise: The sliding window approach effectively filters out transient spikes, enhancing the reliability of anomaly detection.
Notes:
The size of the sliding window (
deque
withmaxlen=50
) can be adjusted based on system requirements and data rates.The initial minimum threshold is set to 20% above the first observed frequency; this percentage can be modified if necessary to better suit specific operational conditions.
This enhancement aims to provide a more resilient and maintenance-free approach to monitoring coil frequencies, improving overall system reliability.
Checklist
The following relevant macros have been tested:
CARTOGRAPHER_CALIBRATE
PROBE
PROBE_ACCURACY
CARTOGRAPHER_THRESHOLD_SCAN
CARTOGRAPHER_TOUCH CALIBRATE=1
CARTOGRAPHER_TOUCH
CARTOGRAPHER_TOUCH METHOD=manual
BED_MESH_CALIBRATE