MS2/extra beta 3 (20070706)

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

Moderators: jsmcortina, muythaibxr

muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

MS2/extra beta 3 (20070706)

Post by muythaibxr »

Fixed in this beta are (at least)

1) Distributor mode should not have any more odd problems
2) Closed loop idle contains fixes from one-off s19
3) Use page 3b instead of 3a in hopes that people having problems with 3a won't anymore.
4) ini fixes. I can't remember what for, so hopefully James chimes in on this one.

I'm sure there were other fixes, but I'm drawing a blank on the other things that James fixed. I'm sure he'll chime in and add those things to this thread.

I still have to fix any bugs listed in the bugs thread.

Here is the s19

http://www.msextra.com/ms2extra/files/b ... 70706b.zip
Last edited by muythaibxr on Sat Jul 07, 2007 8:36 pm, edited 2 times in total.
jsmcortina
Site Admin
Posts: 39619
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

I changed the False trigger calculations to calculate right - I'd made a mistake in the code previously. So hopefully now "simple" might actually work.
The ini file changes hide those options when not running in distributor or EDIS as they aren't used.
Likewise next pulse tolerance is only used in EDIS.

I changed the "1st deriv prediction" so it is only selectable when running distributor. In other modes it could cause major problems.

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".
User avatar
Maglin
Experienced MS/Extra'er
Posts: 243
Joined: Wed Jun 29, 2005 1:48 am
Location: Wichtia, KS

Post by Maglin »

IAC stepper still isn't working. I also tried the code dev section and setting the IAC steps their to see if I could get a change. Nothing. So currently the IAC is stuck at the start value. Even rebuilt the MSQ from scratch just to be sure it wasn't the MSQ upload causing problems.
Jeremiah
93 5.8 LX Mustang - MSIIextra
92 Eagle Talon TSI AWD Turbo - MSIIextra
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

We didn't do anything to fix IAC stepper. Anything we do for that will be in the next beta.

Ken
mattd860
Experienced MS/Extra'er
Posts: 226
Joined: Mon Nov 13, 2006 10:59 am

Post by mattd860 »

Hey I noticed there is two VE table # 3's in the Extended menu under table switching. What is the 'second' ve table 3 for?
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

One is 16x16, one is 12x12... you can select either.

Also, anyone who has downloaded the version above, redownload from that link, I missed committing a couple of fixes before doing that release, so the "b" release has those fixes.

Ken
User avatar
Maglin
Experienced MS/Extra'er
Posts: 243
Joined: Wed Jun 29, 2005 1:48 am
Location: Wichtia, KS

Post by Maglin »

A few minor things I've found. MAT based curve generator isn't working. ASE tapper curve generator isn't working. The ASE table generator will revert it back to the default settings. It was just way to high and I find it easier to use the generator to get it in the ball park and then tweak it from their. Only things I've found so far.

I'm not to sure if this is a bug or not. EGO after any burn doesn't work for about 20-30 seconds. It will go back to 100% and stay their until it starts to work again. This is only stim tested so far.
Jeremiah
93 5.8 LX Mustang - MSIIextra
92 Eagle Talon TSI AWD Turbo - MSIIextra
jsmcortina
Site Admin
Posts: 39619
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

Maglin wrote:IAC stepper still isn't working.
Can you confirm the last version that was working? I likely broke something trying to include Al's 2.8 changes.

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".
User avatar
Maglin
Experienced MS/Extra'er
Posts: 243
Joined: Wed Jun 29, 2005 1:48 am
Location: Wichtia, KS

Post by Maglin »

The 6/10b alpha is the newest one that works. After that one it's broken. Just loaded it up. 6/17 wasn't working for me.
Jeremiah
93 5.8 LX Mustang - MSIIextra
92 Eagle Talon TSI AWD Turbo - MSIIextra
jsmcortina
Site Admin
Posts: 39619
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

Thanks for the information.

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".
jsmcortina
Site Admin
Posts: 39619
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

The other thing I added that made it into this beta is the ability to see the raw ADC value from ADC6,7. This allows things like EGT logging.

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".
mattd860
Experienced MS/Extra'er
Posts: 226
Joined: Mon Nov 13, 2006 10:59 am

Post by mattd860 »

Ken. I think there still might be a problem with the idle code although you can see some screens shots of my setup below and let me know if you see any obvious errors (like backwards tables or something). The bump and cold start problem seems to have been fixed. I'm not having a problem with that at all anymore. However, there seems to be a problem idling down after traveling on the highway for long periods of time.

I drove a steady 75 for about 30 minutes this morning and then on my way back home around noon. Before driving, I did let it idle for about 30 seconds. When I exited the highway to the stop sign at the end of the ramp, the idle remained very high (about 1800). 1800rpms is way above the threshold for warm-up temp (740rpms + 3% duty cycle which only equals about 1000 rpms and I set my threshold to 600rpms). So obviously PID can't take over. But why would it remain so high? It was idling fine before the longer trip and I even had to drive a few back roads to get to the highway which involved stop and go, and the idle was fine then.

