Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Pedalmap.png

Thanks for your tips
 

shortbus=

Well-Known Member
Most Helpful 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
Most Helpful 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.
 

danadak

Active 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
 

New Articles From Microcontroller Tips

Top