Control Loop Tuner

PID + Filters · Bode & Time Response

Release Notes

v1.2 — Unified Simulator

2026-02-11
  • Consolidated Step Response, Impulse Response, old Simulator, and 3D View into two clean tabs: Bode Plot and Simulator
  • Simulator shows side-by-side 3D scene (w3DScene) and 2D Chart.js time-domain plot (w3DChart) in a flex layout
  • 2D chart plots both Input r(t) (dashed blue) and Output y(t) (solid amber) with animated marker dots and red time indicator synced to 3D animation
  • Simulator uses simCustom() with buildInputFn() — supports step, ramp, sine, square, and sawtooth signals from the GUI signal selector
  • Mass-Spring-Damper (G(s) = 1/(ms²+cs+k)) set as default plant model; PID starts disabled for open-loop behavior

Bug fixes:

  • Bode/Simulator DC gain mismatch: Bode plotted open-loop sys.ol but Simulator used closed-loop sys.cl, causing e.g. MSD 0 dB (gain=1) in Bode but 0.5 m steady-state in Simulator. Fixed updCharts() to select sys.ol or sys.cl based on PID toggle state
  • 3D view ignored signal type: Previously always used simStep() unit step regardless of GUI settings. Changed to use simCustom() data matching the selected input signal and PID/filter configuration
  • Chart title now dynamically shows “Open Loop Response” or “Closed Loop Response” so the active mode is always visible

v1.1 — 3D Mass-Spring-Damper

2026-02-08
  • Added init3D(): creates Three.js r128 WebGL scene with wall, mass block (amber), force arrow (red), damper with piston (blue), and ground plane with grid
  • Spring rendered as 3D helical coil via helixCurve() using TubeGeometry + CatmullRomCurve3; dynamically rebuilt by updSpring(mx) as mass moves
  • Damper piston rod scales/repositions via updDamper(mx); force arrow length tracks instantaneous input force
  • RK4-integrated time response drives animation: anim3D() interpolates y(t) and u(t) arrays at current playback time, calls setMassPos()
  • Custom mouse orbit controls (drag to rotate, scroll to zoom) — no OrbitControls dependency
  • Playback controls: play/pause, restart, speed selector (0.25×–4×), progress bar with elapsed time readout
  • Metrics bar shows m, c, k, ωn, and ζ when Simulator tab is active
  • Fallback message when a non-MSD plant model is selected

v1.0 — Initial Release

2026-02-07
  • SISO control loop tuner: buildSystem() constructs open-loop L(s) = C(s)·G(s)·Filters and closed-loop CL(s) = L/(1+L)
  • MIMO state-space tuner on separate page (mimo.html) with A, B, C, D matrix input
  • PID controller (buildPID()) with Kp, Ki, Kd; derivative filter coefficient N
  • Plant models: custom transfer function (numerator/denominator coefficients), mass-spring-damper, DC motor, thermal system
  • Filter chain: low-pass, high-pass, notch, and lead-lag — each independently togglable
  • Bode plots via freqResp(): log-spaced frequency sweep, magnitude (dB) and phase (°) on separate charts
  • Stability metrics via bodeMetrics(): gain margin, phase margin, gain/phase crossover frequencies, bandwidth
  • Time-domain simulation: tf2ss() state-space conversion, simStep() / simCustom() with RK4 integration
  • Polynomial math utilities: polyMul(), polyAdd(), polyEval() for transfer function algebra
  • Sidebar panel UI with collapsible sections, toggle switches, real-time parameter updates via sched() debounce
  • PWA: service worker (sw.js) with cache-first strategy; manifest.json for installability
Select Mass-Spring-Damper plant model to view 3D visualization
0.00s