Page 1 of 1

speed control error calculation

PostPosted: Fri Dec 09, 2011 11:36 am
by limbq
Hi,
Good day,

i got a sample code from Head2Toe for the speed control of a brush motor using quadature encoder.
pls check attached pdf for full code,
and pls check below picture for my problem.
code.JPG


A) why we need Error1, Error2, Error3?

B) why Error difference not subtrating Error1, nor Error2 but only subtrating Error3? how to determine if i need to subtrate Error3 or Error 5 or Error 100 for my application? why not just using previous error or Error1?

C) Can explain how the following formula for speed control calculation work?
output = (Error0*4)+(sum_E)+(ErrorDifferent*22)
why need to add sum_E?

pls advise and thanks