Continue to Site

# Torque mapping in C : Accelerator pedal vs speed

#### yanno_yokizo

##### New Member
Hi guys, I am struggling trying to define an interpolation based on the below accelerator pedal map. The target is to define a calculation method that outputs the Torque function of the Pedal angle and the current vehicle speed. I am working on the software implementation of this system in C.

#### shortbus=

##### Well-Known Member
Might be wrong, but think your forgetting a very important thing in doing this. That thing is the road and environment. A hill or even a head or tail wind on the vehicle puts more into this than you are showing. Unless your not doing this for an actual driving vehicle.

#### rjenkinsgb

##### Well-Known Member
In its simplest form, and assuming linear change of torque with speed between the two lines & no outside influences:

t = b(p) + ((((r(p) - b(p)) / 50) * s);

t is result
b(p) is blue line value for the pedal position
r(p) is the red line value for the pedal position
s is speed.

The difference between the two lines at a given pedal position, divided by 50 to get 1km/h units, multiplied by the speed and added to the blue line value.

(Assuming I've not mistyped anything!).

Real-world applications typically use multi-dimensional lookup tables for this type of thing, with rather more inputs.

##### Well-Known Member
Two methods :

1) Least squares error fit

2) Power series error fit (better for non linear)

Regards, Dana.

#### yanno_yokizo

##### New Member
In its simplest form, and assuming linear change of torque with speed between the two lines & no outside influences:

t = b(p) + ((((r(p) - b(p)) / 50) * s);

t is result
b(p) is blue line value for the pedal position
r(p) is the red line value for the pedal position
s is speed.

The difference between the two lines at a given pedal position, divided by 50 to get 1km/h units, multiplied by the speed and added to the blue line value.

(Assuming I've not mistyped anything!).

Real-world applications typically use multi-dimensional lookup tables for this type of thing, with rather more inputs.
Thanks. Easy to implement and works beautifully

Replies
4
Views
2K
Replies
9
Views
2K
Replies
5
Views
2K
Replies
4
Views
3K
Replies
6
Views
2K