I fixed the PI loop! and got it tuned crazy fast. There was a mistake in the code
I was doing
newVd = newVd + Kp*error + Ki*sumOfErrors
When it should have been
newVd = Kp*error + Ki*sumOfErrors.
It converges crazy fast and no overshoot. Now I'm finding the optimum rotor time constant. How do I post to the wiki? Then I can update the code. That other code that's on it was so last tuesday. haha
I should add: I don't mind people who critique me kindly. I just had some very bad experiences on the AVR Freaks forum a couple years ago where I was told I was basically an idiot and shouldn't ever try to make things that would go in a moving vehicle. haha.
|