|
Re: PID control loops - feedback is our friend!!!
This might be the problem (it had been screwing up a lot of my code 'till I realized it).
Try casting all your constants to (signed int).
Also, try casting your return value to (unsigned char) both in the return statement and in calling code.
|