Tesla Model 3 Rear Drive Unit Hacking

Topics concerning the Tesla front and rear drive unit drop-in board
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by EV_Builder »

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.
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
New Electric Ireland
Posts: 172
Joined: Sun May 31, 2020 12:22 pm
Location: Ireland
Been thanked: 1 time
Contact:

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by New Electric Ireland »

EV_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'....
viewtopic.php?f=10&t=123&p=21590#p21590
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.
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by EV_Builder »

Very nice!

Thank u!
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
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 Rear Drive Unit Hacking

Post by Jack Bauer »

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
TommyMac
Posts: 2
Joined: Wed Jan 06, 2021 1:27 am

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by TommyMac »

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
davefiddes
Posts: 211
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 14 times
Been thanked: 35 times

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by davefiddes »

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! ;)
User avatar
johu
Site Admin
Posts: 5769
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1011 times
Contact:

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by johu »

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 :)
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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 Rear Drive Unit Hacking

Post by Jack Bauer »

Yes thanks for sharing. I too would like the option of using openinverter on the tms.
I'm going to need a hacksaw
davefiddes
Posts: 211
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 14 times
Been thanked: 35 times

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by davefiddes »

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.
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 Rear Drive Unit Hacking

Post by Jack Bauer »

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
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 Rear Drive Unit Hacking

Post by Jack Bauer »

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
TommyMac
Posts: 2
Joined: Wed Jan 06, 2021 1:27 am

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by TommyMac »

Great news Damien!

I think I’ll purchase a M3 drive unit in prep!
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 Rear Drive Unit Hacking

Post by Jack Bauer »

Boards are now in production at PCBWay.
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 Rear Drive Unit Hacking

Post by Jack Bauer »

Just got a shipping notification from PCBWAY. Boards are on the way:)
I'm going to need a hacksaw
magelan
Posts: 4
Joined: Wed Jan 20, 2021 9:46 pm

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by magelan »

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 ?
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by Isaac96 »

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.
btdale
Posts: 10
Joined: Wed Mar 04, 2020 2:07 pm
Location: Chattanooga, Tennessee

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by btdale »

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 :)
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 Rear Drive Unit Hacking

Post by Jack Bauer »

Got a little present from PCBWay:) I think we have a winner. Video and reveal soon.
Attachments
2021-02-05 12.22.19.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 Rear Drive Unit Hacking

Post by Jack Bauer »

One more hint ...
Attachments
2021-02-05 12.29.49.jpg
I'm going to need a hacksaw
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 Rear Drive Unit Hacking

Post by mdrobnak »

I'd call that more than a hint. :D

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
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 Rear Drive Unit Hacking

Post by Jack Bauer »

Internet : You can't run a Musk motor with a measly little Stm32.

Johannes : Hold my beer.

I'm going to need a hacksaw
MX5EV
Posts: 7
Joined: Mon Jun 08, 2020 4:52 pm
Location: New Hampshire, USA

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by MX5EV »

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.
Greenbeast
Posts: 115
Joined: Sat Dec 26, 2020 5:44 pm

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by Greenbeast »

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
collin80
Posts: 110
Joined: Sun Aug 30, 2020 3:28 pm
Location: United States, Michigan
Been thanked: 4 times
Contact:

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by collin80 »

MX5EV wrote: Sun Feb 07, 2021 7:11 pm 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.
That would neeeeeeever happen. ;) Yeah, there are already several people who know how to flash the various components in a Tesla over CAN. The process isn't really a super state secret or anything. There's some aspects which aren't really part of any standard you could get a hold of but the process isn't that terrible.

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.
collin80
Posts: 110
Joined: Sun Aug 30, 2020 3:28 pm
Location: United States, Michigan
Been thanked: 4 times
Contact:

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by collin80 »

Jack Bauer wrote: Sun Feb 07, 2021 5:27 pm Internet : You can't run a Musk motor with a measly little Stm32.
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.

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!
Post Reply