Notes On the Control Program

Integration

Since we obtain the actual pendulum position and compute the error based on it, we can calculate an approximation to the integral using the error multiplied by the sample period and adding a suitable number of those products together, just as Paul suggested. For computational efficiency, the oldest error (multiplied by the sample period) will be subtracted from the integration and the newest error (multiplied by the sample period) will be added to it.

Describing the integration technique is a perfect opportunity for presenting the reasons why the methods of analysis being taught in EE471 are actually inadequate for the microprocessor based (or digital) system we are designing.

Derivation

The derivation can be computed by simply determining the slope of the error from the previous point to the current point.