View Single Post
Old 01-14-2009, 03:12 PM   #199 (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,362
Thanked 1,202 Times in 765 Posts
Sorry, that last message was getting sort of long, so I thought I should start the new topic here:

My thinking is this: (I know I'm wrong, but I want to understand why)

1. Why go to all the trouble of doing a properly tuned PID loop to modify PWM duty based on current. It was suggested to me that while I was tuning the loop using the unit step, I could get current overshoots above MAX_CURRENT that could wreck the mosfets, so that I would need to add a hardware based current control while tuning.

2. Is a good PID loop really faster than what I'm doing right now to find the target PWM duty that gives the correct current. Here's what I'm doing... During each loop, I read the temperature, throttle position, and current. If current is too high (like if at 10% throttle, it's above 10% of MAX_CURRENT), drop PWM duty by 1 (not throttle), read current, if too big, drop PWM duty by 1, etc...

I figure you shouldn't have to do that drop by one very many times, because during each main loop, I only allow the PWM duty to grow by at most 1, regardless of the actual throttle position. It's sort of hard to explain. I should upload my new code and explain each line in more detail.
__________________
kits and boards
  Reply With Quote
The Following User Says Thank You to MPaulHolmes For This Useful Post:
JANI-DIP (01-13-2021)