Institution: Aristotle University of Thessaloniki — Department of Electrical and Computer Engineering
Course: Computational Intelligence (2024–2025)
Author: Eleana Zeri — AEM: 10811
This repository documents the implementation of Fuzzy Logic controllers (Mamdani/Larsen type) applied to closed-loop control problems, and Takagi-Sugeno-Kang (TSK) fuzzy inference systems applied to supervised learning tasks. The work spans four projects covering DC motor control, autonomous vehicle navigation, regression on benchmark datasets, and binary/multi-class classification. All implementations are carried out in MATLAB, with Simulink used where continuous-time system modeling is required.
A Fuzzy Logic PI (FZ-PI) controller is designed to regulate the angular velocity of a DC motor. The controller is evaluated across three distinct operating scenarios — step response, trajectory tracking, and external disturbance rejection — to assess steady-state accuracy, transient performance, and robustness. The Mamdani inference scheme is employed, with rule bases and membership functions defined using domain knowledge.
- Model the DC motor plant in Simulink as a continuous-time transfer function.
- Define the FIS structure (inputs, outputs, membership functions) using the Fuzzy Logic Toolbox.
- Encode the linguistic rule base in the
.fisfile reflecting PI control logic (error and change-in-error as inputs). - Integrate the FIS block into each Simulink scenario model.
- Simulate all three scenarios and log system response (velocity vs. time).
- Evaluate performance using metrics: rise time, settling time, steady-state error, and disturbance rejection amplitude.
- MATLAB: Scripting environment used to orchestrate simulation runs, load
.fisfiles, and post-process logged signal data. - Simulink: Used for modeling the continuous-time dynamics of the DC motor and constructing the closed-loop control block diagram for all three scenarios.
- Fuzzy Logic Toolbox: Used to define, store, and load the Mamdani FIS (
dc_motor_flc.fis), and to embed the fuzzy inference block within the Simulink feedback loop.
| File | Description |
|---|---|
simulate_dc_motor_control.m |
Main script; loads the FIS, runs all three Simulink scenarios, and plots response metrics. |
dc_motor_flc.fis |
Mamdani FIS definition file encoding membership functions and the linguistic rule base. |
scenario_1_step_response.slx |
Simulink model for evaluating step reference tracking. |
scenario_2_trajectory_tracking.slx |
Simulink model for evaluating reference trajectory following. |
scenario_3_disturbance_rejection.slx |
Simulink model for evaluating rejection of external load disturbances. |
report_fuzzy_control_dc_motor.pdf |
Technical report documenting design choices, simulation results, and analysis. |
A Mamdani-type Fuzzy Logic Controller is designed to enable autonomous obstacle avoidance for a simulated vehicle. Sensor distance readings (front, left, right) serve as controller inputs, and the steering angle is the output. Two controller variants are compared: an untuned baseline and a manually tuned version, with performance evaluated against the same navigation scenarios.
- Define the simulation environment and sensor geometry for distance measurement.
- Implement the sensor distance calculation logic to map obstacle proximity to scalar inputs.
- Design the untuned FIS: define input/output universe of discourse, membership functions, and rule base.
- Refine the tuned FIS by adjusting membership function parameters and rule weights based on observed navigation failures.
- Simulate both controllers across standard obstacle course scenarios.
- Compare navigation success rate, minimum clearance distance, and trajectory smoothness between the two variants.
- MATLAB: Used for running the simulation loop, calling the sensor geometry calculations, invoking
evalfisfor control output, and generating trajectory plots. - Fuzzy Logic Toolbox: Used to define and evaluate both the untuned (
car_controller_untuned.fis) and tuned (car_controller_tuned.fis) Mamdani FIS objects, and to inspect membership function distributions during manual tuning.
| File | Description |
|---|---|
simulate_obstacle_avoidance.m |
Main simulation script; runs the vehicle navigation loop using both FIS variants and plots trajectories. |
calculate_sensor_distances.m |
Computes front, left, and right sensor distances from the vehicle's current position and heading. |
car_controller_untuned.fis |
Baseline Mamdani FIS prior to parameter tuning. |
car_controller_tuned.fis |
Refined Mamdani FIS after manual membership function and rule weight adjustment. |
report_fuzzy_control_car_navigation.pdf |
Technical report covering FIS design, tuning rationale, and comparative evaluation. |
Takagi-Sugeno-Kang (TSK) fuzzy models are trained to predict continuous target variables on two benchmark datasets: the UCI Airfoil Self-Noise dataset and the Superconductivity dataset. The study compares model structures generated via grid partitioning and subtractive clustering, and evaluates generalization performance using k-fold cross-validation. Metrics reported include RMSE and the coefficient of determination
- Load and inspect raw dataset; identify input features and target variable.
- Preprocess data: apply stratified train/test splitting and z-score normalization via
preprocess_split_scale.m. - Generate candidate FIS structures using grid partitioning (varying MF count) and subtractive clustering (varying cluster radius).
- Train each TSK model using ANFIS on the training partition.
- Evaluate each trained model on the held-out test set; compute RMSE and
$R^2$ . - Perform k-fold cross-validation on the best-performing configuration to obtain a robust generalization estimate.
- MATLAB: Used for data loading, calling preprocessing routines, orchestrating ANFIS training loops across model configurations, and aggregating cross-validation results.
- Fuzzy Logic Toolbox: Used to generate initial FIS structures via
genfis1(grid partitioning) andgenfis2(subtractive clustering), and to train TSK models usinganfis. - Statistics and Machine Learning Toolbox: Used for k-fold cross-validation partitioning (
cvpartition) and to applyzscorenormalization to input features.
| File | Description |
|---|---|
tsk_regression_airfoil.m |
TSK regression pipeline applied to the UCI Airfoil Self-Noise dataset. |
tsk_regression_superconduct.m |
TSK regression pipeline applied to the Superconductivity dataset. |
preprocess_split_scale.m |
Shared utility for stratified train/test splitting and z-score feature normalization. |
airfoil_self_noise.dat |
Airfoil Self-Noise dataset (UCI repository). |
superconduct.csv |
Superconductivity dataset (UCI repository). |
report_tsk_regression.pdf |
Technical report detailing model selection, cross-validation methodology, and results. |
TSK fuzzy models are applied to binary and multi-class classification tasks using Haberman's Survival dataset and the Epileptic Seizure Recognition dataset. The FIS structure is generated via subtractive clustering applied independently per class (class-dependent partitioning), which produces a rule base that reflects the geometric distribution of each class in the feature space. Model performance is assessed using classification accuracy and confusion matrices.
- Load dataset and perform exploratory class distribution analysis.
- Preprocess data using
preprocess_split_scale.m: stratified splitting to preserve class ratios, followed by feature normalization. - Apply subtractive clustering separately on each class subset to generate class-dependent cluster centers.
- Construct the TSK FIS with one rule per cluster, using linear consequents.
- Train the combined FIS using ANFIS and evaluate on the test partition.
- Report per-class precision, recall, overall accuracy, and the confusion matrix.
- MATLAB: Core scripting environment for data manipulation, class-wise clustering, ANFIS training invocation, and performance metric computation.
- Fuzzy Logic Toolbox: Used to generate class-dependent FIS structures via subclust, to assemble the combined rule base, and to train the TSK classifier using
anfis.
| File | Description |
|---|---|
tsk_classification_haberman.m |
TSK classification pipeline applied to Haberman's Survival dataset. |
tsk_classification_epileptic.m |
TSK classification pipeline applied to the Epileptic Seizure Recognition dataset. |
preprocess_split_scale.m |
Shared utility for stratified splitting and feature normalization. |
haberman.data |
Haberman's Survival dataset (UCI repository). |
epileptic_seizure_data.csv |
Epileptic Seizure Recognition dataset (UCI repository). |
report_tsk_classification.pdf |
Technical report covering FIS design, class-dependent clustering, and evaluation results. |
1. Clone the repository:
git clone https://github.com/eleanazeri/Computational-Intelligence.git
cd Computational-Intelligence2. Navigate to the desired project directory in MATLAB:
cd('01-Fuzzy-Control-DC-Motor')3. Run the main script:
run('simulate_dc_motor_control.m')4. To open a Simulink model directly:
open('scenario_1_step_response.slx')All scripts are self-contained. Dataset files are included in the respective project directories and are referenced via relative paths. No additional configuration is required beyond a standard MATLAB installation with the Fuzzy Logic Toolbox and the Statistics and Machine Learning Toolbox.
| Project | Directory | Entry Point |
|---|---|---|
| Fuzzy Control — DC Motor | 01-Fuzzy-Control-DC-Motor/ |
simulate_dc_motor_control.m |
| Fuzzy Control — Car Navigation | 02-Fuzzy-Control-Car-Navigation/ |
simulate_obstacle_avoidance.m |
| TSK Regression | 03-TSK-Regression/ |
tsk_regression_airfoil.m, tsk_regression_superconduct.m |
| TSK Classification | 04-TSK-Classification/ |
tsk_classification_haberman.m, tsk_classification_epileptic.m |
This repository constitutes academic coursework submitted for the Computational Intelligence course, Department of Electrical and Computer Engineering, Aristotle University of Thessaloniki. All rights are reserved by the author. This work is not intended for redistribution, reuse, or commercial application.