Gen2 Prius: Custom PIDs for Torque (Android App) with formulas

Discussion in 'Gen 2 Prius Technical Discussion' started by usbseawolf2000, Jun 24, 2011.

  1. usbseawolf2000

    usbseawolf2000 HSD PhD

    Joined:
    Sep 22, 2004
    14,487
    3,000
    0
    Location:
    Fort Lee, NJ
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    See below. That should sum it up.

    [​IMG]
    [​IMG]

    Source

    MG2 is the traction and regen motor. You can monitor MG2 torque to see how much electric propulsion and regen HSD is doing. Surprisingly, MG2 assists way less than I thought! The gas engine's torque is enough for most of my driving needs. MG2 RPM is pretty useless since it ties to the vehicle speed.

    MG1 starts the gas engine and also acts as a generator to supply electricity to either MG2 or charge the HV battery. MG1 torque is wrong at the moment but RPM seems right. MG1 can be monitored to see how much electricity is being generated from the gas engine.

    There are a bunch of PIDs but I don't have time to add them yet. I'll post later so you guys can test.

    BTW, do you get the correct unit? On mine, MG2 torque's unit is displaying "F". That's for the coolant temperature.
     
    2 people like this.
  2. usbseawolf2000

    usbseawolf2000 HSD PhD

    Joined:
    Sep 22, 2004
    14,487
    3,000
    0
    Location:
    Fort Lee, NJ
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    This is what I am talking about. HV SOC's unit should be "%" and MG2Torq should be Nm.

    [​IMG]
     

    Attached Files:

  3. usbseawolf2000

    usbseawolf2000 HSD PhD

    Joined:
    Sep 22, 2004
    14,487
    3,000
    0
    Location:
    Fort Lee, NJ
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    I think these will be useful. I have not tested them. They are from HV ECU.

    HV Battery Charge
    PID: 21CF
    Min: 0
    Max: 50
    Unit: kW
    Equation: E-64
    Header: 7E3

    HV Battery Discharge
    PID: 21CF
    Min: 0
    Max: 50
    Unit: kW
    Equation: F-64
    Header: 7E3

    HV Battery Fan Mode
    PID: 21CF
    Min: 0
    Max: 10
    Unit: Num
    Equation: I
    Header: 7E3
     
  4. usbseawolf2000

    usbseawolf2000 HSD PhD

    Joined:
    Sep 22, 2004
    14,487
    3,000
    0
    Location:
    Fort Lee, NJ
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    I added a link to the spreadsheet with a bunch of custom PIDs in the first post. Please confirm / report issue with any of them so I can track it with the group effort.
     
  5. usbseawolf2000

    usbseawolf2000 HSD PhD

    Joined:
    Sep 22, 2004
    14,487
    3,000
    0
    Location:
    Fort Lee, NJ
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    Torque version 1.4.94 supports the custom PIDs to be imported directly from micro SD card. I added the CSV file (with 117 PIDs) in the first post along with two additional screenshot.
     
  6. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,705
    511
    63
    Location:
    USA
    Vehicle:
    2009 Prius
    Thanks for documenting it. I don't think this formula is correct:

    Anyone got the correct formula (agreeing with blC & buC)?
     
  7. usbseawolf2000

    usbseawolf2000 HSD PhD

    Joined:
    Sep 22, 2004
    14,487
    3,000
    0
    Location:
    Fort Lee, NJ
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    The unit may be F instead of C. Does it make sense or is it totally off?
     
  8. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,705
    511
    63
    Location:
    USA
    Vehicle:
    2009 Prius
    It's off a lot for my 2009 Prius, either F or C. Give it a try on your car and we can compare notes.
     
  9. usbseawolf2000

    usbseawolf2000 HSD PhD

    Joined:
    Sep 22, 2004
    14,487
    3,000
    0
    Location:
    Fort Lee, NJ
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    Prius was parked in a cool garage. Outside air temp was 82 deg F. So, 72 deg F for the battery makes sense to me. I'll update the unit from C to F.

    [​IMG]
     

    Attached Files:

  10. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,705
    511
    63
    Location:
    USA
    Vehicle:
    2009 Prius
    Not so fast. Compare them with blC and buC, or blF and buF if you like. Take a drive in a warm day without A/C so you can warm up the HV batteries. Let blC and buC rise up a few degrees and see if the battery temperatures follow. Mine don't, at least not the same magnitude.
     
  11. usbseawolf2000

    usbseawolf2000 HSD PhD

    Joined:
    Sep 22, 2004
    14,487
    3,000
    0
    Location:
    Fort Lee, NJ
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    Unfortunately, I don't have a ScanGauge II to do that test.

    I checked the xGauge for blC and buC. They are using Mode 03 at PID C3.

    Battery Temp 1 is using Mode 21 at PID CF. So they are from two different ECUs.

    I believe CF is the HV Battery ECU. C3 is higher level because it also reports MG1, MG2 and set target engine RPM. Mode 21 is Toyota specific mode. Mode 3 is the generic DTC mode.

    Therefore, I think Battery Temp 1 is more accurate.
     
  12. usbseawolf2000

    usbseawolf2000 HSD PhD

    Joined:
    Sep 22, 2004
    14,487
    3,000
    0
    Location:
    Fort Lee, NJ
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    In my spreadsheet, C3 has temp for MG1, MG2 and their inverters. Can you check them against blC and buC?
     
  13. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,705
    511
    63
    Location:
    USA
    Vehicle:
    2009 Prius
    ECU identification is in the header (for example 7E3), not the query code following it. 3C3 is the header, not "Mode 03, PID C3".

    At any rate if you don't trust blC and buC (I really don't see why not) then don't use them. Just start collecting the HV battery temperature data using your formula and see how much it moves with the ambient temperature. (Hint: not much at all)
     
  14. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,705
    511
    63
    Location:
    USA
    Vehicle:
    2009 Prius
  15. usbseawolf2000

    usbseawolf2000 HSD PhD

    Joined:
    Sep 22, 2004
    14,487
    3,000
    0
    Location:
    Fort Lee, NJ
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    Nope, haven't seen or read that thread yet. Will do later.

    I also recall you did the test that showed the threshold temp when the HV battery fan kicked in. So I trust you more. :D
     
  16. vincent1449p

    vincent1449p Active Member

    Joined:
    May 24, 2004
    894
    331
    0
    Location:
    Singapore
    Vehicle:
    2012 Prius c
    I don't think it is correct. If you substitute K & L with 0 & 0, you get 32 for the min. value. If you substitute K & L with 255 & 255, you get 73.73 for the max. value.

    From the Repair Manual, the range is -40 to 194 ºF. You can try this formula:

    (234 * 256 / 65535 * K) + (234 / 65535 * L) - 40

    Vincent
     
    2 people like this.
  17. usbseawolf2000

    usbseawolf2000 HSD PhD

    Joined:
    Sep 22, 2004
    14,487
    3,000
    0
    Location:
    Fort Lee, NJ
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    Thanks Vincent. I will try that formula tomorrow. Care to explain how you derived it from knowing min and max?
     
  18. vincent1449p

    vincent1449p Active Member

    Joined:
    May 24, 2004
    894
    331
    0
    Location:
    Singapore
    Vehicle:
    2012 Prius c
    Certainly.:)

    Let Tmin. = -40, Tmax. = 194, y = Calculated temp., x = Value read by Torque

    y = Mx + C

    When y = Tmin., x = 0,
    -40 = M * 0 + C
    C = -40

    When y = Tmax., x = FFFFh = 65535,
    194 = M * 65535 - 40
    M = 234 / 65535

    y = 234 / 65535 * x - 40

    Now, to split x into K & L,

    y = 234 / 65535 * ( 256 * K + L ) - 40

    (234 * 256 / 65535 * K) + (234 / 65535 * L) - 40

    Vincent
     
    SFO likes this.
  19. usbseawolf2000

    usbseawolf2000 HSD PhD

    Joined:
    Sep 22, 2004
    14,487
    3,000
    0
    Location:
    Fort Lee, NJ
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    I tested this morning. I saw Battery Temp 1 = 89 degrees while Battery Temp 2 = 72.89. I'll make updates to all 3.
     
  20. usbseawolf2000

    usbseawolf2000 HSD PhD

    Joined:
    Sep 22, 2004
    14,487
    3,000
    0
    Location:
    Fort Lee, NJ
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    Vincent,

    Your explanation got me thinking about the HV Battery SOC. Following your method, I got the following formula.

    100 / 255 * A​

    However, isn't the SOC's formula 0.5 * A?