This project presents a data-driven approach to developing an adaptive clutch engagement controller. It leverages machine learning to analyse real-world driving data from an AMT, identify distinct clutch engagement profiles, and build a predictive model that selects the optimal clutch modulation strategy based on initial vehicle conditions for manual transmissions.
The final output is a simulated real-time controller that can intelligently modulate clutch engagement to balance ride comfort (low jerk) and component longevity (low wear).
Clutch control is critical for ensuring smooth gear shifts and minimizing wear on the clutch system. A one-size-fits-all control strategy is often suboptimal, as the ideal engagement profile can vary significantly based on factors like engine speed, torque, and vehicle speed.
This project tackles that challenge by:
- Analyzing Real-World Data: Ingesting and processing
.matfiles from AMT vehicle tests. These profiles are pre-tuned and ready for deployment in manual vehicles. The AMT used here is the Daimler Truck G90AMT and the manual transmission it's used to model is the Daimler Truck G131. - Identifying Engagement Profiles: Isolating hundreds of individual clutch engagement events and using cubic splines to standardise them.
- Clustering Profiles: Using K-Means clustering on statistical and shape-based features of the splines to discover distinct, recurring engagement patterns (e.g., "fast and aggressive," "slow and smooth").
- Training a Predictive Model: Building an XGBoost classifier that predicts which engagement cluster is most appropriate based on the vehicle's state at the start of the clutch event.
- Defining "Ideal" Curves: For each cluster, identifying the single best real-world event that resulted in the lowest combined cost of driveline jerk and clutch wear.
- Simulating a Controller: Developing a real-time controller that uses the driver's pedal input to select a predicted "ideal" curve, effectively translating driver intent into an optimised, automated clutch action.
The pipeline is executed in a series of modular steps:
- Data Ingestion: MATLAB
.matfiles are converted into a more accessible.csvformat. - Time Alignment: Data from various sensors, recorded at different frequencies, is aligned to a common time vector using linear interpolation.
- Feature Calculation: Key performance metrics like slip power and vehicle speed are calculated from raw sensor data.
- Event Segmentation: The continuous time-series data is segmented into individual clutch engagement events.
- Spline Fitting: Each event's clutch position curve is fitted to a cubic spline to create a fixed-length vector representation, making them comparable.
- Unsupervised Clustering: The splines are clustered to group similar engagement styles.
- Supervised Classification: An XGBoost model is trained to predict the optimal cluster ID using the initial conditions of the engagement event as features. Hyperparameters are tuned using Optuna.
- Cost Analysis: Each event is assigned a cost based on a weighted score of estimated driveline jerk and clutch wear energy. The "ideal" curve for each cluster is the one with the lowest cost.
- Real-Time Simulation: A final script simulates the controller's logic, using a sample manual driving dataset to show how it would modulate the clutch in response to pedal input.
- Core Libraries: Python 3.12, Pandas, NumPy, SciPy
- Machine Learning: Scikit-learn, XGBoost, Optuna
- File Handling: H5py (for
.matfiles), Joblib (for saving models/scalers) - Visualization: Matplotlib, SciencePlots (optional)
- Environment: Jupyter Notebook or Individual Python Scipts
- Python 3.10+
- Ensure all required Python packages are installed:
pip install pandas numpy scipy scikit-learn xgboost optuna h5py joblib matplotlib scienceplots
- Clone this repository to your local machine.
- Create the directory structure as shown in the File Structure section.
- Place your raw
.mattest data files in thedata/amt_raw/directory. - Place a
.csvfile with manual driving data (for the final simulation) in thedata/man_raw/directory. Ensure it has the columns specified in the final notebook cell.
- Open the
clutch-controller.ipynbnotebook in a Jupyter environment. - Execute the cells sequentially from top to bottom.
- The notebook will:
- Process the raw data.
- Train the machine learning model.
- Save the model and curve artifacts to the
artifacts/directory. - Generate and display plots showing the clustered curves and the final controller simulation.
This project was developed as an engineering internship task. While it is a complete proof-of-concept, contributions and suggestions are welcome. Potential areas for improvement include:
- Enhanced Error Handling: Adding more robust checks for file I/O and data integrity.
- Unit Testing: Implementing tests for key functions to ensure reliability.
- Configuration Management: Moving more "magic numbers" from the code into the
Configclass. - Code Refactoring: Encapsulating the main execution logic into functions for better reusability.