Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Chassis CAN Logging To ASCII Text Plus Graphing

This site may earn commission on affiliate links.
That thang makes gobs of front torque--man it's off the charts...

----
LCC, thought we were gonna have to give you 2 minutes in the penalty box for lack of acceleration

lol, well I just reused the graphing tools I built based on Bill's original data set, and rather than change the parser I zero'd out the front torque, so it would work with either variant.


What is interesting is you can see early on that the rear torque seems very spiky as it appears to "hunt" around the 400Nm mark. (I'm guessing this is a software/firmware threshold).

I'd love to see a P85 plot.
 
So I've managed to put in a little more time into a conversion algorithm that takes SavvyCAN output and converts it to a similar "cross tab" format that lola is outputting from his device.

Now I think I'm there or thereabouts (still a few tweaks to do, I've literally put under an hour in).

Result probably the slowest 0-60 time posted from a full throttle Tesla launch :redface: (Edit: disclaimer I haven't trimmed the start of the file, so that's an easy way to trim c.500ms from my time ;) )

Nice charts! In the top one, I don't see the power curve in yellow (or maybe it's my screen rendering?)

Also, what was your SoC during this test?
 
Nice charts! In the top one, I don't see the power curve in yellow (or maybe it's my screen rendering?)

Also, what was your SoC during this test?


Good spot, I think in Bill's device he just grabbed it from the CAN, and if memory serves it's pretty much the absolute value of calculated power. I wanted the signed value and calculated it from V * I), so I haven't bothered checking for those messages. (hence it's all zero)

SOC from memory was c. 70%
 
I do hear a "skitter" type sound from the tires in the dry. It looks like Tesla has designed the launch to throw a bunch of energy into the tire side wall then pull back to keep from completely blowing them off. Very neat stuff.

I've been trolling over on the DL upgrade thread to see if I could find someone to log before and after update data. I've got a bunch of data for my car but they have yet to start scheduling updates in WPB. Anyone here have a pending L update that wants to log data?

I'd love to log data but I'm still not scheduled for my L upgrade yet either. Service center tells me they are expecting March, but nothing is on the books yet.
 
The first logger has made it into the wild. I thought it would be best to describe its operation here and work through issues as well so that others that end up with one in the future have a resource.


Description
The logger is based on an ECU reflashing tool I did many years ago. It consists of a small printed circuit board in a black plastic snap together housing with an OBDii connector on one end. The opposite end (from the OBDii connector) has a usb connector, switch and tri-color LED.


The Tesla diagnostics cable has the Tesla specific connector on one end and a female DB-9 on the other. It was purchased from FastTech and the packing slip with part number can be found earlier in this thread.


I have added a male DB-9 pigtail to refreshing tool to provide a connection to the FastTech Tesla diagnostic cable. I simply carved a hole in the plastic housing of the refreshing tool and zipped tied the pigtail to the tool to stress relieve where the wires were soldered to the board.


Operation
You will find that you are connecting and disconnecting the tool a lot. The easiest way I have found to use it is to attach the FastTech cable to the Tesla diagnostic connector then run the DB-9 end out over the top of the cubby before snapping the cubby back into position. For those not familiar with the diagnostic connector, it resides behind the center cubby below the 17” screen. GENTLY pull the lower lip down and two clips will release allowing the front of the cubby to pivot down. You can then reach into the gap between the screen and the top of the cubby to fish out the Tesla diagnostics connector. Once the FastTech cable is attached, you position the cable between the two snaps and gently put the cubby back in position. The cable will now be dangling from between the top of the cubby and the 17” display and can be neatly tucked into the cubby when not in use. To use the logger, simply connect the loggers DB-9 male to the dangling DB-9 female. The car powers the logger through the diag cable.


The logger can do one of two things. It can log battery health or performance data. The switch on the end of the logger is set before powering up the tool. Look at the switch/usb/LED end of the logger and identify the plastic parting line (between the upper and lower snap together plastic halves of the logger cover). The switch/usb/LED are on the “UP” side of that parting line.


Placing the switch in the UP position (switch away from the plastic parting line) puts the logger in performance logging mode. This will provide the front/rear motor torque logs seen earlier in this thread. Set the switch before connecting the logger’s DB-9 connector. When you do connect the logger you should see a quick reset sequence whereby the LED flashes all three colors once then it will attempt to determine if the car is two wheel or all wheel drive by looking for a message from the front drive unit. I set the Red LED during this search and loop until I see a message from the rear drive unit then look for the front drive unit message. My car is normally powered up by the time I am plugging the logger in thus the above measseges are received very quickly and you do not even percieve that the Red LED blinked on and off. If the logger hangs with the Red LED on, it is not receiving CAN message traffic.


