Thursday, December 4, 2014

Closed Loop Idle

Back to idle :)

Rev2 of this is post is available - check it out - new and improved !

Closed Loop Idle - Overview

CLI is a feature that intended to keep the idle steady and consistent regardless of  internal/external physical conditions change. (AFR, MAP, CLT, IAT etc')

In order to control a changing conditions environment you need dynamically changing mechanisms.

Dynamically changing mechanisms is a long and high name for:
- EGO - Dynamic fuel correction
- Idle advance - Dynamic spark correction
- CLI - Dynamic Air correction

When you can control fuel,air and spark - you are the master of your engine.

When you get all three tuned right - your idle will be very close/better to/then factory idle :)

After some time you run open-loop (PWM-Warmup) and all is good, meaning the idle valve is operational, you can get a relatively good idle and AFR, it is time to try CLI.

Let's dive in, put your swimsuit on.

Idle advance

Idle advance is dynamic spark correction.
It will try and help you keep a steady idle even when conditions change.
It does not keep idle by it self, it is responsible of the spark side of idle.




Idle Advance On: Adaptive - in order to prepare the ground for CLI (closed loop idle).
Apply As: Adder - an addition to spark map value.
Condition Is: CL PID - when CLI is active Idle Advance kicks in (if needed)

After you choose "Adaptive" and close the menu, you will have "Idle Adaptive Timing" enabled.
open it...




Can you see what I did there ?

If rpm drops for any reason, it will add timing in order to "help" the engine recover.

Update:

"Braineack" from Miataturbo forum pointed out that the "idle advance" curve should take care of over rpm situations, not only under rpm...

I think it should look something like this:


Added spark when under rpm and under spark when over rpm.

I use the first table (only under rpm correction, works good for me).

Closed Loop Idle 

CLI is dynamic air correction mechanism using PWM-valve.

PWM-valve allow air in the engine when the throttle is closed, gas paddle lifted.

CLI will automatically control PWM-valve in order to take care of air supply to the engine.

Change "Algorithm" to "Closed-loop"




Main CLI menu:



PID
proportional-integral-derivative controller (PID controller) is a control loop feedback mechanism (controller) widely used in industrial control systems. A PID controller calculates an error value as the difference between a measured process variable and a desired setpoint. The controller attempts to minimize the error by adjusting the process through use of a manipulated variable.

If you look carefully at the sub menus in this form you can see three sub menus concerning PID and one sub menu concerning CLI valve...


The first sub menu - "Closed Loop Idle Valve setting" has a little misleading name, this settings define the behavior of the valve when releasing the throttle paddle. 
When in open-loop. 
Eventually leading to idle.

So, in "Closed Loop Idle" settings you define IAC behavior when in open-loop (PID disabled) and for closed-loop (PID enabled).

I know it is a little confusing, but this is how it is...
A part of CLI settings is open loop IAC behavior - on its way to closed-loop.

The other three PID menus define the delay, behavior and activation values for PID operation.
We start at the first sub menu:

Closed Loop Idle Valve setting:
Idle Valve Close Duty(%): Remember "Output Test mode - Idle Valve" ? put the value you've found, here.
(max closed %)
Idle Valve Open Duty(%): same as above (max opened %)
Dahspot Adder(%): The amount of valve % to add when throttle is lifted. (getting ready for idle rpm)
Dahspot Decay Factor(sec?): How long will it take the adder above to decline to 0 - leaving CLI to follow regular CLITR (Closed Loop Idle Target RPM)
Use Last Value Or Table: "Use initial value table" the other option "use last value" did not work good for me.
Use CLT Or MAT In Table Lookup: I use CLT
Close Delay(s): How long will it take the valve to close when throttle is pressed.
Leave Valve Closed Above(rpm): as it says.
For This Number Of Seconds(s): as it says.

Next sub-menu:

Closed-Loop Idle PID Delays And Behavior
PID Delay(s): tool tip
Crank To Run Taper(s): How long to keep following  "Idle Cranking Duty/Steps" curve after engine start
PID Ramp To Target Time(s):  tool tip
PID Control Interval(ms): tool tip
PID Disable RPMdot: tool tip

