The system simulated below consists of a single an object, denoted by "@", which is constrained to move within a one-dimensional space. The object begins with an initial velocity rightwards of 4 m/s, and is fitted with a PID controller. Each dot in the graphic represents one meter of space, with the vertical bars denoting ten meter intervals. The "8" marks the setpoint, which the PID controller will attempt to stabilize the object around.
The PID controller uses an error function (the displacement between the setpoint and the object, in this simulation) bring the systems to a stable state. The acceleration of the object (provided entirely by the PID controller) is determined by the following function: \[ a(t) = k_e e(t) + k_i\int_0^t e(x)dx + k_d\frac{de(t)}{dt}, \] where the error function \(e\) is given by \(e(t) = s_0 - s\), \(s_0\) is the setpoint displacement, \(s\) is the current displacement. Note that the error function is used in three different ways (matching up with the three letters in PID). The three coefficients \(k_e\), \(k_i\), and \(k_d\) determine the contribution from the proportional, integral, and derivative components of the acceleration.
Note the following: