Wide CL AFR Control w/ WB

Subscribe
Nov 4, 2008 | 05:33 PM
  #1  
I'm looking for wider control of the AFR in closed loop- a range of 16:1 to 11:1 using my LC-1's NB output. My thoughts follow this thread. I expect the resolution to be horrible, but as long as the AFR's within 1/2 a point I'll be happy. I want to get into closed loop as soon as the o2's warmed up. I also want to experiment with eliminating power enrichment mode to allow fueling correction at wot.

My concern is that the BLM/INT doesn't have enough range for the ecm to be able to reach extreme AFR's being that base fueling calc's are limited to whatever I have the stoich constan set at. One possible solution I came up with was allowing the ecm to stay in startup enrichment mode so I can manipulate the base fueling calc's into closed loop. Watching my datalogs it appears that the ecm can enter closed loop before the startup enrichment has expired, however I'm uncertain if the dispalyed target AFR or the stoich constant is being used. Clarification, please?

My other problem is how to deal with INT dealy vs error. It needs to be changed to deal with a much more linear response curve, but I have no idea where to start. Ideas? Comments? Am I dreaming? ('165 ecm w/ $32b)
Reply 0
Nov 5, 2008 | 12:58 AM
  #2  
Re: Wide CL AFR Control w/ WB
Well I tested my theory and the ecm will enter closed loop when startup enrichment is still in effect. So now I just need to figure out the response curve.
Reply 0
Nov 5, 2008 | 11:50 AM
  #3  
Re: Wide CL AFR Control w/ WB
Yes, then when the ECM goes into closed loop the startup enrichment is no longer used. The stoich constant is in use for the commanded AFR.

It would be better to use the true WB output instead of a simulated NB from the LC-1. Plug it into either of the MAP inputs and do an ADC conversion on it. Change the code so that it compares the commanded AFR with the WB AFR and adjusts the INT from that.

This would be instead of comparing the NB O2 with the O2 window values.

Now for the trick part, change the closed loop code area so that the commanded stoich AFR is really the value from the open loop AFR table. Need to also change the code so that it doesn't check the stoich constant to remain in closed loop.

In the code someplace GM puts a test of the current commanded AFR against the stoich constant from the calibration. If they don't match the ECM will drop out of closed loop. So be sure to disable that check.

The proportional gains will most likely need changing. As they are intended to cause the AFR to oscillate. The INT delays may need a little tweaking, the delay is mostly to deal with transport delay. Which is the time it takes between when the ECM changes the INT and that change is seen at the O2 sensor. (injectors need to fire with the new PW, chamber needs to intake, compress, burn, then exhaust the new PW, then travel down the pipe to the O2 sensor, then the O2 needs time to respond and report back).

This is basically a quick method of open loop WB control. It would be better to change how the prop gains work so that a better PID loop can be had. But getting the above working first makes it easier to do a better PID loop in the end.

Note that under WOT this can get dangerous. This is the main reason I never released the stuff I did. At a minimum you may want to set the code up so that fuel can only be added during WOT, never removed.

RBob.
Reply 0
Nov 5, 2008 | 01:23 PM
  #4  
Re: Wide CL AFR Control w/ WB
Quote: Yes, then when the ECM goes into closed loop the startup enrichment is no longer used. The stoich constant is in use for the commanded AFR.

It would be better to use the true WB output instead of a simulated NB from the LC-1. Plug it into either of the MAP inputs and do an ADC conversion on it. Change the code so that it compares the commanded AFR with the WB AFR and adjusts the INT from that.

This would be instead of comparing the NB O2 with the O2 window values.

Now for the trick part, change the closed loop code area so that the commanded stoich AFR is really the value from the open loop AFR table. Need to also change the code so that it doesn't check the stoich constant to remain in closed loop.

In the code someplace GM puts a test of the current commanded AFR against the stoich constant from the calibration. If they don't match the ECM will drop out of closed loop. So be sure to disable that check.

The proportional gains will most likely need changing. As they are intended to cause the AFR to oscillate. The INT delays may need a little tweaking, the delay is mostly to deal with transport delay. Which is the time it takes between when the ECM changes the INT and that change is seen at the O2 sensor. (injectors need to fire with the new PW, chamber needs to intake, compress, burn, then exhaust the new PW, then travel down the pipe to the O2 sensor, then the O2 needs time to respond and report back).

This is basically a quick method of open loop WB control. It would be better to change how the prop gains work so that a better PID loop can be had. But getting the above working first makes it easier to do a better PID loop in the end.

Note that under WOT this can get dangerous. This is the main reason I never released the stuff I did. At a minimum you may want to set the code up so that fuel can only be added during WOT, never removed.

RBob.
I am playing with S-AUJPv4 right now that already has wideband inputs and a variety of wideband calibrations stored within it for use with various WBo2 brands. It is inputed through the extra 5 volt channels straight from the 0-5 volt signal on the wideband. If I could get my hands on a hacked out version of the complete code, I am looking at adding closed loop wideband support to the existing code, similar to what the Code59 guys did with $58 based $59. Code re-work I have is going to be somewhat extensive but somewhat straight forward at the same time. It will basically replace the NB closed loop with the wideband CL. Basically the extent of the re-work will be replacing the incoming 02 buffer with the calculated wideband equivalent. Then all the voltages will be shifted according to the difference in wideband vs. narrowband. It will function just like the GM stuff with BLM cells, INT, Proportional gains, etc. It will just be ALOT more accurate than a NBO2 or WBO2 in Narrowband mode. Once you understand the input buffer works on a 0-255 count, it is easy to see how this can and will work. The stock AUJP stuff brings the BLM, IF removing fuel, BLMs lower than 128, back to 128 during PE. If its lean when it enters PE, it keeps adding fuel. At WOT S-AUJPv4 can revert back to a fixed INT/BLM value of 128.
Reply 0
Nov 5, 2008 | 02:21 PM
  #5  
Re: Wide CL AFR Control w/ WB
Well damn, sounds like you guys have this handled. I kind of took the anti-engineering approach to get what I want quick & dirty. I don't think I have a good grasp on what exactly the INT delay vs error is there for. Is it purely to deal with the sensor's internal delay or to deal with the response curve? I'll still play around with what I've done just out of curuiosity, but I'll have to wait for you to polish off your version of S-AUJPv4. I wish I was better with code so I could help but I'm still in the learning phase.
Reply 0
Nov 5, 2008 | 03:32 PM
  #6  
Re: Wide CL AFR Control w/ WB
Remember guys, this is feedback control. You will have to change PID constants, if not make a PID table lookup or other PID calculation to account for the variances in O2 sensor voltage differential (the NB changes a lot from stoich to rich or lean; the WB changes linearly) and different response time for higher RPM (where the feedback control was never designed to operate).
Keep this in mind.

-Steven
Reply 0
Nov 5, 2008 | 08:37 PM
  #7  
Re: Wide CL AFR Control w/ WB
Quote: Basically the extent of the re-work will be replacing the incoming 02 buffer with the calculated wideband equivalent. Then all the voltages will be shifted according to the difference in wideband vs. narrowband.
Not sure what you mean by "shifted according to the difference"
What you describe for replacing the value can be done pretty quick.
Replacing the memory location where the A/D read is stored will allow a 1-0 volt range but will still act as the NB control. The input would just have a nicer slope instead of the S-curve.
There is already code for a separate input setup in V4 right at the NB o2 read that can be uncommented to be the value returned by an alternate input instead of the NB value. I just havn't gotten around to trying it out.
Instead of U5 channel 2 (NB read), read U5 channel 0 (Pin F14 WB input) could also be done very easily. That is the WB input 0-5 volt
(Change location 48AC in TP hex editor to 00, See the attachment.)
No warranty expressed or implied!

I don't believe you want to use the alternate input on U6. It may take too long for mux to get the value back. Just speculating but the U5 is the same chip so response would be the same as the NB speed.
It would still need to be the inverted 1 volt input but would be more accurate than the NB sensor outside the regular linear range of the NB.

Quote:
If its lean when it enters PE, it keeps adding fuel. At WOT S-AUJPv4 can revert back to a fixed INT/BLM value of 128.
IIRC, The code currently leaves the last value (if adding) or goes 128 if removing upon entering PE.

I would like an RPM/MAP AFR table to reference (as RBob stated).
Would make it work just how you'd want. Only part throttle though and one special cell for idle only. Not part of the main table. Idle flag would make it go there.
Winter project brewing...

Wide CL AFR Control w/ WB-48ac-change.jpg  

Reply 0
Nov 5, 2008 | 08:42 PM
  #8  
Re: Wide CL AFR Control w/ WB
Quote: Am I dreaming? ('165 ecm w/ $32b)
In my world, yes.
Some MAF guys need to pick up the ball and do some of the code mods that have been discussed in many of the threads so the SD guys don't keep all the fun stuff.
I have no way of testing any MAF stuff.
Sorry,
Jp

Ps, Believe me, I'm still in the learning phase too!
Jump in, the water's deep
Reply 0
Nov 5, 2008 | 10:23 PM
  #9  
Re: Wide CL AFR Control w/ WB
Quote: Not sure what you mean by "shifted according to the difference"
What you describe for replacing the value can be done pretty quick.
Replacing the memory location where the A/D read is stored will allow a 1-0 volt range but will still act as the NB control. The input would just have a nicer slope instead of the S-curve.
There is already code for a separate input setup in V4 right at the NB o2 read that can be uncommented to be the value returned by an alternate input instead of the NB value. I just havn't gotten around to trying it out.
Instead of U5 channel 2 (NB read), read U5 channel 0 (Pin F14 WB input) could also be done very easily. That is the WB input 0-5 volt
(Change location 48AC in TP hex editor to 00, See the attachment.)
No warranty expressed or implied!

I don't believe you want to use the alternate input on U6. It may take too long for mux to get the value back. Just speculating but the U5 is the same chip so response would be the same as the NB speed.
It would still need to be the inverted 1 volt input but would be more accurate than the NB sensor outside the regular linear range of the NB.


IIRC, The code currently leaves the last value (if adding) or goes 128 if removing upon entering PE.

I would like an RPM/MAP AFR table to reference (as RBob stated).
Would make it work just how you'd want. Only part throttle though and one special cell for idle only. Not part of the main table. Idle flag would make it go there.
Winter project brewing...
I am trying the F14 switch now as we speak, I will let you know. I've already burned the bin just need to switch the wiring pin and go from there.
Reply 0
Nov 5, 2008 | 11:04 PM
  #10  
Re: Wide CL AFR Control w/ WB
Quote: Ps, Believe me, I'm still in the learning phase too!
Jump in, the water's deep
Heh, I try but I keep sinking. I think back on how complicated tuning seemed when I started and laugh when I look at machine code. Honestly I've been considering making the jump to map so I can play with all the neat stuff out there but I don't want to loose the ease of tuning.
Reply 0
Nov 6, 2008 | 11:14 PM
  #11  
Re: Wide CL AFR Control w/ WB
Quote: I am trying the F14 switch now as we speak, I will let you know. I've already burned the bin just need to switch the wiring pin and go from there.
Well guys it didn't work. I went down this afternoon and had my buddy (owns a muffler shop) blow a hole in the header collector and weld me in an 02 bung. I added an AC Delco AS-74 (IIRC) 3-wire 02 sensor (1994 G10 Van 4.3 TBI/Automatic). I unpinned the wire from the wideband and re-pinned the stock 02 sensor and reconnected the dormant plug under the hood. Everything is running GREAT now. Runs smooth under all conditions and HAULS ***!
Reply 0
Nov 7, 2008 | 05:21 PM
  #12  
Re: Wide CL AFR Control w/ WB
Plot them side by side now and see the difference between them. May indicate why it didn't work well.

Edit: "I unpinned the wire from the wideband and re-pinned the stock 02 sensor and reconnected the dormant plug under the hood."
They should have been in different locations (F14 = WB, stock NB = wherever it went)
Reply 0
Nov 7, 2008 | 06:39 PM
  #13  
Re: Wide CL AFR Control w/ WB
Quote: Plot them side by side now and see the difference between them. May indicate why it didn't work well.

Edit: "I unpinned the wire from the wideband and re-pinned the stock 02 sensor and reconnected the dormant plug under the hood."
They should have been in different locations (F14 = WB, stock NB = wherever it went)
I would, but now that its there, the routines for the NB02 are nearly exactly matched to the stock AC Delco sensor. The sensor is brand new and should work for a long time. I could plot out the differences, but to be honest, I really don't have a reason too.
Reply 0
Subscribe