Tesla Model 3 Rear Drive Unit Hacking
- EV_Builder
- Posts: 1205
- Joined: Tue Apr 28, 2020 3:50 pm
- Location: The Netherlands
- Has thanked: 18 times
- Been thanked: 37 times
- Contact:
Re: Tesla Model 3 Rear Drive Unit Hacking
Mhhh i can do that but i need a M3 engine for that and that's 3K euro and i have no clue what the risk of this succeeding would be.
...i wrote my tactic here but thought better remove since only 5 people 'know' how todo it and Tesla is reading along....
(Perhaps we should make a For Your Eyes only section??)
Next question: Where can i find the dimensions of the M3 engine because if it wont fit in my build i would have bought a 'bookshelf blocker'....
Can you send me a link with the dimensions or measure it up for me?
Width is my biggest concern. Are we talking front or rear engine? (or is the inverter part the same..).
Is the chargeport already finalized? Thats actually something usefull for my build (i buy the parts?) and help on it.
...i wrote my tactic here but thought better remove since only 5 people 'know' how todo it and Tesla is reading along....
(Perhaps we should make a For Your Eyes only section??)
Next question: Where can i find the dimensions of the M3 engine because if it wont fit in my build i would have bought a 'bookshelf blocker'....
Can you send me a link with the dimensions or measure it up for me?
Width is my biggest concern. Are we talking front or rear engine? (or is the inverter part the same..).
Is the chargeport already finalized? Thats actually something usefull for my build (i buy the parts?) and help on it.
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
see http://www.wdrautomatisering.nl for bespoke BMS modules.
- New Electric Ireland
- Posts: 172
- Joined: Sun May 31, 2020 12:22 pm
- Location: Ireland
- Been thanked: 2 times
- Contact:
Re: Tesla Model 3 Rear Drive Unit Hacking
viewtopic.php?f=10&t=123&p=21590#p21590EV_Builder wrote: ↑Mon Jan 04, 2021 6:12 pm Where can i find the dimensions of the M3 engine because if it wont fit in my build i would have bought a 'bookshelf blocker'....
In Ireland we undertake training & open source RND for the New Electric group, 5 companies converting boats, buses, cars and trucks to electric drive since 2008.
- EV_Builder
- Posts: 1205
- Joined: Tue Apr 28, 2020 3:50 pm
- Location: The Netherlands
- Has thanked: 18 times
- Been thanked: 37 times
- Contact:
Re: Tesla Model 3 Rear Drive Unit Hacking
Very nice!
Thank u!
Thank u!
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
see http://www.wdrautomatisering.nl for bespoke BMS modules.
- Jack Bauer
- Posts: 3639
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 276 times
- Contact:
Re: Tesla Model 3 Rear Drive Unit Hacking
No secret section on the openinverter forum I'm afraid:) but of course you are free to pursue whatever option best suits your needs. In any event my recent adventures with the vcu are reawakening my long atrophied programming skills so I'll look after the spi side of things. And back on topic the next rev of board is in production at jlcpcb:)
I'm going to need a hacksaw
Re: Tesla Model 3 Rear Drive Unit Hacking
Hi there, I’ve read this thread from start to finish, and although I can’t contribute to the hacking side of things, I appreciate the work and effort that’s going into these projects, even if I only understand the basic principles. As an engineer myself (automotive manufacturing not electronic) i appreciate that things take time to get right - even if the ‘bosses’ don’t believe that!
Although we didn’t speak Damien I had a wander around the bmw at fully charged year before last and was seriously impressed. Confirmed in my mind that a Tesla drive unit was the way to go.
I’m excited to see the latest solution for the m3 motor, as until recently I was considering the model S drive unit for my conversion, but the layout of the model 3 is much more suited to my conversion. Which is why I’m now glad I didn’t pull the trigger on a model S motor. Keeping an eye out for a m3 drive unit as we speak.
First post here so just wanted to show my support. I’ll have a look at the patreon links too.
Cheers
Tom
Although we didn’t speak Damien I had a wander around the bmw at fully charged year before last and was seriously impressed. Confirmed in my mind that a Tesla drive unit was the way to go.
I’m excited to see the latest solution for the m3 motor, as until recently I was considering the model S drive unit for my conversion, but the layout of the model 3 is much more suited to my conversion. Which is why I’m now glad I didn’t pull the trigger on a model S motor. Keeping an eye out for a m3 drive unit as we speak.
First post here so just wanted to show my support. I’ll have a look at the patreon links too.
Cheers
Tom
-
- Posts: 277
- Joined: Mon Jan 18, 2021 12:39 pm
- Location: Edinburgh, Scotland, UK
- Has thanked: 62 times
- Been thanked: 88 times
Re: Tesla Model 3 Rear Drive Unit Hacking
Long time lurker, first time poster looking to find somewhere to make a contribution to the M3 inverter project(s).
I've been doing a bit of digging into the C2000/TMS320F28377D processor platform and using this for OpenInverter.
From what I can see from Damien's digging the chips on existing M3 inverter boards are toast. Tesla have blown the OTP fuses preventing access to the secure memories, JTAG, etc. If I'm understanding the Technical Reference Manual correctly, once that happens it makes the chip useless to anyone that isn't Tesla. My take away from that is that we'll need to scrape off the Musk-goo and replace the processor with a new part if we want to use the board as-is?
Looking then at the feasibility of building an OpenInverter variant for the C2000 platform. If I'm understanding the docs it would be OK to use the LAUNCHXL-F28379D dev board (easy for me to get in the UK from RS or Farnell). The only significant differences I can see between the TMS320F28377D and the TMS320F28379D on the dev board is the addition of some Configurable Logic Blocks. Does this seem correct?
The toolchain front looks a bit of a mixed bag. Sadly no gcc or llvm port for the TMS320 C28x CPU platform so as far as I can see. The TI compiler is free as-in-beer with no particularly onerous license conditions. This makes me a bit uneasy that it might just disappear one day or they do an Autodesk / Lattice and start charging big bucks for it. The C++ side of things is pretty prehistoric being confined to C++03 rather than the C++11 that OpenInverter uses. That said OpenInverter doesn't seem to use any particular C++11 constructs that I have seen on a quick squint.
Not sure where best to go next or if my understanding above makes sense. I figure that if a C2000 port of OpenInverter is desirable then figuring out how to make the existing code more hardware portable without breaking it and existing boards is probably the place to start. I've very little knowledge of inverters but have dabbled in open ECUs in the past (Megasquirt and efi332), can't be too different!
I've been doing a bit of digging into the C2000/TMS320F28377D processor platform and using this for OpenInverter.
From what I can see from Damien's digging the chips on existing M3 inverter boards are toast. Tesla have blown the OTP fuses preventing access to the secure memories, JTAG, etc. If I'm understanding the Technical Reference Manual correctly, once that happens it makes the chip useless to anyone that isn't Tesla. My take away from that is that we'll need to scrape off the Musk-goo and replace the processor with a new part if we want to use the board as-is?
Looking then at the feasibility of building an OpenInverter variant for the C2000 platform. If I'm understanding the docs it would be OK to use the LAUNCHXL-F28379D dev board (easy for me to get in the UK from RS or Farnell). The only significant differences I can see between the TMS320F28377D and the TMS320F28379D on the dev board is the addition of some Configurable Logic Blocks. Does this seem correct?
The toolchain front looks a bit of a mixed bag. Sadly no gcc or llvm port for the TMS320 C28x CPU platform so as far as I can see. The TI compiler is free as-in-beer with no particularly onerous license conditions. This makes me a bit uneasy that it might just disappear one day or they do an Autodesk / Lattice and start charging big bucks for it. The C++ side of things is pretty prehistoric being confined to C++03 rather than the C++11 that OpenInverter uses. That said OpenInverter doesn't seem to use any particular C++11 constructs that I have seen on a quick squint.
Not sure where best to go next or if my understanding above makes sense. I figure that if a C2000 port of OpenInverter is desirable then figuring out how to make the existing code more hardware portable without breaking it and existing boards is probably the place to start. I've very little knowledge of inverters but have dabbled in open ECUs in the past (Megasquirt and efi332), can't be too different!

