View Single Post
Old 07-21-2009, 07:12 PM   #7 (permalink)
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
I just took a drive with a PI loop that is pretty well tuned to my motor. However, with the added feature that throttle doesn't change instantly, but rather has a max ramp rate. So, let's say you floor it. The slowThrottle will be heading toward actualThrottle, and the PI loop will be making sure the current is exactly matching the slowThrottle on it's journey. It felt really good in my car, but that doesn't mean anything. hehe. If you feel oscillations or jerkiness, I'll decrease my P value some and we can try it again.

I didn't include a derivative term because the EVTech people suggested to me that it is more likely to cause instability in this context. I read up on it, and each control loop I read about for high power motor controllers didn't include the derivative part. Based on the graphs I've gotten from my serial port, it seems that the current converges to the throttle exponentially, so I think it's OK with just P and I.

I was thinking about how to integrate the 2 also! Lots of fun stuff to try!

I'll email you the PI version with P = 18 and I = 150 (meaning 18/32, 150/32000). If it's too jerky, I'll send you one with P = 10 or something like that. Or you can just change Kp in the program to whatever you want! hahaha! It's just a variable. I keep forgetting you have an STK500. As an example, changing Kp to 10 in the program would be the same as changing it's actual value to 10/32.
kits and boards

Last edited by MPaulHolmes; 07-21-2009 at 08:34 PM.. Reason: typo
  Reply With Quote