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

Post by Jack Bauer »

Ok. Just confirmed pin 60 as the resolver exciter using the front drive unit inverter which still has its Musk brain intact. I'm seeing 10khz sine 3.5v peak on that pin even with resolver unplugged. Feedback signals appear on sine and cos pins only when resolver is connected.
I'm going to need a hacksaw
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 »

Jack, are you putting stuff out on GitHub? Would like to pull the trigger together again so I can play along. If I get confident I might buy the M3 motor. I want 4WD :)
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
davefiddes
Posts: 213
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 14 times
Been thanked: 38 times

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by davefiddes »

Jack Bauer wrote: Fri May 07, 2021 11:25 am Ok. Just confirmed pin 60 as the resolver exciter using the front drive unit inverter which still has its Musk brain intact. I'm seeing 10khz sine 3.5v peak on that pin even with resolver unplugged. Feedback signals appear on sine and cos pins only when resolver is connected.
Sorry for the wild goose chase. Doesn't make a lot of sense on the face of it, pin 60/ADCIND4 is analog input only. I'd imagine you'll find the same signal on pin 42/ADCINA1/DACOUTB which is the only DAC output channel that's free. Of academic interest only though for your board's purposes.
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 need to apologise at all:) Glad to have some company on the journey. Nothing on pin 42 that I can measure. Keeping in mind of course we are very far from having the inverter in run mode. Both Musk brains are probably totally freaked out.
I'm going to need a hacksaw
davefiddes
Posts: 213
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 14 times
Been thanked: 38 times

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by davefiddes »

I'm stumped for now. DACOUTA and DACOUTC are the Sine/Cosine inputs. If there's nothing on DACOUTB then that implies the sine wave is coming from something off chip or I really haven't understood the pin mapping capabilities of this chip. :(
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by MattsAwesomeStuff »

Jack Bauer wrote: Fri May 07, 2021 1:44 pmBoth Musk brains are probably totally freaked out.
Image
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 »

On that note I just ran a test on the lobotomised rear inverter. Injected 3.3v 10khz sine onto the pin 60 pad. Guess what? Elon's body just sat there. No excitation, no feedback. Sounds like I have a bit of digging to do tomorrow. Could be just some enable pin or it's me that's messed up and the signal that I thought was a dac output is just monitoring. What we do know as of now is that it goes away when the mcu is held in reset and is not present when the mcu is removed. Good catch Dave:)
I'm going to need a hacksaw
davefiddes
Posts: 213
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 14 times
Been thanked: 38 times

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by davefiddes »

Curious. What happens if you inject the 10kHz square wave (this is part of the gate drive PSU IIRC?). Is there perhaps a PLL generating the sine wave from that?
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 »

Well, moron of the month award goes to .....wait for it.....ME! Turns out you were right Dave. The 10khz square wave on pin 160 is indeed the source of the resolver excitation. when I applied a 10khz 3.3v sq wave to this pin I get a nice sine wave back on pin 60 as well as corresponding sine and cos on their respective pins. So I tried 4.4khz. Musk don't like that. Lots of distortion. He does like 8.8Khz no problem.... Johannes is going to kill me. We don't need a dac...
I'm going to need a hacksaw
davefiddes
Posts: 213
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 14 times
Been thanked: 38 times

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by davefiddes »

Reverse engineering is hard. Your original hypothesis seemed fine to me and the TI app notes and training materials are all about synthesising sine waves digitally. I've done a bit of digging in a Synchro/Resolver conversion book and can't quite figure out what Tesla is doing with the ADC sample of the exciter reference. There must be some sort of automatic synchronisation or error correction tuning going on. More learning required...

If you kept the F103RDT6 it has 3 ADC channels so would allow us to do a similar job to the Tesla FW in the future if we figure out the value in using it. Then again if it hasn't mattered up to now KISS.
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 »

davefiddes wrote: Sat May 08, 2021 12:09 pm Reverse engineering is hard. Your original hypothesis seemed fine to me and the TI app notes and training materials are all about synthesising sine waves digitally. I've done a bit of digging in a Synchro/Resolver conversion book and can't quite figure out what Tesla is doing with the ADC sample of the exciter reference. There must be some sort of automatic synchronisation or error correction tuning going on. More learning required...

If you kept the F103RDT6 it has 3 ADC channels so would allow us to do a similar job to the Tesla FW in the future if we figure out the value in using it. Then again if it hasn't mattered up to now KISS.
Some ideas:
Couldn't it be as simple as a check that the 10Khz signal sending out is healthy and working? So that your quality of Sin / Cos is guaranteed? Or that they use it to check resolver connections?
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
johu
Site Admin
Posts: 5789
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1023 times
Contact:

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by johu »

Shiiiet, all that good work for nothing. Still, was fun :)
Hmm, 8.8 kHz means we need to bump control loop frequency to 17.6 kHz. Or deploy one of the extra timers for generating it in a well synchronized manner.
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 »

It's all good. I'll just rip off your hard work for the vcu:) Anyway, boards on the way.
I'm going to need a hacksaw
JaniK
Posts: 391
Joined: Sun Aug 25, 2019 12:39 pm
Location: Finland
Has thanked: 49 times
Been thanked: 10 times

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by JaniK »

Heh, just received my Leaf VCU today, thanks Damien.

Now I have to prepare to dish out another small share of a lanzarote manor for a M3 modboard. Well I have had the motor sitting in the garage for a year now, so not a huge surprise.

I am not asking the obvious stupid question anymore.

Board truly has matured a long way from the Wired modboard.

Well done.
Any opinions are my own, unless stated otherwise. I take no responsibility if you follow my way of doing things and it doesn't work. Please double check with someone who knows what they are doing.
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 »

Thank you:) Just never could get myself to like the wired board but it was an important step.

In other news the ...uh...High density devices have arrived. Just don't tell the Muskians that its actually a Gigadevice part.
Attachments
2021-05-11 09.20.26.jpg
I'm going to need a hacksaw
User avatar
johu
Site Admin
Posts: 5789
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1023 times
Contact:

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by johu »

108 MHz, wow :) So you could just connect it to the 10 MHz crystal and it will happily run at 90 MHz. Just the LED will blink a bit too fast ;)
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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 »

Damien, did you consider of a step in between?
First making a header modboard and giving the modboard it self the counter part? I hope we won't have many board iterations but it would make hardware upgrading/updating a walk in the park...
When we have all things done/running we could go 'weld on style'..
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 »

Got a delivery :)
Attachments
2021-05-19 17.30.37.jpg
I'm going to need a hacksaw
JaniK
Posts: 391
Joined: Sun Aug 25, 2019 12:39 pm
Location: Finland
Has thanked: 49 times
Been thanked: 10 times

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by JaniK »

Exciting, next the black box in the middle?

That really reminds me of some old Athlon/duron processors.
Any opinions are my own, unless stated otherwise. I take no responsibility if you follow my way of doing things and it doesn't work. Please double check with someone who knows what they are doing.
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 »

And its in. Quite anticlimactic in the end. Power rails, xtal and a few random tests show no shorts or non connections so far. Now to fit the BEAST of an mcu that this drive unit deserves:)
Attachments
2021-05-20 11.54.08.jpg
2021-05-20 11.53.57.jpg
2021-05-20 11.25.37.jpg
I'm going to need a hacksaw
davefiddes
Posts: 213
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 14 times
Been thanked: 38 times

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by davefiddes »

Exciting times. Hope it all goes smoothly. Looks like you've gone for a regular FR4 based PCB this time rather than the flat flex. Is this because you don't need the castellated edges? Do you need to do anything on the underside to stop vias shorting against the ground pad for the TI chip?
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 experimenting with the fr4 really. its a lot cheaper than the polymide so at least will let me find the mistakes:)
I'm going to need a hacksaw
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 »

Jack Bauer wrote: Thu May 20, 2021 12:52 pm Just experimenting with the fr4 really. its a lot cheaper than the polymide so at least will let me find the mistakes:)
Did you consider the idea for a connector/populate board for this phase of the dev? The cheaper board could connect to it...
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
vaijab
Posts: 2
Joined: Tue Jul 13, 2021 7:57 pm

Re: Tesla Model 3 Rear Drive Unit Hacking

Post by vaijab »

I am just wondering whether there has been any progress on this project? I am planning for my next EV conversion (bmw e36 cabrio) and looking for options in terms of a drive unit. Would love to go with tesla model 3 one.
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 »

The model 3 drive unit project will be worked on again soon. As I have mentioned elsewhere I'm in the process of a house move which places a considerable strain on my time.
I'm going to need a hacksaw
Post Reply