Miata Turbo Forum - Boost cars, acquire cats.

Miata Turbo Forum - Boost cars, acquire cats. (https://www.miataturbo.net/)
-   MEGAsquirt (https://www.miataturbo.net/megasquirt-18/)
-   -   MS2 AC Idle Up Code (https://www.miataturbo.net/megasquirt-18/ms2-ac-idle-up-code-60882/)

gslender 10-06-2011 03:00 AM

MS2 AC Idle Up Code
 
Hi,

For those with MS2 systems, I'm working on establishing a firmware release that contains code for AC Idle Up.

Following the progress and provide your thoughts here... http://www.msextra.com/forums/viewto...p?f=91&t=42485

G

gslender 10-08-2011 10:52 PM

Test code has been posted... which works... oh yeah!!

Based on 3.1.3 code and include configurable delay.

http://www.msextra.com/forums/viewto...299164#p299164

Techsalvager 10-10-2011 10:35 AM

I wonder if the ecu disengages the AC at full throttle or above said TPS position or maybe its part of an external. If it does disengage the ac, I think thats another thing that would need implemented.

I have to say good work!

richyvrlimited 10-10-2011 10:39 AM

It does and it already is.

gslender 10-10-2011 03:58 PM


Originally Posted by Techsalvager (Post 781706)
I think thats another thing that would need implemented.

I have to say good work!

Using my firmware you can. Just setup another AND condition to be TPS < 90 and the AC (via WLED) will only activate when the timer hits your value AND when the throttle is under WOT. if you don't have a VTPS you can use rpm or kpa to simulate what high load you don't want the AC to engage under.

So cool. :bowrofl:

G

Techsalvager 10-10-2011 04:29 PM

gslender yeah I didn't see it until I read the first post.

sparkstack 10-11-2011 05:04 PM

I've found that if i enter the number 3 in the battery factor my car dies and won't start again until it's changed back to 2 or 4.

Any reason for this?

Greg G 10-11-2011 05:35 PM

Could you post a log? Wonder if it affects cranking idle valve duty..

sparkstack 10-11-2011 05:45 PM

4 Attachment(s)
two attached

gslender 10-11-2011 05:53 PM

I think I know what it is... an undated firmware is coming in a few minutes. Would be great if you can confirm fixed... hang on.

gslender 10-11-2011 05:57 PM

2 Attachment(s)
try this firmware. the ini hasn't changed.

Greg G 10-11-2011 06:39 PM

Sparkstack-- dunno about the cranking issue, but it looks like the battery idle valve correction is too strong, possible contributing to the oscillation you get. Have you tried a factor of 1 or lower?

My concept of it is that it should catch any RPM dip due to large drops in voltage, and should have minimal impact during steady state idling. Could the correction ramp up as it gets farther from 13.2? Or perhaps a dead zone/minimal batt voltage parameter be used? Will try it on my car in a bit, and post back.

gslender 10-11-2011 07:03 PM


Originally Posted by Greg G (Post 782395)
My concept of it is that it should catch any RPM dip due to large drops in voltage, and should have minimal impact during steady state idling. Could the correction ramp up as it gets farther from 13.2? Or perhaps a dead zone/minimal batt voltage parameter be used? Will try it on my car in a bit, and post back.

Mmmm, well there is obviously scope to get this mod included in my firmware, but I just need guidance on what you are looking to fix. I personally don't see any issues with lights, car audio with voltage drops that are causing idle rpm dip, but that might be because I'm accepting of very slight fluctuations and hunting - which was there before with the stock ECU. :dunno:

Telling me large drops, dead zones, minimal batt voltage don't help - as without specific values, my interpretation on what minimal is, might not be yours .... :ugh::eek3:

In saying that, if you can describe what you want (ie when voltage goes to X please make duty go to Y, and give me a few points on a table, I can work out a formula that can model this and add some element of adjustment factor to account for other peoples needs etc. :cool:

G

Greg G 10-11-2011 07:15 PM

Got it. Will test it out and sift through the data! Thanks! :)

gslender 10-11-2011 07:38 PM

...also, there is non-linear battery correction already included (recent update) for the injector PW, so might be best to confirm operation with my battery duty fix disabled (set to zero) as realistically I'm unlikely to catch-and-stop a voltage drop quickly anyway and the injector stuff might be the better outcome... assuming you only wish to restore correct idle operations when voltage drops to 10V instead of 13.2V ???

G

gslender 10-11-2011 07:39 PM

...eg Battery correction factor in opening time

sparkstack 10-11-2011 07:42 PM


Originally Posted by gslender (Post 782405)
Mmmm, well there is obviously scope to get this mod included in my firmware, but I just need guidance on what you are looking to fix. I personally don't see any issues with lights, car audio with voltage drops that are causing idle rpm dip, but that might be because I'm accepting of very slight fluctuations and hunting - which was there before with the stock ECU. :dunno:

I'd go along with that. My bone stock 90 never had a rock solid idle, it always fluctuated a little, which is probably due to the narrowband sensor. It usually idled between 14.2 and 15.7, the warmer it got the narrower the swing.

Now i'd love a rock solid 850rpm (1000rpm with AC) idle with the MSQ, but right now i'm not there and i'm not going to loose sleep over it. Prior to this firmware i either had a 1200rpm base idle or knock when the AC was on. My main priority now i've got this far (thanks gslender) is to drive it around and tune the rest of the map. I'll come back to idle later.

gslender 10-11-2011 08:18 PM

So sparkstack, did that revised firmware fix the bug with duty factor set to 2/3/4 etc.... ?

G

Greg G 10-11-2011 08:46 PM

Ok quick report on the battery idle correction- works great, my only request is that we be able to input correction factors in tenths. My sweet spot is somewhere between 1 and 2. Small rpm dip if factor is 1- if factor is 2, the rpm actually rises when the fan goes on! But yippee it works! No issue with steady state idle, it is the smoothest it's been in an long time. :makeout:

There some more smoothness to be had with tapering the PID values down to match the new idle control features. Will post data and graphs in a few hours, they are quite interesting.

EDIT: graphs/logs posted on my idle thread so as not to pollute this one ;)

sparkstack 10-11-2011 10:00 PM


Originally Posted by gslender (Post 782451)
So sparkstack, did that revised firmware fix the bug with duty factor set to 2/3/4 etc.... ?

G

Haven't tested it yet. I'll test it out tomorrow when i get home.

gslender 10-13-2011 04:34 PM

Update 13 Oct 2011 - released ms2extra_3.1.3_idleup_v3
* Added disable all routines if cranking, otherwise enabled.
* Increased resolution of batt correction by 10.
* Added target idle rpm add.
* Fixed bug in experimental Battery idle duty correction (thanks to Greg for testing/confirming this is fixed).

Get it fresh from here
http://www.msextra.com/forums/viewto...p?f=91&t=42485

bearda 10-19-2011 09:29 AM

I'm getting ready to mod the DIYPNP in my 95 to put the AC under software control instead of the passthrough relay control DIY Autotune had in their build notes. Previously I had the input from 1Q (AC activation switch) going into Input 1 and running out to the fan and AC clutch relays. My plan was to just run the output of Input1 into PE1 and then run a line from ALED to the fan and clutch pins, but then I saw a note about removing R14 on Input1.

I have no idea why R14 was removed (although I'm sure I did it if that's what they said to do), so I'm not sure if it'll screw things up now that I'll be running the Input1 out line to the CPU instead of directly to the relays. I'm guessing it has something to do with output voltage or current limiting, but without a schematic I'm not sure what's going on. Should I just move the AC stuff over to Input2 and otherwise run everything as planned?

Matt Cramer 10-19-2011 11:01 AM

Put R14 back in. R14 is a pull up to 5 volts on the output side of the buffer.

bearda 10-19-2011 11:13 AM


Originally Posted by Matt Cramer (Post 785562)
Put R14 back in. R14 is a pull up to 5 volts on the output side of the buffer.

Yeah, I can see that causing a mess. Thanks for the quick response, that'll be a load off my mind when I'm reworking the jumpers tonight.

Braineack 10-19-2011 11:16 AM

I'm going to be modding Florin's DIYPNP for this tonight as well. After I install the U3 opt amp I mistakenly left off.


If the code is anyhting like the ms3 code I know it works well. Loving the battery voltage addtion, the factory ECU does this, and my MS firmware has to add this.

bearda 10-19-2011 11:27 AM


Originally Posted by Braineack (Post 785574)
I'm going to be modding Florin's DIYPNP for this tonight as well. After I install the U3 opt amp I mistakenly left off.

Was the missing U3 the cause of the wacky input problems he was having?

Braineack 10-19-2011 11:33 AM

yep

gslender 10-19-2011 04:04 PM

Gentlemen - the Idle Up mod I've created is based on MS2Extra firmware 3.1.3 which included Seq Inj and PID Idle improvements. Unfortunately it also introduced a bug that causes a lean condition > 6000 rpm for those with Seq Inj. Jean (dev from MSExtra) has released a firmware fix, but not the source code (yet) and it is planned to be made available in 3.1.4 from which I'll quickly apply my mod and re-release the Idle Up mode back to the community.

So...

If you are running batch inj, ignore this and your fine (enjoy smooth idle and better AC/Batt control).

If you are running seq inj, be very careful and perhaps only test the ac idle, do some idle tuning, but don't go and do WOT without using either the 3.1.3c test firmware from Jean or go back to 3.1.2 or earlier. As soon as I get the new firmware from the devs I'll add my new idle code etc.

G

Greg G 10-19-2011 05:41 PM


Originally Posted by Matt Cramer (Post 785562)
Put R14 back in. R14 is a pull up to 5 volts on the output side of the buffer.

Paging Brain - do I have this issue with input1? :hustler:

gslender 10-19-2011 06:12 PM

I'm not clear why you'd run the output of Input1 into PE1 ? Why not just run the AC activation switch to PE1 and then run the chosen WLED output (that status4 is triggered to switch) to Input1 and leave the Output1 as is with the AC/Fan controls running off that. The only thing you may want to do is add a diode to protect the PE1 input from shorts etc...otherwise I'm unclear why you'd run Input1 into PE1 as PE1 is an input itself and there is no reason to do that.

Braineack 10-19-2011 06:24 PM

its protected through the opt amp, otherwise aled or wled can go straight to the the output directly from the stamped switch on the us module.


buy yeah, technically one could go 1Q to PE1, then ALED to 1J.

Greg G 10-19-2011 06:28 PM

I just followed the manual for pe1:

The DIYPNP can switch fuel and spark tables on command to accommodate different engine configurations or fuel octane ratings. Use the Input 1 or Input 2 circuits for this. The IN pin on the input circuit connects to an external switch, and the OUT pin connects to the PE1 input. The external switch connects to ground, and activates the alternate fuel and spark tables when the input is grounded.

The circuits marked Input 1 and Input 2 are general purpose on/off inputs, with a buffer circuit to protect the processor. They are designed for ground triggered inputs, but with some protection for the processor if you accidentally connect them to 12 volts. The output is 5 volts when the input wire is disconnected, 0 volts when the input signal is pulled to ground. These can be used for launch control or table switching.
I did post the question before I did the rewire... :facepalm:

Greg G 10-19-2011 06:32 PM


Originally Posted by Braineack (Post 785753)
its protected through the opt amp, otherwise aled or wled can go straight to the the output directly from the stamped switch on the us module.


buy yeah, technically one could go 1Q to PE1, then ALED to 1J.

Ok but going 1q through input1 to pe1/pe0 is safer? This hardware nitty gritty is beyond me, past the basic stuff... :noob:

But wait- assuming I have no r14 resistor in input 1, what does that mean in English? :). And Matt, you said it was ok to use input 1, no mention of the r14... :facepalm:

Braineack 10-19-2011 06:39 PM

yes, hence the line about the protection to the processor. if you accidentally somehow get 12v on that line, nothing will happen.

if you run straight to pe1 and get 12v to that, the cpu will fry instantly.

Greg G 10-19-2011 06:48 PM

BTW, for those rewiring- I also removed the connection between the AC relay and the AC fan relay. So for my car, the AC fan is also triggered by status 4, using aled. Staggering the engagement helps make the transition smoother.

Brain, how does ms3 deal with turning off the AC? How does it transition back to no load idle, is there some sort of taper?

Braineack 10-19-2011 08:10 PM

i dunno, it's pretty seamless, that's all i know.

Braineack 10-20-2011 09:23 AM

I loaded your v3 code on a DIYPNP last night, works as expected but for one caveot -- the delay on status 4. When set to 20, the delay was 20 seconds, when set to 10 the delay was ten seconds. I left it at 1 which seemed to be a good delay, seemed a touch quicker than 1 full sec, so I was okay with it.

On my MS3 I run ~450ms delay at 12% increase, works very well. I don't see any reason why you'd need more than 1 second of delay with the expection being Greg G and his throttled SC.



BTW, that took a lot of head scratching last night, i kept thinking my DMM was failing, as sometimes I'd check the output and it wasn't grounding, then I'd try it again and it would be, and remove the ground as soon as I'd remove the input. Finally, it hit me that there was a huge delay in the output, where I could count to 20 and the DMM would start beeping.

Hopefully you have the fixed code for seq. inj. as I have another unit handy that I want to load this on, but he's running seq.

Greg G 10-20-2011 10:32 AM

No I'm good with a ~0.33 sec delay (status4 value of 1), and 13% adder. Weird that you get 1sec per status4 unit, I measured 0.33/unit.

Braineack 10-20-2011 10:39 AM

That acutally might be closer to what I saw. I left it on "1", and like I said, it was a touch faster than a full second. In fact, yes now that you mention it, I counted like 10 seconds when I had it set to "20".

I was just confused when I read the docs and it said "20" should be 2 seconds.

My suggestion would be if possible to be able to set it in milliseconds like the ms3 firmware.

Greg G 10-20-2011 11:05 AM

I noticed that at different idle adder values, the time value for a unit of status 4 changes ever so slightly. Not enough to make a big difference, but there nonetheless.

Could you please post a pic of the setup window for the AC idle up in ms3? I saw one before but I can't find it. I seem to recall seeing some sort of 'taper off' setting. Thanks :)

Braineack 10-20-2011 11:11 AM

looks pretty much like the ms2 one:

select input|output
adder duty
adder delay (0 to 1000ms)
rpm target increase
and tps to disable above X%

gslender 10-20-2011 04:03 PM


Originally Posted by Braineack (Post 785883)
I loaded your v3 code on a DIYPNP last night, works as expected but for one caveot -- the delay on status 4. When set to 20, the delay was 20 seconds, when set to 10 the delay was ten seconds. I left it at 1 which seemed to be a good delay, seemed a touch quicker than 1 full sec, so I was okay with it.

On my MS3 I run ~450ms delay at 12% increase, works very well. I don't see any reason why you'd need more than 1 second of delay with the expection being Greg G and his throttled SC.

I wish the MS3 source was available to look at...but either way I'll look at ways of improving resolution and accuacy of the timer.



Originally Posted by Braineack (Post 785883)
BTW, that took a lot of head scratching last night, i kept thinking my DMM was failing, as sometimes I'd check the output and it wasn't grounding, then I'd try it again and it would be, and remove the ground as soon as I'd remove the input. Finally, it hit me that there was a huge delay in the output, where I could count to 20 and the DMM would start beeping.

Lol... Sounds like someone needs to RTFM...:rofl:


Originally Posted by Braineack (Post 785883)
Hopefully you have the fixed code for seq. inj. as I have another unit handy that I want to load this on, but he's running seq.

Nope, still not released.... Have a read and plead the case on the MSEXTRA forums.

Braineack 10-20-2011 05:01 PM


Originally Posted by gslender (Post 786040)
Lol... Sounds like someone needs to RTFM...:rofl:

hey you wrote it. it clearly says 20 = 2sec.

when 20 = like 9-10sec.

gslender 10-20-2011 05:58 PM


Originally Posted by Braineack (Post 786053)
hey you wrote it. it clearly says 20 = 2sec.

when 20 = like 9-10sec.

I was referring to your post above where you didn't realise there was a huge delay between when you ground the input and the DMM beeping from the output - I reads like you didn't even know there would be a delay as I would have thought it would only take you 1 try (and not much head scratching) to figure out that the delay is based on the value.

My code is based on what is written in the source re an existing MAPdot timer, and it should be counting roughly around every 100ms...or tenth of a second, so I'll have to review that to make sure indeed I've got that right.

Braineack 10-20-2011 06:36 PM

(Posting from my phone.)

Yeah I was expecting a very short delay...not 10 seconds worth.

I used "1" and its a good half second delay.

Greg G 10-20-2011 07:51 PM

Yeah maybe there is some more smoothness to be had by increasing the resolution 10x. Though getting it to count in tenths of a second would be ideal. :bowrofl:

Asx 10-20-2011 08:50 PM


Originally Posted by Braineack (Post 785758)
yes, hence the line about the protection to the processor. if you accidentally somehow get 12v on that line, nothing will happen.

if you run straight to pe1 and get 12v to that, the cpu will fry instantly.

maybe my shit is bananas, but on my NB1 (99), 1P (Signal from A/C switch) goes to 12v if the A/C button is on but the fan is off.
Heads up.

Braineack 10-20-2011 09:02 PM

oh yeah. actually, someone found that out the hard way.

input circuit is a must.

gslender 10-21-2011 03:24 AM


Originally Posted by Asx (Post 786097)
maybe my shit is bananas, but on my NB1 (99), 1P (Signal from A/C switch) goes to 12v if the A/C button is on but the fan is off.
Heads up.

Well, if it floats from GND to 12V, then I'm confused how you'd ever be able to trigger any input... what do you look for? and wouldn't it short in that case?

In either case, yes having some protection for PE1 (eg using the input circuits) would be a good idea.

G

Asx 10-21-2011 02:24 PM

I'm not entirely sure of what you're saying.

If AC button is on and Fan is set between 1-4 speed, then 1P goes low
If AC button is on and fan is off, 1P goes 12v
If AC button is off and fan is off, then I'm not entirely sure what happens I'd have to go over the schematic again.

I was assuming, by DIY's description of the input circuits on the DIYPNP that the output would be 5v as long as the input was not grounded, and grounded out when grounded in. It does make me nervous that I can't see a schematic of it though. I'm not good enough at electronics to try to reverse engineer the input circuit.

I would assume that a simpler way to condition the 1P signal would be to use a diode to cockblock +12v and a pull-up to 5v to keep the pin from floating

Then I have Wled (or maybe ALED? can't remember) running to Input 1 in with R14 removed so it won't pull the output (a/c fan and clutch relays) to 5v to the when the input is high.
this is a little silly, but I was running low on jumper wire and I don't need the extra input circuit. Again, I'd feel better if I had the schematic for the input circuits.
EDIT: Actually, I think I'll just pick up some jumper wire at ratshack as I trust the IPS022g a lot more than the pn2222a for driving a pair of relays.

Greg G 10-21-2011 03:42 PM

Ok, so let me get this clearly stated:

Pe1 and pe0 can only accept a 0-5v signal?

So with my input 1 circuit not having the r14 resistor, I am feeding it a 0-12v signal? It is working as is, but am I damaging something?

Asx 10-21-2011 06:26 PM

I beleive, without r14 the connection between your input 1 out and pe0/1 will just float when the the "in" isn't grounded. If that's true then you could have issues with pe0/1 going high/low randomly. Alledgedly. Maybe.
I think you should replace r14 or just use the otherinput circuit.

Think of it like this, the processor pins only understand yes or no, and without r14 in place you're giving it a dunno. It still works but sometimes the dunno might be more negative or more positive andthe processor just kind of guesses. With r14 in there you are giving it a firm yes or no

Again, I'm not cool enough to Totally reverse engineer the input circuits so this is based on my somewhat limited understanding.

But no you aren't showing it 12v. If you did, it would let the magic smoke out

Greg G 10-21-2011 06:34 PM

Ok I think I saw that. Once, I turned off the AC switch, and it didn't turn off till about 3 seconds later. I went "WTF was that?" But it never happened again...

gslender 10-21-2011 07:01 PM

You don't need to use the input circuit to drive pe1, but it certainly is easy if you do as it avoids you having to add something (diode) to protect from 12v live shorts and a pull up to ensure it can't float when not switched to gnd.

From the DIYAutotune docs...

The circuits marked Input 1 and Input 2 are general purpose on/off inputs, with a buffer circuit to protect the processor. They are designed for ground triggered inputs, but with some protection for the processor if you accidentally connect them to 12 volts. The output is 5 volts when the input wire is disconnected, 0 volts when the input signal is pulled to ground.
I've finally decided that this weekend I'm going to produce a wiring guide/diagram that will accompany the next release - this way folks with a DIYPNP kit can simply follow and get it right.

Greg G 10-22-2011 05:54 AM

Well I moved it to input 2 circuit. Works the same, more peace of mind :)

bearda 10-23-2011 04:15 PM

I loaded everything up on Friday and am really liking the idle up feature. I've been fighting with the lightweight flywheel and AC causing the car to stall for so long it FINALLY feels like I don't have to worry about when the AC is engaged anymore. Thanks a ton. I'm waiting to do any extensive testing unit the build with the sequential injection fix is ready, but now that 3.1.4 has been release I'm hoping that's no too far away.

Greg G 10-23-2011 05:36 PM

Great to hear it works with a lightened flywheel. I was holding off on installing my Toda fw because of the droop issue. Could you post a log? :)

The next version will have even more refinements to the AC code ;)

gslender 10-24-2011 08:00 AM

Update 24 Oct 2011 - released ms2extra_3.1.4_idleup_v5
* Fixed timer to now closely match 10th second status4 counting.
* Migrated code to new 3.1.4 beta firmware.

Get it fresh from here
http://www.msextra.com/forums/viewto...p?f=91&t=42485

Braineack 10-24-2011 08:36 AM

Of course you update after I left for work, with a DIYPNP still on v3 in a box ready to ship in my car...

gslender 10-24-2011 08:38 AM

I'd add a silent-box-opening-install feature if I could .... sorry.

G


All times are GMT -4. The time now is 12:11 PM.


© 2024 MH Sub I, LLC dba Internet Brands