Tesla Model 3 Battery Hacking

Topics concerning the Tesla front and rear drive unit drop-in board
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Tesla Model 3 Battery Hacking

Post by Jack Bauer »

First tests with the Spartan 6 FPGA. Looks like we can detect the long pulses in order to decode CS. Now onto clk and data.
Attachments
2020-04-28 13.44.28.jpg
2020-04-28 13.44.43.jpg
scope_10.jpg
scope_9.jpg
scope_8.jpg
I'm going to need a hacksaw
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Tesla Model 3 Battery Hacking

Post by Jack Bauer »

New board just arrived from JLCPCB.
Attachments
2020-05-08 15.25.00.jpg
2020-05-08 15.24.31.jpg
I'm going to need a hacksaw
mike77cos
Posts: 26
Joined: Mon Oct 14, 2019 6:29 am
Location: Cornwall
Has thanked: 1 time

Re: Tesla Model 3 Battery Hacking

Post by mike77cos »

I can't wait to see how you get on with it 😍
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Tesla Model 3 Battery Hacking

Post by Jack Bauer »

Good news is our new pcbs with the Xilinx FPGA onboard work a treat.
Attachments
2020-05-17 10.07.07.jpg
2020-05-17 10.12.08.jpg
I'm going to need a hacksaw
retrEVnoc
Posts: 33
Joined: Sun Aug 11, 2019 8:22 pm
Location: CA & OR, USA
Been thanked: 1 time

Re: Tesla Model 3 Battery Hacking

Post by retrEVnoc »

Do your boards work with each battery module board, or require the main Model3 BMS?
User avatar
Kevin Sharpe
Posts: 1345
Joined: Fri Dec 14, 2018 9:24 pm
Location: Ireland and US
Been thanked: 4 times

Re: Tesla Model 3 Battery Hacking

Post by Kevin Sharpe »

retrEVnoc wrote: Thu May 21, 2020 12:21 am Do your boards work with each battery module board, or require the main Model3 BMS?
Damien's board generates the Tesla version of the isoSPI bus that connects the battery modules. It's possible this hardware will be enough to implement the BMS functionality but we just don't know today.
This is a personal post and I disclaim all responsibility for any loss or damage which any person may suffer from reliance on the information and material in this post or any opinion, conclusion or recommendation in the information and material.
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Tesla Model 3 Battery Hacking

Post by Jack Bauer »

I'm going to need a hacksaw
User avatar
Kevin Sharpe
Posts: 1345
Joined: Fri Dec 14, 2018 9:24 pm
Location: Ireland and US
Been thanked: 4 times

Re: Tesla Model 3 Battery Hacking

Post by Kevin Sharpe »

Another great video Damien :)

You say in the video that you are not sure what you are going to do with this development. My advice is to sell the board as a closed source, tested and supported solution that simply converts isoSPI to SPI and nothing else. Basically a board that does one thing really, really well.

You are entitled to make a financial return for your efforts and I have no doubt that you'll end up using the funds to undertake even more open source projects that we all benefit from :D
This is a personal post and I disclaim all responsibility for any loss or damage which any person may suffer from reliance on the information and material in this post or any opinion, conclusion or recommendation in the information and material.
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Tesla Model 3 Battery Hacking

Post by Jack Bauer »

Time for a little update on the M3 BMS isospi board development.

As of today we have successful decode of the Tesla variant iso spi into normal spi that can be read by a (fast!) microcontroller. When connected to just one slave the data rate is very fast. There is just enough block ram in the fpga to buffer it so I'm leaning towards having to put some external fast ram on the board once we get talking to a full pack.

Work on transmission has now commenced so once we get something running on the bench I'll make a video.
I'm going to need a hacksaw
MattsAwesomeStuff
Posts: 897
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 289 times
Been thanked: 177 times

Re: Tesla Model 3 Battery Hacking

Post by MattsAwesomeStuff »

