Page 2 of 4 FirstFirst 1234 LastLast
Results 21 to 40 of 79

Thread: Turbonator LM Code - Wideband Discussion

  1. #21
    Heroes never die, they just reload! Turbo Mopar Staff Frank's Avatar
    Join Date
    Dec 2005
    Location
    California, MD
    Posts
    9,183

    Re: Turbonator LM codebase

    Code:
    ; *****************************************
    ; For each cell, the first number is "rich", the second is "lean".
    ; If the O2 sensor is returning a lean value, "rich" kicks are added.
    ; If the O2 sensor is returning a rich value, "lean" kicks are added.
    ;
    ;     KICK - (factor * 512) - 512  (unsigned number)
    ; eg: $19  -   1.05  * 512  - 512 - 5%
    ; *****************************************
    ;          KICKS
    ;       Rich, Lean
        chem 4 n O2PrimaryRampKickCell0 x 0 65535 y Y 0 255 out PRIRMP Kick_Cell0_PrimaryRamp
        db  $1a,  $04       ; Cell 0
    Rob,
    Can you help me out with this code? I guess I don't understand that math up there. I understand that the rich kick is $1a while the lean kick is $04. What I don't understand is the whole match and what that relates to. The example doesn't make much scense to me.

    Thanks,
    Frank


    PS> If you use the code tags, you can keep the formats and spacing, etc.
    Last edited by Frank; 07-02-2008 at 09:18 AM.
    Frank Katzenberger
    Squirrel Performance - Home of the best turbo calc!!!
    http://www.squirrelpf.com


    91 Daytona Shelby - It is getting there

    87 Shelby CSX #418 - Near stock is a good thing!

    94 Bronco 302 XLT - Shorty Headers, 3" exhaust, cold air intake, & Soft top



    "... to get the best out of it, you have to go beyond the line. Where bravery becomes insanity. Shall I turn into this hairpin bend at a 100mph? Why not!"



    Visit the new Knowledge Center today!

    Check out the one and only Shelby Dodge Registry!

  2. #22
    Heroes never die, they just reload! Turbo Mopar Staff Frank's Avatar
    Join Date
    Dec 2005
    Location
    California, MD
    Posts
    9,183

    Re: Turbonator LM codebase

    I think this should be changed...

    Code:
    CheckIfO2SensorDataIsValid:
            lda  RawO2Sensor    ; load a with memory contents
            cmpa O2TLMH_O2HighLimitDelayedClosedLoop    ; compare a with memory contents (data is 1f)
            bhs  L1257          ; branch if greater or equal
            cmpa O2TLML_O2LowLimitDelayedClosedLoop    ; compare a with memory contents (data is 0f)
            bhs  L1253          ; branch if greater or equal
            ; O2 sensor has now traveled outside of the .35 to .55 volt range, which means
            ; it is likely returning real data.
    to

    Code:
            ; O2 sensor has not traveled outside of the .35 to .55 volt range, which means
            ; it is likely returning real data.
    Frank Katzenberger
    Squirrel Performance - Home of the best turbo calc!!!
    http://www.squirrelpf.com


    91 Daytona Shelby - It is getting there

    87 Shelby CSX #418 - Near stock is a good thing!

    94 Bronco 302 XLT - Shorty Headers, 3" exhaust, cold air intake, & Soft top



    "... to get the best out of it, you have to go beyond the line. Where bravery becomes insanity. Shall I turn into this hairpin bend at a 100mph? Why not!"



    Visit the new Knowledge Center today!

    Check out the one and only Shelby Dodge Registry!

  3. #23
    Visit www.boostbutton.com... Turbo Mopar Contributor ShelGame's Avatar
    Join Date
    Dec 2005
    Location
    Whitmore Lake, Michigan, Unite
    Posts
    9,918

    Re: Turbonator LM codebase

    Quote Originally Posted by Frank View Post
    I think this should be changed...

    Code:
    CheckIfO2SensorDataIsValid:
            lda  RawO2Sensor    ; load a with memory contents
            cmpa O2TLMH_O2HighLimitDelayedClosedLoop    ; compare a with memory contents (data is 1f)
            bhs  L1257          ; branch if greater or equal
            cmpa O2TLML_O2LowLimitDelayedClosedLoop    ; compare a with memory contents (data is 0f)
            bhs  L1253          ; branch if greater or equal
            ; O2 sensor has now traveled outside of the .35 to .55 volt range, which means
            ; it is likely returning real data.
    to

    Code:
            ; O2 sensor has not traveled outside of the .35 to .55 volt range, which means
            ; it is likely returning real data.
    I think you're probably right on that.

    As to the math - no I don't really get it either. I don't know where the 'factor' comes from. And, I don't know what the significance of the 5% is (I guess it's 5% rich or lean?). I didn't write that, it's from the origianl BB60 source (Geoff).

    My understanding of how the systems works may not be exactly correct. But, I do know that shifting the kicks toward the lean side will make the engine run leaner in closed loop (and vice-versa to the rich side).
    https://db.tt/SV7ONZpQ
    Rob Lloyd
    '89 Daytona C/S

    2.5 T1 Auto
    13.24 @ 100.5mph
    NHRA #3728 AF/S

    boostbutton.com
    tuning wiki

  4. #24
    Heroes never die, they just reload! Turbo Mopar Staff Frank's Avatar
    Join Date
    Dec 2005
    Location
    California, MD
    Posts
    9,183

    Re: Turbonator LM codebase

    Ok, I think I figured it out....

    The code snipt below is the amount to change by...

    Code:
    ; *****************************************
    ; For each cell, the first number is "rich", the second is "lean".
    ; If the O2 sensor is returning a lean value, "rich" kicks are added.
    ; If the O2 sensor is returning a rich value, "lean" kicks are added.
    ;
    ;     KICK - (factor * 512) - 512  (unsigned number)
    ; eg: $19  -   1.05  * 512  - 512 - 5%
    ; *****************************************
    ;          KICKS
    ;       Rich, Lean
        chem 4 n O2PrimaryRampKickCell0 x 0 65535 y Y 0 255 out PRIRMP Kick_Cell0_PrimaryRamp
        db  $1a,  $04       ; Cell 0
    What I missed was key wording that says, if lean, then hit it with the rich kicks. If it is rich, then hit it with lean kicks. What that really says, that if it is below 0.35 volts (lean), as determined elsewhere in the code, then to hit it with $04 which is to make it push towards 0.55 volts (rich). If it is rich, then use $1A.

    So it looks like you can adjust the O2 voltage limits in the code here...

    Code:
    O2HSWP_O2HighLimitForRampSwitching:
        chem 3 n O2HighLimitForRampSwitching O2 0 255 none Y 0 255 out O2HSWP Compared_with_raw_O2_sensor_signal_to_determine_toggle._$19_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2HSWP "Compared with Raw O2 signal for switching toggles. This is the high limit"
        db  $19
    O2LSWP_O2LowLimitForRampSwitching:
        chem 3 n O2LowLimitForRampSwitching O2 0 255 none Y 0 255 out O2LSWP Compared_with_raw_O2_sensor_signal_to_determine_toggle._$18_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2LSWP "Compared with Raw O2 signal for switching toggles. This is the low limit"
        db  $18
    ; *****************************************
    O2TLMH_O2HighLimitDelayedClosedLoop:
        chem 3 n O2HighLimitDelayedClosedLoop O2 0 255 none Y 0 255 out O2TLMH O2_Sensor_High_Limit_for_delayed_switch_to_closed_loop._$1f_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2TLMH "Compared with Raw O2 signal for Delayed switch to Closed Loop"
        db  $1f
    O2TLML_O2LowLimitDelayedClosedLoop:
        chem 3 n O2LowLimitDelayedClosedLoop O2 0 255 none Y 0 255 out O2TLML O2_Sensor_Low_Limit_for_delayed_switch_to_closed_loop._$0f_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2TLML "Compared with Raw O2 signal for Delayed switch to Closed Loop"
        db  $0f
    ; *****************************************
    O2MIDH_O2HighLimitForMidLevelDetermination:
        chem 3 n O2HighLimitForMidLevelDetermination O2 0 255 none Y 0 255 out O2MIDH O2_Sensor_High_Limit_for_In-Middle_determination._$1c_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2MIDH "Compared with Raw O2 signal for In-Middle determination"
        db  $1c
    O2MIDL_O2LowLimitForMidLevelDetermination:
        chem 3 n O2LowLimitForMidLevelDetermination O2 0 255 none Y 0 255 out O2MIDL O2_Sensor_Low_Limit_for_In-Middle_determination._$12_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2MIDL "Compared with Raw O2 signal for In-Middle determination"
        db  $12
    I think we would have to determine what the values like $1C or $12 relate too, but if I am right, they would just need to be scaled for the equivelent wideband voltages.

    If that works, then we should be able to tighten up the ramp switching limits since rich and lean conditions are more clearly defined. By adjusting those, we won't need to touch the cells too much. We may have to reduce the kick sizes to ensure that you could fail at meeting the center of the rich/lean so that autocal would still work.

    However there are some clitches. We would still need to use the NB out of our WB setups. So that we dont have to change the 'greater than' or 'less than' logics in the code. What we would need to do is modify the NB out to be the inverse of the WB. This would be because the A/D for the O2 sensor is more then likely not setup for the voltage levels of the WB out. In addition, the A/F to voltage is in the wrong direction.

    So all in all, modify the NB out to be the inverse of the WB out. Modify the O2 limit values and then see how much you can tighten the kick and auto cal values.


    OR I COULD BE CRAZY!
    Last edited by Frank; 07-02-2008 at 03:02 PM.
    Frank Katzenberger
    Squirrel Performance - Home of the best turbo calc!!!
    http://www.squirrelpf.com


    91 Daytona Shelby - It is getting there

    87 Shelby CSX #418 - Near stock is a good thing!

    94 Bronco 302 XLT - Shorty Headers, 3" exhaust, cold air intake, & Soft top



    "... to get the best out of it, you have to go beyond the line. Where bravery becomes insanity. Shall I turn into this hairpin bend at a 100mph? Why not!"



    Visit the new Knowledge Center today!

    Check out the one and only Shelby Dodge Registry!

  5. #25
    Rhymes with tortoise. Turbo Mopar Staff cordes's Avatar
    Join Date
    Dec 2005
    Location
    Tuscola, IL
    Posts
    21,463

    Re: Turbonator LM codebase

    So perhaps we could just bump up all of the limits and it would then raise the target voltage (and therefore AF) but the autocal would still seek the midrange like it should, just at a higher AF?

  6. #26
    Heroes never die, they just reload! Turbo Mopar Staff Frank's Avatar
    Join Date
    Dec 2005
    Location
    California, MD
    Posts
    9,183

    Re: Turbonator LM codebase

    Quote Originally Posted by cordes View Post
    So perhaps we could just bump up all of the limits and it would then raise the target voltage (and therefore AF) but the autocal would still seek the midrange like it should, just at a higher AF?
    From the looks of it, nothing really seeks anything. It looks like, according to the code explination, that when rich is hit, to decrease fuel in until lean is hit, then to increase fuel until rich is hit. The amount to decrease is defined by the kick value. If it doesn't hit the rich or lean condition by the time it reaches the limits, then it adjusts the autocal cells.
    Frank Katzenberger
    Squirrel Performance - Home of the best turbo calc!!!
    http://www.squirrelpf.com


    91 Daytona Shelby - It is getting there

    87 Shelby CSX #418 - Near stock is a good thing!

    94 Bronco 302 XLT - Shorty Headers, 3" exhaust, cold air intake, & Soft top



    "... to get the best out of it, you have to go beyond the line. Where bravery becomes insanity. Shall I turn into this hairpin bend at a 100mph? Why not!"



    Visit the new Knowledge Center today!

    Check out the one and only Shelby Dodge Registry!

  7. #27
    Heroes never die, they just reload! Turbo Mopar Staff Frank's Avatar
    Join Date
    Dec 2005
    Location
    California, MD
    Posts
    9,183

    Re: Turbonator LM codebase

    Figured out what those values are.... well an approximate. I used the standard NB lookup. That gives you a reference....

    Code:
    hex	dec	volts	a/f
    19	25	0.44	14.60
    18	24	0.42	14.62
    			
    1F	31	0.54	14.51
    0F	15	0.26	14.77
    			
    1C	28	0.49	14.56
    12	18	0.32	14.71
    Last edited by Frank; 07-02-2008 at 05:07 PM.
    Frank Katzenberger
    Squirrel Performance - Home of the best turbo calc!!!
    http://www.squirrelpf.com


    91 Daytona Shelby - It is getting there

    87 Shelby CSX #418 - Near stock is a good thing!

    94 Bronco 302 XLT - Shorty Headers, 3" exhaust, cold air intake, & Soft top



    "... to get the best out of it, you have to go beyond the line. Where bravery becomes insanity. Shall I turn into this hairpin bend at a 100mph? Why not!"



    Visit the new Knowledge Center today!

    Check out the one and only Shelby Dodge Registry!

  8. #28
    boostaholic Turbo Mopar Contributor
    Join Date
    Mar 2008
    Location
    Arizona Bay
    Posts
    1,097

    Re: Turbonator LM codebase

    Quote Originally Posted by Frank View Post
    Ok, I think I figured it out....

    The code snipt below is the amount to change by...

    Code:
    ; *****************************************
    ; For each cell, the first number is "rich", the second is "lean".
    ; If the O2 sensor is returning a lean value, "rich" kicks are added.
    ; If the O2 sensor is returning a rich value, "lean" kicks are added.
    ;
    ;     KICK - (factor * 512) - 512  (unsigned number)
    ; eg: $19  -   1.05  * 512  - 512 - 5%
    ; *****************************************
    ;          KICKS
    ;       Rich, Lean
        chem 4 n O2PrimaryRampKickCell0 x 0 65535 y Y 0 255 out PRIRMP Kick_Cell0_PrimaryRamp
        db  $1a,  $04       ; Cell 0
    What I missed was key wording that says, if lean, then hit it with the rich kicks. If it is rich, then hit it with lean kicks. What that really says, that if it is below 0.35 volts (lean), as determined elsewhere in the code, then to hit it with $04 which is to make it push towards 0.55 volts (rich). If it is rich, then use $1A.

    So it looks like you can adjust the O2 voltage limits in the code here...

    Code:
    O2HSWP_O2HighLimitForRampSwitching:
        chem 3 n O2HighLimitForRampSwitching O2 0 255 none Y 0 255 out O2HSWP Compared_with_raw_O2_sensor_signal_to_determine_toggle._$19_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2HSWP "Compared with Raw O2 signal for switching toggles. This is the high limit"
        db  $19
    O2LSWP_O2LowLimitForRampSwitching:
        chem 3 n O2LowLimitForRampSwitching O2 0 255 none Y 0 255 out O2LSWP Compared_with_raw_O2_sensor_signal_to_determine_toggle._$18_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2LSWP "Compared with Raw O2 signal for switching toggles. This is the low limit"
        db  $18
    ; *****************************************
    O2TLMH_O2HighLimitDelayedClosedLoop:
        chem 3 n O2HighLimitDelayedClosedLoop O2 0 255 none Y 0 255 out O2TLMH O2_Sensor_High_Limit_for_delayed_switch_to_closed_loop._$1f_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2TLMH "Compared with Raw O2 signal for Delayed switch to Closed Loop"
        db  $1f
    O2TLML_O2LowLimitDelayedClosedLoop:
        chem 3 n O2LowLimitDelayedClosedLoop O2 0 255 none Y 0 255 out O2TLML O2_Sensor_Low_Limit_for_delayed_switch_to_closed_loop._$0f_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2TLML "Compared with Raw O2 signal for Delayed switch to Closed Loop"
        db  $0f
    ; *****************************************
    O2MIDH_O2HighLimitForMidLevelDetermination:
        chem 3 n O2HighLimitForMidLevelDetermination O2 0 255 none Y 0 255 out O2MIDH O2_Sensor_High_Limit_for_In-Middle_determination._$1c_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2MIDH "Compared with Raw O2 signal for In-Middle determination"
        db  $1c
    O2MIDL_O2LowLimitForMidLevelDetermination:
        chem 3 n O2LowLimitForMidLevelDetermination O2 0 255 none Y 0 255 out O2MIDL O2_Sensor_Low_Limit_for_In-Middle_determination._$12_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2MIDL "Compared with Raw O2 signal for In-Middle determination"
        db  $12
    I think we would have to determine what the values like $1C or $12 relate too, but if I am right, they would just need to be scaled for the equivelent wideband voltages.

    If that works, then we should be able to tighten up the ramp switching limits since rich and lean conditions are more clearly defined. By adjusting those, we won't need to touch the cells too much. We may have to reduce the kick sizes to ensure that you could fail at meeting the center of the rich/lean so that autocal would still work.

    However there are some clitches. We would still need to use the NB out of our WB setups. So that we dont have to change the 'greater than' or 'less than' logics in the code. What we would need to do is modify the NB out to be the inverse of the WB. This would be because the A/D for the O2 sensor is more then likely not setup for the voltage levels of the WB out. In addition, the A/F to voltage is in the wrong direction.

    So all in all, modify the NB out to be the inverse of the WB out. Modify the O2 limit values and then see how much you can tighten the kick and auto cal values.


    OR I COULD BE CRAZY!
    I'm pretty sure that the a/d converters in the LM are all the same 0-5v 8 bit a/d converters. The values are compared to the o2 sensor volts based upon the output from a/d converter. That's the reason the max is 2f (1v = 0x33 slightly larger than 0x2f). If the mid points, and max/min points are all able to be set like that we may only need to scale the size of the kicks so that it's enough of a correction.

  9. #29
    Heroes never die, they just reload! Turbo Mopar Staff Frank's Avatar
    Join Date
    Dec 2005
    Location
    California, MD
    Posts
    9,183

    Re: Turbonator LM codebase

    Quote Originally Posted by risen View Post
    I'm pretty sure that the a/d converters in the LM are all the same 0-5v 8 bit a/d converters. The values are compared to the o2 sensor volts based upon the output from a/d converter. That's the reason the max is 2f (1v = 0x33 slightly larger than 0x2f). If the mid points, and max/min points are all able to be set like that we may only need to scale the size of the kicks so that it's enough of a correction.
    If we setup our NB out to be linear where 1-volts @ 9-a/f and 0-volts @ 19-a/f, then all we have to do is scale the max/mins to the new voltages and then mess with the kicks. Pretty simple. I may do this on Saturday.
    Last edited by Frank; 07-02-2008 at 07:12 PM.
    Frank Katzenberger
    Squirrel Performance - Home of the best turbo calc!!!
    http://www.squirrelpf.com


    91 Daytona Shelby - It is getting there

    87 Shelby CSX #418 - Near stock is a good thing!

    94 Bronco 302 XLT - Shorty Headers, 3" exhaust, cold air intake, & Soft top



    "... to get the best out of it, you have to go beyond the line. Where bravery becomes insanity. Shall I turn into this hairpin bend at a 100mph? Why not!"



    Visit the new Knowledge Center today!

    Check out the one and only Shelby Dodge Registry!

  10. #30
    boostaholic Turbo Mopar Contributor
    Join Date
    Mar 2008
    Location
    Arizona Bay
    Posts
    1,097

    Re: Turbonator LM codebase

    Quote Originally Posted by Frank View Post
    If we setup our NB out to be linear where 1-volts @ 9-a/f and 0-volts @ 19-a/f, then all we have to do is scale the max/mins to the new voltages and then mess with the kicks. Pretty simple. I may do this on Saturday.
    I'd be a bit concerned about the minimum granularity of the a/d converter. You may get huge toggles using that wide a sweep. Insetad of .1 volt being a few fractions of an afr on a narrowband, it's now closer to a full afr. Try it and let us know how it works. Or maybe try like 0v = 13a/f and 1v=16 af. (or some variation that puts 14.7 in the middle).

    Once I get some other wiring work done on my car I'm going to try and revamp the max/min limits so you can use the whole 0-5v sweep and see how that goes.
    Last edited by Frank; 07-02-2008 at 07:12 PM.

  11. #31
    Heroes never die, they just reload! Turbo Mopar Staff Frank's Avatar
    Join Date
    Dec 2005
    Location
    California, MD
    Posts
    9,183

    Re: Turbonator LM codebase

    Quote Originally Posted by risen View Post
    I'd be a bit concerned about the minimum granularity of the a/d converter. You may get huge toggles using that wide a sweep. Insetad of .1 volt being a few fractions of an afr on a narrowband, it's now closer to a full afr. Try it and let us know how it works. Or maybe try like 0v = 13a/f and 1v=16 af. (or some variation that puts 14.7 in the middle).

    Once I get some other wiring work done on my car I'm going to try and revamp the max/min limits so you can use the whole 0-5v sweep and see how that goes.
    Well I guess it won't be that much work to do it full up right. I can use the WB out. But the problem is that my WB out is 0v @ 9af and 5v @ 19af. That means I need to change all of the greater then and less then statements. I guess that is not that hard. I will do it that way so I get the best 0-5v setup and maximize all of the 8-bits assigned to that A/D.
    Frank Katzenberger
    Squirrel Performance - Home of the best turbo calc!!!
    http://www.squirrelpf.com


    91 Daytona Shelby - It is getting there

    87 Shelby CSX #418 - Near stock is a good thing!

    94 Bronco 302 XLT - Shorty Headers, 3" exhaust, cold air intake, & Soft top



    "... to get the best out of it, you have to go beyond the line. Where bravery becomes insanity. Shall I turn into this hairpin bend at a 100mph? Why not!"



    Visit the new Knowledge Center today!

    Check out the one and only Shelby Dodge Registry!

  12. #32
    boostaholic Turbo Mopar Contributor
    Join Date
    Mar 2008
    Location
    Arizona Bay
    Posts
    1,097

    Re: Turbonator LM codebase

    Quote Originally Posted by Frank View Post
    Well I guess it won't be that much work to do it full up right. I can use the WB out. But the problem is that my WB out is 0v @ 9af and 5v @ 19af. That means I need to change all of the greater then and less then statements. I guess that is not that hard. I will do it that way so I get the best 0-5v setup and maximize all of the 8-bits assigned to that A/D.
    I thought one of your previous posts had the mid-points in it. Shouldn't it just be a matter of straddling those around 0x80 or 2.5V? I'm going to read the code later on, so I stop with all this conjecture.

  13. #33

    Re: Turbonator LM codebase

    Catching up on this thread. Frank, I think you translated that code comment correctly. I was not able to wrap my head around it either until now...assuming it was trying to be correct in the first place. If the kicks are indeed timer values then I understand how you could use them to make the "average" mixture a little leaner or richer.

    The stock cal is probably setup to handle a fair amount of variance in the sensor output. Tolerances in the wiring and the sensor and so forth need to be taken into account. The WB output should be more accurate, so you should be able to narrow the "neutral zone".

    All that said, it just seems easier to feed the LM a conditioned WB signal using a tool that was meant for the job.

  14. #34
    Heroes never die, they just reload! Turbo Mopar Staff Frank's Avatar
    Join Date
    Dec 2005
    Location
    California, MD
    Posts
    9,183

    Re: Turbonator LM codebase

    Quote Originally Posted by MiniMopar View Post
    Catching up on this thread. Frank, I think you translated that code comment correctly. I was not able to wrap my head around it either until now...assuming it was trying to be correct in the first place. If the kicks are indeed timer values then I understand how you could use them to make the "average" mixture a little leaner or richer.

    The stock cal is probably setup to handle a fair amount of variance in the sensor output. Tolerances in the wiring and the sensor and so forth need to be taken into account. The WB output should be more accurate, so you should be able to narrow the "neutral zone".

    All that said, it just seems easier to feed the LM a conditioned WB signal using a tool that was meant for the job.

    Russ,
    I finished the code. It is untested, but I am confident that it will work if you want to give it a try. Attached is the Turbonator V6 code that has been modified to accept the Techedge WB as the new O2 input. I documented all changes to the code. It was pretty straight forward suprisingly enough!!!

    I also made changes to the chem code so that DCAL will treat those values literally as AFR since it is a nice linear curve unlike stock NB. I will eventually make it so it will be pretty in Chem2. Below are my additions and code snipets.

    ----------------------

    Added...
    Code:
    ; | FLK - Added/Changed code                                                   |
    ; |                                                                            |
    ; | FLK01) Multiple changes have been made in this section. The first is all of| 
    ; |        the max O2 sensor ranges have been changed from $2F to $FF since the|
    ; |        analog input is actually 0v to 5v.                                  |
    ; |        Since the Techedge WB output is linear, I have made a change to the |
    ; |        table to show actual A/F target.  The modifier is from hex to volts |
    ; |        is volts = hex_to_dec * 0.01961.  The modifier from volts to AFR is |
    ; |        AFR = (volts * 2) + 9.                                              |
    ; |        I have also rescaled the original hex values to nb volts to nb afr  |
    ; |        curve and then used the formulas above to the nex hex values.       |
    ; | FLK02) Reversed the branch if lower and branch if greater statements since |
    ; |        the techedge output is lower voltage for richer afr unlike stock.   |
    ; |        *There are 4 instances of this change.                              |
    ; |                                                                            |
    ; | Note 1) Search for the change identifier, i.e. FLK01 to find the changes.  |
    ; |                                                                            |
    ; | Note 2) Below is how I scaled the NB sensor values to WB sensor values.    |
    ; |  hex     dec     nb volts  afr        wb volts  dec      hex               |
    ; |  19      25      0.49      14.56      2.78      142      8E                |
    ; |  18      24      0.47      14.59      2.80      143      8F                |
    ; |  1F      31      0.61      14.40      2.70      138      8A                |
    ; |  0F      15      0.29      14.75      2.88      147      93                |
    ; |  1C      28      0.55      14.50      2.75      140      8C                |
    ; |  12      18      0.35      14.70      2.85      145      91                |
    ; |                                                                            |
    ; | Note 3) THIS IS FOR TECHEDGE WIDEBAND UNITS ONLY AT THIS TIME.             |
    ----------------------

    Original...
    Code:
    ; *****************************************
    ; For detecting toggles
    ; *****************************************
    O2HSWP_O2HighLimitForRampSwitching:
        chem 3 n O2HighLimitForRampSwitching O2 0 255 none Y 0 255 out O2HSWP Compared_with_raw_O2_sensor_signal_to_determine_toggle._$19_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2HSWP "Compared with Raw O2 signal for switching toggles. This is the high limit"
        db  $19
    O2LSWP_O2LowLimitForRampSwitching:
        chem 3 n O2LowLimitForRampSwitching O2 0 255 none Y 0 255 out O2LSWP Compared_with_raw_O2_sensor_signal_to_determine_toggle._$18_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2LSWP "Compared with Raw O2 signal for switching toggles. This is the low limit"
        db  $18
    ; *****************************************
    O2TLMH_O2HighLimitDelayedClosedLoop:
        chem 3 n O2HighLimitDelayedClosedLoop O2 0 255 none Y 0 255 out O2TLMH O2_Sensor_High_Limit_for_delayed_switch_to_closed_loop._$1f_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2TLMH "Compared with Raw O2 signal for Delayed switch to Closed Loop"
        db  $1f
    O2TLML_O2LowLimitDelayedClosedLoop:
        chem 3 n O2LowLimitDelayedClosedLoop O2 0 255 none Y 0 255 out O2TLML O2_Sensor_Low_Limit_for_delayed_switch_to_closed_loop._$0f_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2TLML "Compared with Raw O2 signal for Delayed switch to Closed Loop"
        db  $0f
    ; *****************************************
    O2MIDH_O2HighLimitForMidLevelDetermination:
        chem 3 n O2HighLimitForMidLevelDetermination O2 0 255 none Y 0 255 out O2MIDH O2_Sensor_High_Limit_for_In-Middle_determination._$1c_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2MIDH "Compared with Raw O2 signal for In-Middle determination"
        db  $1c
    O2MIDL_O2LowLimitForMidLevelDetermination:
        chem 3 n O2LowLimitForMidLevelDetermination O2 0 255 none Y 0 255 out O2MIDL O2_Sensor_Low_Limit_for_In-Middle_determination._$12_stock._O2_sensor_range_is_$00_to_$2f
        chem2 byte O2MIDL "Compared with Raw O2 signal for In-Middle determination"
        db  $12
    New...
    Code:
    ; *****************************************
    ; For detecting toggles
    ; *****************************************
    ; FLK01) Multiple changes have been made in this section. The first is all of 
    ;        the max O2 sensor ranges have been changed from $2F to $FF since the
    ;        analog input is actually 0v to 5v.  
    ;        Since the Techedge WB output is linear, I have made a change to the
    ;        table to show actual A/F target.  The modifier is from hex to volts
    ;        is volts = hex_to_dec * 0.01961.  The modifier from volts to AFR is
    ;        AFR = (volts * 2) + 9.  
    ;        I have also rescaled the original hex values to nb volts to nb afr
    ;        curve and then used the formulas above to the nex hex values.
    ; 
    O2HSWP_O2HighLimitForRampSwitching:
        chem 3 n O2HighLimitForRampSwitching O2 0 255 none Y 9 19 AFR O2HSWP Compared_with_raw_O2_sensor_signal_to_determine_toggle._Stock_AFR_is_14.56._O2_sensor_range_is_now_an_AFR_of_9_to_19
        chem2 byte O2HSWP "Compared with Raw O2 signal for switching toggles. This is the high limit"
        db  $8E
    O2LSWP_O2LowLimitForRampSwitching:
        chem 3 n O2LowLimitForRampSwitching O2 0 255 none Y 9 19 AFR O2LSWP Compared_with_raw_O2_sensor_signal_to_determine_toggle._Stock_AFR_is_14.59._O2_sensor_range_is_now_an_AFR_of_9_to_19
        chem2 byte O2LSWP "Compared with Raw O2 signal for switching toggles. This is the low limit"
        db  $8F
    ; *****************************************
    O2TLMH_O2HighLimitDelayedClosedLoop:
        chem 3 n O2HighLimitDelayedClosedLoop O2 0 255 none Y 9 19 AFR O2TLMH O2_Sensor_High_Limit_for_delayed_switch_to_closed_loop._Stock_AFR_is_14.40._O2_sensor_range_is_now_an_AFR_of_9_to_19
        chem2 byte O2TLMH "Compared with Raw O2 signal for Delayed switch to Closed Loop"
        db  $8A
    O2TLML_O2LowLimitDelayedClosedLoop:
        chem 3 n O2LowLimitDelayedClosedLoop O2 0 255 none Y 9 19 AFR O2TLML O2_Sensor_Low_Limit_for_delayed_switch_to_closed_loop._Stock_AFR_is_14.75._O2_sensor_range_is_now_an_AFR_of_9_to_19
        chem2 byte O2TLML "Compared with Raw O2 signal for Delayed switch to Closed Loop"
        db  $93
    ; *****************************************
    O2MIDH_O2HighLimitForMidLevelDetermination:
        chem 3 n O2HighLimitForMidLevelDetermination O2 0 255 none Y 9 19 AFR O2MIDH O2_Sensor_High_Limit_for_In-Middle_determination._Stock_AFR_is_14.50._O2_sensor_range_is_now_an_AFR_of_9_to_19
        chem2 byte O2MIDH "Compared with Raw O2 signal for In-Middle determination"
        db  $8C
    O2MIDL_O2LowLimitForMidLevelDetermination:
        chem 3 n O2LowLimitForMidLevelDetermination O2 0 255 none Y 9 19 AFR O2MIDL O2_Sensor_Low_Limit_for_In-Middle_determination._Stock_AFR_is_14.70._O2_sensor_range_is_now_an_AFR_of_9_to_19
        chem2 byte O2MIDL "Compared with Raw O2 signal for In-Middle determination"
        db  $91
    ----------------------

    Original...
    Code:
            lda  RawO2Sensor    ; load a with memory contents
            cmpa O2MIDL_O2LowLimitForMidLevelDetermination    ; compare a with memory contents (data is 12)
            blo  L1048          ; branch if lower
            cmpa O2MIDH_O2HighLimitForMidLevelDetermination    ; compare a with memory contents (data is 1c)
            bhs  L1048          ; branch if greater or equal
    New...
    Code:
            lda  RawO2Sensor    ; load a with memory contents of the O2 Sensor
    ; FLK02) Reversed the branch if lower and branch if greater statements since the
    ;        techedge output is lower voltage for richer afr unlike stock.
            cmpa O2MIDL_O2LowLimitForMidLevelDetermination    ; compare a with memory contents (data is 12)
            bhs  L1048          ; branch if greater or equal
            cmpa O2MIDH_O2HighLimitForMidLevelDetermination    ; compare a with memory contents (data is 1c)
            blo  L1048          ; branch if lower
    ; end change
    ----------------------

    Original...
    Code:
            lda  RawO2Sensor    ; load a with memory contents
            ldb  #$ff           ; load b with value -11111111-
            cmpa O2MIDH_O2HighLimitForMidLevelDetermination    ; compare a with memory contents (data is 1c)
            bhi  L1209          ; branch if higher
            cmpa O2MIDL_O2LowLimitForMidLevelDetermination    ; compare a with memory contents (data is 12)
            bhi  L1210          ; branch if higher
    New...
    Code:
            lda  RawO2Sensor    ; load a with memory contents
            ldb  #$ff           ; load b with value -11111111-
    ; FLK02) Reversed the branch if lower and branch if greater statements since the
    ;        techedge output is lower voltage for richer afr unlike stock.
            cmpa O2MIDH_O2HighLimitForMidLevelDetermination    ; compare a with memory contents (data is 8C)
            bhi  L1210          ; branch if higher
            cmpa O2MIDL_O2LowLimitForMidLevelDetermination    ; compare a with memory contents (data is 91)
            bhi  L1209          ; branch if higher
    ; end of change
    ----------------------

    Original...
    Code:
            lda  RawO2Sensor    ; load a with memory contents
            cmpa O2TLMH_O2HighLimitDelayedClosedLoop    ; compare a with memory contents (data is 1f)
            bhs  L1257          ; branch if greater or equal
            cmpa O2TLML_O2LowLimitDelayedClosedLoop    ; compare a with memory contents (data is 0f)
            bhs  L1253          ; branch if greater or equal
            ; O2 sensor has now traveled outside of the .35 to .55 volt range, which means
            ; it is likely returning real data.
    L1257:  clra                ; a = 0
            sta  L00B1          ; store a into memory
            sta  Timer_CLTIME_ClosedLoopTimer ; store a into memory
            lda  BitFlags81     ; load a with memory contents
            ora  #b81_bit4      ;  -00010000-
    L1252:  sta  BitFlags81     ; store a into memory
    L1253:  clra                ; a = 0
            sta  SecondaryO2ControllerKicks_Signed          ; store a into memory
            rts                 ; return from subroutine
    
    L1255:  clrb                ; b = 0
            lda  RawO2Sensor    ; load a with memory contents
            cmpa O2MIDH_O2HighLimitForMidLevelDetermination    ; compare a with memory contents (data is 1c)
            bhs  L1258          ; branch if greater or equal
            cmpa O2MIDL_O2LowLimitForMidLevelDetermination    ; compare a with memory contents (data is 12)
            blo  L1258          ; branch if lower
    New...
    Code:
            lda  RawO2Sensor    ; load a with memory contents
    ; FLK02) Reversed the branch if lower and branch if greater statements since the
    ;        techedge output is lower voltage for richer afr unlike stock.
            cmpa O2TLMH_O2HighLimitDelayedClosedLoop    ; compare a with memory contents (data is 8C)
            bhs  L1253          ; branch if greater or equal
            cmpa O2TLML_O2LowLimitDelayedClosedLoop    ; compare a with memory contents (data is 91)
            bhs  L1257          ; branch if greater or equal
            ; O2 sensor has now traveled outside of the *2.75* to *2.85* volt range, which means
            ; it is likely returning real data.
    ; end of change
    L1257:  clra                ; a = 0
            sta  L00B1          ; store a into memory
            sta  Timer_CLTIME_ClosedLoopTimer ; store a into memory
            lda  BitFlags81     ; load a with memory contents
            ora  #b81_bit4      ;  -00010000-
    L1252:  sta  BitFlags81     ; store a into memory
    L1253:  clra                ; a = 0
            sta  SecondaryO2ControllerKicks_Signed          ; store a into memory
            rts                 ; return from subroutine
    
    L1255:  clrb                ; b = 0
            lda  RawO2Sensor    ; load a with memory contents
    ; FLK02) Reversed the branch if lower and branch if greater statements since the
    ;        techedge output is lower voltage for richer afr unlike stock.
            cmpa O2MIDH_O2HighLimitForMidLevelDetermination    ; compare a with memory contents (data is 8c)
            blo  L1258          ; branch if lower
            cmpa O2MIDL_O2LowLimitForMidLevelDetermination    ; compare a with memory contents (data is 91)
            bhs  L1258          ; branch if greater or equal
    ; end of change
    ----------------------

    Supporting information...


    If you look at the Wideband graph here, this is why I had to change/reverse the branch statements in the code. The te Wideband output has less voltage for rich conditions. Since the asm code is written to look at voltages, not AFR, they had to be reversed.

    Once I find out if this works, I will create a full release where the WB unit type can be selected before it is compiled.

    Frank


    ***FILES REMOVED - WILL POST WHEN CODE REWORKED MORE COMPLETELY***
    Last edited by Frank; 07-07-2008 at 02:50 PM.
    Frank Katzenberger
    Squirrel Performance - Home of the best turbo calc!!!
    http://www.squirrelpf.com


    91 Daytona Shelby - It is getting there

    87 Shelby CSX #418 - Near stock is a good thing!

    94 Bronco 302 XLT - Shorty Headers, 3" exhaust, cold air intake, & Soft top



    "... to get the best out of it, you have to go beyond the line. Where bravery becomes insanity. Shall I turn into this hairpin bend at a 100mph? Why not!"



    Visit the new Knowledge Center today!

    Check out the one and only Shelby Dodge Registry!

  15. #35
    Heroes never die, they just reload! Turbo Mopar Staff Frank's Avatar
    Join Date
    Dec 2005
    Location
    California, MD
    Posts
    9,183

    Re: Turbonator LM codebase

    There was a slight mistake in some minor documentation. I have since fixed it. Anything before 11:05 AM EST should be ignored. Thanks!
    Frank Katzenberger
    Squirrel Performance - Home of the best turbo calc!!!
    http://www.squirrelpf.com


    91 Daytona Shelby - It is getting there

    87 Shelby CSX #418 - Near stock is a good thing!

    94 Bronco 302 XLT - Shorty Headers, 3" exhaust, cold air intake, & Soft top



    "... to get the best out of it, you have to go beyond the line. Where bravery becomes insanity. Shall I turn into this hairpin bend at a 100mph? Why not!"



    Visit the new Knowledge Center today!

    Check out the one and only Shelby Dodge Registry!

  16. #36
    boostaholic Turbo Mopar Contributor
    Join Date
    Mar 2008
    Location
    Arizona Bay
    Posts
    1,097

    Re: Turbonator LM codebase

    Hell yeah, Frank. Since you've already done all the hard work we innovate users will either have to adjust the output on the lc-1 to match the techedge output or change the values so that the mid point is 2.45 V (per below). I can give the hex values for the actual code if anyone wants them. If I get to adding innovate values before anyone else does, I would like to make the techedge/innovate mid points selectable with either a build time option or a bitflag. Maybe when I get to it Rob will weigh in as to how he would like it added into the cal.

    Innovate's manual says this about the default w/b output:

    As factory programmed the first output simulates a typical narrow band oxygen sensor. The
    second output is programmed to output between 0 V for an AFR of 7.35 (gasoline) and 5.0V for
    an AFR of 22.39. Other curves of course are easily programmable.

  17. #37

    Re: Turbonator LM codebase

    Thanks, Frank. Looks straight forward enough. I'll need to reroute the O2 signal to try this, but I've been meaning to run some different discreet signals back to the the TE module anyway. I'll let you know what happens!

  18. #38

    Re: Turbonator LM codebase

    Quote Originally Posted by risen View Post
    As factory programmed the first output simulates a typical narrow band oxygen sensor. The
    second output is programmed to output between 0 V for an AFR of 7.35 (gasoline) and 5.0V for
    an AFR of 22.39. Other curves of course are easily programmable.
    Yeah the TE is nicely conditioned, but you could tweak the constants to work with the Innovate as long as you know the transfer function.

  19. #39
    boostaholic Turbo Mopar Contributor
    Join Date
    Mar 2008
    Location
    Arizona Bay
    Posts
    1,097

    Re: Turbonator LM codebase

    Quote Originally Posted by MiniMopar View Post
    Yeah the TE is nicely conditioned, but you could tweak the constants to work with the Innovate as long as you know the transfer function.
    For a default lc-1 w/b output it's linear. The above mentioned voltage points are the max and min, and 2.45 is 14.7 (calcualted from the above points). I figured I'd toss the info out there in case someone else with a lc-1 wants to try it. I'm going to try it eventaully, but I'm not in a hurry .

  20. #40
    Heroes never die, they just reload! Turbo Mopar Staff Frank's Avatar
    Join Date
    Dec 2005
    Location
    California, MD
    Posts
    9,183

    Re: Turbonator LM codebase

    Quote Originally Posted by risen View Post
    Hell yeah, Frank. Since you've already done all the hard work we innovate users will either have to adjust the output on the lc-1 to match the techedge output or change the values so that the mid point is 2.45 V (per below). I can give the hex values for the actual code if anyone wants them. If I get to adding innovate values before anyone else does, I would like to make the techedge/innovate mid points selectable with either a build time option or a bitflag. Maybe when I get to it Rob will weigh in as to how he would like it added into the cal.

    Innovate's manual says this about the default w/b output:

    As factory programmed the first output simulates a typical narrow band oxygen sensor. The
    second output is programmed to output between 0 V for an AFR of 7.35 (gasoline) and 5.0V for
    an AFR of 22.39. Other curves of course are easily programmable.
    Quote Originally Posted by MiniMopar View Post
    Yeah the TE is nicely conditioned, but you could tweak the constants to work with the Innovate as long as you know the transfer function.

    Well hopefully I will be able to give this a testing on Saturday. If it works, I will work on adding the Innovate, the Zen, and the TE so you just select it and compile. We can then get Rob to roll these into his Turbonator code.

    I will have my scanner hooked up on Saturday to ensure that the O2 voltages match the WB and that the Rich/Lean conditions toggle accordingly.

    Thanks,
    Frank
    Frank Katzenberger
    Squirrel Performance - Home of the best turbo calc!!!
    http://www.squirrelpf.com


    91 Daytona Shelby - It is getting there

    87 Shelby CSX #418 - Near stock is a good thing!

    94 Bronco 302 XLT - Shorty Headers, 3" exhaust, cold air intake, & Soft top



    "... to get the best out of it, you have to go beyond the line. Where bravery becomes insanity. Shall I turn into this hairpin bend at a 100mph? Why not!"



    Visit the new Knowledge Center today!

    Check out the one and only Shelby Dodge Registry!

Page 2 of 4 FirstFirst 1234 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •