View Single Post
Old 05-22-2009, 12:09 AM   #1346 (permalink)
MPaulHolmes
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,368
Thanked 1,202 Times in 765 Posts
Oops, I think I found a problem with the PI loop. hehe. I'm integrating, but I forgot a little thing I like to call delta_t. My delta_t is 1/1000 of a second. That could affect things. Leaving that out made my integration correction off by a factor of 1000. my bad. Actually, when I first tried it, I was doing the sampling much faster, so the correction was more like off by 15000 or who knows what! I had just tried to convert some guy's suggestions from the EV Tech list, and he hadn't mentioned that I was integrating, and his explanation had a few errors, and I just blindly followed it. But I decided to read up on it, and it's way easier when you can just look at the math yourself! Man! So you CAN use Reimann sums in real life! What's that all about!

What if I did a slightly different version of a PI loop, where instead of integrating from t = 0, I only go back like maybe 128 samples or whatever, and do that running average thing again with the errors, and then multiply by delta_t and my 'I' constant? Would that cause issues with convergence? I don't think so. I'm going to try that. I guess the errors can be negative, so maybe I'll just have a running total instead, and multiply that by 'I' constant and delta_t.

Man, I'm not going to lie, "my kingdom for 32 bits"
__________________
kits and boards

Last edited by MPaulHolmes; 05-22-2009 at 12:38 AM..
  Reply With Quote