This application is designed to assist in visualizing, analyzing, and evaluating torque measurements from your in-house automatic torque measurement machine. It provides a user-friendly interface to process CSV data files, perform advanced analyses, and determine PASS or FAILED results based on multiple criteria.
- Simultaneous Visualization: Display all graphs for up to two measurement files side by side for easy comparison.
- Adjustable Parameters:
- High-pass filter cutoff frequency.
- RMS window size for moving RMS calculation.
- HPF_RMS threshold value.
- Y-axis scale adjustment.
- Automatic File Detection: The application automatically detects new CSV files added to the specified directory without needing to refresh the page.
- PASS or FAILED Analysis:
- Detect sudden spikes in filtered data.
- Compare HPF_RMS values against a user-defined threshold.
- Placeholder for machine learning model predictions.
- Data Download: Easily download processed CSV and PDF reports.
- User-Friendly Interface: Intuitive layout with helpful tooltips and documentation.
- Python 3.7 or higher
- Git (optional, for cloning the repository)
- specify your data directory.
-
Clone the Repository:
git clone https://github.com/plypieng/InteractiveTorqueProject.git
-
Navigate to the Project Directory:
cd InteractiveTorqueProject -
Create a Virtual Environment (recommended):
python -m venv venv
-
Activate the Virtual Environment:
-
On Windows:
venv\Scripts\activate
-
On Unix or MacOS:
source venv/bin/activate
-
-
Install Dependencies:
pip install -r requirements.txt
-
Configure the Data Directory:
-
Ensure that your CSV data files are located in the
W:/drive. -
If you need to change the data directory, update the
ALLOWED_DIRECTORYvariable inapp.py:ALLOWED_DIRECTORY = 'path/to/your/data/directory'
-
-
Start the Application:
python app.py
-
Access the Application:
- Open a web browser and navigate to
http://localhost:8050.
- Open a web browser and navigate to
-
Select Measurement Files:
- Choose up to two CSV files from the dropdown menus to visualize and compare their data.
-
Adjust Parameters:
- High-Pass Filter Cutoff Frequency: Enter the desired cutoff frequency in Hz.
- RMS Window Size: Specify the window size for calculating the moving RMS.
- HPF_RMS Threshold: Set the threshold value for HPF_RMS analysis.
- Y-axis Scale: Use the slider to adjust the Y-axis range of the plots.
-
View Graphs and Analysis:
- The application displays the normal data plot, filtered data plot, and FFT plot for each selected file.
- Extracted features and analysis results are shown alongside the graphs.
-
Interpret Analysis Results:
- Overall Result: Displays PASS or FAILED based on the analysis criteria.
- Detailed Messages: Provides information on sudden spike detection, HPF_RMS threshold comparison, and machine learning predictions.
-
Download Data:
- Use the "Download CSV" and "Download PDF" buttons to download the processed data and reports.
-
Automatic File Updates:
- The application automatically updates the file selection options when new CSV files are added to the data directory.
- Purpose: Identify sudden spikes in the filtered data, which may indicate dust particles or surface defects on the ball screw.
- Method:
- Calculate the absolute difference between consecutive points in the high-pass filtered data.
- Detect spikes where the difference exceeds a predefined threshold.
- Result:
- If spikes are detected, the analysis recommends re-measurement.
- Purpose: Assess the roughness of the ball screw surface based on the HPF_RMS value.
- Method:
- Calculate the moving RMS of the filtered data using the specified window size.
- Compare the maximum HPF_RMS value against the user-defined threshold.
- Result:
- If the HPF_RMS exceeds the threshold, it may indicate excessive surface roughness, leading to increased heat generation.
- Purpose: Utilize advanced machine learning models to predict the condition of the ball screw.
- Method:
- Placeholder: Currently, this is a placeholder function.
- Future Integration: Plans to incorporate models like LSTM autoencoders or supervised learning models trained on the CSV data.
- Result:
- Provides a PASS or FAILED prediction based on the model's output.
torque-measurement-app/
├── app.py # Main Dash application
├── utils.py # Utility functions
├── plots.py # Plot creation functions
├── pdf_generator.py # PDF report generation
├── requirements.txt # Python dependencies
├── README.md # Project documentation
-
Machine Learning Integration:
- Train and integrate machine learning models for more accurate predictions.
- Models may include LSTM autoencoders, supervised classifiers, etc.
-
Enhanced Reporting:
- Improve PDF report generation to include analysis results and recommendations.
-
User Interface Improvements:
- Add notifications or alerts for new files detected.
- Provide more customization options for plots and analysis parameters.
This project is licensed under the MIT License. You are free to use, modify, and distribute this software as per the terms of the license.