Hi guys, I am working on a hobby project where I need to have a PID algorithm. I went through a lot of codes about implementing the integral term. I am a bit confused as at some places I found
1) errsum = errsum + err*dt
While at some places I just found
2) errsum = errsum + err
According to my understanding, we are just summing the error for the "I" term, so why do we have to multiply by "dt" in the 1st approach? Also if we see dimensionally, if suppose we are correcting angles in degrees, then the 1st one gives "deg*s" which is not dimensionally correct. Also, if we multiply by dt, which if very small, makes the "I" term pretty small too.
I guess I am missing something, and I am confused too. Can some-one help please?