- johu
- Site Admin
- Posts: 6619
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 344 times
- Been thanked: 1485 times
- Contact:
Re: Tesla Model 3 Rear Drive Unit Hacking
Yes it seems if you need to go through the trouble of removing this enormous ground pad part, it makes sense to replace it with something well usable.
I thought about drawing in an additional HAL between libopencm3 and the application software from time to time but then couldn't be bothered. Even the grey bearded STM32F1 is still a long way from running out of steam for motor control.
That said, additional out of box research is always good. Thanks for sharing your findings
I thought about drawing in an additional HAL between libopencm3 and the application software from time to time but then couldn't be bothered. Even the grey bearded STM32F1 is still a long way from running out of steam for motor control.
That said, additional out of box research is always good. Thanks for sharing your findings

Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- Jack Bauer
- Posts: 3639
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 276 times
- Contact:
Re: Tesla Model 3 Rear Drive Unit Hacking
Yes thanks for sharing. I too would like the option of using openinverter on the tms.
I'm going to need a hacksaw
-
- Posts: 277
- Joined: Mon Jan 18, 2021 12:39 pm
- Location: Edinburgh, Scotland, UK
- Has thanked: 62 times
- Been thanked: 88 times
Re: Tesla Model 3 Rear Drive Unit Hacking
Hadn't spotted the big ground pad under the QFP. That'll make it interesting getting parts on and off without damaging the PCB.
The STM32F1 has done so much there's not been much need to change before this. I've seen too much software messed about by premature generalisation and/or leaky abstraction layers in the past can definitely empathise with not adding such a layer unnecessarily.
I'll keep prodding away at your code and the C2000 dev tools and see if I get anywhere useful. I guess an initial goal would be a hack conversion of stm32-sine that outputs sine waves on the LAUNCHXL-F28379D. I have an STM32 Bluepill somewhere so hopefully should be able to get something up an running quickly with the existing code. If I get that far then we can figure out a way to integrate any changes in a way you'd be happy with. Wary of over-promising.
The STM32F1 has done so much there's not been much need to change before this. I've seen too much software messed about by premature generalisation and/or leaky abstraction layers in the past can definitely empathise with not adding such a layer unnecessarily.
I'll keep prodding away at your code and the C2000 dev tools and see if I get anywhere useful. I guess an initial goal would be a hack conversion of stm32-sine that outputs sine waves on the LAUNCHXL-F28379D. I have an STM32 Bluepill somewhere so hopefully should be able to get something up an running quickly with the existing code. If I get that far then we can figure out a way to integrate any changes in a way you'd be happy with. Wary of over-promising.
- Jack Bauer
- Posts: 3639
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 276 times
- Contact:
Re: Tesla Model 3 Rear Drive Unit Hacking
Removing the part is not too hard with the right technique. I have a video on this waiting to go. Appreciate the assist. I'll keep plugging away at the adapter in any event.
I'm going to need a hacksaw
- Jack Bauer
- Posts: 3639
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 276 times
- Contact:
Re: Tesla Model 3 Rear Drive Unit Hacking
Ok folks long time no update. Thanks to PCBWay I think we have a neat solution. Won't be cheap (bare boards a little over $100USD each!) but I think this is going to work. Basically taking the provious design, shrinking slightly to allow more overlap of the adapter board and main board pads and going to a flexi pcb material with gold fingered ffc connections on all 4 sides to solder to the pads. Need to do some back and forth with their engineering people but should have boards very soon. I should also note that PCBWay are sponsoring these boards for me. If it works out I'll get them to populate the next batch so wish me luck:)
I'm going to need a hacksaw
Re: Tesla Model 3 Rear Drive Unit Hacking
Great news Damien!
I think I’ll purchase a M3 drive unit in prep!
I think I’ll purchase a M3 drive unit in prep!
- Jack Bauer
- Posts: 3639
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 276 times
- Contact:
Re: Tesla Model 3 Rear Drive Unit Hacking
Boards are now in production at PCBWay.
I'm going to need a hacksaw
- Jack Bauer
- Posts: 3639
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 276 times
- Contact:
Re: Tesla Model 3 Rear Drive Unit Hacking
Just got a shipping notification from PCBWAY. Boards are on the way:)
I'm going to need a hacksaw
Re: Tesla Model 3 Rear Drive Unit Hacking
Hello. Sorry if i missed the information but i couldnt find the possible specs of a hacked model 3 rear drive train.
Are there any numbers with a decent cooling of max continuous Voltage and current Battery > Inverter and Inverter > Motor ? phase v*ah or total v*ah ?
Are there any numbers with a decent cooling of max continuous Voltage and current Battery > Inverter and Inverter > Motor ? phase v*ah or total v*ah ?
-
- Posts: 656
- Joined: Sat Oct 05, 2019 6:50 pm
- Location: Northern California, USA
- Been thanked: 2 times
- Contact:
Re: Tesla Model 3 Rear Drive Unit Hacking
We know that the original unit will do at least 211Kw - 400 volts and lots of current. Since Damien is currently in the process of building modboards, he has not yet done power testing.
Re: Tesla Model 3 Rear Drive Unit Hacking
Could the transaxle and motor be mounted "in reverse" and then run in reverse and function properly? Can the transaxle run in reverse constantly?
Thanks to everyone who do the work y'all rock
Thanks to everyone who do the work y'all rock

