Using Conditions for Programmable Outputs

This is a forum for discussing the development and testing of alpha MS2/Extra code. Documentation
(Runs on MS2 and Microsquirt)

Moderators: jsmcortina, muythaibxr

Post Reply
zmanco
Experienced MS/Extra'er
Posts: 329
Joined: Mon May 28, 2007 2:16 pm

Using Conditions for Programmable Outputs

Post by zmanco »

I've been using the programmable outputs to control the cooling fan. I noticed I could add a second condition so enabled RPM > 625 as a way to prevent the fan from coming on when hot before the engine started. However, it also seems like a good way to turn the fan off in the event the engine RPM drops below a set point - for example if it were to stumble with a sudden load or poor clutch release etc. My question is how hysteresis is used in this condition.

Idle target is 700 RPM so I would like the fan to turn off when idle drops below 625 and not turn back on until the idle is back above 700 (hysteresis of 75). However, the way hysteresis works for the coolant temp is to not turn back on until the temp = threshold - hysteresis. If RPM is handled the same way, then the fan would turn off as the revs dropped below 625 rpm, but would turn back on at 550 rpm which is not desirable. Ideally there would be a function "not less than" instead of "greater than" where the output would be enabled when = threshold + hysteresis.
screen_shot_2014-09-15_12-15-51.png
Is there a way to accomplish this? Or asked another way, is hysteresis for RPM treated the same way as for coolant?

I tried a negative value for hysteresis but it's not easy to simulate the low rpm condition so couldn't tell if that gave the desired response.
Daniel
'73 240Z
Castle Rock, CO USA
Alfagta
Experienced MS/Extra'er
Posts: 239
Joined: Wed Aug 21, 2013 2:54 am

Re: Using Conditions for Programmable Outputs

Post by Alfagta »

Enabeld when value > threshold and disabled when value < threshold - hysteresis.
Alfa 156 GTA
Alfa 75 Race Car MS III -- alway latest FW
Alfa 164 V6 Turbo
Alfa 155 2,5TD RIP
Test MS II --always latest FW
Tunerstudio V2.6.11 Registered
MegaLog Viewer V3.4.04 Registered
zmanco
Experienced MS/Extra'er
Posts: 329
Joined: Mon May 28, 2007 2:16 pm

Re: Using Conditions for Programmable Outputs

Post by zmanco »

Alfagta wrote:Enabeld when value > threshold and disabled when value < threshold - hysteresis.
Yes, that's what I've observed with coolant temp. By that logic, I tried setting the RPM threshold to 700 and hysteresis to 75. In theory that should result in the fan enabled above 700 rpm and then not being disabled until rpm drops below 625. In practice, the result was the fan would cycle on/off a time or two as the temp increased and reached the threshold. Once it passed the threshold, it stopped cycling. I initially thought it might be noise on the coolant signal, but lowering the rpm threshold made it go away, so I don't think it has anything to do with the coolant signal.
Daniel
'73 240Z
Castle Rock, CO USA
LilSki
Helpful MS/Extra'er
Posts: 52
Joined: Wed Nov 28, 2012 10:53 am

Re: Using Conditions for Programmable Outputs

Post by LilSki »

In my opinion there is no reason to to shut the fan off for any reason other then temp. I personally would not want the fan to be switching off and on so rapidly. the fan can cause the RPM to drop on it's own so you could get caught in an endless loop.

On my car I have two fans so I use a 10 second delay on fan 1 and 20 seconds on fan 2. This gives the engine plenty of time to stabilize before the fans kick on.
zmanco
Experienced MS/Extra'er
Posts: 329
Joined: Mon May 28, 2007 2:16 pm

Re: Using Conditions for Programmable Outputs

Post by zmanco »

LilSki wrote:In my opinion there is no reason to to shut the fan off for any reason other then temp. I personally would not want the fan to be switching off and on so rapidly. the fan can cause the RPM to drop on it's own so you could get caught in an endless loop.
I think that's the idea behind using hysteresis. To be clear, I've got a stable idle and while there's a voltage drop when the fans turn on, the idle doesn't drop significantly, hence this isn't really an important feature for me. Rather, like many of us, I wanted to understand the code better and if possible, cover the broadest range of conditions.

Going back to my original question, I found it covered in the new manuals: http://www.megamanual.com/ms2/spare.htm. I was also able to test the idle hysteresis by slowly letting the clutch out part way while parked to slow the engine speed. Using an RPM threshold of 700 (which is the idle target as well) and hysteresis of 75 resulted in the fans turning off when rpm dropped below around 625 and then restarting once the idle rpm exceeded 700. Not sure why I saw the intermittent results I described earlier - and I was not able to duplicate them again either.
Daniel
'73 240Z
Castle Rock, CO USA
Post Reply