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.
|