It seems that after a while, the 'last known' becomes' the max DC because when driving on the highway, sometimes I lift my foot of the pedal completely for decelerating or coasting so it sees the TPS below the threshold but rpms at 3000-3500rpms. So because the rpms are way above the threshold, PID never starts however, it thinks the last known is now somewhere between 3000-3500rpms but because it's restricted by the max DC, it just goes up to that and stays there because it’s not allow to go higher.

Did I explain all that clearly enough? Sometimes I suck as explanations.

For me, I would love the 'last known' DC to just be completely done away with and have a constant (the min DC for PID) plus the adder to be what it will always idle down to. Then when the rpm threshold is met, the countdown will start and after it ends, PID will take over and further decrease the DC. PID should never have to increase the DC from there so the constant + adder should always be higher than the target rpm even for max load (A/C, etc). So even if the AC is never on, the DC adder should always be set to add the appropriate amount 'just in case'. Then PID will scale it either down to the min DC or down to the target RPM

Or just make the last know DC unable to be reset until the rpm threshold is met. I think now it might be based on how long the valve is active after the TPS threshold is crossed.

Image

Image

Image
Last edited by mattd860 on Sat Jul 07, 2007 11:23 am, edited 2 times in total.
pettaw
Helpful MS/Extra'er
Posts: 93
Joined: Fri Apr 29, 2005 6:56 am
Location: London, UK

Post by pettaw »

I think I'm having similar problems to you mate, so its not just you. I'll have another play tomorrow and try and get a log of it doing it as well as an msq.
Keithg
Super MS/Extra'er
Posts: 2413
Joined: Sun Mar 06, 2005 9:15 am
Location: Chicago, IL, USA
Contact:

MS2/extra beta 3 (20070706)

Post by Keithg »

My guess is that the MAT was high causing a higher last_idleDC in traffic. When you were on the hwy, MAT cooled down and lastDC+adder pushed rpms above the threshold. Once MAT warmed up again in stop and go traffic, it was fine b/c the rpms were below the threshold.

I feel that the adaptive nature of using 'lastidleDC' is 'good' in that it will compensate for A/C on and during warmup. In the winter, I feel we will revisit this as the 5-10% lower idleDC (air requirements) will amplify this. Other than what I have suggested, I do not know how we may allow for it to idle down if last_idle_DC gets out of sync with the needs of the engine except to keep increasing the rpm threshold. In my case, I am at 500 as an adder with a 900 rpm warm idle.

KeithG
I drove a steady 75 for about 30 minutes this morning and then on my way back home around noon. Before driving, I did let it idle for about 30 seconds. When I exited the highway to the stop sign at the end of the ramp, the idle remained very high (about 1800). 1800rpms is way above the threshold for warm-up temp (740rpms + 3% duty cycle which only equals about 1000 rpms and I set my threshold to 600rpms). So obviously PID can't take over. But why would it remain so high? It was idling fine before the longer trip and I even had to drive a few back roads to get to the highway which involved stop and go, and the idle was fine then.

muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

Yeah, sounds like when you were on the highway, the "last DC + adder" became enough to keep you above the threshold. I think you could probably tune this out by making the rpm adder higher...

I'm starting to think that instead of CLT affecting the "adder" the IAT should.

I'm going to have a look around at anything I can find for the way the OEMs do it, and see what I can find from them.

In the meantime, I think just increasing the RPM adder a bit will solve the problem. I'd increase it enough that it's always higher than 1800.

As Keith said, I think without having a switch input for AC, there's no way the MS can know the AC is on (so no way to add an "AC adder"), so the only way to do it then is by using the last DC.

The last DC is only saved when the PID loop is entered as well, so there's no way it's getting set when you're above the rpm threshold.

Ken
mattd860
Experienced MS/Extra'er
Posts: 226
Joined: Mon Nov 13, 2006 10:59 am

Post by mattd860 »

muythaibxr wrote:Yeah, sounds like when you were on the highway, the "last DC + adder" became enough to keep you above the threshold. I think you could probably tune this out by making the rpm adder higher...

