Forum >Replies by 1900gte
userhead 1900gte
Replies (1)
  • You Reply: Hello Stanley,
    Sorry for the late reaction, was out of town for a week.
    I wrote a simple rough sketch with which i could simply increase the PID value and see what the ECU would return.
    PID 0A and OB did not work at all. the rest till 20 works, though I wonder if some of the calcultions are correct.
    For instance PID 15 LAmba is very interesting but only gives 0 or 1, i think the calculation of smallValue/200 is not correct.
    So it needs more tinkering
    ps.  PID x0B would be great because i have a turbo car.

    // mode 0 pids
    #define PID_FUEL_SYS_STS 0x03
    #define PID_ENGINE_LOAD 0x04
    #define PID_COOLANT_TEMP 0x05
    #define PID_SHORT_FUEL_TRIM 0x06
    #define PID_LONG_FUEL_TRIM 0x07
    #define PID_FUEL_PRESSURE 0x0A  // not VAG 2003
    #define PID_INTAKE_MAP 0x0B      // not VAG 2003
    #define PID_RPM 0x0C
    #define PID_SPEED 0x0D
    #define PID_TIMING_ADVANCE 0x0E
    #define PID_INTAKE_TEMP 0x0F
    #define PID_MAF_FLOW 0x10
    #define PID_THROTTLE 0x11
    #define PID_CMD_SEC_AIR_STS 0x12
    #define PID_OXYGEN_SEN_PRES 0x13
    #define PID_LAMBDA_B1S1 0x14    //not VAG 2003
    #define PID_LAMBDA_B1S2 0x15
    #define PID_RUNTIME 0x1F
    #define PID_FUEL_LEVEL 0x2F
    #define PID_DISTANCE 0x31
    #define PID_BAROMETRIC 0x33
    #define PID_LAMBDA 0x34
    #define PID_CONTROL_MODULE_VOLTAGE 0x42
    #define PID_ABSOLUTE_ENGINE_LOAD 0x43
    #define PID_AMBIENT_TEMP 0x46
    #define PID_ETHANOL_PERCENTAGE 0x52
    #define PID_FUEL_RAIL_PRESSURE 0x59
    #define PID_HYBRID_BATTERY_PERCENTAGE 0x5B
    #define PID_ENGINE_OIL_TEMP 0x5C
    #define PID_ENGINE_FUEL_RATE 0x5E
    #define PID_ENGINE_TORQUE_PERCENTAGE 0x62
    #define PID_ENGINE_REF_TORQUE 0x63
    #define PID_ABS_ENGINE_LOAD 0x63


    int COBD::normalizeData(byte pid, char* data)
    {
    int result;
    switch (pid) {
    case PID_ENGINE_LOAD:  //0x04
    result = (getSmallValue(data) *100)/255;
    break;
    case PID_COOLANT_TEMP:// 0x05
    result = getSmallValue(data) - 40;
    break; 
            case PID_SHORT_FUEL_TRIM: // kPa  0x06
    result = ((getSmallValue(data)-128) *100)/128;
    break;
            case PID_LONG_FUEL_TRIM: // kPa  0x07
    result = ((getSmallValue(data)-128) *100)/128;
    break;
            case PID_FUEL_PRESSURE:  // PID = 0A
    result = getSmallValue(data) * 3;
    break;
    case PID_INTAKE_MAP:  // 0X0B
            case PID_RPM:  // 0x0C
    result = getLargeValue(data) >> 2;
    break;
            case PID_SPEED:  //0x0D
            result = getSmallValue(data) ;
    break;
            case PID_TIMING_ADVANCE:  //0x0E
    result = (getSmallValue(data) /2)-64;
    break;             
    case PID_INTAKE_TEMP: // 0x0F
    result = getSmallValue(data) - 40;
    break;
            case PID_MAF_FLOW:  //0x10
    result = getLargeValue(data) / 100;
    break;
    case PID_THROTTLE:  //0x11
    result = (getSmallValue(data) *100)/255;
    break;
            case PID_LAMBDA_B1S1:  // 0x14 
      result = getSmallValue(data) /200;
    break;     
            case PID_LAMBDA_B1S2:  // 0x15 
      result = getSmallValue(data) /200;
    break;     
            case PID_RUNTIME: // second  0x1F
    result = getLargeValue(data);
    break;
    case PID_FUEL_LEVEL:  //0x2F
    result = (getSmallValue(data) *100)/255;
    break;
    case PID_DISTANCE: // km  //0x31
    result = getLargeValue(data);
    break;
    case PID_BAROMETRIC: //    //0X33 
            case PID_LAMBDA:  // 0x34 
      result = getLargeValue(data) /32768;
    break;
            case PID_CONTROL_MODULE_VOLTAGE: // V  0x42
    result = getLargeValue(data) / 1000;
    break;
    case PID_ABSOLUTE_ENGINE_LOAD:  //0x43 
    result = (getLargeValue(data)*100)/255;
    break;
    case PID_AMBIENT_TEMP:  //0x46
    result = getSmallValue(data) - 40;
    break;
    case PID_ENGINE_OIL_TEMP:  //0x5C
    result = getSmallValue(data) - 40;
    break;

    case PID_ENGINE_FUEL_RATE: // L/min  0x5E
    result = getLargeValue(data) /20;
    break;
    case PID_ENGINE_TORQUE_PERCENTAGE: // %  0x62
    result = (int)getSmallValue(data) - 125;
    break;
            case PID_ENGINE_REF_TORQUE: // Nm  0x63
    result = getLargeValue(data);
    break;
          /* case PID_ABS_ENGINE_LOAD :  //0x63
    case PID_ETHANOL_PERCENTAGE:
    case PID_HYBRID_BATTERY_PERCENTAGE:
    result = getLargeValue(data) * 100 / 255; // %
    break;
    */ default:
    result = getSmallValue(data);        //speed 0x0D  baromatric 0x33
    }
    return result;
    }