No announcement yet.

Get current gear for mercedes?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Get current gear for mercedes?

    I am making some software for my car and was wondering how to get the current gear that my Mercedes is in.

    Does anyone know how to get this ... or even better get a table like the one here:
    that contains Mercedes specific commands?


  • #2
    Current gear is not a defined pid in EOBD/OBD2.
    If it is available then it's Mercedes specific.


    • #3
      As p2psmurf says, current gear isn't available. That doesn't mean you can't guess it though.

      Drive in first gear for a while, storing VSS and RPM. Then drive in second gear gear for a while, storing VSS and RPM... etc.

      Dividing one by the other gets you a ratio that is effectively a gear. In future, to figure out what gear you're in, just calculate the current ratio and see which of your ratios it's currently closest to [say, within 15%]. If it's not close to any of them, you can assume you're out of gear or something.

      I've been looking at how to do this programmatically for a while. Turns out the ratios just ain't that clean most of the time. For example, here's a plot of vss/rpm for me, going from a stop all the way up to freeway speed in sixth gear, going past time traffic lights on the way:

      Note that in essence, there's graph-wide a "flat bit" at each gear; if you can get a good estimate of the value of that flat bit, you're good to go. Note that due to sampling wibbles, you can't get the instantaneous RPM *and* VSS simultaneously, which is why the graph isn't properly flat.

      The application you see there is actually a tool to filter data based on fourier transforms that I wrote to experimentally see if I could flatten the flat bits. It turns out to suck for this data, but the tool's still pretty useful for graphing things and molesting other data [I have some friends that are using it to clean up various other types of data, now]. It's called obdfft; it's open source, in the obdgpslogger package :-D

      Gary (-;
      OBDGPSLogger, for logging OBDII and/or GPS data
      OBDSim, an OBDII/ELM327 software simulator
      mp3car forums: obdgpslogger, obdsim


      • #4
        I know it would be specific to the manafacture ... most cars you can get it using extended pid's