Once the logger determines TWD/AWD, it will flash the Red LED once for single motor or twice for dual motor. I really do need to change this to flashing Green so as not to be confused with hanging Red on no CAN traffic. After indicating number of motors, the logger will wait patiently for the throttle to exceed 50%. Once throttle exceeds 50%, the Green LED will be active indicating the logger is running. Once the throttle goes below 50%, the Green will be joined by the Blue indicating you are in post-threshold logging. This lasts for about 15 seconds and is meant to capture region and/or a full run if you are using Launch mode (which triggers the 50% threshold). Once the Green/Blue LED goes out, you are back into wait for TPS Threshold mode.


Placing the switch in the Down position (towards the plastic shell half parting line) puts the logger into battery health logging. Examples of these logs can be found earlier in this thread. Attaching the logger to the car via the DB-9 connector in this mode will give you the same Red/Green/Blue LED test cycle followed by immediate logging of BMS data. It takes about three seconds to receive all 0x20 CAN frames of BMS data. The logger will be green while doing this. The logger will then sleep for about ten seconds before repeating the cycle. This logging rate is a compromise between having a good amount of data yet still being able to log complete single charger charge sessions.


The logger can be disconnected in either mode at any time. If you are interested in capturing the last bit of data, I suggest you allow the performance logger’s Green/Blue light to extinguish or the allow for two complete cycles on the battery health logger prior to disconnecting power.


Retrieving Data
I’ll start by apologizing here. This is where the project gets home brew.


The logger appears as a mass storage device on USB (memory stick) with 256 MB size and only 4 MB usable. Early on I pulled the FAT structure from a 256 MB memory card and simply report all but 4 MB of sectors as unusable. Some PCs insist on scanning the whole FAT structure every time you plug in which is slow with my device. I normally quickly disconnect and reconnect to upset the process and have the drive appear in explorer. MACs are much worse than PCs in that they want to write a bunch of crap to any drive they mount. I gave up trying to pull data from the device on my MAC and simply use a netbook. Let me know if anyone has any success working with a MAC. Also, if there are any FAT geniuses out there, I’d love to try a proper 4 MB FAT :)


Once the drive appears on your chosen computer, there will be a single LOGDATA.TXT file that is 1 MB in size. I never know when power is going to be pulled thus the fixed file size. Drag and drop copy this file over to pull off the data. You can leave the file on the logger if you want new data to append to the old file or simply erase the file from the logger if you want to start new. If you do erase the file, the next power up cycle should be connecting to the car which will erase the logger’s flash memory and re-initialize the logger with an empty file to log to. When you plug the logger into the car following a log file deletion, expect to see the three LED boot sequence followed by a solid Red for twenty seconds as the logger erases flash memory. I really need to do a better LED sequencing as this erasure cycle could be confused with a performance logging configuration awaiting CAN traffic. For now, it is up to the user to know the difference.


Error Codes
There are blinking error codes for things like full log file and various procedural failures. The full log file is a single blinking Red. I’ll pull the rest of the error codes out of the program and post them here by I never see them and thus you are unlikely to see them as well.


Good Luck :)

KB,
I did do my wife's car.... It was below 50% SoC and went to about 90%. I really need to redo the charge in Range Mode but will post what I have now shortly.


My car is scheduled for L upgrade as is another forum member out in California. We will both be logging data prior to and just after the upgrade. It will be interesting to see how consistent the changes are from car to car.
 
  • Informative
Reactions: benjiejr
Update on Error Codes

It turns out I set the Green LED when in performance mode waiting to for CAN traffic to identify Two Wheel Drive or All Wheel Drive. If you plug the logger in with the switch in the Up position, it does the Red then Green then Blue boot LED sequence then goes solid Green the logger is waiting for Rear Drive CAN Traffic.

I've been testing more loggers to go out and it caused me to go back and check the Battery Health initialization LED sequence. The correct sequence goes like this-
Red then Green then Blue power on LED test
Blue for a period of time up to ten seconds as the logger waits for a Battery Odometer CAN message (one every ten seconds)
A quick Blue blip as the logger processes the first battery health data set and writes the results to flash memory
A roughly ten second no LED period as a pause between capturing data sets
A roughly three second Green period while it captures all 0x20 CAN data frames for battery health
The no LED then Green LED cycle repeats going forward until you get a single flashing Red from a full battery or the car finishes charging and de-powers the diagnostic port (which de-powers the logger :) )

Number of Red Blinks ------> Error
1 Your log file is full
2 Logger failed to set initial CAN Address Filters. Note that the Logger is always in Passive Listening Mode and will never acknowledge a CAN frame
3 Logger failed to set end of logging session CAN Filters (needed to capture Battery Odometer and State of Charge)
4 Logger failed to return to CAN Address Filters for performance logging data

As mentioned in the first post, you should normally only ever see a single blinking red light error code indicating the log file is full.


