Estimating O2 transport delay

For discussing B&G MS-I/MS-II set-up and tuning of fuel parameters (including idle valves, etc.).
Forum rules
Read the manual to see if your question is answered there before posting. Many users will not reply if the answer is already available in the manual.

If your question is about troubleshooting, configuration, or tuning, you MUST include your processor type (MS-I or MS-II) and code version in your post. If your question is about PCB assembly or modifications, you must also include the main board version number (1.01, 2.2 or 3.0). For tuning/troubleshooting questions, please attached a datalog and your MSQ file to your post.

If you have questions about MS1/Extra or MS2/Extra code configuration or tuning, please post them at www.msextra.com Such questions posted here will be moved to: a temporary MSextra sub-forum, where they will be removed after 7 days

The full forum rules are here: Forum Rules, be sure to read them all regularly.
Post Reply
142 guy
MegaSquirt Newbie
Posts: 20
Joined: Thu Aug 13, 2015 10:21 am

Estimating O2 transport delay

Post by 142 guy »

I have been wanting to do a little more refining of the operation of the O2 sensor in closed loop operation on the Megasquirt II installation on my 1971 Volvo B20E. Right now, I am just using the proportional gain feedback loop with a gain of around 20% or 30%. Unless the operating conditions are spot on for the Ve value in the fuel table, this generally results in some steady state error between the target value for AFR and the actual AFR achieved. Turning up the proportional gain setting can reduce this steady state error; but, can also lead to oscillations in the loop which can drive the AFRs to some pretty extreme values under the right operating conditions. I have thought that adding some integral control action might reduce the steady state error that exists between the target AFR and actual AFR.

In the MSII code, when you add integral control action, you are given the opportunity to add in transport delays for the O2 loop. The transport delay presumably being the time from when the injector pulse width changes until the time you measure a change in AFR as input to Megasquirt (so it includes the intake process, combustion process, exhaust transport and the O2 controller time delays). I say presumably as the Mega Manual description of the O2 feedback tuning loops is somewhat abbreviated. The Mega Manual describes the transport delays as part of a Smith Predictor algorithm; but, does not go into any detail about the implementation of the algorithm and I have not had the cajones to go ploughing into the source code to confirm what it is actually doing. I also presume that you could set the transport delays to zero; but, that might not be wise depending on how the algorithm is implemented.

I decided to take a crack at measuring the transport delays on my B20E. For the record, I have an IPD header on the B20E with a wideband O2 sensor installed in the adapter between the end of the header and the start of the exhaust system. I am using an Innovate LC1 controller with the factory default settings.

I attempted to measure the transport delay by logging the engine operation and looking for fairly sharp transitions in the fuel PW and matching transitions in the AFR value coming into Megasquirt. The Smith Predictor time delay algorithm as implemented in Megasquirt is a function of engine load, the proxy for engine load being the value 120,000 /( (engine MAP) x (engine RPM)). The total transport delay is

Td = Tfixed + Tvariable x 120,000/(MAP x RPM)

Because the variable component is a function of MAP and RPM, it would be desirable if MAP and RPM did not change during the measurement. This is not too hard to do at idle. I dropped the TPSdot threshold on my acceleration enrichments way down and cranked up the enrichment adder for the test. This allowed me to initiate a fairly significant transition in fuel PW by just tapping the throttle pedal lightly. Because the MAP and engine speed don’t change much with the small tap, these variables remain steady and it is fairly easy to pick out the transition in the fuel PW and O2 feedback signal. This works for the engine at light load; but, not so well (or at all) with the engine under load. The car really has to be driving to get ‘under load’ values. You can still initiate a transition in fuel PW by altering the throttle opening quickly; however, the transitions don’t tend to be as well defined in the data logs and the RPM and MAP change more than in the tests at idle speed, so you have some decisions to make as to what values from the data logs do you use for the MAP and RPM values. Do you use the values at the start, mid point or end of the transition and do you key the MAP values to the transition in the fuel PW or the transition in the AFR signal. For consistency and without implying that this is correct, I recorded the MAP and RPM values that corresponded to the start of the transition in the fuel PW. The raw data from all of my measurements from my data logs is below. The values in the left columns are the time stamps for the start of transitions for the fuel PW and the AFR value with the time delay being the difference between those two values. The columns on the right are the MAP (kPa) and RPM values at the time of the transition and the calculated value for 120,000/(MAP x RPM) at the transition.

O2 correction was turned off during most of the tests; however, I don't think this particularly matters as I was just looking for the initial event transitions. Where I ended up in terms of engine operation didn't matter.

Image

The transport delay function in MegaSquirt being a linear function, I did a least squares regression on the measured time delay values versus the engine load measure values. This gave me the following values:

T fixed = 0.068 sec
Tvariable = 0.1405

The previous table also has the calculated values of time delay for the various engine load values based upon the least squares fit. I plotted the raw values of measured time delay versus engine load along with the line predicted by the least squares fit. That graph is as follows:

Image

The data is pretty scattered and I only have 14 events that I have looked at (I have logs of a lot more if needed). Given the data scatter, that is probably a pretty small data set from which to extract quantitative values. I think the scattering reflects the difficulty in trying to pick out the fuel PW and AFR transitions in what can be a noisy signal and taking a guess at the MAP and RPM values that apply to the transition. I have yet to try implementing the time delays in the Megaquirt O2 feedback control loop. Before doing this, I was curious as to whether anybody has tried to measure the transport delay in the control loop and if so, what technique did you use and what did your transport delay coefficients look like (realizing that they will be different for different engine configurations). I am curious as to whether my values seem in the ball park or is just a bunch of noise.
Post Reply