How to find discrete integral given different time intervals. I want to implement a PID controller and I'm unsure of how to find the integration part. Normally the integral is calculated as $\sum_{n=1}^{t} e_{n}$, where $e_n$ is the sample error at time n. However, this assumes that the time intervals are all the same. In my case the timer intervals are different So how I find the integral ?

just multiply by the time interval
think of it like areas of rectangles