I have nothing useful to say, other than general praise and excitement at yet another milestone being achieved. Great work.
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Tesla Model 3 Battery Hacking

Post by Jack Bauer »

New Keysight scope purchased with Patreon donations. Now I can get back to work on the Tesla Model 3 BMS. Lack of a 4 channel fast DSO with SPI decode meant this project has been on hold since I had to give back the demo unit. As I don't get any sponsorship, things like this need to be purchased at normal price so delays happen. Thanks to the kind assistance of those on Patreon (and elsewhere) we can get back to hacking and publish a beta design for the M3 bms decoder.
Attachments
2020-07-23 10.06.23.jpg
I'm going to need a hacksaw
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Tesla Model 3 Battery Hacking

Post by Isaac96 »

I hope you take that with you to Lanzarote :P
User avatar
mdrobnak
Posts: 692
Joined: Thu Mar 05, 2020 5:08 pm
Location: Colorado, United States
Has thanked: 1 time
Been thanked: 5 times

Re: Tesla Model 3 Battery Hacking

Post by mdrobnak »

Are the PC based DAQs not good for this sort of thing? (PicoScope I think is one of the more well known ones)
-Matt
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Tesla Model 3 Battery Hacking

Post by Jack Bauer »

Lots of options out there. My experience with pc based scopes is that unless you get a good one (expensive) and a good pc (expensive) then its no use. Plus I prefer to have physical buttons to push:)
I'm going to need a hacksaw
retrEVnoc
Posts: 33
Joined: Sun Aug 11, 2019 8:22 pm
Location: CA & OR, USA
Been thanked: 1 time

Re: Tesla Model 3 Battery Hacking

Post by retrEVnoc »

MattsAwesomeStuff wrote: Mon Jun 29, 2020 12:42 am I have nothing useful to say, other than general praise and excitement at yet another milestone being achieved. Great work.
Same here, great work Damien, please unlock these awesome batteries for everyone!! Heading to your Patreon now...
Ken_S
Posts: 26
Joined: Fri Mar 22, 2019 8:58 pm
Location: Clear Creek County, Colorado

Re: Tesla Model 3 Battery Hacking

Post by Ken_S »

I thought I would share this here, as an aside replying to the prior discussions about using edge connectors with the flex pcb cables on these modules. This is a photo of a partial solution, tested on a spare flex PCB from eBay.
Tesla model 3 BMS flex pcb with crimp contact.jpg
As excited as I am following the developments towards decoding the Tesla model 3 BMS, my final pack assembly is happening in the next month, and therefore I am going with an off the shelf BMS... in order to simplify the wiring process I have been searching for a solution for connecting to the flex PCBs directly, and this is what settled on.

The blue connector is an Amphenol Flat Flex Connector (digikey PN 609-2193-ND). The contact is ideal, a very secure flat crimp insulation piercing design, but they are only available in 2.54 mm spacing connectors, while the Tesla flex PCB is 3.5 mm spacing. Therefore my plan is to remove the contacts from the connector and solder the pins into a PCB laid out for the correct spacing, designed to connect the flex PCB pads to a board mount connector for the BMS cell tap wires. The PCB will slide in behind the flex cable and provide a rigid backing for carefully crimping each contact.

Hopefully this helps someone! When I finish the pcb layout and test the boards, I will post the eagle and gerber files online somewhere to share them.
User avatar
muehlpower
Posts: 574
Joined: Fri Oct 11, 2019 10:51 am
Location: Germany Fürstenfeldbruck
Has thanked: 12 times
Been thanked: 102 times

Re: Tesla Model 3 Battery Hacking

Post by muehlpower »

I would prefer to solder additional cables to the original board to use any BMS. Later, when the BMS has hacked, you can remove the cables and reactivate the tesla boards.
User avatar
Kevin Sharpe
Posts: 1345
Joined: Fri Dec 14, 2018 9:24 pm
Location: Ireland and US
Been thanked: 4 times

Re: Tesla Model 3 Battery Hacking

