Monday, December 8, 2014

Spark Map and Tune

Spark Map and Tune

Basically you want to tune spark on a dyno, and give someone that it is not his first time tuning spark to tune it for you...

How to look on a spark map:


Spark can be dangerous  to your engine, if knock knock on your door your engine could go byebye.
Because of that, if you're a beginner at tuning, I suggest you give the spark tuning to someone experienced - on a dyno.

I understand that my high rpm/kpa cells can use less deg, but this is knock free dyno tested (200whp)

Next:
- TPSdot Uses %WOT
- Getting ready for dyno
- MLV - MegaLogViewer
- TS - TunerStudio dashboards

Closed Loop Idle Target RPMs & PID tune

Hey !

Closed Loop Idle Target RPMs
Closed Loop Idle Target RPMs is where you setup your CLT to RPM curve.



This is my curve, 1600rpm when cold, down to 900rpm when hot.

Every time you start your engine after you set up this curve, pay attention to the rpm, and adjust the curve to your liking.


Closed Loop Idle PID Gains tune




From: MSEXTRA Manual
  • Proportional Gain This setting controls the Proportional Gain of the PID algorithm. Setting this higher will result in a larger immediate response to changes in RPM. Setting this too high can result in unwanted oscillation of RPM.
  • Integral Gain This setting controls the Integral Gain of the PID algorithm. This is the PID setting used to actually make the RPM meet the target RPM. Setting it too low will cause the RPM to never reach the target. Setting this value too high will result in unwanted oscillation of RPM.
  • Derivative Gain This setting controls the Derivative Gain of the PID algorithm. It can be used to help dampen the effects of the Proportional and Integral settings. It is usually not necessary for good control of Idle speed. It is recommended that this is left at 0%.
PID Tune
  1. Zero all the gains - Set all the gains to 0%. This is so that the effects of tuning the I-term in the next step are not confused with the effects of any other setting.
  2. Tune the Integral (I) gain - The Integral gain is the only term that controls whether the code actually reaches its target. Higher values for Integral gain will result in the code being able to get closer to the commanded target; however, a value that is too high will result in oscillation. The easiest way to determine a good value for the I term is to keep increasing it until oscillation occurs, then slightly lower it. If this value is increased to 200% without reaching a point where oscillation occurs, then the RPM with valve opened setting can be decreased as far as necessary, and the open duty/steps setting and closed duty/steps setting can be made further apart to make the PID loop more sensitive.
  3. Tune the Proportional (P) gain - After tuning the I gain so that the RPM reaches the commanded target without oscillation, the P gain can be tuned. The best way to tune this is to set it as high as possible without getting any oscillation. After setting this, try turning on the air conditioning or other accessories that normally lower RPM or increase load. When these accessories are turned on, the RPM should dip a bit then recover (the valve position should increase significantly). Using longer PID ramp to target times can also make it so that when the PID algorithm engages, a higher P gain can be set without causing oscillation.
  4. Tune the Derivative (D) gain - For most users, use of the D gain should not be necessary. It substantially dampens the response of the loop.


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

Wednesday, December 3, 2014

A/C Idle Up

Hey ! let's roll...


A/C Idle Up




Very nice and helpful feature, that will rise the rpm just before engaging the A/C compressor in order to avoid the annoying rpm drop when A/C kicks in.

I use a DIYPNP version of MS.
My A/C is wired like that:
1K > Input1 IN > Input1 OUT > PE1

WLED > 1B&1G

Idle-up Duty Adder(%): How much PWM Idle valve % to add before A/C switched on.
Idle-up Target RPM adder(rpm): How much rpm to add to CLI Target Curve.


WLED is disabled here, it is only configured in the A/C Idle up menu as Idle-Up Output.

Next:
Closed Loop Idle
Idle Advance 


Monday, December 1, 2014

Over Boost protection and Rev Limier

Today: Protection.

Over Boost and Rev Limiter.

Over Boost Protection

Over Boost will save you from dangerously unwanted boost level.



Under boost control settings you can set the Overboost Protection.
You can choose between Spark or fuel cut, or both.
Then you set the max boost - in kpa - 200kpa = 14.5psi = 1bar of boost.
Hysteresis is the kpa level below max boost where spark/fuel are re-enabled.

Set it right, it's important, especially when playing with boost controllers, actuators springs or other boost altering devices.


Rev Limiter

We all know what a rev limiter is, but here you can set a "smart" rev limiter.
I use "CLT based" rev limiter in order to limit rev on high\low CLT.



Lets go through the options:

HARD REV LIMIT:
Hard rev limit(RPM): RPM limit - 7200rpm for a stock internals miata - same as stock ECU.
Soft Limit Zone / Hysteresis(RPM): RPM needs to drop by this much from max RPM before fuel is re-enabled.

COOLANT TEMP LIMITER
Rev Limiter CLT Based: You can choose between normal rev limiter - only max rpm, or you can choose CLT based, that will let you use rev limiter in a more creative way.
Rev Limit TPS Bypass(TPS %): At what TPS % the rev limiter settings are ignored.
I recommend setting it close to 100% in order to allow emergency WOT.
RPM When In TPS Bypass(RPM): The new rev limiter when in bypass TPS %.
I think 7200rpm is good here also.

For all the rest of the options, no extra info - read the tool tip.


More to come:
- High resolution AFR table.
- Idle advance
- A/C idle up
- Closed loop idle
- Spark map
- Required Fuel
- Getting ready for dyno