Skip to content

tomatohe/ControlTheoryOverview

Repository files navigation

PD Controller Playground

An interactive Python simulation for exploring Proportional-Derivative (PD) controller behavior with real-world effects.

Quick Start

pip install -r requirements.txt

# Static plots with sliders
python pd_controller_playground.py

# Animated mass-spring-damper visualization (recommended)
python pd_animated_playground.py

# Armature-controlled DC motor with PD loop
python dc_motor_pd_playground.py

What You Can Explore

Slider What it does What to observe
Kp Proportional gain ↑ Kp → faster response but more overshoot/oscillation
Kd Derivative gain ↑ Kd → more damping, but amplifies sensor noise
dt Sampling period ↑ dt → poor discretisation, potential instability
Noise σ Sensor noise std dev ↑ Noise → jittery control signal (derivative amplifies it)
Delay steps Transport delay ↑ Delay → phase lag → oscillation → instability
Saturation Actuator limit ↓ Saturation → limited authority, slow response

Phenomena to Observe

  • Instability — Crank up Kp with some delay and watch the system diverge
  • Oscillation — High Kp with low Kd produces underdamped ringing
  • Steady-state error — PD has no integrator; observe residual offset
  • Noise amplification — Add noise and increase Kd to see the control signal go wild

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages