Announcement

Collapse
No announcement yet.

WBO2 into motronic

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Originally posted by kymi

    So you will use non-initialized variable for compare function in the code...
    Exactly like my code examples above. Simply disable the original input before it’s placed into RAM than just read the raw analog input again for data logging AFR input in the jump out of the logging routine also like my code above.
    "The really good drivers got the bugs on the side windows." Walter Röhrl

    Comment


    • #32
      Guys, stop asking questions from “highest” or/and “special” position!! If you want to help, help, just like Dmitri did, no matter how many reasons he has to do something else and how many times some of us thought that he did not help, that he was highly commercial, bad, ….. and etc and etc (no matter that this thought is not posted) , but the truth finally came out another !!! He helping with every word, especially when he is angry ?!!! Because even in that cases he produce (again sorry for the word Dmitri) very useful info and he never intentionally did or wrote something fake/sarcastically/mockingly/sneeringly for someone no matter how much reasons he have for that. He helping without anything back now, even in that situation. He can feel its self “important” and go for his job/problems and throw everything away. His post for lambda control is example how to help - in 1. 2. 3 points he insert quicker course “Haw to set/tune correctly yours M232” - without "special" questions and of course, if someone can read carefully what he wrote. And M232.org and all his threads is prove for that. How much time, knowledge, and effort are needed to create such a thing, and what kind of person would share this with others for free. Each of us can make conclusions!

      Matt you should.. no … you must keep the stock logic!!! Always do that when changing something in code, this prevents consequential problems. i.e after disable reading of AN6 add instead code:00007117 mov A, RAM_39, add code:00007117 mov A, 0xFCh to keep stock logic or if you want keep in mind what you did and how this will affect logic. You can do the same with AN4, just replace code:00004F6A mov R4, A with code:00004F6A mov R4, 0x80h to keep stock logic and use AN4 for you need. AN4 without connection - default value is 2.5 Volts 0x80h. Consider that AN4 and AN6 are used in Dmitri’s LC and NLS.

      Consider that DPTR = 0xBE0X is not a address of AN’s inputs, it is just one approach to address reading of AN0-7. There are few more. Dmitri use another way to address ANs by code:000086B3 orl ADCON1, #4 and AN5 codede:00000440 orl ADCON1, #5 and in boost code there is the same approach.

      Following advice of Dmitri I found 5 lambda control thresholds. I change the stock logic to use wideband lambda controller and again by his advice I post this here:
      The code_2C22 read AN7 (narrow band sensor signal) and then put value in R2.
      To use wideband O2 sensor, instead AN7 you should read AN6 filed in R2 + add "correction factor" to have 80h for 2.5 Volts from Lambda controller. Consider that AN6 without connection have 4.75 Volts IIRC (not 0 Volts)and when add signal 0-5V from wideband O2 controler, final result must be corrected a little bit by "correction factor" i.e. add some value (0xF for example) if you want to have 80h for stoic.

      Stoich value for narrowband is in 0x8408 = 5Ch = 0.499 Volts if over this value set bit RAM_29.4. For WBO2 to be 80h for example.

      The code_2C4F manage the 5 thresholds . All logic is based on R4.
      R4=5 if Lambda signal is over DPTR 0x8411 = E1h = 1.01 Volts - Very rich – for WBO2 to be C0h
      R4=4 if Lambda signal is over DPTR 0x8409 = 62h = 0.48 Volts - Rich - for WBO2 to be 86h
      R4=3 if Lambda signal is over DPTR 0x840A = 56h = 0.42 Volts - Stoic - for WBO2 to be 79h
      R4=2 if Lambda signal is over DPTR 0x8412 =12h = 0.09 Volts - Lean - for WO2 to be e 3Eh
      R4=1 if Lambda signal is uder DPTR 0x8412 =12h = 0.09 Volts - Very lean - for WBO2 to be 3Eh
      Consider that stock narrow band sensor is somehow faster i.e. instantly going rich or lean, but WBO2 controller does that smoothly. All stock logic is based on that characteristic of narrow band 02 sensor. When you start testing you will see what I mean.

      Some of WBO2 controllers like LC-1/2 or LM-1/2 have “Advanced settings” for every Analog output. In this settings can be configured specific voltages during Warm-up and even for Error conditions, instead high impedance. With these functions for simulated narrow band can be configured constant 0.449V during Warm-up and for the other WBO2 controller analog output 2.5V and in case of malfunctioning of O2 sensor also. This eliminates problem in M232 during warm-up, but I will agree with Dmitri and keep his countdown timer like much more safety solutions especially if you use WBO2 controller instead stock!!!
      Most important - with this function can be simulated every voltage between 0 – 5V for comparison with logged value from AN6 and also for sensor diagnosis - Dmitri wrote before for that.
      You must add in case of malfunctioning of WBO2 sensor some value (5V) in WBO2 controller (0xFF minus "correction factor" on AN6 for example) and add logic for control of error state. Below in lambda control logic you can find one 60 seconds timer if lambda signal is not changed + fault code which can be used for that.
      I conduct few tests with WB02 controller instead stock, but still can’t find good reason to replace it without change of stock logic. One hole less in downpipe is not a good reason. If there is new logic for full Wideband closed loop, then will be different. I just play with this when free times have.

      I what to write that all my finding is based on the incredible help from Dmitri!!!!!!!!!


      Sorry for my English!!


      Comment


      • #33
        Finally

        I think with wideband you know exact mixture, so there is no point to use these thresholds.
        All the stock logic must be removed and probably a good idea to do PI controller with I being only active when we are close to target...

        It is possible to run closed loop on WOT too, but then a correction map will need to be introduced for stuff like WMI.
        And on WOT without proper diagnosis I'd limit the correction to 5% max.
        http://tuner.ee - http://www.facebook.com/tuner.ee

        Comment


        • #34
          WOW! good in depth information D_anev! what all you said needs to be like put in a sticky or added to the wiki itself!!

          all my information wasnt for the actual functionality of having the wideband lambda control the ECU itself. i was just telling a simple way to get the 0-5V signal into the ECU on AN6 so it can be used in data logging. i have ran my car with the stock sensor and the ZT-3 for regular lambda control and i didnt really see a difference in how it acted.
          Last edited by vwnut8392; 26 February 2018, 19:12.
          "The really good drivers got the bugs on the side windows." Walter Röhrl

          Comment


          • #35
            When you understood that R2 = Ram_2 = 0x02 then it's easy to see, I needed some time to realize this... :-D

            Comment


            • #36
              Originally posted by vwnut8392 View Post
              all my information wasnt for the actual functionality of having the wideband lambda control the ECU itself. i was just telling a simple way to get the 0-5V signal into the ECU on AN6 .
              Exactly,
              If you want, add one add A, 0xF "correction factor" in your code, add Scalar for adjustment of the difference between voltage from WBO2 controller and constant voltage (about 4.75 Volts) of AN6 to be able to have 80h for lambda=1 or just set desired voltage for lambda=1 with this difference in WBO2 controller. Then set constant voltage in WOB2 controller 2.5 Volts for example and see what you have in MAF_C in BDL. Then divide max AFR (22.35 for example) on your WBO2 by min AFR (7.35)and then /256 to have bit step and change Dmitri,s Winlog driver for MAF_C or MAF_T to convert raw value to AFR (7.35+ raw value * bit step OR if raw value is CPL then 22.35 - raw value * bit step) which can be compared directly to AFR_req.
              Originally posted by prj View Post
              I think with wideband you know exact mixture, so there is no point to use these thresholds. All the stock logic must be removed and probably a good idea to do PI controller with I being only active when we are close to target....
              Hmmm
              you mean something like this:

              New_Code_Lambda_control:
              Push DPTR, B and etc used in code!

              P-control:
              Mov A, AFR_req - may be Ram_8 or (Ram_F+Ram_10);
              subb A, AFR;
              jnz Code_P_control; - check for error e(t);
              Mov R4, 0x00;
              Sjmp Code_End or direct ret/END ;

              Code_P_control:
              Jc to Code_Rich;
              Code_lean:
              Cjne A, 0xXX, Code_Next1; - value for % close to target, for residual e (t) error from P.
              Code_next1:
              Mov R4, 0x01;
              Jc code_I_Control;
              Mov A to some xram_e(t) - for I control;
              Add A into AFR_req;
              Mov AFR_Req, A
              sjmp Code_End;

              Code_Rich
              Cjne A, 0xXX, Code_next2; - value for % close to target, for residual e (t) error from P.
              Code_next2:
              Mov R4, 0x02;
              Jc code_I_Control;
              Mov A to some xram_e(t) for I control;
              Subb AFR_req and A;
              Mov AFR_Req, A
              sjmp Code_End;

              Code_I_control:
              Jbc Ram_2B.7, Code_End; – state from the I control delay timer if is there;
              Cjne R4, 0x01, decrease of_AFR_req – check rich lean;
              Mov A, AFR_req;
              Add A, 0x02h -
              Mov AFR_Req, A,
              Sjmp Code_end;

              Code_ decrease of_AFR_req
              Cjne R4, 0x02, Code_end;
              Mov A, AFR_req;
              Subb A, 0x02h -
              Mov AFR_Req, A,

              Code_End;
              Pop DPTR, B and etc used in new code!

              I work on one new code for I control with delta AFR from xram_e(t) and actual AFR, but for now is this.
              The code is very very very general (just one idea) and there is a lot of mistakes , but only this I can do for one hour this morning "Please, don't shooting to the pianist, he can play only like that!"
              I think those exercises add too much "noise" in this topic must be in another new or deleted, because there are no much useful info!
              ...
              shoot now
              Last edited by d_anev; 27 February 2018, 12:24.

              Comment


              • #37
                May the patent US4646697 (epo.org) can help a little bit
                For wideband lamdba control I didn't found a patent yet but I like the "step size" defintion about the reaction time (patent DE19610170A1).

                Comment


                • #38
                  Originally posted by Acki View Post
                  May the patent US4646697 (epo.org) can help a little bit
                  For wideband lamdba control I didn't found a patent yet but I like the "step size" defintion about the reaction time (patent DE19610170A1).
                  Everything is useful . But i start one idea only for new logic created for one hour, there are many approaches to do that and I use variables like AFR_req add, subb by it and etc which is not presented in that format in stock code. Code can be optimized/grouped, because some of the command are repeated. This аre generalized variables for simplicity. Exact AFR management by lambda control will be very different I follow the main idea of Dmitri for this i.e. from M232.org "... read 8051 assembler and wish to contribute to the project". I'm still far away from readers and developers of 8051, but this is the one place for exchange of views and experience and idea from his post for PI controller.
                  Аny suggestions for new logic are welcome

                  PS: Dmitri will not did that or other final tested and worked solution for any of us except all data in M232.org . We must do the main part and when hi have a free time and wish may be he will help and correct some mistakes.
                  Last edited by d_anev; 27 February 2018, 13:44.

                  Comment


                  • #39
                    I think you will get decent results with just a P with an amplification map. Either based on RPM or delta AFR.
                    Or you can just make a simple map where axis is delta AFR and value is amount to correct, then run that every certain amount of time.
                    And then activate an I component once the AFR gets close to target, deactivate it, if it strays far from target.
                    http://tuner.ee - http://www.facebook.com/tuner.ee

                    Comment


                    • #40
                      Shouldn't sound like I critizize your code or something like that. It's more some brain storming for me.
                      I'm also not a developer - more trial and error of understanding everything *g*

                      I like how this all starts to grow new ideas thx prj for this "kick off"!

                      Comment


                      • #41
                        Originally posted by prj View Post
                        I think you will get decent results with just a P with an amplification map. Either based on RPM or delta AFR.
                        Or you can just make a simple map where axis is delta AFR and value is amount to correct, then run that every certain amount of time.
                        And then activate an I component once the AFR gets close to target, deactivate it, if it strays far from target.
                        Are you see what I mean in my first post for Dmitri's productivity Answer with few sentences, contains several solutions on one task!!! The choice is yours I posting wall of words, zero solutions... real facts ....the other things are just opinions.

                        Comment


                        • #42
                          p. 96 wideband lamda control...
                          Attached Files

                          Comment

                          Working...
                          X