PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

Related simulators

Continue with similar topics in this category — or all 48 in Engineering.

View category →
NewUniversity / research

PID Tuning Sandbox

Launch Simulator

Second-order plant step response: overshoot, rise/settling time, Ziegler–Nichols Ku/Pu hints, actuator saturation, and disturbance rejection.

NewSchool

Watt Governor (schematic)

Launch Simulator

Flyballs and sleeve vs RPM; steam throttle gap — speed feedback cartoon.

NewUniversity / research

Cart–Pole: LQR vs MPC vs PID

Launch Simulator

Nonlinear cart inverted pendulum: linearize about upright φ = θ, discrete-time LQR from DARE (Q, R → K), finite-horizon LQ MPC with DARE terminal cost, and hand-tuned PID — same force limit, kicks, and plant as the mechanics cart-pole.

NewUniversity / research

Thermostat vs PID

Launch Simulator

First-order room: on/off hysteresis vs continuous PID heater power.

NewUniversity / research

Bicycle Model & Stanley Controller

Launch Simulator

Kinematic bicycle (rear-axle): δ = θ_e + atan2(k_e·e, v) Stanley path-following law. Pick oval, race-track, lemniscate, sine-road or S-curve and tune k_e, v, L; live cross-track e(t) and steering δ(t).

NewSchool

Finite State Machine

Launch Simulator

Traffic-light Moore machine: timed green–yellow–red cycle or manual step; state graph.

PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Engineering/PID Controller (1D)

PID Controller (1D)

Cart on a track: Kp, Ki, Kd and random velocity impulses toward set-point x = 0.

Gains

2.4
0.6
0.85
2.2

Model: mẍ = u with u = Kp e + Ki ∫e dt + Kd ė, e = x_target − x, m = 1. Derivative on measured velocity matches a common “PD on position + I” form for set-point regulation.

Measured values

Position x1.200
Velocity v0.000

About this model

A PID Controller (1D) simulator visualizes the core principles of feedback control by modeling a cart constrained to move along a single horizontal track. The system's objective is to regulate the cart's position, driving it to and holding it at a defined set-point, here chosen as x = 0. The cart is subject to random velocity impulses that act as persistent disturbances, mimicking real-world unpredictability like uneven friction or external pushes. The controller's task is to counteract these disturbances using a control signal calculated from the position error—the difference between the set-point and the cart's current measured position. This calculation is governed by the PID algorithm: u(t) = Kp * e(t) + Ki * ∫e(τ)dτ + Kd * (de/dt). The proportional term (Kp) provides an immediate response proportional to the error, the integral term (Ki) accumulates past errors to eliminate steady-state offset, and the derivative term (Kd) predicts future error based on its rate of change, damping the response. The simulator simplifies the physics by assuming the control signal directly sets the cart's acceleration (via a force F = m*a, with mass often normalized to 1), ignoring more complex dynamics like motor saturation or detailed friction models. By adjusting the Kp, Ki, and Kd gains, students can directly observe the trade-offs between responsiveness, overshoot, oscillation, and settling time, gaining practical intuition for tuning a fundamental control system used in applications from cruise control to industrial robotics.

Who it's for: Undergraduate engineering students studying control systems, dynamics, or mechatronics, as well as educators demonstrating closed-loop feedback principles.

Key terms

  • PID Controller
  • Proportional-Integral-Derivative
  • Feedback Control
  • Set-point
  • Error Signal
  • System Response
  • Disturbance Rejection
  • Control Loop

How it works

Too much Kp rings; Ki removes steady-state offset but can wind up; Kd damps overshoot. Impulses mimic bumps or load steps on a cart or ball-on-beam toy model.

Frequently asked questions

What does the integral term (Ki) actually do that the proportional term (Kp) cannot?
The proportional term responds only to the present error. If a constant disturbance (like a steady push) exists, the cart will settle at a position where the proportional force just balances the disturbance, resulting in a persistent steady-state error. The integral term sums all past errors over time. This accumulating action allows the controller to generate a corrective force even when the instantaneous error is small, eventually driving the steady-state error to zero.
Why does increasing the derivative gain (Kd) sometimes make the system smoother?
The derivative term acts on the rate of change of the error. When the cart is moving rapidly toward the set-point, a positive derivative term produces a braking force proportional to the velocity. This damping effect reduces overshoot and oscillation, leading to a smoother, more critically damped approach to the target. However, if Kd is set too high, it can over-damp the system, making it sluggish, or amplify high-frequency noise.
How do the random velocity impulses relate to real-world control systems?
These impulses model unpredictable external disturbances or internal system noise that a real controller must handle. Examples include wind gusts affecting a drone's position, varying load on a conveyor belt, or sensor noise. A well-tuned PID controller must reject these disturbances quickly and return the system to its set-point with minimal deviation, demonstrating its robustness.
What are the main simplifications in this 1D model compared to a real system?
This model assumes ideal conditions: the control output translates directly into acceleration without delay or saturation limits, the cart's mass and friction are often normalized or ignored, and the sensor provides perfect, instantaneous position feedback. Real systems have actuator limits, sensor lag, quantization, and more complex dynamics (like stiction or backlash), which introduce additional challenges for controller design and tuning.