In the meantime, I think just increasing the RPM adder a bit will solve the problem. I'd increase it enough that it's always higher than 1800.
I could easily do this but it kind of defeats the purpose of having the PID loop start controlling the IAC at an rpm threshold. Unless I make the PID delay really high, there are plenty of circumstances when the PID delay will end by the time RPMS fall from 2000+ to 800 if I decelerate in gear. And having a PID delay set very high will be annoying when in dense traffic or driving around large parking lots. Not to mention the fact that for me to resolve this problem via a tune fix, I will need to set my rpm threshold to about 1500rpms. So when the engine is cold, the new threshold will be 2500-3000, which is ridiculous and even a PID delay of 15 seconds won't be good enough. For some reason when traveling consistent long distances, the 'last known' is being altered and this must be fixed. If there's any way to prevent the 'last known' DC from ever going above the previous 'last known' DC if the rpm threshold has not been crossed, I think this will be a simple solution. So if 'last known' DC is 31%, it will never get reset until that RPM threshold was crossed. So if the threshold was low (about 500), then the threshold will almost never get crossed when cruising on the highway.

I understand you said "in the meantime" so for now I will increase the rpm threshold but only in hope of better code down the road.
muythaibxr wrote:I'm starting to think that instead of CLT affecting the "adder" the IAT should.
I don't know... while I can see an advantage or two about this, I personally don't think it should be the main determining factor for the target rpm. And what Keithg said doesn't really make much sense regarding my problem because MAT temp may have cooled a bit on the highways, they did not cause coolant temps to drop below the 160 and 140°F marks when the target is changed. So the duty cycle should not have been changed due to different temps. My car runs around 190-200°F and the highest temp on the table is 160°F. So as far as it is (or should be) concerned, at any temp after 160°, the target will be 740rpms.

Also, MAT varies way too much even between the same two vehicles. You have to assume that if most of us have gone as far as installed a custom tunable ecu, that we have also custom designed a non stock intake. For the time being, my intake is unshielded and just sits right under the hood. So the MAT temp can be much hotter than the engine and can heat up much quicker especially on hotter days. Or much cooler on cool days. MAT plays a huge role in engine operations but CLT is much more important as well as consistent.

muythaibxr wrote:As Keith said, I think without having a switch input for AC, there's no way the MS can know the AC is on (so no way to add an "AC adder"), so the only way to do it then is by using the last DC.
An AC switch is not necessary and I was never an advocate of this. I think the DC adder should always account for the AC being on even if it isn't. So when the adder is added to a constant or the last known DC, the total DC will recover the idle whether the AC is on or not. Then PID will pull the DC down after the timer ends. If the AC is not on, then before the PID delay ends, the idle will be slightly higher but we're not talking more than 100-300rpms, which is nothing. And with the above fixes, the timer doesn't need to be on that long at all - 2-3 seconds max. If PID is tuned right, it will pull the rpms down until the target is met or just go to the min DC.
muythaibxr wrote:The last DC is only saved when the PID loop is entered as well, so there's no way it's getting set when you're above the rpm threshold.
Ken
Like I said above, somehow its getting confused then or maybe the PID loop is somehow activated when above the rpm threshold because idle control goes from perfect to very high over the course of 20 minutes while traveling above the threshold.
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

mattd860 wrote:
muythaibxr wrote:Yeah, sounds like when you were on the highway, the "last DC + adder" became enough to keep you above the threshold. I think you could probably tune this out by making the rpm adder higher...

In the meantime, I think just increasing the RPM adder a bit will solve the problem. I'd increase it enough that it's always higher than 1800.
muythaibxr wrote:I'm starting to think that instead of CLT affecting the "adder" the IAT should.
I don't know... while I can see an advantage or two about this, I personally don't think it should be the main determining factor for the target rpm. And what Keithg said doesn't really make much sense regarding my problem because MAT temp may have cooled a bit on the highways, they did not cause coolant temps to drop below the 160 and 140°F marks when the target is changed. So the duty cycle should not have been changed due to different temps. My car runs around 190-200°F and the highest temp on the table is 160°F. So as far as it is (or should be) concerned, at any temp after 160°, the target will be 740rpms.
You misunderstand... instead of making the dashpot adder based on the rpm target, which is based on CLT, I'm going to make the dahspot adder based on MAT. The idea being that Higher MAT requires a higher dashpot, but after you drive for a bit, and the MAT cools off, you don't need as high of a dashpot.
Also, MAT varies way too much even between the same two vehicles. You have to assume that if most of us have gone as far as installed a custom tunable ecu, that we have also custom designed a non stock intake. For the time being, my intake is unshielded and just sits right under the hood. So the MAT temp can be much hotter than the engine and can heat up much quicker especially on hotter days. Or much cooler on cool days. MAT plays a huge role in engine operations but CLT is much more important as well as consistent.
I don't think CLT has a huge role in how much of a dashpot adder you need. I've seen MAT make a large difference on idle speed as well as AFR.

