View Single Post
Old 07-05-2009, 12:39 PM   #1923 (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
Hey David! Don't you mean you can't wait to SEE how it controls the car? hehe. Here's a quick video of the new controller in action. I have absolutely no complaints about how it drives. It's very smooth. I tested it yesterday with average current proportional to throttle, where the average current is the running average of the last 16 current reads. I'm using a virtual pwmDuty variable that has a range of 0-2044, which I round and map onto 0-511. The pwmDuty variable is updated each time the throttle is read, which is about 1000 times a second.

Just like dlaing originally suggested, there is no more waiting for Analog to digital conversions to finish. Instead, an interrupt just happens when an A/D conversion is finished. The chip is running at 16 MHz, and the A/D clock is now running at 500 kHz, which makes for a very smooth throttle.

__________________
kits and boards
  Reply With Quote