Modifying fuel injection based on custom sensor

All questions about MS2/Microsquirt/Microsquirt module. See also MS2/Extra manuals

Moderators: jsmcortina, muythaibxr

Post Reply
hc08
MS/Extra Newbie
Posts: 5
Joined: Thu Apr 10, 2014 2:59 pm

Modifying fuel injection based on custom sensor

Post by hc08 »

Let's say I have wired up a custom sensor to a Megasquirt 2 (v3.57 board) unit, and I have generated a correction factor for engine fueling based on the readings of this sensor using a custom .ini file. How would I actually go about applying this correction factor to the engine fueling? Let's also say for simplicity's sake that I have a single cylinder engine with only one injector.
jsmcortina
Site Admin
Posts: 39621
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Modifying fuel injection based on custom sensor

Post by jsmcortina »

The microcontroller in the Megasquirt runs the engine, not your tuning computer. So, having data in TunerStudio doesn't help and won't allow you to do anything, unless I'm misunderstanding the question.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Matt Cramer
Super MS/Extra'er
Posts: 17507
Joined: Thu Apr 16, 2009 8:08 pm

Re: Modifying fuel injection based on custom sensor

Post by Matt Cramer »

Upgrading to MS3 would let you use a blend curve between two fuel and ignition tables based on a custom sensor.

With MS2, you could pretend the second sensor was a baro sensor and use the baro correction curve for it, but that's about the only work-around I can think of with current code. The only other option would be to dust off your C and modify the firmware for this feature.
Matt Cramer -1966 Dodge Dart slant six running on MS3X
hc08
MS/Extra Newbie
Posts: 5
Joined: Thu Apr 10, 2014 2:59 pm

Re: Modifying fuel injection based on custom sensor

Post by hc08 »

jsmcortina wrote:The microcontroller in the Megasquirt runs the engine, not your tuning computer. So, having data in TunerStudio doesn't help and won't allow you to do anything, unless I'm misunderstanding the question.

James
Am I correct in understanding that even if I have the custom sensor wired up to one of the spare inputs (i.e. adc7) of Megasquirt 2, I will not be able to actually affect the engine fueling because the microcontroller itself doesn't do anything with that data? So basically, all I can do with the sensor wired up and a custom .ini is just crunch some numbers and display them on a gauge in Tunerstudio?
Matt Cramer wrote:Upgrading to MS3 would let you use a blend curve between two fuel and ignition tables based on a custom sensor.

With MS2, you could pretend the second sensor was a baro sensor and use the baro correction curve for it, but that's about the only work-around I can think of with current code. The only other option would be to dust off your C and modify the firmware for this feature.
If I already have a baro sensor and I want to retain it while simultaneously using the custom sensor, would I be able to multiply the two correction factors? I've already tried to include the correction factor from the custom sensor into the total correction variable (gammaEnrich), but apparently a statement like gammaEnrich = { gammaEnrich*CustomCorrection } is invalid.
Matt Cramer
Super MS/Extra'er
Posts: 17507
Joined: Thu Apr 16, 2009 8:08 pm

Re: Modifying fuel injection based on custom sensor

Post by Matt Cramer »

If you are already using barometric correction, there's nothing in the MS2 firmware that will modify the fueling based on an analog sensor reading. TunerStudio can only display the sensor's reading, and if you get creative, do some math based on it. But the math can only be used for display and logging; it can't be sent back to the ECU. Actually having the sensor change the fueling would require modifying the MS2 firmware, or upgrading to MS3.
Matt Cramer -1966 Dodge Dart slant six running on MS3X
hc08
MS/Extra Newbie
Posts: 5
Joined: Thu Apr 10, 2014 2:59 pm

Re: Modifying fuel injection based on custom sensor

Post by hc08 »

OK, thanks for the help on this topic. I don't know how to modify the firmware, so it looks like I won't be able to do what I want with a MS2.
Post Reply