Closed-Loop Idle PID Activation Settings
Idle Activation TPS Threshold(%): highest TPS that allow PID activation.
RPMdot Thershold(rpm/sec): RPM change speed, how fast the rpm change, close to idle or in idle it will be slow (30rpm/sec is slow)
Max Decel Load(%): Lowest MAP that allow PID activation, should be a little below idle MAP.
PID Lockout On Switch Active: If clutch switch is present you can use it here as CLI activator.
PID RPM Window Size (1=Off): tool tip(?)

Closed Loop Idle PID Gains
tool tips

Settings and settings...., let's talk about the whole CLI concept and what happens when.

When I was tuned to run PWM-Warmup (open-loop idle) I had the IAC (Idle Air Control) set to a specific (low) value for idle.

Goods:
- Easy to set up
- Works (sometimes)

Bads:
- Not dynamic - when the physical conditions for the engine change, it would not "care", it would just do the same (same IAC %) leading to oscillation, too low or too high idle.
- When the throttle is lifted and the clutch is pressed, the rpm run down pretty fast, the static IAC % will not be enough to "hold" and "stop" the rpm from taking a deep dive below desired idle...
When A/C is on, it is even worse, it can even lead to engine stall.

SO !

In order to make idle "smart" and sexy like factory idle, we must enable some auto correction features.

CLI - what happen when.
The first trigger that will make MS look into this menu and check what to do is: throttle lift.
When you lift your leg from the throttle MS is checking to see what IAC % to use in order to give the rpm a "soft" landing just before (=Dashpot Adder) idle (PID idle).

Ok ?

MS will find the answer in "Closed-Loop Idle Initial Values" - meaning, what IAC % @ what CLT/RPM.
I will address this table in a sec.

MS checks the CLT and the looks at CLITR (Closed-Loop Target RPM) to know what IAC % to use.
Next,
So, now the IAC is standing by opened, rpm is decreasing, MS checks for  Closed-Loop Idle PID Activation Settings, TPS is good, RPMdot will be good when the rpm will get close to idle range and Max decel Load will be here when the rpm has "landed" and  the engine is close to normal idle MAP (around 30kpa).

NOW ! PID takes control of the rpm following Closed Loop Idle PID Gains as behavior guidelines.

k ?

1. Throttle lifted
2. IAC % for RPM soft "landing"
3. RPM "landed"
3. PID conditions are met
4. PID controls idle
5. Throttle pressed
6. PID disabled
7. IAC closed

Good ? k !

Don't forget that all this is just the automatic air control for idle, automated fuel (EGO) and spark (idle advance) must be right on too.

Closed-Loop Idle Initial Values:
This is the default map values, it is good to start with, I think it will give a little high initial idle but it is great to start with.
After you see/feel that CLI is working, you can tune this little map.




How to tune it ? LOG !

You log a normal drive you take and check it out, you can find in the log what IAC % give what RPM (roughly)  put those numbers in this table, don't forget that @ low CLT the idle will need more IAC % then when high CLT (operation temperature).

This is my table:


MegaLog Viewer - MLV
If you want to check CLI status in MLV - if MS is in CLI or not, you can choose "status2", when it is 0 CLI is off, when it is 128 CLI is on.


When status2=128 it means that PID is enabled ! 
The whole IAC % landing the rpm is happening before that (every time you lift your foot from the throttle), so you can see in the log that the IAC% is up and status2=0 this is because PID is not active yet, but the IAC % is ready for the rpm...

k ?

Tuner studio
You can add a CLI indicator to TS - just remember it is just the PID activation indicator !




Next:
- Closed Loop Idle Target RPMs
- Closed Loop Idle PID Gains tune
- Spark map
- EGO in boost (?)
- Getting ready for dyno

8 comments:

  1. Very beautiful guide.
    very compliments

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. Hi do you know which port do i have to use to connect the pid (clutc o neutral) switch???

    thanks

    ReplyDelete
  4. If you want to use the clutch or neutral switch you need to connect it to a free input on the ECU.

    ReplyDelete
  5. it can´t posible because in the software you can´t choose the input so there is only one so i was searching in megasquirt forum and i found that the pin is PE0 but i want to be confident that the answere is correct.

    ReplyDelete
  6. You can use FLEX too, but what would you configure in Tunerstuido ? I don't think there is a way to configure natural or clutch switch...

    ReplyDelete
  7. I want to connect the signal but i don´t know what is the port, in tunerstudio you can´t choose and see the input information so i want to know where i have to connect it.

    ReplyDelete