View Single Post
Old 07-24-2009, 03:42 AM   #2089 (permalink)
jyanof
Joe
 
Join Date: Feb 2009
Location: phx
Posts: 260
Thanks: 0
Thanked 48 Times in 38 Posts
I found a throttle code that I mostly like - maybe it's a hair too sensitive, but it's good for my rig.

Here's what I was thinking - 500A is needed off the line to get this heavy thing rollin at a reasonable pace, and I don't want to have to floor it to get it. Just feels weird.

You could just set it up so that half of the throttle is active - at half throttle and above, I'd get 500 amps. But, that seems like it'd screw with higher speed driving; Only 150 - 200 amps are needed to cruise, so I'd be trying to nail something like 20% throttle.

To get the best of both I modified the throttle input based on the PWMduty knowing that a zero rpm I have zero PWMduty.

throttlenew=((2*PWMmax - PWMduty)/PWMmax) * throttle

PWMmax is the max bitvalue.

So, when PWMduty is zero, throttlenew=2*throttle, (I'll get full throttle by only pressing halfway).

If PWMduty were it's maximum, that whole mess before 'throttle' would equal 1 and throttlenew = throttle.

The other side effect is that your throttlenew (torque) decreases as you speed up and PWMduty increases. I personally find this nice because it becomes easier to hold the battery amps constant (I try to peg it at 200A during acceleration so as to try to 'baby' the pack). Previously, you had to slowly release the pedal as you accelerate to achieve this (which felt weird). Now, the pedal is more constant.

If I were to change something, I might have 100% throttle at 3/4 PWMduty instead of at PWMdutymax, but I'll leave it like this for now. I imagine it won't be so easy for other vehicle setups, but I'm interested in what other people think about how it feels.

Here's the 3 lines I added (the 1st one is already in there, but I copied it in so it's easy to find where this stuff was added).
rawThrottle = throttlePos >> 1;
throttlePos = (1022-OCR1A)*throttlePos/512;
if(throttlePos > 506)
{throttlePos=506;}

Oh, I also had to make throttlePos a 32bit variable.

Oh, and I changed the ramp to 8 and commented out the ramping if the error was negative, and that fixed the voltage problem I was having and made the throttle more responsive.
__________________
ReVolt AZ testing thread:

http://ecomodder.com/forum/showthrea...ting-9325.html
  Reply With Quote