yes...you want to integrate i add up all the values then divide by total time (multiplying each new i by time shouldn't matter because its an "assumed" even loop time...or use interrupts timers or whatever..) ...then multiply by Ki... don't even bother multiplying by .025 or whatever the loop time is ...just by 1 its simpler
this is what I did for our also Experimental PID loop (PI so far actuallY):
Code:
error=realv-targetv;
errorint=(error+errorint/time)/intprop; //intprop does the same thing as your Ki term
time++;
also it seems that last_OUT isn't being changed anywhere since definition (it always=0)
can you please explain how the deriviatve portion works? ... I am kinda clueless to how it works...and does anything ...basically the theory behind it..and why it helps and what exactly it is