Feature request: remote voltage sensing

Testing and development of Megasquirt 3

Moderators: jsmcortina, muythaibxr

Post Reply
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Feature request: remote voltage sensing

Post by elaw »

Hey, have you guys ever considered allowing a spare analog input to be used to read Batt V instead of the internal divider?

My car, and I have to think there are probably others like it, has the MS box powered from the circuit that originally powered the factory ECU, but the injectors/idle valve/etc. powered from a separate feed coming from the battery. And since the circuits are separate and each have their own loads and drops, the voltage at the Megasquirt's power pin is not necessarily the same as the voltage feeding the engine hardware. And the voltage feeding the engine hardware is what's important for things like determining injector deadtime and correcting the idle valve PWM value.

So it would be really cool if an unused analog input could be used (with a divider network) to read the voltage that's actually driving the injectors and such.

I realize that's not quite as easy as it sounds because the supply for the injectors etc. is usually controlled by a relay. I can think of two solutions to that: 1) read the voltage at a point before the relay or 2) have the code switch between the internal and external source based on a condition. Maybe when the fuel pump is energized? Or when the external input reads > 0 or > some percentage of the internal input?
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
tpsretard2
Master MS/Extra'er
Posts: 662
Joined: Thu Feb 14, 2008 4:59 am

Re: Feature request: remote voltage sensing

Post by tpsretard2 »

There is over 1 volt difference between the ECU supply and the injector supply on my car.
DaveEFI
Super MS/Extra'er
Posts: 4175
Joined: Sun Apr 15, 2012 12:55 am
Location: SW London, UK

Re: Feature request: remote voltage sensing

Post by DaveEFI »

Not really quite sure just why the internal divider network isn't reading the correct voltage? After all, there should be no high current flowing within MS, except on the ground side.
My car was built using a single high current feed direct from the battery to supply all the injection (other than fuel pump and ignition) so I kept it the same. The ignition switch just switches the relay controlling that.
Rover SD1 3.5 EFI
MS2 V3
EDIS
Tech Edge O2
London UK.
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: Feature request: remote voltage sensing

Post by elaw »

It's not that the divider is not reading the correct voltage, it's that it's reading the voltage on the wrong circuit!

In my car, the injectors etc. are on one circuit, with wiring I installed myself directly to the battery. The MS ECU is on a separate circuit: the one that originally powered the OEM ECU, which is fed from a different place and is shared with other loads. So depending on circumstances the voltage at the the Megasquirt ECU could be different from what the injectors and other engine hardware are seeing. And since the voltage at the Megasquirt ECU is used to correct things like injector deadtime, the voltage at the ECU being different from that at the injectors could result in the wrong correction being applied.
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
dontz125
Super MS/Extra'er
Posts: 4221
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: Feature request: remote voltage sensing

Post by dontz125 »

Lift the top leg of R3 (at the top left of the DIP40 socket); run it to a jumper to a spare pin on the DB37. Run a wire from that DB37 pin to the voltage source of your injectors. It may be easier to remove R3 and replace it with a new 50k resistor inline with the jumper.

For a V3.57 board, remove R3 and replace it with a 50k inline resistor as described above. It can be connected at the lower R3 pad, or the right pin of the boot jumper.

The wire can be fairly light, as the 50k Ohm resistance -> current << 1mA.
Temporarily shut down - back soon!
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: Feature request: remote voltage sensing

Post by elaw »

I thought about that, but if the MS senses 0V at startup won't it go into bootloader mode or something?

I know that would not happen if I put the sense wire before the relay feeding the injectors, but I'd prefer to have it after.
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
dontz125
Super MS/Extra'er
Posts: 4221
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: Feature request: remote voltage sensing

Post by dontz125 »

Good point. I can't think of a way around the boot loader problem; I was going to suggest a 10k pull-up to 5v, but decided that would do really weird things to the ADC reading. Short of some really complex relay / transistor riggins, you might have to take it from upstream of the relay.
Temporarily shut down - back soon!
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
Matt Cramer
Super MS/Extra'er
Posts: 17507
Joined: Thu Apr 16, 2009 8:08 pm

Re: Feature request: remote voltage sensing

Post by Matt Cramer »

elaw wrote:I thought about that, but if the MS senses 0V at startup won't it go into bootloader mode or something?

I know that would not happen if I put the sense wire before the relay feeding the injectors, but I'd prefer to have it after.
MS1 would go into bootloader mode. MS2 and MS3 does not, as I've seen firsthand with some oddball damaged circuit boards.
Matt Cramer -1966 Dodge Dart slant six running on MS3X
dontz125
Super MS/Extra'er
Posts: 4221
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: Feature request: remote voltage sensing

Post by dontz125 »

*facepalm* Of course, since the MS2 and MS3 cards have their own boot jumpers, that have nothing to do with H1 on the board ... :oops: :roll:

(Where's a [head bonk] smiley when you need it?)
Temporarily shut down - back soon!
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: Feature request: remote voltage sensing

Post by elaw »

Doh! I forgot about that too.

Still, an option in the firmware would be a lot easier than taking the Megasquirt apart and modifying it...
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
Reverant
Super MS/Extra'er
Posts: 1233
Joined: Sat Apr 15, 2006 12:39 am
Location: Athens, Greece

Re: Feature request: remote voltage sensing

Post by Reverant »

That would probably go inline with the request to be able to assign all the "hardcoded" analog inputs (IAT/CLT/TPS/V) to whichever analogue input you want.
The man behind MS Labs
2005 Audi A3 2.0L TFSI DSG AWD - Extreme MS3
2002 Mazda Miata 1.8 6sp - Enhanced MS3 1.4.0, sequential injection, sequential ignition, big turbo, lots of boost
Post Reply