I think that if you understand the idea (which I think you misunderstood before) you'll agree.
An AC switch is not necessary and I was never an advocate of this. I think the DC adder should always account for the AC being on even if it isn't. So when the adder is added to a constant or the last known DC, the total DC will recover the idle whether the AC is on or not. Then PID will pull the DC down after the timer ends. If the AC is not on, then before the PID delay ends, the idle will be slightly higher but we're not talking more than 100-300rpms, which is nothing. And with the above fixes, the timer doesn't need to be on that long at all - 2-3 seconds max. If PID is tuned right, it will pull the rpms down until the target is met or just go to the min DC.
What works for you might not work for everyone. I've seen rotary engines dip significantly when the AC is turned on, and then require a MUCH higher DC on the idle valve with the AC on... like 10-15% more. The 100-300 rpms is a very bad assumption. The last known DC is _not_ going anywhere, as it is totally necessary for some people. The main problem we need to solve here is why, after driving for a bit, did the same last-known DC + adder that works in city driving cause the idle to be so much higher after a highway run.
Like I said above, somehow its getting confused then or maybe the PID loop is somehow activated when above the rpm threshold because idle control goes from perfect to very high over the course of 20 minutes while traveling above the threshold.
I don't think it's getting confused. there's absolutely no way for it to get confused the way you're thinking. If RPMs briefly dropped to 0 at highway speeds for some reason (could only happen if the wheel decoder briefly lost sync or something like that), and the code somehow activated the PID loop, the duty would just drop down to the minimum and sit there while you're driving, and most likely, after letting off the gas again, your engine would stall.

One of the tests I did during my testing was meant to simulate highway driving. What it did was hold the rpm above the threshold, and the TPS above the threshold for several minutes (I believe it was for 20-30 minutes), then when I came back, I tried repeatedly dropping TPS below the threshold (to make sure that the duty didn't get progressively higher each time). Then I dropped the rpm below the known threshold, and the PID loop was entered, and everything worked fine.

Most likely what is happening is exactly what keithg said, and I'm now considering... the dashpot adder needs to be higher when MAT is higher, and lower when MAT is lower.

In the meantime, before I make the above change, you should be able to get the behavior you're looking for by increasing the RPM adder a bit. I believe that the duty you're seeing when letting off the throttle after a long highway run is probably the same as the one you're seeing in the city, and some other factor (MAT? Oil viscosity? I've seen both affect idle speed), so I'm going to try to account for that.

Ken
mattd860
Experienced MS/Extra'er
Posts: 226
Joined: Mon Nov 13, 2006 10:59 am

Post by mattd860 »

muythaibxr wrote: You misunderstand... instead of making the dashpot adder based on the rpm target, which is based on CLT, I'm going to make the dahspot adder based on MAT. The idea being that Higher MAT requires a higher dashpot, but after you drive for a bit, and the MAT cools off, you don't need as high of a dashpot.

I don't think CLT has a huge role in how much of a dashpot adder you need. I've seen MAT make a large difference on idle speed as well as AFR.

I think that if you understand the idea (which I think you misunderstood before) you'll agree.
Yeah before I though you meant make the target rpm based on MAT. I also understand what you are saying about making the dashpot adder based on MAT but I still don't think that will solve my problem. You said that a high MAT requires a higher adder but a low MAT requires a lower adder. But my adder for anything above 160°F (CLT) is only 3%DC. How much lower can it go to 'fix' the problem??? The problem seems to only occur when MAT supposedly drops so based on what you said, I will need a lower adder than when at higher MAT temps. So should the new adder possibly be a negative number (e.g. -10% DC)? Because that's the only way it will possibly fix the problem.
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

Actually, after thinking about this some more I came up with an idea, and verified it with what the OEMs do.

Basically, the problem is that there are certain conditions where normal means of entering the PID loop doesn't work. For example, after your long cruise, even though the duty is correct given your settings, it's too high for the current conditions, so RPM never goes below the threshold, and the PID loop is never entered.

The idea I came up with is the following:

Normally, the conditions for entering PID control are:

1) TPS at closed position (below threshold).
2) RPM below threshold
3) PID timer expired

Sometimes, we can be "locked-out" of the PID loop, causing PID to never be entered.

So, lockout detection will be added:

If RPM change/sec is below a certain amount (user settable) for a certain amount of time (also user settable), override the normal conditions, and go into the PID loop. I came up with this part on my own, but confirmed it with the OEM document.

Also, the OEM document I looked at specified that one must also check for engine braking once the above RPMdot condition is met... by seeing if MAP is below a certain level. The assumption being that if MAP is really low, then the user is engine braking. This threshold will also be user-settable. IT must be ABOVE the "engine braking" MAP, but BELOW the MAP at idle.

Adding this lockout detection will also allow me to simplify the code a bit, and remove some settings that aren't really necessary (dashpot adder will likely be made a single setting instead of a curve).

Ken
mattd860
Experienced MS/Extra'er
Posts: 226
Joined: Mon Nov 13, 2006 10:59 am

Post by mattd860 »

Wow this sounds really cool. So if TPS is below a threshold, MAP is above a threshold, and the rpms are not changing over time, then PID will be activated?
Post Reply