View Single Post
Old 06-04-2009, 01:37 AM   #1531 (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
One change I've done is to limit the size of pwmDutyFine instead of pwmDuty, to keep the pi loop under control. That's a good idea about ReadThrottle, ReadCurrent, changing to Convert... I had been trying to think of a better name. That's much better.

If I do a ConvertThrottle() every time in main, I'm computing the throttle much more often than I would need to (since it's only read every 16 pwm cycles). Is it better to do it more often outside the ISR than to have a longer ISR? I wasn't sure what the best thing to do was there.

By the way, I'm pretty sure the code is working. I'm fairly certain that the control board now has some bad capacitors. I believe that they were damaged awhile back, perhaps when the controller blew up, and now they are really bad. The oscilloscope made it pretty clear that they were no longer doing their jobs.

I'm not going to be able to test the software until I fix that naughty control board, or I get the new fancy ones back.

__________________
kits and boards
  Reply With Quote