Automating switch between 2 fuel injection maps

Hello,

First of all let me apologise for my complete lack of coding knowledge. I touched on C+ back in my uni days but that was 12 years ago and I have had no need for it ever since!

I come here with the idea of creating a programmable 5 volt switch based on a variable 0-5 volt input signal.

The basis for this is to use the 5 volt switch feature of the Power Commander V (PCV) fuel controller for a motorcycle. This feature allows switching between two fuel tables inside the PCV depending on riding conditions (fuel economy vs power for example).

My idea is to take the 0-5 volt throttle position signal (TPS) and process it so that under certain conditions (like cruising at a steady speed for more than 30 seconds) a 5 volt signal can be sent to the PCV to switch between the 2 fuel maps.

The conditions to be met are as follows:

  1. TPS rate of change less than X volts per millisecond (X to be user definable based on physical testing, estimated initial value based on 1/2 throttle turn in 1/2 second = 2.5 V / 500 ms = 0.005 V/ms)

  2. TPS smoothness factor less than Y for 1 second (Y to be calculated by squaring the TPS rate of change to make all values positive then average over a period of 30 seconds)

  3. Engine run time greater than 120 seconds.

The inspiration for this project comes from an interesting article over at http://www.autospeed.com/cms/A_113196/article.html

I thought about manually switching between a fuel economy map and a power map but the issue seems to be the adverse effect on driveability when targeting extreme fuel economy. A much better approach would be to switch automatically into the economy mode only when cruising along. This could of course be done manually but it would get annoying or forgotten about on smaller sections of cruising.

Thanks for reading!

Hi, Interesting project!

Just to start, see the simple example of reading analog voltages HERE:

Just breadboard this with an Arduino and a 10K potentiometer so you can work on the code.

You have the concepts of the differential voltage change etc..

Look into the "Data Types" Arduino handles so you don't get into a problem there.. THIS: is good...

Thanks for the advice!

I’ve attached my first attempt at the code and would welcome any feedback. The code wouldn’t copy and paste into here very well, hence the .txt file attachment.

Cheers.

PCV Auto Map Switch Rev1.1.txt (5.27 KB)

lewo: 2. TPS smoothness factor less than Y for 1 second (Y to be calculated by squaring the TPS rate of change to make all values positive then average over a period of 30 seconds)

If your goal is making all values positive, you could use abs() instead of squaring.

lg, couka