Announcement

Collapse
No announcement yet.

Better datalogging using the stock ECU

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

  • Better datalogging using the stock ECU

    First of all, I am not completely sure, that this is the right forum for this, but I thought it matches best. If it's not feel free to move the thread around.

    Introduction
    I bought this wideband controller/datalogger. It has a very good bang-for-the-buck ratio, has USB, lots of inputs, etc (more about it in a separate thread).
    What is perhaps the best, is that it has a Winlog driver written for it for logging.

    Winlog is a generic logging platform, for which drivers can be written in C++. It also has drivers for techedge/zeitronix WBO2 out of the box.

    The problem
    The main issue with logging and Motronic, is that you can log load, IAT and timing with VAG-COM, and then have a separate log with MAP, RPM and AFR, EGT in Winlog.
    This makes it very annoying to look up values, since you have to always cross-reference two graphs.

    The solution
    I have looked at VAG-COM, specifically VC-Scope. I then realized that it has source code available.
    VAG-COM communicates with VC-Scope using an anonymous pipe. Accessing that pipe is a matter of substituting the VC-Scope exe file for your own file, then reading the pipe, parsing the data and feeding it to a custom winlog driver. This will allow to graph Load, Timing, IAT, MAP, RPM, EGT and AFR on the same graph in real time.
    Of course, this has other uses as well, for example in a car pc.

    Progress
    I have so far written a program to intercept the data VAG-COM sends.
    I now have to write a driver for Winlog to receive said data. My C++ is a bit rusty (programming 8 bit 8051 ASM is so much easier...), but I am making progress...

    Opinions? Suggestions? Anyone wants to help?
    Last edited by prj; 15 November 2010, 10:42.
    http://tuner.ee - http://www.facebook.com/tuner.ee

  • #2
    Sounds like a good plan there although my knowledge of computer programming is rather limited so I'll have to leave it to the experts... Be interested to see it all working though
    Cheers'en, AndyC
    1994 ABY Coupe - Projekt Alpinweiss

    Comment


    • #3
      That is interesting.
      Logging the newer cars is so incredibly easy. Pretty much anything can be logged with Vagcom on those.
      1995 RS2 on Alcohol (6.8sec 100-200km/h)
      1994 80E Avant
      1986 2L Golf 2 on Alcohol

      Comment


      • #4
        Originally posted by EspenW View Post
        That is interesting.
        Logging the newer cars is so incredibly easy. Pretty much anything can be logged with Vagcom on those.
        Yup. But not with these cars.
        http://tuner.ee - http://www.facebook.com/tuner.ee

        Comment


        • #5
          Originally posted by prj View Post
          Yup. But not with these cars.

          Exactly my point.
          1995 RS2 on Alcohol (6.8sec 100-200km/h)
          1994 80E Avant
          1986 2L Golf 2 on Alcohol

          Comment


          • #6
            Success.
            I now have all Group 0 values in winlog.
            I went a different route than I initially planned. I did not want to restrict VC-Scope functionality in any way, so what I did was look up where the arrays with data are loaded.

            So all my winlog driver does is find the VC-Scope process and read the values directly from it's memory.
            This could also be done with VAG-COM, but because VAG-COM has lots of anti-debug/crack protection, it is a PITA.

            Mapping this ECU just got many times easier...
            I will add the other groups as well and release the driver+source code, in case anyone is interested.
            http://tuner.ee - http://www.facebook.com/tuner.ee

            Comment


            • #7
              I'd be interested to see it in operation. It'd be useful for people like me who know very little to produce a graph of how the car is running and seek assistance based on the information.
              Shane

              Comment


              • #8
                Progress
                I created a winlog driver with a hook on Vag Scope a while ago.
                Resulting log:

                Or this:


                However, group 0 (where load is), does not have very much useful info.
                Actually, load is about the only useful thing you can read from there.

                So, I started digging in IDA Pro once again... and I managed to find Motronic's OBD implementation.
                I found how every single value is calculated. I also found that you can map the OBD output of motronic. You can specify which measuring block is displayed in each group. You can also modify the existing measuring blocks. To make them show what you want.

                If that was too quick - Motronic 2.3.2 uses KWP-1281. It has groups and each group consists of measuring blocks. 2.3.2 has 30 measuring blocks.
                Each block consists of an ID, a low byte and a high byte. That ID is for a lookup table, which specifies how to calculate the value of each block.
                So now I have 30 blocks. M2.3.2 has 10 four block groups and one 10 block group.

                Each four block group is mappable inside the ECU. You can select which blocks to show in which group.
                Now, in addition there is the ten block group out of that 8 values are customizable.

                Because VAG-COM does not calculate block 0, and there are three values (ID, High byte, low byte) for every block. It is possible to modify the algorithms inside motronic and have 24 channel data logging.
                In combination with the SLC DIY it is possible to have these parameters (and more... that's just what I came up with) on the same graph:
                AFR
                MAP
                EGT
                RPM
                LOAD
                Iginition Angle
                Injection Duration
                Duty Cycle
                TPS value
                IAT
                Ambient Pressure
                Battery Voltage
                Coolant Temp
                Oil Temp
                Knock sensor reading #1
                Knock sensor reading #2
                + Everything else that is possible to log with VAG-COM right now.

                And it's possible to update this data 4 times per second.
                This now rivals programmable ECU's.

                What I am working on now
                Since I do not feel yet like implementing the entire KWP-1281 protocol (but I will in the future), what I am writing, is software, which sniffs all the data that VAG-COM receives from motronic and puts it into winlog.
                So you put VAG-COM reading Group 000, and then everything that it receives goes onto the graph.

                I currently have the ECU on my table, with lots of wires hooked up. It takes power directly from my computers PSU. Need to connect a few more wires to get it to talk to VAG-COM on the table.
                This way I won't have to run to the car to test every time.

                This datalogging functionality is one of the major hurdles to overcome with tuning the stock ECU.
                Last edited by prj; 20 January 2011, 11:25.
                http://tuner.ee - http://www.facebook.com/tuner.ee

                Comment


                • #9
                  Jees Dmitri - you need to get out more... pretty intense work.
                  Paul Nugent
                  Webmaster http://S2central.net
                  Administrator http://S2forum.com

                  1994 S2 Coupe ABY - aka Project Lazarus
                  2001 A6 allroad 2.5TDi - family tank
                  2003 S4 Avant 4.2 V8 - daily burble

                  Purveyor of HomeFries and Exclusive agent for Samco hose kits (S2/RS2)

                  There are only 10 kinds of people that understand binary - those that do, and those that don't

                  Comment


                  • #10
                    Originally posted by S2central.net View Post
                    Jees Dmitri - you need to get out more... pretty intense work.
                    Hehe... Do you recognize a certain table in the matrix graph?
                    http://tuner.ee - http://www.facebook.com/tuner.ee

                    Comment


                    • #11
                      This forum never ceases to amaze me.
                      The commitment to our cars is superb.
                      sigpic
                      Other cars:VW Transporter T5 4motion, 'S3 sportback

                      Comment


                      • #12
                        COuld be very interesting. I realised how useful it was having the diagnostics plugged in. Be great to integtrate this into a digital dash / readout
                        Cheers'en, AndyC
                        1994 ABY Coupe - Projekt Alpinweiss

                        Comment


                        • #13
                          Originally posted by Rusty View Post
                          COuld be very interesting. I realised how useful it was having the diagnostics plugged in. Be great to integtrate this into a digital dash / readout
                          That's perfectly doable, but not really viable for the end-user.

                          You don't need that information in day to day driving, it's only for tuning or troubleshooting.
                          http://tuner.ee - http://www.facebook.com/tuner.ee

                          Comment


                          • #14
                            Wouldn't make sense as a full time display, but if you had an existing car PC...
                            1993 ABY Coupe | BMW R1200 GS
                            A6 3.0 TDI Quattro (aka Sonic's 'ring support/cargo vehicle )

                            Comment


                            • #15
                              Originally posted by prj View Post
                              That's perfectly doable, but not really viable for the end-user.

                              You don't need that information in day to day driving, it's only for tuning or troubleshooting.
                              I love all the useless information, must be the Engineer in me

                              For things like track days etc, it would be really useful to be able to have various things displayed that aren't. I should really get an integrated WB02 and EGT probe for that sort of thing, would help with testing of chips / cams also.
                              Cheers'en, AndyC
                              1994 ABY Coupe - Projekt Alpinweiss

                              Comment

                              Working...
                              X