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

More from Engineering

Other simulators in this category — or see all 23.

View category →
NewSchool

Two-Link Arm IK (2R)

Planar 2R manipulator: mouse goal, elbow-up / elbow-down inverse kinematics; joint angles live.

Launch Simulator
NewSchool

Four-Bar Linkage

Crank–rocker geometry with coupler-curve trace; link lengths and crank speed.

Launch Simulator
NewSchool

Cam & Follower

Eccentric circular cam and knife-edge follower: lift and estimated velocity.

Launch Simulator
NewSchool

Finite State Machine

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

Launch Simulator
NewUniversity / research

ADC / DAC (Sampling)

Sine → samples → quantization → ZOH; Nyquist and optional aliasing demo.

Launch Simulator
NewSchool

Stepper Motor (4-phase)

Full-step vs half-step commutation; rotor snaps as coils A–B–A′–B′ sequence.

Launch Simulator
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)

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

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

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.