Post by Kevin Sharpe »

Ken_S wrote: Tue Jul 28, 2020 6:20 amI am going with an off the shelf BMS...
muehlpower wrote: Tue Jul 28, 2020 8:50 am I would prefer to solder additional cables to the original board to use any BMS
Not a topic for this thread but be extremely careful with "off the shelf" BMS systems and Tesla batteries. We have seen several examples of destroyed modules and very poor support by a 'reputable' supplier.

If you wish to discuss further then the BMS sub forum is the place to post;

viewforum.php?f=13
This is a personal post and I disclaim all responsibility for any loss or damage which any person may suffer from reliance on the information and material in this post or any opinion, conclusion or recommendation in the information and material.
Ken_S
Posts: 26
Joined: Fri Mar 22, 2019 8:58 pm
Location: Clear Creek County, Colorado

Re: Tesla Model 3 Battery Hacking

Post by Ken_S »

Kevin Sharpe wrote: Tue Jul 28, 2020 9:36 am
Ken_S wrote: Tue Jul 28, 2020 6:20 amI am going with an off the shelf BMS...
muehlpower wrote: Tue Jul 28, 2020 8:50 am I would prefer to solder additional cables to the original board to use any BMS
Not a topic for this thread but be extremely careful with "off the shelf" BMS systems and Tesla batteries. We have seen several examples of destroyed modules and very poor support by a 'reputable' supplier.

If you wish to discuss further then the BMS sub forum is the place to post;

viewforum.php?f=13
Thanks for the warning. I will continue the discussion there.
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Tesla Model 3 Battery Hacking

Post by Jack Bauer »

Right, back to the hacking. The next phase of this op requires a battery and slave board. Fun though it would be to haul around a full size model 3 brick, I decided to make a bench version from 25 x 18650 cells. This has the added advantage of allowing individual cells to be connected and disconnected allowing us to observe the data changes.
Attachments
2020-07-31 14.25.11.jpg
2020-07-31 14.24.55.jpg
I'm going to need a hacksaw
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Tesla Model 3 Battery Hacking

Post by Jack Bauer »

How to tell a good bms from a bad, Lesson 1: A good bms draws f%^k all current from its attached battery when in sleep mode:)
Attachments
2020-08-01 09.27.52.jpg
I'm going to need a hacksaw
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Tesla Model 3 Battery Hacking

Post by Jack Bauer »

So time for a little bms update. Now that we have our bench battery and slave setup we can connect the whole lot to a hv controller. Looking at the pt can output on message 0x332 we see the cell voltages correctly reported. Then we can spy on the spi with the salea and actually see the data coming in from the slave board. But what we can now do most importantly is to cause changes in that data by messing with the connected cells.
Attachments
2020-08-02 14.03.21.jpg
2020-08-02 14.03.10.jpg
2020-08-02 13.34.11.jpg
I'm going to need a hacksaw
tom91
Posts: 1303
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 102 times
Been thanked: 216 times

Re: Tesla Model 3 Battery Hacking

Post by tom91 »

Can you export raw hex data of the SPI bus? Then I would not mind having a look at it, I would suspect quite some likeness to the standard linear chip protocol.
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Tesla Model 3 Battery Hacking

Post by Jack Bauer »

Attached capture from Salae logic analyser. Can be viewed with free software : https://www.saleae.com/downloads/

Few points to note : The spi runs with Cpol=1 and Cpha=1. The capture starts with the hv controller powered down and powers on after about 0.5sec. One slave connected with all 25 cells attached.
Attachments
1slave.zip
(1.02 MiB) Downloaded 76 times
I'm going to need a hacksaw
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Tesla Model 3 Battery Hacking

Post by Jack Bauer »

Ignore my last. I am a clown. Attached capture as before but with correct spi decode pin assignments.
Attachments
1slave_correct_spi.zip
(443.34 KiB) Downloaded 84 times
I'm going to need a hacksaw
Post Reply