On a different note, the logger code is easily changed to make things more useful. I can email drag and drop update files that are simply dropped on the logger as a small file. The next time the logger is powered up, it will update its code.

Once we get a few out there and have a consensus on needed changes I'll do an update.
 
Last edited:
  • Informative
Reactions: benjiejr
For those getting their loggers, this is what should be showing up :)
 

Attachments

  • 2016-02-15 19.49.25.jpg
    2016-02-15 19.49.25.jpg
    1.5 MB · Views: 127
  • Like
Reactions: benjiejr
Just a quick note as others will post more detail.

I used an old OBDii reflashing tool I did for ICE (BMW, MB) as the basis for the logger. As such, it does have an OBDii connector on the end of it. I did not test what would happen if the OBDii plug was connected with the car. Apparently, it causes some problems (almost gave me a heart attack when I read the message) so please NEVER connect the logger to the car via the OBDii connection. The system is designed to be connected to the car via the Tesla diagnostics connector which resides behind the cubby underneath the center 17" touch screen.
 
Just a quick note as others will post more detail.

I used an old OBDii reflashing tool I did for ICE (BMW, MB) as the basis for the logger. As such, it does have an OBDii connector on the end of it. I did not test what would happen if the OBDii plug was connected with the car. Apparently, it causes some problems (almost gave me a heart attack when I read the message) so please NEVER connect the logger to the car via the OBDii connection. The system is designed to be connected to the car via the Tesla diagnostics connector which resides behind the cubby underneath the center 17" touch screen.

I'm doing the idiot testing it appears... anyway... As said do NOT plug this into ODBII port. Scared the "stuff" out of me too ;)

Bit of a first review and status update using this:

Updated status codes work great. Watch out for long red light - that's just the 1MB file being created / formatted.

Make sure the switch is in the correct direction. The perf capture only occurs > 50% throttle - so if you see a green led illuminate every 5 or 10 seconds then the switch is in the wrong position for perf work.

Talking of files. I'm just deleting the log file between runs as it only appears as read / delete only - funky as I can delete it, though not modify the contents. Entails an additional 20 seconds on startup (long red LED as dummy file is written).

Can capture about 8 full runs. Each appear to be ~20 seconds and 9th is always truncated. Good for short runs, or take you laptop until FAT partition info is fixed.
Battery capture ran for good 3 1/2 hours and had plenty of space left. I believe that it would capture pretty well even with single charger.
As well as variety of 0-60s, I'm going to push for 30-50 and 30-70 runs as I believe / hope / pray* that this will be the majority of the value add of the ludicrous upgrade

First set of data in on my p85d ahead of upgrade came in just great. More of a test than anything as it's wet and still pretty cold here. Hoping for some sunshine tomorrow.

Few graphs (thanks for KennyBobby for the original graphs) and I'll link to excel source later:
2-16-16 Battery Charging.PNG
2-16-16 Graph Run1.PNG
2-16-16 Graph Run2.PNG
2-16-16 Graph Run7.PNG

Again, great work on the logger and if anyone has any requests for data let me know how I can help. Currently trying to get some track time in for 1/4 mile, etc. though as I mentioned it's a little wet currently :(
 
Once we get a few more loggers out there up and running it would be a relatively simple matter to add additional logging formats. The firmware on the logger can be updated by dragging the update file (128K in size) onto the logger so it is a simple matter to change personalities.

Let me know if there are additional items or even completely different data sets that would be interesting to document.
 
Apparently, it causes some problems (almost gave me a heart attack when I read the message) so please NEVER connect the logger to the car via the OBDii connection.

I'm doing the idiot testing it appears... anyway... As said do NOT plug this into ODBII port. Scared the "stuff" out of me too ;)


OK, you guys know that after that build-up you've just got to share what the scary message actually said, right? :)
 
Howdy Mike--So you have dual chargers and is that the gray and yellow BatI on the charging chart?

Hi KB, I pulled the data from Bill's post: http://www.teslamotorsclub.com/show...lus-Graphing?p=1348326&viewfull=1#post1348326
The first value is time in seconds.
The second number (100.0) is State of Charge.
The third is pack voltage (BatV)
The fourth pack current (BatI)
Fifth is the product of the two or power in KW (This is currently also labeled as BatI - buglet or undocumented feature? Guessing this should be BatW (or BatPow? ;) )).

I played with this chart a little more just. It makes sense to calculate BatW offline (always best to capture less data if possible). I also note now which sets of values against which axis.
2-16-16 Battery Charging v2.PNG


btw - 2 questions back at you:
1) Where's the best place for us all to share this data? Dropbox, or shall I just share out folder via. link on Google Drive?
2) How did you create that awesome battery cell animation? I'm guessing some wizardry involving PivotCharts? :)
 
Last edited: