GitHunt
HA

haider-sama/Dynamic-Modelling-Control-Magnetic-Levitating-System

Dynamic modeling and PID control of a magnetic levitation system using MATLAB & Simulink.

🧲 Dynamic Modelling & Control of a Magnetic Levitation System – MATLAB & Simulink

πŸ“– Introduction

This project demonstrates the modeling, analysis, and control of a magnetic levitation (maglev) system, where a ferromagnetic ball is suspended under an electromagnet.

The goal is to maintain the ball’s position at a desired reference point by regulating the input voltage to the coil.
Due to the system’s nonlinear dynamics and open-loop instability, it provides a rich case study for modern control system design.

The project includes:

  • Nonlinear state-space modeling and linearization
  • Stability, controllability, and observability analysis
  • Transfer function derivation
  • PID controller design & tuning
  • Nonlinear simulations in MATLAB/Simulink with 3D visualization

πŸ”¬ Methodology

1. System Modeling

  • Derived a nonlinear state-space model based on Newton’s laws and electrical circuit dynamics.
  • Considered system states: ball position, velocity, and coil current.
  • Linearized the system around equilibrium points for analysis.

2. Control Design

  • Implemented P, PD, and PID controllers for stabilization.
  • Tuned parameters to minimize overshoot, settling time, and steady-state error.
  • Verified stability using step response analysis and eigenvalue evaluation.

3. Simulation

  • Built a nonlinear Simulink model of the maglev system.
  • Implemented PID control using MATLAB’s built-in blocks.
  • Simulated ball levitation with 3D visualization of motion.

πŸ—‚οΈ Project Structure


β”œβ”€β”€ πŸ“„ 2022MC45.prj # MATLAB project file
β”œβ”€β”€ πŸ“„ maglev_nonlinear.slx # Nonlinear Simulink model
β”œβ”€β”€ πŸ“„ maglev.wrl # 3D visualization model
β”œβ”€β”€ πŸ“„ maglev.x3d # 3D simulation data
β”œβ”€β”€ πŸ“„ AppendixA.m # MATLAB code for analysis
β”œβ”€β”€ πŸ“„ CEA_Report_2022_MC_45.pdf # Full project report
β”œβ”€β”€ πŸ“„ ReadMe.txt # Extra notes
└── πŸ“„ README.md # Project documentation

πŸ“Œ Key Insights

  • Demonstrates how nonlinear systems can be modeled and controlled using classical and modern techniques.
  • Shows the importance of PID tuning in stabilizing unstable systems.
  • Highlights the use of MATLAB & Simulink for real-world control engineering problems.