Im currently designing a PID control for a dc motor, but i dont know a lot about programming , and I dont have a clue about how to implement the PID algorithm on C++ or VB specially for the Integral and derivative part.

m(t) = Kp * e(t) + Ki * int[e(t)dt] + Kd * [de/dt]

I found on a page that the integral and derivative part can be put like this:

m(n) = Kp * e(n) + Ki * sum( e(k)*dt, 1, n ) + Kd * [e(k) - e(k-1)] / dt

But im still a bit confused about putting it on code
Hope u can help me

jaem.deviantart.com