1. Attachments are working again! Check out this thread for more details and to report any other bugs.

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

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

  1. gliderman

    gliderman Active Member

    Joined:
    Aug 2, 2011
    751
    223
    0
    Location:
    Texas
    Vehicle:
    2010 Prius
    Model:
    IV
    Where is the mount going?
     
  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
    It is going in the cup holder. I got something like this.

    YEAH! 9.7 inches capacitive multi-touch screen. Here is another pic with all 3 screens. :D

    [​IMG]
     

    Attached Files:

  3. gliderman

    gliderman Active Member

    Joined:
    Aug 2, 2011
    751
    223
    0
    Location:
    Texas
    Vehicle:
    2010 Prius
    Model:
    IV
    Looks like mission control. ;-)
     
  4. jpadc

    jpadc Type before I think too often

    Joined:
    Sep 9, 2008
    343
    34
    0
    Location:
    Indianapolis and Northern Wisconsin
    Vehicle:
    2008 Prius
    Model:
    N/A
    That is very nice.... Lots of screen real estate.
     
  5. ehybrid

    ehybrid Junior Member

    Joined:
    Nov 8, 2011
    17
    4
    0
    Location:
    Melbourne, Australia
    Vehicle:
    2009 Prius
    Model:
    N/A
    Just wondering if your kW converted spreadsheet of PID's is available for download?

    Ben.



     
  6. 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 just published the csv file to the first post. You can also download it here.
     
  7. ehybrid

    ehybrid Junior Member

    Joined:
    Nov 8, 2011
    17
    4
    0
    Location:
    Melbourne, Australia
    Vehicle:
    2009 Prius
    Model:
    N/A
    Great, except there's still hp's, ft-lb's and degF throughout...

    Also, the "friction brake power" seems to have 200kw and 200hp as the "max value" which seems inconsistent. I'd offer a patch but I have no idea what's sensible, or if it even matters, or even if it's wrong :) (I'm guessing it's primarily used to set the scale on the dial gauge?)

    By inspection, it looks like I should be able to just change the units, change the min and max values, and multiply by the appropriate scaling factor - is there more to it than that?

    Of course, I'd also be surprised if someone hadn't already done it...

    Ben.
     
  8. ehybrid

    ehybrid Junior Member

    Joined:
    Nov 8, 2011
    17
    4
    0
    Location:
    Melbourne, Australia
    Vehicle:
    2009 Prius
    Model:
    N/A
    I've made the changes I think are necessary, and attached - the more I looked the more obvious it seemed

    Even so, I'd appreciate an eyeball over it for sanity checking if you don't mind :)

    Thanks,
    Ben.
     

    Attached Files:

  9. ehybrid

    ehybrid Junior Member

    Joined:
    Nov 8, 2011
    17
    4
    0
    Location:
    Melbourne, Australia
    Vehicle:
    2009 Prius
    Model:
    N/A
    And for a slightly more difficult question, any idea how to go about adding injector pulse width?

    (xgauge equivalent PID below if that helps)
    07E021F3 / 0306 8461 05F3 / 3808 / 000A 0008 0001 / inj
     
  10. 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 left both (hp and kW) in there so you can use whichever you prefer. I prefer hp. The min and max can be adjusted in the gauge as well.

    Feel free to make adjustment to your liking. I am just trying to maintain the master list.
     
  11. xs650

    xs650 Senior Member

    Joined:
    Jul 2, 2010
    4,539
    1,433
    9
    Location:
    Northern California
    Vehicle:
    2010 Prius
    Model:
    II
    USB, can you point me to a good explanation of Ian's equations used in the Torque App. Particularly what the algebraic letters represent.

    My android phone is due via UPS today and a Kiwi bluetooth dongle is also on the way. When I load Ian's app onto my android phone, will I find the explanation there?

    I've looked at his website and didn't find an explanation there.

    Thanks for the custom pids list you are maintaining.
     
  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
    Try this thread when I started learning and had the same question.

    The alphabets stands for the bytes returned in the data. "A" represent the first byte. "B" represent the second byte.

    Let's take MG2 at 7E2 (HV ECU) as an example. The data that come back is very long (multi-frame). In fact, there are 32 bytes.

    Only the first two bytes are related to rpm of MG2. The equation to get the correct value in decimal is:

    ((256 * A) + B ) - 16383

    The 3rd and 4th bytes are for MG2 torque, etc. By using A, B, C and D, I was able to derive MG2 power. That's only because both the torque and rpm are from 7E2.

    Some of the data are binary (on or off). For example, the Smartkey Status. In order to pull the first bit from the first byte, you use {A:0}. For the last bit, use {A:7}, as there are 8 bits in a byte.
     
    1 person likes this.
  13. 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
    We are going to need Vincent's expertise on this one. :(
     
    1 person likes this.
  14. xs650

    xs650 Senior Member

    Joined:
    Jul 2, 2010
    4,539
    1,433
    9
    Location:
    Northern California
    Vehicle:
    2010 Prius
    Model:
    II
    Thanks, I don't think I would have found that thread on my own, I've spent some time on that site.. I should have gotten a clue what was going on from the hex conversion looking equations though.

    Looks like I have a homework assignment and thanks again for pulling all the info together for us.
     
  15. vincent1449p

    vincent1449p Active Member

    Joined:
    May 24, 2004
    894
    331
    0
    Location:
    Singapore
    Vehicle:
    2012 Prius c
    Hi ehybrid,

    I believe this xgauge was found by hobbit:

    http://www.techno-fandom.org/~hobbit/cars/can-split.html

    I think the reason for the deviation is the rounding error in the scaling. From the RM, the Injection period of the No. 1 cylinder:

    Min.: 0 ms, Max.: 32.64 ms

    http://share.qclt.com/丰田普瑞斯原厂英文手册PDF格式/Repair Manual/04pruisr/05/2054m/cidlitac.pdf

    Using y = Mx + C,

    When x = 0 (Min.), y = 0 => C = 0

    When x = 255 (Max.), y = 32.64 => M = 0.128

    Therefore, I think the xgauge should be:

    07E021F3 / 0306 8461 05F3 / 3808 / 0080 0064 0000 / inj

    The corresponding Torque equation:

    Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 Column 7 Column 8
    0 Name ShortName ModeAndPID Equation Min Value Max Value Units Header
    1 Injection period of the No. 1 cylinder inj 21F3 C * 0.128 0 32.64 ms 7E0

    Vincent
     
    2 people like this.
  16. ehybrid

    ehybrid Junior Member

    Joined:
    Nov 8, 2011
    17
    4
    0
    Location:
    Melbourne, Australia
    Vehicle:
    2009 Prius
    Model:
    N/A
    The injector pulse width PID seems to ... sort of work.... other than something in the changes I've made to that spreadsheet has broken most of the other pid's and makes torque crash :/

    I've been staring at the thing for hours, someone feel like making me feel silly and show me where my ridiculous typo is?

    Ben.
     
  17. ehybrid

    ehybrid Junior Member

    Joined:
    Nov 8, 2011
    17
    4
    0
    Location:
    Melbourne, Australia
    Vehicle:
    2009 Prius
    Model:
    N/A
    Sorry for being a serial pest :) Hope my contribution can result in a second "master list" with metric units for everything, rather than having double the number of pid's in the one spreadsheet (the list is so long as to be a major inconvenience to add displays as it is - unless there's an easy way I don't know about?)

    Have a question on your "friction brake power" calculation:-
    Seems
    (((256 * A) + B) - 16383) * ((4*R - 512) + (4*E)) / 9549
    Which would seem to translate as:-
    MG2 revolution * Brake master cylinder torque + brake regenerative torque

    ...I don't understand why you're adding the regen torque... Seems that should be labeled "total brake power" or have the last term removed, right?

    Ben.
     
  18. xs650

    xs650 Senior Member

    Joined:
    Jul 2, 2010
    4,539
    1,433
    9
    Location:
    Northern California
    Vehicle:
    2010 Prius
    Model:
    II
    Hi Ben, Your equation came through with a smiley in it. You can avoid that by enclosing it in {code} {/code} except use the square brackets instead of the curly ones I used.

    This is only an example and may not be correct...
    Code:
    (((256 * A) + B - 16383) * ((4*R - 512) + (4*E)) / 9549
    
    I'm assuming it should have been a B
     
  19. ehybrid

    ehybrid Junior Member

    Joined:
    Nov 8, 2011
    17
    4
    0
    Location:
    Melbourne, Australia
    Vehicle:
    2009 Prius
    Model:
    N/A
    Sorry xs650, didn't notice. Try2 :-
    Code:
    ((4*R - 512) +   (4*E)) * 0.7376
    (((256 * A) + B) - 16383) * ((4*R - 512)   + (4*E)) / 9549   
    
    These two are for "friction pad torque" and "friction brake power" -- both seem to add the "regenerative torque" factor (the 4*E part)

    Ben.
     
  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
    I noticed your CSV files doesn't have qualifiers (""). Perhaps, that may have caused it. I have seen Torque not importing the custom PIDs if CSV is not properly formatted. I have not seen it crash. If adding the qualifiers don't fix it, try the latest version. It is really fast and noticeable on Zio. :D

    Master cylinder torque is positive but the regen torque is negative. Adding them together should result in torque just from the friction pad.