- Jack Bauer
- Posts: 3639
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 276 times
- Contact:
Re: Tesla Model 3 Rear Drive Unit Hacking
Got a little present from PCBWay:) I think we have a winner. Video and reveal soon.
I'm going to need a hacksaw
- Jack Bauer
- Posts: 3639
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 276 times
- Contact:
- 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 Rear Drive Unit Hacking
I'd call that more than a hint. 
In a way this is the best of the both worlds - massively engineered acquisition / power supply circuits, with a just-as-complex-as-needed motor control firmware.
Nice job!
-Matt

In a way this is the best of the both worlds - massively engineered acquisition / power supply circuits, with a just-as-complex-as-needed motor control firmware.
Nice job!
-Matt
- Jack Bauer
- Posts: 3639
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 276 times
- Contact:
Re: Tesla Model 3 Rear Drive Unit Hacking
Internet : You can't run a Musk motor with a measly little Stm32.
Johannes : Hold my beer.
Johannes : Hold my beer.
I'm going to need a hacksaw
Re: Tesla Model 3 Rear Drive Unit Hacking
This is an amazing job. While I'm sure someone will figure out how to flash the OEM chip over CAN like Tesla does, this is a great alternative.
Combine this with a BMS, CCS Charging and a VCU and you could run a whole car.
Combine this with a BMS, CCS Charging and a VCU and you could run a whole car.
-
- Posts: 115
- Joined: Sat Dec 26, 2020 5:44 pm
Re: Tesla Model 3 Rear Drive Unit Hacking
I've just watched this despite no intention to use any Tesla parts, frankly i'm astounded this is possible from a DIYer position. Incredible
-
- Posts: 110
- Joined: Sun Aug 30, 2020 3:28 pm
- Location: United States, Michigan
- Been thanked: 6 times
- Contact:
Re: Tesla Model 3 Rear Drive Unit Hacking
That would neeeeeeever happen.

