DIY Electric Car Forums banner

Tesla 10Kw Open Source Charger Controller

130K views 645 replies 35 participants last post by  Kevin Sharpe  
#1 ·
So I've had a first look at the Tesla Gen 2 10Kw charger. Now , making one of these work as is with CAN messages is near on impossible due to the level of integration of the charger and the car. So I decided to have a look inside. Seems it uses 3 x 3.5kw modules linked back to a central logic board. Each modules connects to the logic pcb with 8 wires.

So far i have identified GND , +12v , +5v and a 500k canbus. Two lines seems to carry analog signals and one seems to be open circuit. Attached see some CAN captures from this internal network. I may be wrong but I bet it will be easier to work out these messages and get the individual charger modules to wake up.

So plan is to design a little breakout board so I can monitor the signals on a live car during the charge process and log the CAN messages.

Stay tuned:)
 

Attachments

Discussion starter · #5 ·
Looks interesting. I mostly use an arduino due with savvycan for logging. I do also want to monitor all the lines and have a plug and play solution as I don't want to go cutting and soldering on another persons working car:)
 
Discussion starter · #14 ·
Progress. Managed to isolate charger block one and get it to stay enabled separate from the Tesla logic board. It spits out 13 CAN IDs. Took a log. Its on the github : https://github.com/damienmaguire/Tesla-Charger

Question is : What now .....
 

Attachments

Discussion starter · #17 ·
I've grabbed a few more logs of the internal CAN network and uploaded to github. Few things falling out of this :


  • The CAN busses are tied together and the control board broadcasts 5 IDs to all the charger modules
  • The charger modules pump out 15 CAN IDs each. Each ID is incremented by 2 and depends on a set of jumpers on each 12way interface plug on the module.
I suspect all these charger modules are programmed the same. The nasty stuff stopping us just running the charger is on the logic board. If I can get a capture from a car before , starting and during a charge event and play this back to the modules I think they will wake up. Of course I could be way wrong about this. I guess I'll know if a Falcon 9 first stage lands on my house.
 
Discussion starter · #19 ·
Tom , this is an internal CAN network in the charger between the logic board and the charger power modules. It would not be available externally to the charger. It's a GEN 2 charger but not sure what years that would be ...
 
Discussion starter · #27 ·
Rigged up the Variac and did a few logs on one module. Swept the mains input up and down , flicked it directly on and off 0,230vac. Rectified the variac and swept the dc input from 0 to 350vdc and then flicked it on and off 3 times on another log.

Used a 230v 100w filament lamp to limit current.

Logs on the github : https://github.com/damienmaguire/Tesla-Charger
 

Attachments

Discussion starter · #28 · (Edited)
Looks like 0x0207 bytes 0 and 1 contains the mains voltage.:D

ID : 0x0227 byte 3 seems to contain battery voltage and relates somehow to byte2 ...
 
Discussion starter · #29 ·
So I think this will come down to the CAN messages. As it will be a few weeks before I get the capture from a car I'm going to jump the gun a little and work up a replacement open source logic board.

Basics I have in mind so far :


  • Due SAM3 processor with two CAN transceivers. One talks to the power modules the other talks externally.
  • USB port on board to program desired settings and upload firmware.
  • replicate as many of the Tesla external connections as possible e.g. control pilot , proximity etc
If anyone has any ideas or needs now is the time ....
 
Discussion starter · #32 ·
So ganging the chargers up whether it be in a vehicle or Diy supercharger can be handled in software over the external CAN bus. We have lots of spare pins in the external connector so bringing out the USB or serial for software upgrades should be no problem. Likewise I'll come up with something for I/O expandability.

That said I'm not going to try and get it right first time here. I'll get a V1 board done fairly quickly so we can prove it works once I get a CAN capture from a car. It's a small pcb so minimum cost.

Connector hunting was fairly easy on this one. The internal connector for the power modules is a 24 way JST. Same as on the large drive unit logic board and the external connector is a 30 way Samtec IPS1-115-01-S-D.

Of course none of this will work if the CAN traffic is weird in some way or contains encryption etc etc. My sense of it is though they will keep the internal network simple but who knows.

Then it's on to the gen 3 charger ..... :D
 
Discussion starter · #33 ·
So here is a look at where I am going with the logic board. Obviously not finished yet just a snapshot of current progress. I'm aiming to be pin compatible with the oem X042 connector so the Tesla inlet will connect right up and the charger will look after control pilot , latching etc.
 

Attachments

Discussion starter · #43 ·
Thanks Colin. Graph is very good. You can even see where I paused the variac on the way up and down. I got stuck working on the TM4 earlier in the year until I stopped thinking of CAN frames as bytes and more an array of bits then things made a lot more sense.

Not sure about byte 0. Perhaps something to do with the pfc booster? When I get a log from a charging car I hope this will make more sense.
 
Discussion starter · #44 ·
One of my great failures in life has been not getting Savvycan to run on linux. So i'm stuck with windoze. Did a 4 hour round trip last night to log a charge session. Guess what this morning? Bill decides to take a crap on my laptop. No more log files:mad:

Did find one interesting thing which I noted. Seems messages 0x042c , 0x043c and 0x044c carry the charge current request in bytes 2 and 3 relevant to each power module. Was very easy to see on the live graphs. Anyway , more logging to be done.
 
Discussion starter · #46 ·
Ok so got a new CAN log during a charge.

Message 0x42c 42 c4 1f 4a fe 00 00 00

Guess so far :

Byte 2 and 3 I think have the charge current command. Measured 12.6A into the pack.
 
Discussion starter · #50 ·
Ok have a new log up on the github. Didn't want to upload a raw log as it's a friends car and I don't want him getting in trouble with Elon! This one is the 4 command messages from the charger logic board to the power modules :
Logic_msgs_chg_start.csv

Events:
start capture
press ‘open charge port’ button
get out of the car
insert plug
Charging initalises
Charging commences
stop capture


Oh and SavvyCAN now compiles and runs on Linux:D:D:D