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
    I created a new view to test out the HSD combined power and the Friction Brake torque. I also changed the gauge type to see if I like them better.

    [​IMG]

    HSD Combined Power = ((256*A + B - 16383) * ((32*C + 0.125*D - 500)*0.7376) / 5252) + ((256*G + H - 16383) * ((32*I + 0.125*J - 500)*0.7376) / 5252) + (((256 * K) + L) * 0.0134)

    Brake Pad Torque = ((4*R - 512) + (4*E)) * 0.7376

    I ran into an issue when trying to create the Parallel vs. Series power ratio. Since MG1 and MG2 can reverse roles, I can't do it with a static equation.

    [Edit]: I tested and found a logical mistake in the HSD Combined Power. It should not include HV battery power since the motor reports the power that it consumes from the battery. I removed it from the above equation.

    The Brake Pad Torque seems to be working right. I did not have Regen Brake Torque and Master Cylinder Torque next to it to compare. It was seeing -3 lbs-ft when I was expecting zero so it is not completely right yet.
     

    Attached Files:

    • New.jpg
      New.jpg
      File size:
      71.5 KB
      Views:
      4,545
  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
    HSD Power is allowing me to see the drivetrain loss and I am caught up in minimizing that loss to gain additional efficiency (more MPG). Take a look at these two screenshots.

    I was stuck in a 45 min traffic congestion right before the Holland tunnel heading to NJ. The HV battery was getting low so I force charged it to prevent it to drive like a Honda hybrid.

    HSD requested 12.2 hp from the ICE. The generator (MG1) reported generating 12.2 hp (near 100% efficient?). However, the battery is being charged with 8.9 hp. If Prius is idling with ICE off, headlight on, with my sound system playing, HV battery discharged at 0.6hp. So the loss is 2.7hp (22%) from the inverter to the battery.

    [​IMG]

    The second pic below was taken at speed around 50 mph. Judging from the ICE power, I was accelerating. Here, we see ICE is generating 24.2hp but MG2 was acting as a generator creating 10.6hp (series hybrid). This means, 13.6hp is going through mechanical path (parallel hybrid). At this moment in time, Prius is acting more parallel than series. The first pic shows 100% series since zero mechanical power (car at rest) went to the wheel.

    Another interesting thing revealed was what appears to be drivetrain loss. ICE was generating 24.2hp. The battery took 1.9hp to recharge. HSD combined power was only 19.1hp. There is 3.2hp difference minus 0.6hp idle loss equals 2.6hp. I don't know where that 2.6hp goes.

    [​IMG]
     

    Attached Files:

  3. cwa

    cwa Member

    Joined:
    Mar 15, 2011
    41
    2
    0
    Location:
    Colombo
    Vehicle:
    2008 Prius
    Model:
    N/A
    Hi USB,

    Do you know the difference between ELM327 and PLX Bluetooth ?

    Or Does PLX support CAN BUS protocal?

    CWA
     
  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
    The Kiwi Bluetooth that I am using is from PLX so, yes it supports CAN BUS. It was $85 on Amazon the other day but now $90.

    Stay away from the clone ELM327 bluetooth adapters. I have one and it doesn't work on CAN BUS.

    OBDLink uses the new ST chip that is backward compatible with ELM327 commands. I have the OBDLink SX version (with USB cable to connect with a netbook) and it works well with CAN BUS. The bluetooth version is said to be the fastest but it was $50 more than Kiwi.

    Here is a list of adapters for Torque:

    Bluetooth Adapters - TorqueWiki
     
    1 person likes this.
  5. cwa

    cwa Member

    Joined:
    Mar 15, 2011
    41
    2
    0
    Location:
    Colombo
    Vehicle:
    2008 Prius
    Model:
    N/A
    Many thanks USB for swift response. I will try to get PLX . My car does not responding to normal OBD2 as it is a JDM (prius 2008) model. I was told that CAN BUS will work on this JDM model.
     
  6. cwa

    cwa Member

    Joined:
    Mar 15, 2011
    41
    2
    0
    Location:
    Colombo
    Vehicle:
    2008 Prius
    Model:
    N/A
    Hi USB,

    Finally I placed an order for plx Wiki BT unit. I am also expecting Galaxy tab.

    Would you share the latest csv file for custom PIDs and (and the exact location to be copied) so that I can have a quick start?

    Regards

    CWA
     
  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
    I added the latest csv file in the first post. Here is a link to it.
     
    1 person likes this.
  8. djras

    djras New Member

    Joined:
    Sep 1, 2011
    32
    2
    0
    Location:
    Victorville, CA
    Vehicle:
    2009 Prius
    Model:
    II

    I downloaded the latest CSV, but the latest version of torque (1.5.11 i believe) does not seem to use the .torque directory for the csv file. Do you know where it does look?

    David

    P.S. I found the problem was I had been using the FREE version of Torque. I paid the 4.95 and now works as shown.
     
  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
    Great to hear. What are you running on? Post some pics too, would love to see.

    The previous version was importing only the top 100 PIDs. I reported the bug and I am not sure this version fixed it. Don't go crazy if you don't see everything loaded. I moved the important PIDs to the top in the CSV.
     
  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
    Did you get yours?
     
  11. thatguy

    thatguy New Member

    Joined:
    Sep 15, 2011
    19
    7
    0
    Location:
    Virginia
    Vehicle:
    2005 Prius
    Model:
    N/A
    usb,
    Thanks for your fantastic work on the Torque .csv. I have been modifying it to fit my preferred units (kW) and I have a few questions about it:

    Where did you get your data? xGauge? A manual? Days spent with CAN?

    Where is the "Brake - Friction Pad Torque (lbs-ft)" measured? Is it at MG2, the wheels, or somewhere else?

    I am trying to display friction brakes in kW but aren't sure about my multiplier. My current formula is Friction (kW) = (((256 * A) + B) - 16383) * ((4*R - 512) + (4*E)) / 5335 but if the torque is measured somewhere other than MG2 I am off by at least a 4.113 gear ratio.
     
  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
    My work is based on a spreadsheet Vincent found.


    It is basically Master Cylinder Torque + Regenerative Torque

    Since MCT is negative value and RT is positive, adding them would result in the remaining torque which is from the friction pad.

    Both MCT and RT are from 7E2, the same as MG2 so your formula should be correct. Any reason why you are dividing by 5335 instead of 5252 to get power?
     
  13. thatguy

    thatguy New Member

    Joined:
    Sep 15, 2011
    19
    7
    0
    Location:
    Virginia
    Vehicle:
    2005 Prius
    Model:
    N/A
    Thanks for confirming my assumption and checking my numbers. 5335 was a mistake; the correct value to divide by is 9549 for output in kW. For hp the denominator is 5252 / 0.7376 = 7120.

    Friction Brake Power (kW) = (((256 * A) + B) - 16383) * ((4*R - 512) + (4*E)) / 9549
    Friction Brake Power (hp) = (((256 * A) + B) - 16383) * ((4*R - 512) + (4*E)) / 7120

    I also found that using the individual battery cell voltages and the battery current gives both higher resolution and more stable numbers for HV battery pack output than the reported HV resource. The downside is that it uses a different ModeAndPID so I can't combine it with engine and motor numbers to determine losses in a single gauge in Torque. The formula I use is:
    ModeAndPID 21CE
    Header 7E3
    Battery power (kW) = 0.001 * ((2.56 * B) + (0.01 * C) - 327.68) * ((2.56 * (D + F + H + J + L + N + P + R + T + V + X + Z + AB + AD)) + (0.01 * (E + G + I + K + M + O + Q + S + U + W + Y + AA + AC + AE)) - 4587.52)

    Battery Power (hp) = ((2.56 * B) + (0.01 * C) - 327.68) * ((2.56 * (D + F + H + J + L + N + P + R + T + V + X + Z + AB + AD)) + (0.01 * (E + G + I + K + M + O + Q + S + U + W + Y + AA + AC + AE)) - 4587.52) * 0.001341

    I came across a pretty interesting report on the 2004 Prius drivetrain by Oak Ridge National Lab (ORNL). They disassembled a prius and bench-tested a bunch of the components individually. The report includes data on gear losses at various oil temperatures and speeds (Tables 3.7-13), motor efficiency contours (Figures 3.18-20), lots of curves, and tons of pictures. It may help you answer your question about where the missing energy on your Torque display is going.

    The report is titled "Evaluation of 2004 Toyota Prius
    Hybrid Electric Drive System". It can be found here:
    www.k0bg.com/images/pdf/890029.pdf
     
    1 person likes this.
  14. 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, I added them to google spreadsheet. I'll publish the .csv file to import later or if someone asks for it.

    I must admit, this is getting hardcore! Of course in a good intellectually amusing way. :D

    I am curious what device you are running on.
     
  15. thatguy

    thatguy New Member

    Joined:
    Sep 15, 2011
    19
    7
    0
    Location:
    Virginia
    Vehicle:
    2005 Prius
    Model:
    N/A
    At the moment I am running Torque on my android phone, a HTC EVO. The 4.3" screen is mounted on a bendable stalk that is attached to the little triangular window just forward of the driver. If I get around to it I would like to end up permanently installing my old phone, a HTC Hero, somewhere below the speedometer but close to driving line-of-sight.

    The gauges I typically display are:
    ICE Power, HSD Power, HV Power, HV SOC, Friction Brake Power, and Timing Advance
    If you have any suggestions for other fun and useful gauges I’d love to hear them. I’m an engineer, an optimizing efficiency nut, and I could watch changing numbers all day.

    My driving is broken down into three regimes: power, glide, and braking.
    When operating under power I try to keep ICE Power between 15 and 20 kW (max engine efficiency). I regularly exceed this for on-ramps, big hills, and the like, but for most straight roadway driving I try to stay in that band. Once I reach my peak speed I start to glide, trying to keep ignition timing at 5 degrees (fuel cut) and power in and out of the batteries as close to zero as possible (thus minimizing round-trip battery and conversion losses). When braking I try to brake with enough foresight to keep the Friction Brake Power value close to or at zero until I get down to 7 mph. If I have enough room to brake softly I like to keep power into my batteries under 10 kW on the theory that this is gentler to the batteries (6 years 148,000 miles) and may have a higher round-trip efficiency.

    My 65 mile round-trip commute is half highway and half high-speed secondary road with slight hills and unavoidable stoplights. I have a mile or two of low-speed roadway on each end to properly warm up the engine and cool down the cabin. My typical speeds are 65-70 mph on the highway and 55-65 on the secondary. Since I started using the strategy outlined above I have been able to get a multi-tank average of 56-58 mpg even with A/C in the evening commute. While far from what some have achieved this is significantly better than the 48-52 mpg I ran earlier this summer on the same commute with similar temperatures.
     
    EDM Prius likes this.
  16. cwa

    cwa Member

    Joined:
    Mar 15, 2011
    41
    2
    0
    Location:
    Colombo
    Vehicle:
    2008 Prius
    Model:
    N/A
    Thanks USB. I just got it. I also just downloaded the paid version and just about to put your PID file. Let you know the outcome.

    Just a question, what is the fastest PID rate on your device? mine is 18 pid /s - which is not bad. I have disable the fast communication.

    Regards

    CWA:)
     
  17. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,705
    511
    63
    Location:
    USA
    Vehicle:
    2009 Prius
    If you really keep the HV battery current null during glide then you will find the battery SOC filled up gradually since pulsing and braking both fill it up and eventually there will be no room to accept regen current. In most cases it's better and easier to just do the "no arrow" glide which does use a bit of current (3 ~ 7 amps depending on speed). This slowly bleeds the HV battery during glide to make room to accept charge from pulsing and braking.
     
  18. 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 checked mine yesterday. I had the fast communication disabled to save battery too. It said 11 PID per sec. :(
     
  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
    How is yours going? I got a HP Touchpad on the fire sale. I can't wait to dual-boot Android on it and run Torque. Bluetooth is not working on it yet so I am anxiously waiting for progress from CM7 team. :)
     
  20. thatguy

    thatguy New Member

    Joined:
    Sep 15, 2011
    19
    7
    0
    Location:
    Virginia
    Vehicle:
    2005 Prius
    Model:
    N/A
    I try to keep the current near zero on glide but I have found, as you said, that it is effectively impossible to keep it at zero. If I'm not paying much attention to the numbers on the highway-speed glide I tend to stabilize at either 2.4-3 kW out of the batteries or 1-1.5 kW in. If I am paying close attention to the gauge I can keep it to .5-1.5 kW out of the batteries but it is incredibly sensitive to accelerator petal position. Most of my time on the highway is spent between 63 and 68% SOC.

    Although they are expected to be rainy, I'm going to log data for the next few commutes so I can look at the histograms to get a better feel for how much of my drive I'm actually following my guidelines.