Speed dependent throttle curve

Post Reply
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Speed dependent throttle curve

Post by catphish »

After driving a car with openinverter, one thing I didn't love was the throttle deadzone reserved for regen. I wondered if it would be good at have a throttle map that behaved more like an ICE, with the full throttle travel being usable at all times, and regen being relative to speed.

I therefore propose this patch (not as a complete replacement as I've written it, but as a selectable option).
https://github.com/catphish/stm32-sine/ ... 67e2984c1a

What this does is fairly simple:
* At 0 RPM, there is no regen. The throttle is mapped as 0-100% forward. For example 1% throttle means 1% acceleration.
* At the speed defined by "brkrampstr / regenrampstr", the throttle is remapped so that zero throttle is full regen (brkmax / offthrotregen) and 100% throttle is still 100% acceleration.
* Between those two points, there is a linear ramp, so at 50% of brkrampstr speed, you get 50% of brkmax regen.

The benefit is no throttle deadzone when stationary, and hopefully a more natural feel. The disadvantage is that there will be a lot less regen / braking at low speed.

I've only tested this on the bench so far, but wondered if people were interested in the concept. The other possibility here would be the ability to load a full table, but openinverter doesn't really have a place to put maps for now. The CalcThrottle function takes a throttle and a rpm input, and gives a torque output, so there are plenty of possibilities here.
tom91
Posts: 1273
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 201 times

Re: Speed dependent throttle curve

Post by tom91 »

I do a very similar thing in my control of the outlander motor it works perfect and mimics an OEM feel.

I have actually taken it a little further, the first couple of 100 rpm there is no regen at all, but this should be tuned.

This is also very nice as a decent control, so you rolling down a hill and it decelerates to a constant speed and keeps the car there.
Founder Volt Influx https://www.voltinflux.com/
remy_martian
Posts: 47
Joined: Fri Mar 22, 2019 7:44 pm

Re: Speed dependent throttle curve

Post by remy_martian »

Isn't the pedal position a torque/motor_current command to where excess torque automatically produces regen as the natural order of the universe as prescribed by Michael Faraday? Throttle closed is a zero torque command which should be max regen (braking torque decays) all the way to zero vehicle speed.

I guess I don't understand what "throttle deadband" means. You should simply command 0-100% torque from the traction drive motor...the rest is up to the vehicle, motor, inertia, and gravity as far as whether any regen occurs. The amount of regen is modulated by the throttle position in one pedal driving. Zero throttle is max regen.

I'm missing something conceptually if there's a deadband or hysteresis in commanded torque by the throttle pedal to the inverter.
Friends don't let software friends do hardware design
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: Speed dependent throttle curve

Post by catphish »

remy_martian wrote: Mon Jul 11, 2022 8:26 pm Isn't the pedal position a torque/motor_current command to where excess torque automatically produces regen as the natural order of the universe as prescribed by Michael Faraday? Throttle closed is a zero torque command which should be max regen (braking torque decays) all the way to zero vehicle speed.

I guess I don't understand what "throttle deadband" means. You should simply command 0-100% torque from the traction drive motor...the rest is up to the vehicle, motor, inertia, and gravity as far as whether any regen occurs. The amount of regen is modulated by the throttle position in one pedal driving. Zero throttle is max regen.
Zero torque means no acceleration, and no regen. If you want regen, you have to send a request for *negative* torque. For this reason, Openinverter maps the throttle to a range like -30 to +100. If you're stationary, the part between -30 and 0 doesn't do anything.

If you just commanded 0% to 100%, you'd never have any regen.
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: Speed dependent throttle curve

Post by catphish »

remy_martian wrote: Mon Jul 11, 2022 8:26 pm You should simply command 0-100% torque from the traction drive motor...the rest is up to the vehicle, motor, inertia, and gravity as far as whether any regen occurs. The amount of regen is modulated by the throttle position in one pedal driving. Zero throttle is max regen.
The reason this isn't true is that regen it's the result of natural forces, it's a deliberate negative acceleration by the inverter. The goal of my code is actually to create something more like what you're describing, to mimic the feel of "engine braking" so the braking force increases as speed increases.
remy_martian
Posts: 47
Joined: Fri Mar 22, 2019 7:44 pm

Re: Speed dependent throttle curve

Post by remy_martian »

catphish wrote: Mon Jul 11, 2022 8:31 pm
remy_martian wrote: Mon Jul 11, 2022 8:26 pm Isn't the pedal position a torque/motor_current command to where excess torque automatically produces regen as the natural order of the universe as prescribed by Michael Faraday? Throttle closed is a zero torque command which should be max regen (braking torque decays) all the way to zero vehicle speed.

I guess I don't understand what "throttle deadband" means. You should simply command 0-100% torque from the traction drive motor...the rest is up to the vehicle, motor, inertia, and gravity as far as whether any regen occurs. The amount of regen is modulated by the throttle position in one pedal driving. Zero throttle is max regen.
Zero torque means no acceleration, and no regen. If you want regen, you have to send a request for *negative* torque. For this reason, Openinverter maps the throttle to a range like -30 to +100. If you're stationary, the part between -30 and 0 doesn't do anything.

If you just commanded 0% to 100%, you'd never have any regen.
ick

I now see what you're talking about - it's a virtual brake pedal, not one pedal driving like on my production car.
Friends don't let software friends do hardware design
remy_martian
Posts: 47
Joined: Fri Mar 22, 2019 7:44 pm

Re: Speed dependent throttle curve

Post by remy_martian »

catphish wrote: Mon Jul 11, 2022 8:41 pm
remy_martian wrote: Mon Jul 11, 2022 8:26 pm You should simply command 0-100% torque from the traction drive motor...the rest is up to the vehicle, motor, inertia, and gravity as far as whether any regen occurs. The amount of regen is modulated by the throttle position in one pedal driving. Zero throttle is max regen.
The reason this isn't true is that regen it's the result of natural forces, it's a deliberate negative acceleration by the inverter. The goal of my code is actually to create something more like what you're describing, to mimic the feel of "engine braking" so the braking force increases as speed increases.
I submit you don't need to set a constant at which speed you turn on regen, but rather can map "brkrampstr / regenrampstr" to being a variable that is a function of either vehicle/motor speed or is pulled from a lookup table with speed as the address. From there you linear interpolate to closed throttle being max regen, continuously until you're stopped. Blip the throttle and you're merely adding in some torque to the regen braking to reduce regen. Balancing regen and added torque holds speed. Go down a hill, it starts to regen on its own, minimally initially unless the speed increases significantly beyond the mapped speed or the throttle starts being closed.

I'm up to my eyeballs trying to build my inverter output driver stage right now, and plan to use the OI controller (Johannes is likely at the casino spending the money from my second board order 😂), so am interested in going beyond this "it's a brake pedal below 30% WOT" stuff.
Friends don't let software friends do hardware design
remy_martian
Posts: 47
Joined: Fri Mar 22, 2019 7:44 pm

Re: Speed dependent throttle curve

Post by remy_martian »

Some good material in this dissertation (I am starting at zero knowledge in this area):

https://publikationen.bibliothek.kit.ed ... 41/6717029
Friends don't let software friends do hardware design
remy_martian
Posts: 47
Joined: Fri Mar 22, 2019 7:44 pm

Re: Speed dependent throttle curve

Post by remy_martian »

Friends don't let software friends do hardware design
tom91
Posts: 1273
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 201 times

Re: Speed dependent throttle curve

Post by tom91 »

remy_martian wrote: Tue Jul 12, 2022 4:58 am Take a look at Table 1 here:

https://link.springer.com/content/pdf/1 ... 0546-x.pdf

🤓
Look at Fig 5, the figure that actually includes vehicle speed/motor speed. You notice how they taper the deceleration for all pedal positions to 0 m/s2 for speeds aproaching 0 km/h?
Founder Volt Influx https://www.voltinflux.com/
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: Speed dependent throttle curve

Post by Bigpie »

tom91 wrote: Mon Jul 11, 2022 8:14 pm I do a very similar thing in my control of the outlander motor it works perfect and mimics an OEM feel.
What vehicle do you have the outlander motor in?
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
tom91
Posts: 1273
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 201 times

Re: Speed dependent throttle curve

Post by tom91 »

Bigpie wrote: Tue Jul 12, 2022 8:34 am
tom91 wrote: Mon Jul 11, 2022 8:14 pm I do a very similar thing in my control of the outlander motor it works perfect and mimics an OEM feel.
What vehicle do you have the outlander motor in?
At the moment a classic mini, soon will have one in a Gen 2 new mini. The vehicle used does not really have any impact on this topic.
Founder Volt Influx https://www.voltinflux.com/
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Speed dependent throttle curve

Post by johu »

Alright, so besides ramping down "offthrotregen" starting at "regenrampstr" we'd also ramp down "regentravel"
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: Speed dependent throttle curve

Post by catphish »

johu wrote: Tue Jul 12, 2022 9:45 am Alright, so besides ramping down "offthrotregen" starting at "regenrampstr" we'd also ramp down "regentravel"
Yes, that's good description of what this does. Another way to implement it might be to actually dynamically modify regentravel. I'm not sure whether this would result in the same curve or not.
Post Reply