View Single Post
Old 07-22-2009, 11:31 PM   #2061 (permalink)
blackpanther-st
EcoModding Lurker
 
Join Date: Apr 2009
Location: Maine
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
Paul, I don't see where this should be having the problem you are describing; if the code is correct, then at low or no RPM and throttle at 1, then when the current rises, the code should be cutting PWM to keep the equation balanced, but if PWM goes to 1 and current is still too high to keep the equation balanced, the problem is not the equation but rather just not having enough steps to bring PWM small enough.

If you can not increase the number of steps, then a possible workaround would be scale PWM exponentially to the 512 steps the code is able to use, or at least for the first 170 steps and then linear for the last 342 steps. (that would be to keep the high end of the scale from getting to jumpy, yet enable precision where it is needed at the low end.

Edit; thinking about this further, I think the formula for a hyperbola would be ideal to set your 512 scale to for all 512 steps. Hyperbola - Wikipedia, the free encyclopedia



graph upper right, green, minus the offset from 0.

__________________
"Experience is something you get right after you need it !"

http://www.diyelectriccar.com/garage/cars/143

http://www.diyelectriccar.com/forums...tor-32083.html

Last edited by blackpanther-st; 07-22-2009 at 11:55 PM..
  Reply With Quote