I changed the pwm so it's effectively 14 bit, although it really is only 10 bit. I use an auxiliary variable to store the "fine" PWM duty, and each time it is updated, I shift that value down 4 bits, putting it in the range 0-1023. It makes for very smooth driving at near 0 rpm. I would definitely describe the throttle as a bit squishy as JayC was saying. I might try a PI loop again. It was an abysmal failure last time. The greater PWM resolution I bet will fix that problem. Or I'll just do something like "squishy if change in throttle is small", "fast and snappy if change in throttle is large". That would still allow for smooth takeoffs, and I don't think would require a PI loop. Right now, it feels perfectly smooth, and stopping is pretty quick (4 times faster to slow down than to speed up), but not instantaneous, because it made for jerky driving each time I would take my foot off the gas, I mean throttle haha.
I'm going to get that PI loop working. It will be nice to have when RPM feedback is implemented. I have a little hall effect rpm thing that that was $6 that I haven't tried out yet.
Last edited by MPaulHolmes; 05-20-2009 at 06:36 PM..
|