The biggest issues are:
1. You'd have to pretty much 100% reverse engineer the whole pinout for the OEM chip so that you're sure you don't have it doing anything too dumb. Now, you nearly have to do this anyway with Damien's approach because you still are connected to the same pins and have to write code to do the same things. I imagine he's using a chip that the community knows well to hopefully shorten the process. Using the OEM chip would be an additional big learning curve for everyone.
2. Once you figure out how to write the code now you need to flash it. While some of us know how to flash stuff over CAN to a Tesla device we're not really releasing that info publicly because Uncle Elon will pee in the punch if we do. That is, what's possible now would probably get locked down if too many people knew about it. That's really the double edged sword of open source. Some things you can't give specifics about because once they're in open source someone from the OEM will make sure you can't keep using the same methods.
Thus, while it is 100% possible to flash the original chip it's potentially fraught with future issues. Damien's approach is much more difficult for Tesla to work around. And, frankly, I don't think they'd bother. Having to cut the legs off of the chip, desolder it, and use a custom board that you then have to solder on is a LOT of work. The barrier of entry is so high that I think they'd just figure it's a niche market of no concern. Contrast this with someone spilling the beans on how to flash custom stuff over CAN. That approach conceivably affects every single motor in every single car. A much bigger target, much easier to pull off rapidly, much more worrisome to an OEM. Then they send the black ops people and the bean spiller gets their patties wacked and thrown in the back of a nondescript van. So, I think the likelihood of custom firmware to be flashed over CAN is slim.
But, Damien has perfected a different approach and I think that's pretty cool. I wish I had the hardware skills to do stuff like that.
-
- Posts: 110
- Joined: Sun Aug 30, 2020 3:28 pm
- Location: United States, Michigan
- Been thanked: 6 times
- Contact:
Re: Tesla Model 3 Rear Drive Unit Hacking
To be fair, most of the negative feedback I saw was more along the lines of: Sure, it'll work but that chip is too slow to really get the motor up to full potential and running dead smooth.Jack Bauer wrote: ↑Sun Feb 07, 2021 5:27 pm Internet : You can't run a Musk motor with a measly little Stm32.
That feedback could be accurate, it might not. I think your STM32 chip is probably fast enough with clever programming to make it happen pretty well. Granted, I've moved on to 600Mhz and 240Mhz processors but I think it could be possible at 72Mhz or 94Mhz or such a speed. One thing is for sure, the Model 3 motor is a bit different and, in theory, more difficult to control well. So, it might take a bit longer than usual but I have faith that you, Johannes, and others can make it work pretty well. As a bonus, should it turn out that you do need to change processors, you happen to have experience in making a processor mod board and you already did the reverse engineering so a different chip is only a redesign away.
I'm looking forward to seeing where this all goes!