Skip to content

Repository files navigation

Analog Control System

MATLAB simulation of a closed-loop analog control system with transport delays, sensor dynamics, and actuator saturation.

Plant Model

The controlled plant consists of:

  • Integrating element1 / (s·Tᵢ)
  • First-order inertiaKₚ / (1 + s·Tₚ)
  • Second-order oscillatory element1 / (1 + s·a₁ + s²·a₂)
  • Transport delaye^(−s·T₀)

The full open-loop plant transfer function:

                    Kₚ · e^(−s·T₀)
G(s) = ——————————————————————————————————————————
        s·Tᵢ · (1 + s·Tₚ) · (1 + s·a₁ + s²·a₂)

Controller Design Methods

Folder / File Method
szukanie_Kp.m Proportional gain sweep (overshoot & settling time)
LEAD/ Lead compensator via root-locus
LAG/ Lag compensator (Bode design)
LEAD-LAG/ Combined Lead-Lag compensator
STATE FEEDBACK/ Full state-feedback with Luenberger observer
tuning_z_n.m Ziegler-Nichols PID tuning
pid_optim.m + pid_cost.m PID optimization (ITAE criterion, fminsearch)
main.m Unified simulation — compares selected controller vs. baseline

Simulation Details

  • Time-domain simulation using trapezoidal (Heun) integration
  • Actuator saturation at ±5 V
  • Step and ramp reference inputs
  • Comparison plots of designed controller vs. proportional baseline

Requirements

  • MATLAB R2020a or later
  • Control System Toolbox

Quick Start

% Run the main simulation (default: Lead-Lag + State Feedback comparison)
main

% Sweep proportional gain to find optimal Kp
szukanie_Kp

% Optimize PID parameters
pid_optim

About

MATLAB simulation & design of analog controllers (Lead, Lag, Lead-Lag, State Feedback, PID) for a circuit with transport delay and saturation

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages