MaxSFI with CAN-EGT for coolant temp

User avatar
IanEpperson
Posts: 66
Joined: Fri May 05, 2006 11:35 pm

MaxSFI with CAN-EGT for coolant temp

Post by IanEpperson »

I was surprised to learn that the 4 CHT sensors wired into my CAN-EGT are not enough to provide the "coolant temp" input for an MS (or my shiny new MaxSFI) ECU, and most people just run a second sensor. Thinking about it a bit and after chatting with Mario, I think it can be made to work with a small bit of electronics. Ideally I'd be able to mod the CAN-EGT or the ECU to tell it to accept the values as coolant via the CAN bus, but I'm not sure if I'd be able to get ahold of the source code.

The MaxSFI coolant temp input is looking for a variable resistance to ground, and is adjustable in Tunerstudio. The CAN-EGT puts out a 0-5 volt signal per sensor, with 0v = 0 degrees F and 5v = 1200 degrees F. There's a few different simple circuits that can convert a variable voltage into a variable resistance.
2017-02-08 10.16.56 pm.png
This assumes the MaxSFI is using a 5 volt pullup to sense the resistance, and the CAN-EGT is outputting 2.5 volts - which would be an engine melting 600 degrees. I'm waiting to hear back from Mario to see what the pin voltage is, and if it can handle 100mA. I can up the resisters value to lower the current, but this provides a decent slope. I could add a couple of diodes and wire up each of the sensors, which should then be a max reading across all of them.

Another, less predictable solution would be a combination LED to photosensor. It would be nice and isolated, but probably wouldn't read anything until the output is about 1.5 volts, which would be about 350 degrees - that's a lot of range to give up. I suppose I could use a mini incandescent bulb like a rice light which would light sooner, but would have to be a small enough wattage to handle wrapping in a small package (I imagine heat-shrink tubing). Also, incandescent lights burn out much faster then LEDs.

If this works, it's less than $10 in parts, a simple solder job, more accurate temp inputs and one less wire and connector.
You do not have the required permissions to view the files attached to this post.
TZepeSH
Posts: 303
Joined: Tue Nov 02, 2004 10:55 pm

Re: MaxSFI with CAN-EGT for coolant temp

Post by TZepeSH »

I have to read a bit on maxsfi, but I think it is much simpler than that.
MS has a voltage divider from 5V with one of the resistor (the one to ground) being variable - the sensor (figure A). And it just converts the analog 0-5V signal to ADC. So what you would need to do if CAN EGT outputs 0-5V is to de-solder the 5V pull-up form MS and feed the signal directly to the ms controller, through a limiting resistor (1KOhm) (figure B). I will try to make a quick sketch.
input change.JPG
You do not have the required permissions to view the files attached to this post.
User avatar
IanEpperson
Posts: 66
Joined: Fri May 05, 2006 11:35 pm

Re: MaxSFI with CAN-EGT for coolant temp

Post by IanEpperson »

Interesting suggestion TZepeSH, but I'm not going to be changing the components on the MaxSFI.

Image

Maybe that'll work for someone running a more solder-accessible MS system though.
User avatar
Chip Birks
Posts: 4006
Joined: Wed Mar 12, 2008 5:59 pm

Re: MaxSFI with CAN-EGT for coolant temp

Post by Chip Birks »

This feels way over thought to me. Why not just run a sensor like the ecu is wanting?

Its only one more wire and a connector.
User avatar
IanEpperson
Posts: 66
Joined: Fri May 05, 2006 11:35 pm

Re: MaxSFI with CAN-EGT for coolant temp

Post by IanEpperson »

Chip, I thought I had bought everything, but had neglected that one more sensor, one more wire and one more connector. I'd rather spend $5 on parts (that I probably already have in the garage anyway) instead of $60 + shopping and waiting, do less wiring and have a more accurate sensor as a result. The circuit is way simple.


Sent from my iPhone using Tapatalk
User avatar
Piledriver
Moderator
Posts: 22520
Joined: Sat Feb 16, 2002 12:01 am

Re: MaxSFI with CAN-EGT for coolant temp

Post by Piledriver »

I wanted to use a proper CHT TC under the plug for the same purpose, did it ~as TZepeSH described.
(had to use an electrically insulated TC due to ground loop issues, TCs are very low voltage)
Eventually had to ditch it as the fine SS sheathed TCs kept dying due to vibration.
(EGT TC sensors are similar, just usually much larger)

Usually the inputs have jumpers for pullups etc as most things are flexible on MS, but CLT is a defined input so setting it up hardwired so to speak is excusable, even on an SMD board.

Pulling an SMD resistor really only needs a soldering iron, a couple seconds and a pair of tweezers, but if you haven't done it before I can understand the pucker factor.

It would be far better if the MSExtra code simply allowed assigning another input for CLT, CAN or otherwise, preferably with sane settable limits.

The setup I ended up with, (open element gm sensor elegantly ziptied to a pushrod tube) responds very fast to load changes, in lockstep with underplug tc, with only a consistent rpm/fan speed based offset.
At idle its almost 1:1, at ~70mph cruise the in-head-airflow tc reads ~75f lower than under plug.
I do run well sealed lower tin, required with a working thermostat anyway..
Addendum to Newtons first law:
zero vehicles on jackstands, square gets a fresh 090 and 1911, cabby gets a blower.
EZ3.6 Vanagon after that.(mounted, needs everything finished) then Creamsicle.
User avatar
IanEpperson
Posts: 66
Joined: Fri May 05, 2006 11:35 pm

MaxSFI with CAN-EGT for coolant temp

Post by IanEpperson »

Mario suggested pulling the SMD resister too, but I want the ability to revert back if this all doesn't work and just put on the sensor.

I mocked up the mini squirt input based on the published drawings and the sample resistance from the sensor spec, but couldn't come up with a simple analog circuit that gives a nice slope in the interesting temp range (100F - 400F). There are plenty of digital potentiometers though. So I ordered a $7 arduino and a cheap digital pot which will allow me to pick any range with 100 discrete resister values.

So, maybe program it for 100-500 degrees in 4 degree increments? Seems like that would be plenty of resolution but I could also do 150-450 in 3 degree increments or 50-550 in 5 degree increments. I guess I just need to know about when warm-up enrichment ends and when I want to start cooling it down during over-temp.


Sent from my iPhone using Tapatalk
User avatar
Piledriver
Moderator
Posts: 22520
Joined: Sat Feb 16, 2002 12:01 am

Re: MaxSFI with CAN-EGT for coolant temp

Post by Piledriver »

The range is going to depend on sensor placement, mine sees full under plug ~CHT range but if bolted to the top of the head will see a much lower max temp IIRC, maybe 250.
Addendum to Newtons first law:
zero vehicles on jackstands, square gets a fresh 090 and 1911, cabby gets a blower.
EZ3.6 Vanagon after that.(mounted, needs everything finished) then Creamsicle.
User avatar
MarioVelotta
Posts: 4083
Joined: Wed Mar 12, 2003 12:01 am

Re: MaxSFI with CAN-EGT for coolant temp

Post by MarioVelotta »

IanEpperson wrote:So, maybe program it for 100-500 degrees in 4 degree increments? Seems like that would be plenty of resolution but I could also do 150-450 in 3 degree increments or 50-550 in 5 degree increments. I guess I just need to know about when warm-up enrichment ends and when I want to start cooling it down during over-temp.
Head temps are going to be ambient temp to 450, Once the heads reach 200-250 degrees that is a warm engine. I'm doing some cold start tuning on a car right now and it's 38° degrees outside.

So 0-450/500° would be good.
The Dub Shop
[email protected]
1600 ITB NA - 18sec
1600 Supercharged - 13psi - 15.40 @ 84.66mph
1600 Turbo - 185hp 250tq!! Going for 200
2276 Turbo - 15psi - 11.537 @ 115.74mph
Facebook-Tech-Store
User avatar
IanEpperson
Posts: 66
Joined: Fri May 05, 2006 11:35 pm

Re: MaxSFI with CAN-EGT for coolant temp

Post by IanEpperson »

From a cold start enrichment standpoint, is there any difference between 0 degrees and 50? I'm guessing they're both just considered "too cold".


Sent from my iPhone using Tapatalk
User avatar
MarioVelotta
Posts: 4083
Joined: Wed Mar 12, 2003 12:01 am

Re: MaxSFI with CAN-EGT for coolant temp

Post by MarioVelotta »

50 degrees on the cold side is much more important than 50 on the hot side
The Dub Shop
[email protected]
1600 ITB NA - 18sec
1600 Supercharged - 13psi - 15.40 @ 84.66mph
1600 Turbo - 185hp 250tq!! Going for 200
2276 Turbo - 15psi - 11.537 @ 115.74mph
Facebook-Tech-Store
TZepeSH
Posts: 303
Joined: Tue Nov 02, 2004 10:55 pm

Re: MaxSFI with CAN-EGT for coolant temp

Post by TZepeSH »

As I remember, Megasquirt can have startup enrichment based on temperature. So it matters how cold it is, the colder the more gas is added. I wouldn't throw away that range.
User avatar
IanEpperson
Posts: 66
Joined: Fri May 05, 2006 11:35 pm

Re: MaxSFI with CAN-EGT for coolant temp

Post by IanEpperson »

Amazon shipped the wrong part in the right package so had to reorder the digital pot. Opted for the $4 version instead of the $2 version so I'll get 256 steps instead. That'll give me 0-512 degrees in 2 degree steps, which is tighter than the resolution limit of the input pin that can't sense anything tighter than about 2 degree F without additional circuitry.

(0-5v input read uses 10 bit resolution = 1024 levels sensed, the 0-5v output is 0-2282 degrees F. 2282/1024 is 2.2 degrees per level.)

The slight downside is this chip needs another output for SPI control, so I'll have to double-duty one of the USB program pins. Not a big deal, I'll just have to unplug it from the CAN-EGT if I ever have to reprogram it.

I'm blown away by how dinky the Arduino Trinket is. Just a hair larger than my fingernail - I'll probably just seal it all up in shrink wrap when I'm done.

[img]//uploads.tapatalk-cdn.com/201702 ... 88cfb7.jpg[/img]


Sent from my iPhone using Tapatalk
User avatar
IanEpperson
Posts: 66
Joined: Fri May 05, 2006 11:35 pm

Re: MaxSFI with CAN-EGT for coolant temp

Post by IanEpperson »

Part of the reason why I do this and similar projects (including adding FI to the engine in the first place) is to learn and grow. Last night I learned that "Vss" is ground and not (as I had wired it) 5 volts. However, when I finally did hook it up correctly (and threw out the first digital pot that smoked) it worked. That's bench working, not yet in the car, but as I ramped the voltage from zero to 1 volt, the resistance changed along with it from zero to 10k. I program for a living, but still am proud of having the code work perfectly on the first try. I've got it set up to read about 5 times per second - a slow pace for the Arduino but should be plenty fast enough for something changing as slowly as the CHT. With no math at all in the code, it's reading from 32 - 594 degrees F in 2.2 degree increments - 32 degrees = 0 ohms, 594 = 10k ohms. It's trivial to reverse the range by just using pins 7&8 instead of 6&7 and I should probably throw in a series resister to make it easier for the MS to read.

Here's a link to the circuit in a simulator if you want to play with it: http://tinyurl.com/jsm9erx Note how the MS TP changes as you select different values. With a 1k resister inline, and with the slope that (I think) MS needs, that'll be:
32 degrees F = 11k ohms (lowest temp reading)
313 degrees F = 6k ohms
597 degrees F = 1k ohms (highest temp reading)

I'll add a small stack of diodes to the input of the Arduino to read the highest temp from each cylinder, test that then solder it all to a small board and wrap it up. I'll draw it out and publish the source code if someone wants to make one of these for their own car.

(Note that my math was wrong on the earlier post. I forgot to account for 0C being 32F, not 0F)
User avatar
IanEpperson
Posts: 66
Joined: Fri May 05, 2006 11:35 pm

Re: MaxSFI with CAN-EGT for coolant temp

Post by IanEpperson »

Image

Got the demo board soldered up and tested using a small battery and manual potentiometer. I ended up using a 470 ohm resister inline because I have a pile of them. I tried adding a diode stack to read more than one cylinder, but they dropped too much sensitive voltage. I suppose a perfect solution would have a pin per sensor, but I suspect it's more trouble than it's worth.

Today I'll get back to wiring the engine compartment and figure out where to mount this.


Sent from my iPhone using Tapatalk
Post Reply