Support for EVs (Tesla)

Request and discussion on new / to change features
User avatar
Harry
Site Admin
Site Admin
Posts: 10634
Joined: Sun Sep 12, 2010 10:32 am
Location: Siegum, Germany
Contact:

Re: Support for EVs (Tesla)

Post by Harry »

Thanks for providing this data, let me elaborate a bit on it:

As you can see in the second screenshot, standard OBD PIDs are almost non-existent. The interface is working the same way ICE engine based cars do, but the PIDs provided are super-sparse. All PIDs successfully requested and received come with timing information using the format "[### ms]". Engine Type and VIN are answered. They are static values (never change) and kind of "configuration information". The PIDs to report PIDs available (e.g. PID01-20) are served, but just respond "there is almost nothing". The AT requests are used to configure the OBD interface but do not carry useful information.

Looking into the two links it becomes clear that BEV manufacturers tend to not use standard PIDs (if applicable at all) but prefer using the underlying protocols (CAN, OBD II) as a formal frame and put relevant information into custom PIDs only. This in turn means, we'd need a "by manufacturer" or worse "by model" configuration. Moreover, custom PIDs are slow when requested using the OBD gateway.

LapTimer supports custom PIDs, so this could be a next step to test access to BEV information. However, this is limited to parameters which can be post processed at all. Saying "post process" I mean three things: calculation of values, display of values and storage of values.

Example "power and torque":
  • for ICEs, LapTimer calculates torque and power developed from MAF or MAP, RPM, engine displacement, volumetric efficiency, engine type and intake type. Parts are read from OBD, parts are in the vehicle's information (see Vehicle Details)
  • for BEVs, power calculation would use engine voltage and amperage (in your example, other manufacturers may deliver the product of these, i.e. wattage) plus an engine specific characteristic mapping rpm to torque
  • for BEVs, multiple engines are common, power needs to be added up at a minimum, for on track driving analytics, storing multiple engine 's data might be of interest...
  • once calculated, display and storage would be identical to BEVs.
Example "gear":
  • can be calculated from rpm, speed, wheel and drive / gear ratios for BEVs
  • for most BEVs, gear is irrelevant
  • while gear is extremely important for ICE drivers - the gear needs to match engine characteristics and be the one resulting in max power - it is irrelevant for BEVs; this means displaying and storing it is irrelevant too; while storage can be left empty, gear needs to be removed from video overlays and real time gauge displays for a good user experience; it is good example why driving BEVs is less complicated too...
My view on BEVs is they will replace ICEs over time in public traffic, and later for track use. So I'm aware LapTimer will need to go through a transition too. Depending on the country it will be a few years to decades.

Actually, LapTimer has most of the calculation and storage part for BEVs implemented already. The reason is the never published "Harry's Biker" app which had a focus on eBikes. They are kind of a mix from motorbikes and BEVs. Harry's Biker uses a proprietary BT LE interfaces (Specialized) to retrieve engine and cadence data. As another indicator, you can select Electric as the energy type already.

So this is kind of "in development" and planning for now.

Next steps:
  • In case you are interested, try to configure a common parameter like RPM as a custom PID and let me know if it works with the already existing functionality; let me know if you need assistance beyond the Custom OBD PIDs section in the engine data document available on http://www.gps-laptimer.de/documentation
  • I need a list of requirements BEV drivers will have when using LapTimer; the ones that come to mind are power / torque as discussed above, SoC, front / rear power distribution, engine/battery temperature, throttle / brake pedal, what else?
The biggest problem I see is the missing standardization of BEV PIDs. I will never be able to maintain a vehicle database myself. Instead, a community based approach plus better custom PID configuration might be an option. In no case we will see an easy access path like that we have for ICE engine data... Which is odd.
Image Image Image Image
neonal
10 or more Posts ★
10 or more Posts ★
Posts: 10
Joined: Thu Oct 22, 2015 7:16 pm

Re: Support for EVs (Tesla)

Post by neonal »

Wow, thanks for such detailed answer!

I'm going to give some custom PIDs a go. But before I start I just want to make sure that the adapter is properly setup. As you can see from my screenshot, currently I'm getting 0 Hz. Is it going to be fixed if I make a custom PID work or do I need to fix something else with adapter setup first?

Thanks!
User avatar
Harry
Site Admin
Site Admin
Posts: 10634
Joined: Sun Sep 12, 2010 10:32 am
Location: Siegum, Germany
Contact:

Re: Support for EVs (Tesla)

Post by Harry »

neonal wrote: Sat Jan 18, 2025 11:31 am Wow, thanks for such detailed answer!

I'm going to give some custom PIDs a go. But before I start I just want to make sure that the adapter is properly setup. As you can see from my screenshot, currently I'm getting 0 Hz. Is it going to be fixed if I make a custom PID work or do I need to fix something else with adapter setup first?

Thanks!
From what I see, the app / adapter communication is fine.

The update rate is more complicated than you might expect. :-) The most important rate LapTimet displayed are the gross and net rates data is received at. LapTimer interprets this value as the number of parameters sets(!) received per second. These parameter sets differ depending on car, but include a minimum of RPM and wheel speed, but often additional MAF/MAP or temperature values.

Besides this, we have a raw rate (RPM + wheel speed would count as two values, not 1 set) and the number of requests sent to the adapter per second. In your case, you see 5/0/0/24. This means LapTimer is able to send 24 requests per second, but non is usable payload (like RPM / speed) resulting in 0 parameter sets per second (both gross and net). Finally, the 5 means that the 24 requests result in 5 non-null replies. This will be board battery voltage or the named VIN or engine type parameters. The other request will be those not expected to return a parameter.

So 5/0/0/24 is as expected for a car not returning standard parameters. Once you have a working custom PID active, you should get a value higher than 0 for gross/net rates.
Image Image Image Image
neonal
10 or more Posts ★
10 or more Posts ★
Posts: 10
Joined: Thu Oct 22, 2015 7:16 pm

Re: Support for EVs (Tesla)

Post by neonal »

Apparently I could get some data using 0x220101 PID so I gave it a go without much success. I tried mapping Battery temperature to Coolant temperature channel, set the ECU = PCM, Mode = 22, PID = 0101, Frequency = Low and finally Formula = Q and didn't get anything unfortunately. Now reading the documentation once more, I'm going to try once more with same settings but just setting PID = 000101 and report back. (Edit: That didn't work either)

Meanwhile I wanted to check if I was on the right path and I also have 3 questions:

1- Here there are some PIDs that require "OBD-II header" setting (e.g. 0x7E2). Should I prepend those values with 0s to make the 3 bytes and set them to ECU field (i.e. ECU=0007E2)?
2- The data 0x220101 returns is 60 bytes. I understood from the documentation that I could address bytes up to 52nd (i.e. AZ). Is there a way to address let's say 55th byte?
3- I tried Harry's GPS/OBD Buddy to get some logs for debugging purposes. However when it comes to exporting log files, it fails with an error message about missing permissions (even though I gave all). The other option in the app is "Console" meaning that I could get those logs using adb logcat? Also, do I have to use the GPS buddy or is there a way to get those logs through ADB from LapTimer?

I also appreciate any other suggestions.

Thanks!
Post Reply