View Single Post
Old 10-19-2009, 03:01 PM   #2457 (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,119 Times in 734 Posts
Awesome, Jack! There is very heavy filtering of the pwm signal right now in the software. Also, transitioning the variables from 8 0 to to 16 8 to 24 16 to ... to 128 120 (like you have it in the video) makes it transition from "throttle proportional to current" to "throttle proportional to pwm".

So, with throttle proportional to pwm, but with pwm is very heavily filtered, I think that's where you get the wild transitions for pwm.

Right now, it's a weighted average, so that the new value of pwm is taken to be:

pwmAverage = (127*pwmAverage + pwm)/128. So, it takes some time for pwm to have an affect on the average.
kits and boards
  Reply With Quote